referctoring,

referctoring,

--- Project/LambdicSql/BuilderServices/CodeParts/HCode.cs
+++ Project/LambdicSql/BuilderServices/CodeParts/HCode.cs
@@ -21,11 +21,10 @@
         /// </summary>
         public int Indent { get; set; }

-        //TODO これがfalseなケースってなに？
         /// <summary>
-        /// Is functional.
+        /// Add indent on line feed.
         /// </summary>
-        public bool IsFunctional { get; set; }
+        public bool AddIndentNewLine { get; set; }

         /// <summary>
         /// Enable change line.
@@ -80,7 +79,7 @@
             }

             //if IsFunctional is true, add Indent other than the first line.
-            var addIndentCount = IsFunctional ? 1 : 0;
+            var addIndentCount = AddIndentNewLine ? 1 : 0;
             var sep = Separator.TrimEnd();
             return _texts[0].ToString(isTopLevel, indent, context) + sep + Environment.NewLine +
                 string.Join(sep + Environment.NewLine, _texts.Skip(1).Select(e => e.ToString(isTopLevel, indent + addIndentCount, context).TrimEnd()).ToArray());
@@ -122,6 +121,6 @@
         }

         HCode CopyProperty(params ICode[] texts)
-             => new HCode(texts) { Indent = Indent, IsFunctional = IsFunctional, EnableChangeLine = EnableChangeLine, Separator = Separator };
+             => new HCode(texts) { Indent = Indent, AddIndentNewLine = AddIndentNewLine, EnableChangeLine = EnableChangeLine, Separator = Separator };
     }
 }


fix potential FormatException

fix potential FormatException

--- TwitchPlaysAssembly/Src/Helpers/IRCConnection.cs
+++ TwitchPlaysAssembly/Src/Helpers/IRCConnection.cs
@@ -596,6 +596,8 @@
 	[StringFormatMethod("message")]
 	public static void SendMessage(string message, params object[] args) => SendMessage(string.Format(message, args));

+	public new static void SendMessage(string message) => SendMessage(message, null, true);
+
 	[StringFormatMethod("message")]
 	public static void SendMessage(string message, string userNickName, bool sendToChat, params object[] args) => SendMessage(string.Format(message, args), userNickName, sendToChat);


disable ENABLE_ConversationGUISystem and modify several class member to protected

--- Unity/ConversationManager/ConversationManager.cs
+++ Unity/ConversationManager/ConversationManager.cs
@@ -31,7 +31,8 @@
 @date 20150405 by NDark . add class method StoryIsPlayed()

 */
-#define ENABLE_ConversationGUISystem
+// #define ENABLE_ConversationGUISystem
+
 // #define ENABLE_USE_TIME
 using UnityEngine;
 using System.Collections.Generic ;
@@ -58,8 +59,8 @@
 	}
 	private ConversationManagerState m_State = ConversationManagerState.UnActive ;

-	private int m_CurrentStoryUID = 0 ;
-	private int m_CurrentTakeUID = 0 ;
+	protected int m_CurrentStoryUID = 0 ;
+	protected int m_CurrentTakeUID = 0 ;
 #if ENABLE_USE_TIME
 	private float m_StartTime = 0.0f ;
 #endif
@@ -200,7 +201,7 @@
 		}
 	}

-	private void CloseConversationGUI()
+	protected virtual void CloseConversationGUI()
 	{
 		Debug.Log( "CloseConversationGUI()" ) ;
 #if ENABLE_ConversationGUISystem
@@ -211,7 +212,7 @@
 #endif
 	}

-	private void ShowDialogUI( bool _Show )
+	protected virtual void ShowDialogUI( bool _Show )
 	{

 		if( false == _Show )
@@ -222,9 +223,9 @@
 		{
 			int takeIndex = GetTakeIndex( m_CurrentTakeUID ) ;

-			if( takeIndex >= m_Takes.Count )
-			{
-				Debug.LogError( "takeIndex >= m_Takes.Count" ) ;
+			if( takeIndex < 0 || takeIndex >= m_Takes.Count )
+			{
+				Debug.LogError( "takeIndex >= m_Takes.Count takeIndex=" + takeIndex ) ;
 				return ;
 			}

@@ -307,7 +308,7 @@
 		}
 	}

-	private Story GetStory( int _StoryUID )
+	protected Story GetStory( int _StoryUID )
 	{
 		foreach( Story s in m_Stories )
 		{
@@ -319,7 +320,7 @@
 		return null ;
 	}

-	private int GetTakeIndex( int _TakeUID )
+	protected int GetTakeIndex( int _TakeUID )
 	{
 		for( int i = 0 ; i < m_Takes.Count ; ++i )
 		{


Fix Collections.SingletonMap for .NET 4.5

--- runtime/CSharp/Antlr4.Runtime/Sharpen/Collections.cs
+++ runtime/CSharp/Antlr4.Runtime/Sharpen/Collections.cs
@@ -59,7 +59,11 @@
         public static IDictionary<TKey, TValue> SingletonMap<TKey, TValue>(TKey key, TValue value)
 #endif
         {
+#if NET_4_5
+            return new ReadOnlyDictionary<TKey,TValue>(new Dictionary<TKey, TValue> { { key, value } });
+#else
             return new Dictionary<TKey, TValue> { { key, value } };
+#endif
         }

         private static class EmptyListImpl<T>


restore waiting time for report

restore waiting time for report


Update GhostOrbit.cs (#8100)

Update GhostOrbit.cs (#8100)


[水１本を在庫として格納できる] テスト追加

[水１本を在庫として格納できる] テスト追加

--- VendingMachine/VendingMachineTests/Step4Tests.cs
+++ VendingMachine/VendingMachineTests/Step4Tests.cs
@@ -30,6 +30,10 @@
             return Item.Items.Drink.Factory("レッドブル", 200);
         }

+        public static Item.Item MakeWaterDrink()
+        {
+            return Item.Items.Drink.Factory("水", 100);
+        }

@@ -47,5 +51,22 @@
             格納アイテムリスト.First().Name.Is(redBull.Name);
             格納アイテムリスト.First().Price.Is(redBull.Price);
         }
+
+
+
+        [TestMethod]
+        public void 水１本を在庫として格納できる()
+        {
+            //水
+            var water = MakeWaterDrink();
+
+            //ラックに格納
+            _アイテムRack.Setアイテム(water);
+
+            var 格納アイテムリスト = _アイテムRack.Get格納アイテムリスト();
+            格納アイテムリスト.Count().Is(1);
+            格納アイテムリスト.First().Name.Is(water.Name);
+            格納アイテムリスト.First().Price.Is(water.Price);
+        }
     }
 }


Expose the attributes of return type parameters

--- Mono.Cecil/MethodReturnType.cs
+++ Mono.Cecil/MethodReturnType.cs
@@ -55,6 +55,11 @@
 			set { Parameter.MetadataToken = value; }
 		}

+		public ParameterAttributes Attributes {
+			get { return Parameter.Attributes; }
+			set { Parameter.Attributes = value; }
+		}
+
 		public bool HasCustomAttributes {
 			get { return parameter != null && parameter.HasCustomAttributes; }
 		}


Revert "Lock on Module.Read to allow concurrent access to the module"

This reverts commit 28d137cb1cef0c305ff30e2769e28145a0128fef.

--- Mono.Cecil/ModuleDefinition.cs
+++ Mono.Cecil/ModuleDefinition.cs
@@ -210,8 +210,6 @@
 		Collection<ExportedType> exported_types;
 		TypeDefinitionCollection types;

-		readonly object @lock = new object ();
-
 		public bool IsMain {
 			get { return kind != ModuleKind.NetModule; }
 		}
@@ -762,17 +760,15 @@

 		internal TRet Read<TItem, TRet> (TItem item, Func<TItem, MetadataReader, TRet> read)
 		{
-			lock (@lock) {
-				var position = reader.position;
-				var context = reader.context;
-
-				var ret = read (item, reader);
-
-				reader.position = position;
-				reader.context = context;
-
-				return ret;
-			}
+			var position = reader.position;
+			var context = reader.context;
+
+			var ret = read (item, reader);
+
+			reader.position = position;
+			reader.context = context;
+
+			return ret;
 		}

 		void ProcessDebugHeader ()


Added a remark to DistinctBy documentation about the default equality comparer being used when a null comparer is supplied.

--- MoreLinq/Pull/SetOperations.cs
+++ MoreLinq/Pull/SetOperations.cs
@@ -42,7 +42,8 @@
         /// <typeparam name="TKey">Type of the projected element</typeparam>
         /// <param name="source">Source sequence</param>
         /// <param name="keySelector">Projection for determining "distinctness"</param>
-        /// <param name="comparer">The equality comparer to use to determine whether or not keys are equal.</param>
+        /// <param name="comparer">The equality comparer to use to determine whether or not keys are equal.
+        /// If null, the default equality comparer for <see cref="TSource"/> is used.</param>
         /// <returns>A sequence consisting of distinct elements from the source sequence,
         /// comparing them by the specified key projection.</returns>
         public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source,


LocalizationSimpleCloneAttribute is removed. IClonable interface is used instead.

--- Mvc/Mvc/ValidationLocalizer.cs
+++ Mvc/Mvc/ValidationLocalizer.cs
@@ -92,8 +92,8 @@
 				result = new DataTypeAttribute(attr.DataType);
 			}

-			if (attribute.GetType().GetCustomAttributes(typeof(LocalizationSimpleCloneAttribute), true).Length != 0)
-				result = (ValidationAttribute)Activator.CreateInstance(attribute.GetType());
+			if (result == null && attribute.GetType().GetInterfaces().Contains(typeof(ICloneable)))
+				result = ((ICloneable)attribute).Clone() as ValidationAttribute;

 			return result;
 		}


fix ConcurrentSet for VostokHostBuilder

fix ConcurrentSet for VostokHostBuilder

--- Vostok.Core/Commons/Collections/ConcurrentSet.cs
+++ Vostok.Core/Commons/Collections/ConcurrentSet.cs
@@ -74,6 +74,12 @@
             return GetEnumerator();
         }

+        public void UnionWith(IEnumerable<T> other)
+        {
+            foreach (var value in other)
+                Add(value);
+        }
+
         #region Unsupported operations

         public void ExceptWith(IEnumerable<T> other)
@@ -121,11 +127,6 @@
             throw new NotSupportedException();
         }

-        public void UnionWith(IEnumerable<T> other)
-        {
-            throw new NotSupportedException();
-        }
-
         #endregion
     }
 }


Updated pin layout so it runs along a row (in case you are using a header). Disabled GC messages during debugging.

--- NETMF-Matrix-Keypad/Program.cs
+++ NETMF-Matrix-Keypad/Program.cs
@@ -9,17 +9,17 @@
     {
         private static readonly Cpu.Pin[] ColumnPins =
         {
-            (Cpu.Pin) FEZ_Pin.Digital.Di22,
-            (Cpu.Pin) FEZ_Pin.Digital.Di20,
-            (Cpu.Pin) FEZ_Pin.Digital.Di24
+            (Cpu.Pin) FEZ_Pin.Digital.Di25,
+            (Cpu.Pin) FEZ_Pin.Digital.Di21,
+            (Cpu.Pin) FEZ_Pin.Digital.Di29
         };

         private static readonly Cpu.Pin[] RowPins =
         {
-            (Cpu.Pin) FEZ_Pin.Digital.Di21,
-            (Cpu.Pin) FEZ_Pin.Digital.Di26,
-            (Cpu.Pin) FEZ_Pin.Digital.Di25,
-            (Cpu.Pin) FEZ_Pin.Digital.Di23
+            (Cpu.Pin) FEZ_Pin.Digital.Di23,
+            (Cpu.Pin) FEZ_Pin.Digital.Di33,
+            (Cpu.Pin) FEZ_Pin.Digital.Di31,
+            (Cpu.Pin) FEZ_Pin.Digital.Di27
         };

         private static readonly char[][] Keypad =
@@ -34,6 +34,8 @@
         {
             try
             {
+                Debug.EnableGCMessages(false);
+
                 var keypad = new Keypad(Keypad, RowPins, ColumnPins)
                 {
                     HoldTime = 200


Refactoring

Refactoring

--- NSN-Core/Modules/CoreModule.cs
+++ NSN-Core/Modules/CoreModule.cs
@@ -34,33 +34,24 @@
                 if (!types.ContainsKey(_.route.ToString()))
                     return HttpStatusCode.NotFound;

+                var paraObjects = new List<object>();
+                if (parameters.ContainsKey(_.route.ToString()))
+                {
+                    foreach (ParameterInfo p in parameters[_.route.ToString()])
+                    {
+                        if (Request.Query[p.Name] != null)
+                        {
+                            paraObjects.Add(Convert.ChangeType(Request.Query[p.Name], p.ParameterType));
+                        }
+                    }
+                }
+
                 MethodInfo method = types[_.route.ToString()];
                 object returnObject;
-                if (!parameters.ContainsKey(_.route.ToString()))
-                {
-                    if (method.ReturnType.IsPrimitive)
-                        returnObject = method.Invoke(CoreObject, null);
-                    else
-                        returnObject = new Json(method.Invoke(CoreObject, null));
-                    return returnObject.ToString();
-                }
-
-                var paraObjects = new List<object>();
-                foreach (ParameterInfo p in parameters[_.route.ToString()])
-                {
-                    if (Request.Query[p.Name] != null)
-                    {
-                        paraObjects.Add(Convert.ChangeType(Request.Query[p.Name], p.ParameterType));
-                    }
-                }
-                object[] parObjects = null;
-                if (paraObjects.Count != 0)
-                    parObjects = paraObjects.ToArray();
-
                 if (method.ReturnType.IsPrimitive)
-                    returnObject = method.Invoke(CoreObject, parObjects);
+                    returnObject = method.Invoke(CoreObject, paraObjects.ToArray());
                 else
-                    returnObject = new Json(method.Invoke(CoreObject, parObjects));
+                    returnObject = new Json(method.Invoke(CoreObject, paraObjects.ToArray()));
                 return returnObject.ToString();
             };
         }


Shuffle

Shuffle

--- WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
+++ WalletWasabi/Models/ChaumianCoinJoin/CcjRound.cs
@@ -398,14 +398,18 @@
 							transaction.Outputs.AddWithOptimize(coordinatorFee, coordinatorAddress);
 						}

-						// 7. Create the unsigned transaction.
+						// 7. Shuffle. NBitcoin's shuffle doesn't work: https://github.com/MetacoSA/NBitcoin/issues/713
+						transaction.Inputs.Shuffle();
+						transaction.Outputs.Shuffle();
+
+						// 8. Create the unsigned transaction.
 						var builder = Network.CreateTransactionBuilder();
 						UnsignedCoinJoin = builder
 							.ContinueToBuild(transaction)
 							.AddCoins(spentCoins) // It makes sure the UnsignedCoinJoin goes through TransactionBuilder optimizations.
 							.BuildTransaction(false);

-						// 8. Try optimize fees.
+						// 9. Try optimize fees.
 						await TryOptimizeFeesAsync(spentCoins);

 						SignedCoinJoin = Transaction.Parse(UnsignedCoinJoin.ToHex(), Network);


The word wrap value is now an int instead of Size

Fixes #11

--- NativeUI/Elements/UIResText.cs
+++ NativeUI/Elements/UIResText.cs
@@ -114,7 +114,19 @@
             return Function.Call<float>((Hash)0x85F061DA64ED2F67, (int)font) * scale;
         }

-        public Size WordWrap { get; set; }
+        /// <summary>
+        /// Width of the text wrap box. Set to zero to disable.
+        /// </summary>
+        public int Wrap { get; set; } = 0;
+        /// <summary>
+        /// Size of the text wrap box.
+        /// </summary>
+        [Obsolete("Use UIResText.Wrap instead.", true)]
+        public Size WordWrap
+        {
+            get => new Size(Wrap, 0);
+            set => Wrap = value.Width;
+        }

         public override void Draw(Size offset)
         {
@@ -145,9 +157,9 @@
                     break;
             }

-            if (WordWrap.Width != 0)
-            {
-                float xsize = (Position.X + WordWrap.Width) / width;
+            if (Wrap != 0)
+            {
+                float xsize = (Position.X + Wrap) / width;
                 Function.Call(Hash.SET_TEXT_WRAP, x, xsize);
             }


additional tweaks to fix min inserteddatetime/lastmodifieddatetime

--- src/FODT.DataMigration/Program.cs
+++ src/FODT.DataMigration/Program.cs
@@ -637,6 +637,7 @@
         private static void FixInsertedDateTimeColumns()
         {
             var cmd = @"
+-- UPDATE PERSON
 ; WITH minInsertedDateTime AS (
 SELECT PersonId, MIN(InsertedDateTime) AS InsertedDateTime
 FROM (
@@ -650,8 +651,9 @@
 SET t1.InsertedDateTime = t2.InsertedDateTime
 FROM Person t1
     INNER JOIN minInsertedDateTime t2 ON t1.PersonId = t2.PersonId
-WHERE t1.InsertedDateTime > t2.InsertedDateTime
-
+WHERE t1.InsertedDateTime > t2.InsertedDateTime OR t1.InsertedDateTime = '0001-01-01 00:00:00.0000000'
+
+-- UPDATE SHOW
 ; WITH minInsertedDateTime AS (
 SELECT ShowId, MIN(InsertedDateTime) AS InsertedDateTime
 FROM (
@@ -664,7 +666,158 @@
 SET t1.InsertedDateTime = t2.InsertedDateTime
 FROM Show t1
     INNER JOIN minInsertedDateTime t2 ON t1.ShowId = t2.ShowId
-WHERE t1.InsertedDateTime > t2.InsertedDateTime
+WHERE t1.InsertedDateTime > t2.InsertedDateTime OR t1.InsertedDateTime = '0001-01-01 00:00:00.0000000'
+
+-- UPDATE ShowCast
+; WITH _min AS (
+SELECT ShowCastId, MIN(InsertedDateTime) AS InsertedDateTime
+FROM (
+      SELECT ShowCastId, InsertedDateTime FROM ShowCast
+UNION SELECT ShowCastId, Person.InsertedDateTime FROM ShowCast INNER JOIN Person ON Person.PersonId = ShowCast.PersonId
+UNION SELECT ShowCastId, Show.InsertedDateTime FROM ShowCast INNER JOIN Show ON Show.ShowId = ShowCast.ShowId
+) _ WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000' GROUP BY ShowCastId
+)
+UPDATE ShowCast
+SET ShowCast.InsertedDateTime = _min.InsertedDateTime
+FROM ShowCast INNER JOIN _min ON _min.ShowCastId = ShowCast.ShowCastId
+WHERE ShowCast.InsertedDateTime = '0001-01-01 00:00:00.0000000'
+
+; WITH _min AS (
+SELECT ShowCastId, MIN(LastModifiedDateTime) AS LastModifiedDateTime
+FROM (
+      SELECT ShowCastId, LastModifiedDateTime FROM ShowCast
+UNION SELECT ShowCastId, Person.LastModifiedDateTime FROM ShowCast INNER JOIN Person ON Person.PersonId = ShowCast.PersonId
+UNION SELECT ShowCastId, Show.LastModifiedDateTime FROM ShowCast INNER JOIN Show ON Show.ShowId = ShowCast.ShowId
+) _ WHERE LastModifiedDateTime > '0001-01-01 00:00:00.0000000' GROUP BY ShowCastId
+)
+UPDATE ShowCast
+SET ShowCast.LastModifiedDateTime = _min.LastModifiedDateTime
+FROM ShowCast INNER JOIN _min ON _min.ShowCastId = ShowCast.ShowCastId
+WHERE ShowCast.LastModifiedDateTime = '0001-01-01 00:00:00.0000000'
+
+-- UPDATE ShowCrew
+; WITH _min AS (
+SELECT ShowCrewId, MIN(InsertedDateTime) AS InsertedDateTime
+FROM (
+      SELECT ShowCrewId, InsertedDateTime FROM ShowCrew
+UNION SELECT ShowCrewId, Person.InsertedDateTime FROM ShowCrew INNER JOIN Person ON Person.PersonId = ShowCrew.PersonId
+UNION SELECT ShowCrewId, Show.InsertedDateTime FROM ShowCrew INNER JOIN Show ON Show.ShowId = ShowCrew.ShowId
+) _ WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000' GROUP BY ShowCrewId
+)
+UPDATE ShowCrew
+SET ShowCrew.InsertedDateTime = _min.InsertedDateTime
+FROM ShowCrew INNER JOIN _min ON _min.ShowCrewId = ShowCrew.ShowCrewId
+WHERE ShowCrew.InsertedDateTime = '0001-01-01 00:00:00.0000000'
+
+; WITH _min AS (
+SELECT ShowCrewId, MIN(LastModifiedDateTime) AS LastModifiedDateTime
+FROM (
+      SELECT ShowCrewId, LastModifiedDateTime FROM ShowCrew
+UNION SELECT ShowCrewId, Person.LastModifiedDateTime FROM ShowCrew INNER JOIN Person ON Person.PersonId = ShowCrew.PersonId
+UNION SELECT ShowCrewId, Show.LastModifiedDateTime FROM ShowCrew INNER JOIN Show ON Show.ShowId = ShowCrew.ShowId
+) _ WHERE LastModifiedDateTime > '0001-01-01 00:00:00.0000000' GROUP BY ShowCrewId
+)
+UPDATE ShowCrew
+SET ShowCrew.LastModifiedDateTime = _min.LastModifiedDateTime
+FROM ShowCrew INNER JOIN _min ON _min.ShowCrewId = ShowCrew.ShowCrewId
+WHERE ShowCrew.LastModifiedDateTime = '0001-01-01 00:00:00.0000000'
+
+-- UPDATE PersonClubPosition
+; WITH _min AS (
+SELECT PersonClubPositionId, MIN(InsertedDateTime) AS InsertedDateTime
+FROM (
+      SELECT PersonClubPositionId, InsertedDateTime FROM PersonClubPosition
+UNION SELECT PersonClubPositionId, Person.InsertedDateTime FROM PersonClubPosition INNER JOIN Person ON Person.PersonId = PersonClubPosition.PersonId
+) _ WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000' GROUP BY PersonClubPositionId
+)
+UPDATE PersonClubPosition
+SET PersonClubPosition.InsertedDateTime = _min.InsertedDateTime
+FROM PersonClubPosition INNER JOIN _min ON _min.PersonClubPositionId = PersonClubPosition.PersonClubPositionId
+WHERE PersonClubPosition.InsertedDateTime = '0001-01-01 00:00:00.0000000'
+
+; WITH _min AS (
+SELECT PersonClubPositionId, MIN(LastModifiedDateTime) AS LastModifiedDateTime
+FROM (
+      SELECT PersonClubPositionId, LastModifiedDateTime FROM PersonClubPosition
+UNION SELECT PersonClubPositionId, Person.LastModifiedDateTime FROM PersonClubPosition INNER JOIN Person ON Person.PersonId = PersonClubPosition.PersonId
+) _ WHERE LastModifiedDateTime > '0001-01-01 00:00:00.0000000' GROUP BY PersonClubPositionId
+)
+UPDATE PersonClubPosition
+SET PersonClubPosition.LastModifiedDateTime = _min.LastModifiedDateTime
+FROM PersonClubPosition INNER JOIN _min ON _min.PersonClubPositionId = PersonClubPosition.PersonClubPositionId
+WHERE PersonClubPosition.LastModifiedDateTime = '0001-01-01 00:00:00.0000000'
+
+-- UPDATE Award
+; WITH _min AS (
+SELECT AwardId, MIN(InsertedDateTime) AS InsertedDateTime
+FROM (
+      SELECT AwardId, InsertedDateTime FROM Award
+UNION SELECT AwardId, Person.InsertedDateTime FROM Award INNER JOIN Person ON Person.PersonId = Award.PersonId
+UNION SELECT AwardId, Show.InsertedDateTime FROM Award INNER JOIN Show ON Show.ShowId = Award.ShowId
+) _ WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000' GROUP BY AwardId
+)
+UPDATE Award
+SET Award.InsertedDateTime = _min.InsertedDateTime
+FROM Award INNER JOIN _min ON _min.AwardId = Award.AwardId
+WHERE Award.InsertedDateTime = '0001-01-01 00:00:00.0000000'
+
+; WITH _min AS (
+SELECT AwardId, MIN(LastModifiedDateTime) AS LastModifiedDateTime
+FROM (
+      SELECT AwardId, LastModifiedDateTime FROM Award
+UNION SELECT AwardId, Person.LastModifiedDateTime FROM Award INNER JOIN Person ON Person.PersonId = Award.PersonId
+UNION SELECT AwardId, Show.LastModifiedDateTime FROM Award INNER JOIN Show ON Show.ShowId = Award.ShowId
+) _ WHERE LastModifiedDateTime > '0001-01-01 00:00:00.0000000' GROUP BY AwardId
+)
+UPDATE Award
+SET Award.LastModifiedDateTime = _min.LastModifiedDateTime
+FROM Award INNER JOIN _min ON _min.AwardId = Award.AwardId
+WHERE Award.LastModifiedDateTime = '0001-01-01 00:00:00.0000000'
+
+-- UPDATE Photo
+; WITH _min AS (
+SELECT PhotoId, MIN(InsertedDateTime) AS InsertedDateTime
+FROM (
+      SELECT PhotoId, InsertedDateTime FROM Photo WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000'
+UNION SELECT PhotoId, InsertedDateTime FROM PersonPhoto WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000'
+UNION SELECT PhotoId, InsertedDateTime FROM ShowPhoto WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000'
+)_ GROUP BY PhotoId)
+
+UPDATE t1
+SET t1.InsertedDateTime = t2.InsertedDateTime
+FROM Photo t1
+    INNER JOIN _min t2 ON t1.PhotoId = t2.PhotoId
+WHERE t1.InsertedDateTime > t2.InsertedDateTime OR t1.InsertedDateTime = '0001-01-01 00:00:00.0000000'
+
+-- UPDATE PersonPhoto
+; WITH _min AS (
+SELECT PhotoId, MIN(InsertedDateTime) AS InsertedDateTime
+FROM (
+      SELECT PhotoId, InsertedDateTime FROM Photo WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000'
+UNION SELECT PhotoId, InsertedDateTime FROM PersonPhoto WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000'
+UNION SELECT PhotoId, InsertedDateTime FROM ShowPhoto WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000'
+)_ GROUP BY PhotoId)
+
+UPDATE t1
+SET t1.InsertedDateTime = t2.InsertedDateTime
+FROM PersonPhoto t1
+    INNER JOIN _min t2 ON t1.PhotoId = t2.PhotoId
+WHERE t1.InsertedDateTime = '0001-01-01 00:00:00.0000000'
+
+-- UPDATE ShowPhoto
+; WITH _min AS (
+SELECT PhotoId, MIN(InsertedDateTime) AS InsertedDateTime
+FROM (
+      SELECT PhotoId, InsertedDateTime FROM Photo WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000'
+UNION SELECT PhotoId, InsertedDateTime FROM PersonPhoto WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000'
+UNION SELECT PhotoId, InsertedDateTime FROM ShowPhoto WHERE InsertedDateTime > '0001-01-01 00:00:00.0000000'
+)_ GROUP BY PhotoId)
+
+UPDATE t1
+SET t1.InsertedDateTime = t2.InsertedDateTime
+FROM ShowPhoto t1
+    INNER JOIN _min t2 ON t1.PhotoId = t2.PhotoId
+WHERE t1.InsertedDateTime = '0001-01-01 00:00:00.0000000'
 ";

             Log("Fixing InsertedDateTime Columns for Person/Show");


WIP more tests on RDFPattern

WIP more tests on RDFPattern

--- RDFSharp.Test/Query/Mirella/Algebra/RDFPatternTest.cs
+++ RDFSharp.Test/Query/Mirella/Algebra/RDFPatternTest.cs
@@ -497,6 +497,494 @@
             Assert.IsTrue(pattern.ToString().Equals("?SUBJ ?PRED ?OBJ"));
             Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
         }
+
+        [TestMethod]
+        public void ShouldCreateOptionalSPOPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFResource("ex:obj")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFResource("ex:subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFResource("ex:pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFResource("ex:obj")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 0);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { <ex:subj> <ex:pred> <ex:obj> }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalSPLPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFPlainLiteral("lit")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFResource("ex:subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFResource("ex:pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFPlainLiteral("lit")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 0);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { <ex:subj> <ex:pred> \"lit\" }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalSPLLPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFPlainLiteral("lit", "en-US")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFResource("ex:subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFResource("ex:pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFPlainLiteral("lit", "en-US")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 0);
+            Assert.IsTrue(pattern.ToString().Equals(string.Concat("OPTIONAL { <ex:subj> <ex:pred> \"lit\"@EN-US }")));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalSPLTPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFTypedLiteral("25", RDFModelEnums.RDFDatatypes.XSD_INTEGER)).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFResource("ex:subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFResource("ex:pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFTypedLiteral("25", RDFModelEnums.RDFDatatypes.XSD_INTEGER)));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 0);
+            Assert.IsTrue(pattern.ToString().Equals(string.Concat("OPTIONAL { <ex:subj> <ex:pred> \"25\"^^<http://www.w3.org/2001/XMLSchema#integer> }")));
+            Assert.IsTrue(pattern.ToString(new List<RDFNamespace>() { RDFNamespaceRegister.GetByPrefix("xsd") }).Equals(string.Concat("OPTIONAL { <ex:subj> <ex:pred> \"25\"^^xsd:integer }")));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalVPOPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFResource("ex:pred"), new RDFResource("ex:obj")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFResource("ex:pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFResource("ex:obj")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 1);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { ?SUBJ <ex:pred> <ex:obj> }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalVPLPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFResource("ex:pred"), new RDFPlainLiteral("lit")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFResource("ex:pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFPlainLiteral("lit")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 1);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { ?SUBJ <ex:pred> \"lit\" }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalVPLLPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFResource("ex:pred"), new RDFPlainLiteral("lit", "en-US")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFResource("ex:pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFPlainLiteral("lit", "en-US")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 1);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { ?SUBJ <ex:pred> \"lit\"@EN-US }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalVPLTPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFResource("ex:pred"), new RDFTypedLiteral("25", RDFModelEnums.RDFDatatypes.XSD_INTEGER)).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFResource("ex:pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFTypedLiteral("25", RDFModelEnums.RDFDatatypes.XSD_INTEGER)));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 1);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { ?SUBJ <ex:pred> \"25\"^^<http://www.w3.org/2001/XMLSchema#integer> }"));
+            Assert.IsTrue(pattern.ToString(new List<RDFNamespace>() { RDFNamespaceRegister.GetByPrefix("xsd") }).Equals(string.Concat("OPTIONAL { ?SUBJ <ex:pred> \"25\"^^xsd:integer }")));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalSVOPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFResource("ex:subj"), new RDFVariable("pred"), new RDFResource("ex:obj")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFResource("ex:subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFResource("ex:obj")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 1);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { <ex:subj> ?PRED <ex:obj> }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalSVLPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFResource("ex:subj"), new RDFVariable("pred"), new RDFPlainLiteral("lit")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFResource("ex:subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFPlainLiteral("lit")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 1);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { <ex:subj> ?PRED \"lit\" }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalSVLLPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFResource("ex:subj"), new RDFVariable("pred"), new RDFPlainLiteral("lit", "en-US")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFResource("ex:subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFPlainLiteral("lit", "en-US")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 1);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { <ex:subj> ?PRED \"lit\"@EN-US }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalSVLTPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFResource("ex:subj"), new RDFVariable("pred"), new RDFTypedLiteral("25", RDFModelEnums.RDFDatatypes.XSD_INTEGER)).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFResource("ex:subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFTypedLiteral("25", RDFModelEnums.RDFDatatypes.XSD_INTEGER)));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 1);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { <ex:subj> ?PRED \"25\"^^<http://www.w3.org/2001/XMLSchema#integer> }"));
+            Assert.IsTrue(pattern.ToString(new List<RDFNamespace>() { RDFNamespaceRegister.GetByPrefix("xsd") }).Equals(string.Concat("OPTIONAL { <ex:subj> ?PRED \"25\"^^xsd:integer }")));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalSPVPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFResource("ex:subj"), new RDFResource("ex:pred"), new RDFVariable("obj")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFResource("ex:subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFResource("ex:pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFVariable("obj")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 1);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { <ex:subj> <ex:pred> ?OBJ }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalVVOPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFVariable("pred"), new RDFResource("ex:obj")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFResource("ex:obj")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 2);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { ?SUBJ ?PRED <ex:obj> }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalVVLPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFVariable("pred"), new RDFPlainLiteral("lit")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFPlainLiteral("lit")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 2);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { ?SUBJ ?PRED \"lit\" }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalVVLLPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFVariable("pred"), new RDFPlainLiteral("lit", "en-US")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFPlainLiteral("lit", "en-US")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 2);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { ?SUBJ ?PRED \"lit\"@EN-US }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalVVLTPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFVariable("pred"), new RDFTypedLiteral("25", RDFModelEnums.RDFDatatypes.XSD_INTEGER)).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFTypedLiteral("25", RDFModelEnums.RDFDatatypes.XSD_INTEGER)));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 2);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { ?SUBJ ?PRED \"25\"^^<http://www.w3.org/2001/XMLSchema#integer> }"));
+            Assert.IsTrue(pattern.ToString(new List<RDFNamespace>() { RDFNamespaceRegister.GetByPrefix("xsd") }).Equals(string.Concat("OPTIONAL { ?SUBJ ?PRED \"25\"^^xsd:integer }")));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalSVVPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFResource("ex:subj"), new RDFVariable("pred"), new RDFVariable("obj")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFResource("ex:subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFVariable("obj")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 2);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { <ex:subj> ?PRED ?OBJ }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalVPVPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFResource("ex:pred"), new RDFVariable("obj")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFResource("ex:pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFVariable("obj")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 2);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { ?SUBJ <ex:pred> ?OBJ }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalVVVPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFVariable("pred"), new RDFVariable("obj")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("pred")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFVariable("obj")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 3);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { ?SUBJ ?PRED ?OBJ }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldCreateOptionalPatternWithSharedVariable()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFVariable("subj"), new RDFVariable("obj")).Optional();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFVariable("obj")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsTrue(pattern.IsOptional);
+            Assert.IsFalse(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 2);
+            Assert.IsTrue(pattern.ToString().Equals("OPTIONAL { ?SUBJ ?SUBJ ?OBJ }"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
+
+        [TestMethod]
+        public void ShouldSetUnionWithNextPattern()
+        {
+            RDFPattern pattern = new RDFPattern(new RDFVariable("subj"), new RDFVariable("subj"), new RDFVariable("obj")).UnionWithNext();
+
+            Assert.IsNotNull(pattern);
+            Assert.IsNull(pattern.Context);
+            Assert.IsNotNull(pattern.Subject);
+            Assert.IsTrue(pattern.Subject.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Predicate);
+            Assert.IsTrue(pattern.Predicate.Equals(new RDFVariable("subj")));
+            Assert.IsNotNull(pattern.Object);
+            Assert.IsTrue(pattern.Object.Equals(new RDFVariable("obj")));
+            Assert.IsTrue(pattern.IsEvaluable);
+            Assert.IsFalse(pattern.IsOptional);
+            Assert.IsTrue(pattern.JoinAsUnion);
+            Assert.IsNotNull(pattern.Variables);
+            Assert.IsTrue(pattern.Variables.Count == 2);
+            Assert.IsTrue(pattern.ToString().Equals("?SUBJ ?SUBJ ?OBJ"));
+            Assert.IsTrue(pattern.PatternGroupMemberID.Equals(RDFModelUtilities.CreateHash(pattern.ToString())));
+        }
         #endregion
     }
 }


Inline select formatting.

Inline select formatting.

--- src/Generators/CsharpGenerator.cs
+++ src/Generators/CsharpGenerator.cs
@@ -66,7 +66,7 @@
     public abstract class Select : BaseIfc
     {
         protected BaseIfc choice;
-        public override string ToStepValue(bool isSelectOption = false){{ return choice.ToStepValue(isSelectOption); }}
+        public override string ToStepValue(bool isSelectOption = false){{ return choice.ToStepValue(true); }}
         public override string ToSTEP(){{ return $""#{{choice.StepId}} = {{choice.GetType().Name.ToUpper()}}({{choice.GetStepParameters()}});""; }}
     }
     ";


Add [ActiveIssue] to test that fails only in CI Outerloop

--- src/System.Private.ServiceModel/tests/Scenarios/Security/TransportSecurity/Tcp/ClientCredentialTypeCertificateCanonicalNameTests.cs
+++ src/System.Private.ServiceModel/tests/Scenarios/Security/TransportSecurity/Tcp/ClientCredentialTypeCertificateCanonicalNameTests.cs
@@ -25,6 +25,7 @@
     [Theory]
     [OuterLoop]
     [MemberData("TcpClientCredentialType_Certificate_With_Only_CanonicalName_MemberData")]
+    [ActiveIssue(1047)]
     public static void TcpClientCredentialType_Certificate_With_Only_CanonicalName_EchoString(Uri endpointUri, bool shouldCallSucceed)
     {
         var endpointAddress = new EndpointAddress(endpointUri);


Added IEquatable to PerLevel

Added IEquatable to PerLevel

--- WorldSmith/DataClasses/PropertyTypes/PerLevel.cs
+++ WorldSmith/DataClasses/PropertyTypes/PerLevel.cs
@@ -9,7 +9,7 @@
 namespace WorldSmith.DataClasses
 {

-    class PerLevelConverter : TypeConverter
+    class PerLevelConverter : TypeConverter
     {
         public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
         {
@@ -97,7 +97,7 @@

     //[TypeConverter(typeof(PerLevelConverter))]
     [TypeConverter(typeof(ExpandableObjectConverter))]
-    public class PerLevel : CollectionBase, ICustomTypeDescriptor
+    public class PerLevel : CollectionBase, ICustomTypeDescriptor, IEquatable<PerLevel>
     {
         public PerLevel(string value)
         {
@@ -119,6 +119,25 @@
             }

+        }
+
+        public bool Equals(PerLevel other)
+        {
+            if (other == null)
+                return false;
+
+            if (this.List.Count != other.List.Count)
+                return false;
+
+            for (int i = 0; i < this.List.Count; i++)
+            {
+                if (!((float)this.List[i]).Equals((float)other.List[i]))
+                {
+                    return false;
+                }
+            }
+
+            return true;
         }

         public void Add(float f)


[KMS] Equip (7)

[KMS] Equip (7)

--- WzComparerR2.Common/CharaSim/ItemStringHelper.cs
+++ WzComparerR2.Common/CharaSim/ItemStringHelper.cs
@@ -176,7 +176,7 @@
                 //case GearType.hair2: return "纸娃娃(发型)";
                 case GearType.faceAccessory: return "얼굴장식";
                 case GearType.eyeAccessory: return "눈장식";
-                case GearType.earrings: return "귀걸이";
+                case GearType.earrings: return "귀고리";
                 case GearType.pendant: return "펜던트";
                 case GearType.belt: return "벨트";
                 case GearType.medal: return "훈장";


CA-144951: [WLB Settings] Multiple pop-ups when navigating to Automation tab.

Signed-off-by: Liang Dai <b75e0c1afa1f3a887b91110b0d3218879b1a8933@citrix.com>

--- XenAdmin/SettingsPanels/Wlb/WlbAutomationPage.cs
+++ XenAdmin/SettingsPanels/Wlb/WlbAutomationPage.cs
@@ -53,6 +53,7 @@
         private XenAdmin.Network.IXenConnection _connection;
         private bool _hasChanged = false;
         private bool _loading = false;
+        private HashSet<string> _uuidSet = new HashSet<string>();

         private int[] minimumColumnWidths = {25, 50, 50, 50 };

@@ -214,6 +215,7 @@
                     if (!HostCannotParticipateInPowerManagement(host))
                     {
                         if (e.NewValue == CheckState.Checked &&
+                            _uuidSet.Contains(host.uuid) &&
                             (!_poolConfiguration.HostConfigurations.ContainsKey(host.uuid) ||
                              !_poolConfiguration.HostConfigurations[host.uuid].LastPowerOnSucceeded))
                         {
@@ -236,6 +238,7 @@
                         }
                         else
                         {
+                            _uuidSet.Add(host.uuid);
                             _hasChanged = true;
                         }
                     }


Add method to focus on group of transforms to YesAndCamera

--- YesAndEngine/Components/Optional/YesAndCamera.cs
+++ YesAndEngine/Components/Optional/YesAndCamera.cs
@@ -99,7 +99,7 @@

 			// Update automatic camera motion.
 			if (targetPosition != null) {
-				Vector3 tar = (Vector3)targetPosition;
+				Vector3 tar = targetPosition.Value;
 				velocity = tar - transform.position;
 				RestrictVelocity ();
 				transform.Translate (velocity);
@@ -159,8 +159,38 @@
 		public void MoveTo (Vector2 target, float? size = null) {
 			targetPosition = target;
 			if (size != null) {
-				targetSize = (float)size;
-			}
+				targetSize = size.Value;
+			}
+		}
+
+		// Focus on the specified group of transforms.
+		public void FocusOn (params Transform[] targets) {
+			float left = 0, right = 0, top = 0, bottom = 0;
+
+			// Examine each focal point
+			Vector2 focusPoint = Vector2.zero;
+			foreach (Transform t in targets) {
+				float x = t.position.x;
+				float y = t.position.y;
+				focusPoint.x += x;
+				focusPoint.y += y;
+				if (x < left) {
+					left = x;
+				}
+				if (x > right) {
+					right = x;
+				}
+				if (y > top) {
+					top = y;
+				}
+				if (y < bottom) {
+					bottom = y;
+				}
+			}
+
+			// Calculate position and bounds
+			int count = targets.Length;
+			MoveTo (new Vector2 (focusPoint.x / count, focusPoint.y / count), cam.orthographicSize);
 		}

 		// Drag this camera for a frame.
@@ -206,10 +236,10 @@

 			// Reset the Camera component.
 			if (position != null) {
-				transform.position = (Vector3)position;
+				transform.position = position.Value;
 			}
 			if (size != null) {
-				cam.orthographicSize = (float)size;
+				cam.orthographicSize = size.Value;
 			}
 			if (clearColor != null) {
 				cam.backgroundColor = (Color)clearColor;


Fix problems comparing and casting strings to Pending trust status.

--- Yort.OnlineEftpos.SharedContracts/TrustStatus.cs
+++ Yort.OnlineEftpos.SharedContracts/TrustStatus.cs
@@ -13,7 +13,7 @@
 	{
 		#region Instance Implementation

-		private string _Name;
+		private readonly string _Name;
 		private TrustStatus(string name)
 		{
 			_Name = name;
@@ -43,6 +43,8 @@
 				return TrustStatus.Active;
 			else if (String.Equals(name, TrustStatus.Cancelled._Name, StringComparison.OrdinalIgnoreCase))
 				return TrustStatus.Cancelled;
+			else if (String.Equals(name, TrustStatus.Pending._Name, StringComparison.OrdinalIgnoreCase))
+				return TrustStatus.Pending;

 			return null;
 		}


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Server/WebSocketServiceManager.cs
+++ websocket-sharp/Server/WebSocketServiceManager.cs
@@ -336,10 +336,13 @@
       var ret = new Dictionary<string, Dictionary<string, bool>> ();

       foreach (var host in Hosts) {
-        if (_state != ServerState.Start)
+        if (_state != ServerState.Start) {
+          _log.Error ("The server is shutting down.");
           break;
-
-        ret.Add (host.Path, host.Sessions.Broadping (frameAsBytes, timeout));
+        }
+
+        var res = host.Sessions.Broadping (frameAsBytes, timeout);
+        ret.Add (host.Path, res);
       }

       return ret;


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Server/WebSocketSessionManager.cs
+++ websocket-sharp/Server/WebSocketSessionManager.cs
@@ -226,15 +226,12 @@
       }

       set {
-        string msg;
-        if (!canSet (out msg)) {
-          _log.Warn (msg);
-          return;
-        }
-
         lock (_sync) {
+          string msg;
+
           if (!canSet (out msg)) {
             _log.Warn (msg);
+
             return;
           }


removed debug trace

removed debug trace

--- NewtonPlugin/NewtonCollider.cs
+++ NewtonPlugin/NewtonCollider.cs
@@ -138,7 +138,6 @@
             {
                 if (body.m_world != null)
                 {
-                    Debug.Log("xxxxxxxxxxxxxxxxxxxxxxx");
                     m_shape = Create(body.m_world);
                 }
             }


Fix Function.bind(undefined, ...)

Fix Function.bind(undefined, ...)

--- NiL.JS/BaseLibrary/Function.cs
+++ NiL.JS/BaseLibrary/Function.cs
@@ -823,10 +823,7 @@

             var newThis = args[0];
             var strict = (_functionDefinition._body != null && _functionDefinition._body._strict) || Context.CurrentContext._strict;
-            if ((newThis != null && newThis._valueType > JSValueType.Undefined) || strict)
-                return new BindedFunction(this, args);
-
-            return this;
+            return new BindedFunction(this, args);
         }

         [Hidden]


Last one fix for tests

Last one fix for tests

--- NiL.JS/Statements/CodeBlock.cs
+++ NiL.JS/Statements/CodeBlock.cs
@@ -118,11 +118,13 @@
                     if (allowDirectives)
                     {
                         int start = position;
+                        var hasDirectives = false;
                         do
                         {
                             var s = position;
                             if (position >= state.Code.Length)
                                 break;
+
                             if (Parser.ValidateValue(state.Code, ref position))
                             {
                                 while (position < state.Code.Length && Tools.IsWhiteSpace(state.Code[position]))
@@ -134,6 +136,7 @@
                                     position = s;
                                     break;
                                 }
+
                                 var t = s;
                                 if (Parser.ValidateString(state.Code, ref t, true))
                                 {
@@ -142,6 +145,8 @@
                                     {
                                         state.CodeContext |= CodeContext.Strict;
                                     }
+
+                                    hasDirectives = true;
 #if DEBUG
                                     if (directives == null)
                                         directives = new HashSet<string>();
@@ -157,10 +162,8 @@
                             }
                             else if (state.Code[position] == ';')
                             {
-#if DEBUG
-                                if (directives == null)
+                                if (!hasDirectives)
                                     break;
-#endif

                                 do position++; while (position < state.Code.Length && Tools.IsWhiteSpace(state.Code[position]));
                             }


Add diff to Nitra.TestsLauncher.

Add diff to Nitra.TestsLauncher.

--- Nitra.TestsLauncher/Program.cs
+++ Nitra.TestsLauncher/Program.cs
@@ -1,6 +1,9 @@
 using Nitra.DebugStrategies;
 using Nitra.ViewModels;
 using Nitra.Visualizer;
+
+using Nemerle.Diff;
+
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -132,6 +135,10 @@
             case TestState.Failure:
               ContinuePrint("failed!", ConsoleColor.Red);
               someTestsFailed = true;
+              Indent();
+              Diff(test);
+              Unindent();
+
              break;
             case TestState.Ignored:
               ContinuePrint("ignored.", ConsoleColor.Yellow);
@@ -156,7 +163,86 @@
         PrintLine("Some tests is failed!", ConsoleColor.Red);

       Console.WriteLine("done...");
-      //Console.ReadLine();
+
+      if (someTestsFailed || someTestSuitsFailedToLoad)
+      {
+        //Console.ReadLine();
+        Environment.Exit(-1);
+      }
+    }
+
+    private static void Diff(TestVm test)
+    {
+      var textA = Split(test.Gold);
+      var textB = Split(test.PrettyPrintResult);
+      const int rangeToShow = 3;
+      var indexA = 0;
+      var output = new List<string>();
+
+      foreach (var diffItem in textA.Diff(textB))
+      {
+        //в начале итерации indexA содержит индекс строки идущей сразу за предыдущим блоком
+
+        // определяем нужно ли выводить разделитель
+        if (diffItem.Index - indexA > rangeToShow * 2)
+        {
+          //показываем строки идущие после предыдущего блока
+          for (var i = 0; i < rangeToShow; ++i)
+          {
+            PrintLine("  " + textA[indexA]);
+            ++indexA;
+          }
+
+          PrintLine("  " + "...", ConsoleColor.Gray);
+
+          //показываем строки идущие перед текущим блоком
+          indexA = diffItem.Index - rangeToShow;
+          for (var i = 0; i < rangeToShow; ++i)
+          {
+            PrintLine("  " + textA[indexA]);
+            ++indexA;
+          }
+        }
+        else
+        {
+          //показываем строки между блоками
+          while (indexA < diffItem.Index)
+          {
+            PrintLine("  " + textA[indexA]);
+            ++indexA;
+          }
+        }
+
+        // показываем удаленные строки
+        for (var i = 0; i < diffItem.Deleted; ++i)
+        {
+          PrintLine("- " + textA[indexA], ConsoleColor.Red);
+          ++indexA;
+        }
+
+        // показываем добавленные строки
+        foreach (var insertedItem in diffItem.Inserted)
+          PrintLine("+ " + insertedItem, ConsoleColor.Green);
+      }
+
+      // показываем не более rangeToShow последующих строк
+      var tailLinesToShow = Math.Min(rangeToShow, textA.Length - indexA);
+
+      for (var i = 0; i < tailLinesToShow; ++i)
+      {
+        PrintLine("  " + textA[indexA]);
+        ++indexA;
+      }
+
+      if (indexA < textA.Length)
+        PrintLine("  " + "...", ConsoleColor.Gray);
+
+      PrintLine("END-DIFF", ConsoleColor.Gray);
+    }
+
+    private static string[] Split(string gold)
+    {
+      return gold.Split(new[] { "\r\n", "\n", "\r" }, StringSplitOptions.None);
     }

     private static int CalcMaxNameLen(List<TestSuitVm> testSuits)


Back to gallery link renamed.

Back to gallery link renamed.

--- SentinelSolution/Web/Views/Gallery/ViewGallery.cshtml
+++ SentinelSolution/Web/Views/Gallery/ViewGallery.cshtml
@@ -6,7 +6,7 @@

-		Képtár
+		 Vissza a sorozatokhoz
 		@Html.Partial( MVC.Shared.Views._LoginPartial )


Fixing period

Fixing period

--- SflStucco.Site/SflStucco.Site/Views/Home/Index.cshtml
+++ SflStucco.Site/SflStucco.Site/Views/Home/Index.cshtml
@@ -161,7 +161,7 @@

-
Highly professional staff .

+
Highly professional staff.

We use the latest techniques.

Certified quality materials.

Reasonable prices.


fixed foreach

fixed foreach

--- SharpToolkit.Extensions.Collections/LinqExtensions.cs
+++ SharpToolkit.Extensions.Collections/LinqExtensions.cs
@@ -133,12 +133,14 @@
         /// <typeparam name="T"> Type of the object. </typeparam>
         /// <param name="collection"> The Collection. </param>
         /// <param name="action"> The action to perform on each collection item. </param>
-        public static void ForEach<T>(this IEnumerable<T> collection, Action<T> action)
+        public static IEnumerable<T> ForEach<T>(this IEnumerable<T> collection, Action<T> action)
         {
             if (collection == null) throw new NullReferenceException(nameof(collection));
             foreach (var item in collection)
             {
                 action(item);
+
+                yield return item;
             }
         }


GSF.PQDIF: Modified the PhysicalWriter to round element size to 4-byte boundaries.

--- Source/Libraries/GSF.PQDIF/Physical/PhysicalWriter.cs
+++ Source/Libraries/GSF.PQDIF/Physical/PhysicalWriter.cs
@@ -228,10 +228,10 @@

                 if (!isEmbedded)
                 {
-                    int size = GetByteSize(element);
+                    int padSize = GetPaddedByteSize(element);
                     writer.Write(linkPosition);
-                    writer.Write(size);
-                    linkPosition += size;
+                    writer.Write(padSize);
+                    linkPosition += padSize;
                 }
                 else
                 {
@@ -244,6 +244,9 @@

             foreach (Element element in collection.Elements)
             {
+                if (IsEmbedded(element))
+                    continue;
+
                 switch (element.TypeOfElement)
                 {
                     case ElementType.Collection:
@@ -251,15 +254,19 @@
                         break;

                     case ElementType.Scalar:
-                        if (!IsEmbedded(element))
-                            WriteScalar(writer, element as ScalarElement);
-
+                        WriteScalar(writer, element as ScalarElement);
                         break;

                     case ElementType.Vector:
                         WriteVector(writer, element as VectorElement);
                         break;
                 }
+
+                int byteSize = GetByteSize(element);
+                int padSize = GetPaddedByteSize(element);
+
+                for (int i = 0; i < padSize - byteSize; i++)
+                    writer.Write((byte)0);
             }
         }

@@ -274,6 +281,13 @@
             writer.Write(scalar.GetValue());
         }

+        private int GetPaddedByteSize(Element element)
+        {
+            int byteSize = GetByteSize(element);
+            int padSize = byteSize + 3;
+            return (padSize / 4) * 4;
+        }
+
         private int GetByteSize(Element element)
         {
             switch (element.TypeOfElement)
@@ -301,7 +315,7 @@

             sum = collection.Elements
                 .Where(element => !IsEmbedded(element))
-                .Sum(element => GetByteSize(element));
+                .Sum(GetPaddedByteSize);

             return 4 + (28 * collection.Size) + sum;
         }


LexerクラスにXMLドキュメントを追加

LexerクラスにXMLドキュメントを追加

--- src/Lury/Compiling/Lexer/Lexer.cs
+++ src/Lury/Compiling/Lexer/Lexer.cs
@@ -35,6 +35,9 @@

 namespace Lury.Compiling
 {
+    /// <summary>
+    /// コードをトークン列に変換するを字句解析器です。
+    /// </summary>
     class Lexer : yyParser.yyInput
     {
         #region -- Private Fields --
@@ -48,7 +51,11 @@
         #endregion

         #region -- Constructor --
-
+        /// <summary>
+        /// ソースコードを指定して新しい Lexer クラスのインスタンスを初期化します。
+        /// </summary>
+        /// <param name="logger">ロガーとなる OutputLogger オブジェクト。</param>
+        /// <param name="sourceCode">ソースコードを表す文字列。</param>
         public Lexer(OutputLogger logger, string sourceCode)
         {
             this.logger = logger;
@@ -63,7 +70,10 @@
         #endregion

         #region -- Public Methods --
-
+        /// <summary>
+        /// 文字列の解析位置を進め、解析が続行できるかの真偽値を取得します。
+        /// </summary>
+        /// <returns>解析が続行できるとき true、文字列の終端に達したなど解析が続行できないとき false。</returns>
         public bool Advance()
         {
             if (this.tokens.Length <= this.position + 1)
@@ -77,11 +87,19 @@
             }
         }

+        /// <summary>
+        /// 現在の解析位置でのトークンを取得します。
+        /// </summary>
+        /// <returns>yyParser.IToken　インタフェースを実装するトークンオブジェクト。</returns>
         public yyParser.IToken GetToken()
         {
             return this.tokens[this.position];
         }

+        /// <summary>
+        /// トークンの値を表すオブジェクトを取得します。
+        /// </summary>
+        /// <returns>トークンの値を表すオブジェクト。</returns>
         public object GetValue()
         {
             return 0;


#961 Change tests to use async Task and Task.Delay

--- Source/csla.netcore.test/DataPortal/DashboardTests.cs
+++ Source/csla.netcore.test/DataPortal/DashboardTests.cs
@@ -9,6 +9,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Threading.Tasks;
 using Csla;
 using Csla.Configuration;
 #if !NUNIT
@@ -50,15 +51,14 @@

     [TestMethod]
     [TestCategory("SkipWhenLiveUnitTesting")]
-    public void DashboardSuccessCounter()
+    public async Task DashboardSuccessCounter()
     {
       new CslaConfiguration().DataPortal().DashboardType("Dashboard");
       var dashboard = (Csla.Server.Dashboard.Dashboard)Csla.Server.Dashboard.DashboardFactory.GetDashboard();

       var obj = Csla.DataPortal.Create<SimpleType>();

-      for (int i = 0; i < 15; i++)
-        System.Threading.Thread.Sleep(50);
+      await Task.Delay(500);

       Assert.IsTrue(dashboard.FirstCall.Ticks > 0);
       Assert.AreEqual(1, dashboard.TotalCalls, "total");
@@ -68,19 +68,18 @@

     [TestMethod]
     [TestCategory("SkipWhenLiveUnitTesting")]
-    public void DashboardFailureCounter()
+    public async Task DashboardFailureCounter()
     {
       new CslaConfiguration().DataPortal().DashboardType("Dashboard");
       var dashboard = (Csla.Server.Dashboard.Dashboard)Csla.Server.Dashboard.DashboardFactory.GetDashboard();
-
+
       try
       {
         var obj = Csla.DataPortal.Fetch<SimpleType>("123");
       }
       catch { /*expected failure*/ }

-      for (int i = 0; i < 15; i++)
-        System.Threading.Thread.Sleep(50);
+      await Task.Delay(500);

       Assert.IsTrue(dashboard.FirstCall.Ticks > 0);
       Assert.AreEqual(1, dashboard.TotalCalls, "total");
@@ -90,7 +89,7 @@

     [TestMethod]
     [TestCategory("SkipWhenLiveUnitTesting")]
-    public void DashboardRecentActivity()
+    public async Task DashboardRecentActivity()
     {
       new CslaConfiguration().DataPortal().DashboardType("Dashboard");
       var dashboard = (Csla.Server.Dashboard.Dashboard)Csla.Server.Dashboard.DashboardFactory.GetDashboard();
@@ -102,8 +101,7 @@
       }
       catch { /*expected failure*/ }

-      for (int i = 0; i < 15; i++)
-        System.Threading.Thread.Sleep(50);
+      await Task.Delay(500);

       var activity = dashboard.GetRecentActivity();
       Assert.AreEqual(2, activity.Count, "count");


Remove SoftlineBreakAsHarlineBreak and SmartyPants by default for AllExtensions

--- src/Markdig/MarkdownExtensions.cs
+++ src/Markdig/MarkdownExtensions.cs
@@ -30,7 +30,7 @@
     public static class MarkdownExtensions
     {
         /// <summary>
-        /// Uses all extensions except the Emoji.
+        /// Uses all extensions except the Emoji, SmartyPants and soft line as hard line breaks.
         /// </summary>
         /// <param name="pipeline">The pipeline.</param>
         /// <returns>The modified pipeline</returns>
@@ -51,8 +51,6 @@
                 .UseMath()
                 .UseMedia()
                 .UsePipeTable()
-                .UseSoftlineBreakAsHardlineBreak()
-                .UseSmartyPants()
                 .UseGenericAttributes(); // Must be last as it is one parser that is modifying other parsers
         }


Remove commented out code

Remove commented out code

--- Src/GoogleApis/Apis/Requests/IDirectResponseSchema.cs
+++ Src/GoogleApis/Apis/Requests/IDirectResponseSchema.cs
@@ -25,12 +25,6 @@
     public interface IDirectResponseSchema
     {
         /// <summary>
-        /// All errors the server returned along with the request. 'null' when the request succeeded.
-        /// </summary>
-//        [JsonProperty("error")]
-//        RequestError Error { get; set; }
-
-        /// <summary>
         /// The e-tag of this response.
         /// </summary>
         /// <remarks>


Adjust input drum transition slightly.

Adjust input drum transition slightly.

--- osu.Game.Modes.Taiko/UI/InputDrum.cs
+++ osu.Game.Modes.Taiko/UI/InputDrum.cs
@@ -139,7 +139,7 @@
                 {
                     target.FadeTo(Math.Min(target.Alpha + 0.4f, 1), 40, EasingTypes.OutQuint);
                     target.Delay(40);
-                    target.FadeOut(600, EasingTypes.OutQuint);
+                    target.FadeOut(1000, EasingTypes.OutQuint);
                 }

                 return false;


Code style

Code style

--- TableDependency.OracleClient/OracleTableDependency.cs
+++ TableDependency.OracleClient/OracleTableDependency.cs
@@ -416,9 +416,9 @@
                         var updateDml = ChangeType.Update.ToString();
                         var deleteDml = ChangeType.Delete.ToString();

-                        var enqueueStartMessage = this.PrepareStartEnqueueScript(dataBaseObjectsNamingConvention) + Environment.NewLine;
+                        var enqueueStartMessage = PrepareStartEnqueueScript(dataBaseObjectsNamingConvention) + Environment.NewLine;
                         var enqueueFieldsStatement = string.Join(Environment.NewLine, userInterestedColumns.Select(c => this.PrepareEnqueueScript(c, dataBaseObjectsNamingConvention))) + Environment.NewLine;
-                        var enqueueEndMessage = this.PrepareEndEnqueueScript(dataBaseObjectsNamingConvention);
+                        var enqueueEndMessage = PrepareEndEnqueueScript(dataBaseObjectsNamingConvention);

                         command.CommandText = string.Format(
                             Scripts.CreateTriggerEnqueueMessage,
@@ -575,14 +575,14 @@

         #region Private methods

-        private string PrepareStartEnqueueScript(string dataBaseObjectsNamingConvention)
+        private static string PrepareStartEnqueueScript(string dataBaseObjectsNamingConvention)
         {
             return
                 "SELECT UTL_RAW.CAST_TO_RAW(dmlType) INTO message_buffer FROM DUAL;" + Environment.NewLine +
                 $"DBMS_AQ.ENQUEUE(queue_name => 'QUE_{dataBaseObjectsNamingConvention}', enqueue_options => enqueue_options, message_properties => message_properties, payload => TYPE_{dataBaseObjectsNamingConvention}(messageStart, message_buffer), msgid => message_handle);" + Environment.NewLine;
         }

-        private string PrepareEndEnqueueScript(string dataBaseObjectsNamingConvention)
+        private static string PrepareEndEnqueueScript(string dataBaseObjectsNamingConvention)
         {
             return
                 "SELECT UTL_RAW.CAST_TO_RAW(dmlType) INTO message_buffer FROM DUAL;" + Environment.NewLine +
@@ -602,7 +602,7 @@
             return PrepareEnqueueScriptForOther(column, messageType, dataBaseObjectsNamingConvention);
         }

-        private string PrepareEnqueueScriptForRawType(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
+        private static string PrepareEnqueueScriptForRawType(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
         {
             var variable = "v_" + column.Name.Replace(" ", "_").Replace(Quotes, string.Empty);
             return
@@ -614,7 +614,7 @@
                 $"END IF;" + Environment.NewLine;
         }

-        private string PrepareEnqueueScriptForXmlType(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
+        private static string PrepareEnqueueScriptForXmlType(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
         {
             var variable = "v_" + column.Name.Replace(" ", "_").Replace(Quotes, string.Empty);
             return
@@ -638,7 +638,7 @@
                 $"END IF;" + Environment.NewLine;
         }

-        private string PrepareEnqueueScriptForOther(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
+        private static string PrepareEnqueueScriptForOther(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
         {
             var variable = "TO_CHAR(v_" + column.Name.Replace(" ", "_").Replace(Quotes, string.Empty) + ")";
             return
@@ -651,7 +651,7 @@
                 $"END IF;" + Environment.NewLine;
         }

-        private string PrepareEnqueueScriptForVarchar(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
+        private static string PrepareEnqueueScriptForVarchar(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
         {
             var variable = "v_" + column.Name.Replace(" ", "_").Replace(Quotes, string.Empty);
             return
@@ -676,7 +676,7 @@
                 $"END IF;" + Environment.NewLine;
         }

-        private string PrepareEnqueueScriptForChar(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
+        private static string PrepareEnqueueScriptForChar(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
         {
             var variable = "TO_CHAR(v_" + column.Name.Replace(" ", "_").Replace(Quotes, string.Empty) + ")";
             return
@@ -689,7 +689,7 @@
                 $"END IF;" + Environment.NewLine;
         }

-        private string PrepareEnqueueScriptForTimeStamp(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
+        private static string PrepareEnqueueScriptForTimeStamp(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
         {
             var variable = "TO_CHAR(v_" + column.Name.Replace(" ", "_").Replace(Quotes, string.Empty) + $", '{OracleDatespanFormat}')";
             return
@@ -702,7 +702,7 @@
                 $"END IF;" + Environment.NewLine;
         }

-        private string PrepareEnqueueScriptForDate(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
+        private static string PrepareEnqueueScriptForDate(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
         {
             var variable = "TO_CHAR(v_" + column.Name.Replace(" ", "_").Replace(Quotes, string.Empty) + $", '{OracleDateFormat}')";
             return
@@ -759,7 +759,7 @@

                                     setStatus(TableDependencyStatus.WaitingForNotification);

-                                    using (var reader = getQueueMessageCommand.ExecuteReader())
+                                    using (var reader = getQueueMessageCommand.ExecuteReader(CommandBehavior.CloseConnection))
                                     {
                                         while (reader.Read())
                                         {


Removed old MONOGAME #elif

Removed old MONOGAME #elif

--- Tests/Mapsui.Rendering.Xaml.Tests/MapRendererTests.cs
+++ Tests/Mapsui.Rendering.Xaml.Tests/MapRendererTests.cs
@@ -6,9 +6,6 @@
 using NUnit.Framework;
 #if SKIA
 using Mapsui.Rendering.Skia;
-#elif MONOGAME
-using Mapsui.Rendering.MonoGame;
-using Mapsui.Rendering.MonoGame.Tests_W8;
 #endif

 namespace Mapsui.Rendering.Xaml.Tests


Added a Unit Test

Added a Unit Test

Unit Test for WithCustomConverter Extension.

--- TinyCsvParser/TinyCsvParser.Test/TinyCsvParserTest.cs
+++ TinyCsvParser/TinyCsvParser.Test/TinyCsvParserTest.cs
@@ -25,15 +25,36 @@
         private class CsvPersonMapping : CsvMapping<Person>
         {
             public CsvPersonMapping()
-                : this(new TypeConverterProvider())
-            {
-            }
-            public CsvPersonMapping(ITypeConverterProvider typeConverterProvider)
-                : base(typeConverterProvider)
             {
                 MapProperty(0, x => x.FirstName);
                 MapProperty(1, x => x.LastName);
                 MapProperty(2, x => x.BirthDate);
+            }
+        }
+
+        private class CsvPersonMappingWithTypeConverterProvider : CsvMapping<Person>
+        {
+            public CsvPersonMappingWithTypeConverterProvider()
+                : this(new TypeConverterProvider())
+            {
+            }
+            public CsvPersonMappingWithTypeConverterProvider(ITypeConverterProvider typeConverterProvider)
+                : base(typeConverterProvider)
+            {
+                MapProperty(0, x => x.FirstName);
+                MapProperty(1, x => x.LastName);
+                MapProperty(2, x => x.BirthDate);
+            }
+        }
+
+        private class CsvPersonMappingWithCustomConverter : CsvMapping<Person>
+        {
+            public CsvPersonMappingWithCustomConverter()
+            {
+                MapProperty(0, x => x.FirstName);
+                MapProperty(1, x => x.LastName);
+                MapProperty(2, x => x.BirthDate)
+                    .WithCustomConverter(new DateTimeConverter("yyyy###MM###dd"));
             }
         }

@@ -152,14 +173,14 @@
         }

         [Test]
-        public void WeirdDateTimeTest()
+        public void WeirdDateTimeTest_ProviderBased()
         {
             // Instantiate the TypeConverterProvider and override the DateTimeConverter:
             ITypeConverterProvider csvTypeConverterProvider =
                 new TypeConverterProvider().Add(new DateTimeConverter("yyyy###MM###dd"));

             // Make sure you pass the custom provider into the mapping!
-            CsvPersonMapping csvMapper = new CsvPersonMapping(csvTypeConverterProvider);
+            var csvMapper = new CsvPersonMappingWithTypeConverterProvider(csvTypeConverterProvider);

             // And this is business as usual!
             CsvParserOptions csvParserOptions = new CsvParserOptions(true, new[] { ';' });
@@ -182,6 +203,30 @@
             Assert.AreEqual(12, result[0].Result.BirthDate.Day);
         }

+        [Test]
+        public void WeirdDateTimeTest_CustomConverterBased()
+        {
+            CsvParserOptions csvParserOptions = new CsvParserOptions(true, new[] { ';' });
+            CsvReaderOptions csvReaderOptions = new CsvReaderOptions(new[] { Environment.NewLine });
+            CsvPersonMappingWithCustomConverter csvMapper = new CsvPersonMappingWithCustomConverter();
+            CsvParser<Person> csvParser = new CsvParser<Person>(csvParserOptions, csvMapper);
+
+            var stringBuilder = new StringBuilder()
+                .AppendLine("FirstName;LastName;BirthDate")
+                .AppendLine("Philipp;Wagner;1986###05###12");
+
+            var result = csvParser
+                .ReadFromString(csvReaderOptions, stringBuilder.ToString())
+                .ToList();
+
+            Assert.AreEqual("Philipp", result[0].Result.FirstName);
+            Assert.AreEqual("Wagner", result[0].Result.LastName);
+
+            Assert.AreEqual(1986, result[0].Result.BirthDate.Year);
+            Assert.AreEqual(5, result[0].Result.BirthDate.Month);
+            Assert.AreEqual(12, result[0].Result.BirthDate.Day);
+        }
+
         [Test]
         public void ParallelLinqTest()
         {


Cosmetic whitespace fixes

Cosmetic whitespace fixes

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

--- src/MonoTorrent/Common/Torrent.cs
+++ src/MonoTorrent/Common/Torrent.cs
@@ -430,7 +430,7 @@
         private void ProcessInfo(BEncodedDictionary dictionary)
         {
             this.pieceLength = int.Parse(dictionary["piece length"].ToString());
-
+
             foreach (KeyValuePair<BEncodedString, BEncodedValue> keypair in dictionary)
             {
                 switch (keypair.Key.Text)
@@ -533,25 +533,28 @@
         }

-	/// <summary>
-	/// Loads a .torrent from the specificed path. A return value indicates
-	/// whether the operation was successful.
-	/// </summary>
-	/// <param name="path">The path to load the .torrent file from</param>
-	/// <param name="torrent">If the loading was succesful it is assigned the Torrent</param>
-	/// <returns>True if successful</returns>
-	public static bool TryLoad(string path, out Torrent torrent)
-	{
-		try{
-			torrent = Torrent.Load(path);
-		} catch {
-			torrent = null;
-		}
-
-		return torrent != null;
-	}
-
-
+        /// <summary>
+        /// Loads a .torrent from the specificed path. A return value indicates
+        /// whether the operation was successful.
+        /// </summary>
+        /// <param name="path">The path to load the .torrent file from</param>
+        /// <param name="torrent">If the loading was succesful it is assigned the Torrent</param>
+        /// <returns>True if successful</returns>
+        public static bool TryLoad(string path, out Torrent torrent)
+        {
+            try
+            {
+                torrent = Torrent.Load(path);
+            }
+            catch
+            {
+                torrent = null;
+            }
+
+            return torrent != null;
+        }
+
+
         /// <summary>
         /// Loads a .torrent from the supplied stream
         /// </summary>
@@ -566,23 +569,26 @@
         }

-	/// <summary>
-	/// Loads a .torrent from the supplied stream. A return value indicates
-	/// whether the operation was successful.
-	/// </summary>
-	/// <param name="stream">The stream containing the data to load</param>
-	/// <param name="torrent">If the loading was succesful it is assigned the Torrent</param>
-	/// <returns>True if successful</returns>
-	public static bool TryLoad(Stream stream, out Torrent torrent)
-	{
-		try{
-			torrent = Torrent.Load(stream);
-		} catch {
-			torrent = null;
-		}
-
-		return torrent != null;
-	}
+        /// <summary>
+        /// Loads a .torrent from the supplied stream. A return value indicates
+        /// whether the operation was successful.
+        /// </summary>
+        /// <param name="stream">The stream containing the data to load</param>
+        /// <param name="torrent">If the loading was succesful it is assigned the Torrent</param>
+        /// <returns>True if successful</returns>
+        public static bool TryLoad(Stream stream, out Torrent torrent)
+        {
+            try
+            {
+                torrent = Torrent.Load(stream);
+            }
+            catch
+            {
+                torrent = null;
+            }
+
+            return torrent != null;
+        }

         /// <summary>
@@ -603,33 +609,36 @@
                 using (WebClient client = new WebClient())
                     client.DownloadFile(url, location);
             }
-            catch(Exception ex)
+            catch (Exception ex)
             {
                 throw new TorrentException("Could not download .torrent file from the specified url", ex);
             }

             return Torrent.Load(location);
         }
-
-
-	/// <summary>
-	/// Loads a .torrent file from the specified URL. A return value indicates
-	/// whether the operation was successful.
-	/// </summary>
-	/// <param name="url">The URL to download the .torrent from</param>
-	/// <param name="location">The path to download the .torrent to before it gets loaded</param>
-	/// <param name="torrent">If the loading was succesful it is assigned the Torrent</param>
-	/// <returns>True if successful</returns>
-	public static bool TryLoad(Uri url, string location, out Torrent torrent)
-	{
-		try{
-			torrent = Torrent.Load(url, location);
-		} catch {
-			torrent = null;
-		}
-
-		return torrent != null;
-	}
+
+
+        /// <summary>
+        /// Loads a .torrent file from the specified URL. A return value indicates
+        /// whether the operation was successful.
+        /// </summary>
+        /// <param name="url">The URL to download the .torrent from</param>
+        /// <param name="location">The path to download the .torrent to before it gets loaded</param>
+        /// <param name="torrent">If the loading was succesful it is assigned the Torrent</param>
+        /// <returns>True if successful</returns>
+        public static bool TryLoad(Uri url, string location, out Torrent torrent)
+        {
+            try
+            {
+                torrent = Torrent.Load(url, location);
+            }
+            catch
+            {
+                torrent = null;
+            }
+
+            return torrent != null;
+        }

         private static Torrent Load(Stream stream, string path)


wcf logger: added support for correlation between request and response

--- src/Netco/WCF/LoggingInspector.cs
+++ src/Netco/WCF/LoggingInspector.cs
@@ -1,4 +1,5 @@
-using System.ServiceModel;
+using System;
+using System.ServiceModel;
 using System.ServiceModel.Channels;
 using System.ServiceModel.Dispatcher;
 using Netco.Logging;
@@ -8,8 +9,10 @@
 	/// <summary>
 	/// Inspects WCF messages and logs them into trace channel.
 	/// </summary>
-	public class LoggingInspector : IClientMessageInspector
+	public class LoggingInspector: IClientMessageInspector
 	{
+		readonly ILogger _logger = NetcoLogger.GetLogger< LoggingInspector >();
+
 		/// <summary>Enables inspection or modification of a message before a request message is sent to a service.</summary>
 		/// <param name="request">The message to be sent to the service.</param>
 		/// <param name="channel">The  client object channel.</param>
@@ -18,9 +21,10 @@
 		/// </returns>
 		public object BeforeSendRequest( ref Message request, IClientChannel channel )
 		{
-			this.Log().Trace( @"Request message:
-{0}", request.ToString() );
-			return null;
+			var correlationState = Guid.NewGuid();
+			this._logger.Trace( @"Request {{{0}}}:
+{1}", correlationState.ToString(), request.ToString() );
+			return correlationState;
 		}

 		/// <summary>
@@ -30,7 +34,11 @@
 		/// <param name="correlationState">Correlation state data.</param>
 		public void AfterReceiveReply( ref Message reply, object correlationState )
 		{
-			this.Log().Trace( @"Reply message:
+			if( correlationState != null )
+				this._logger.Trace( @"Response {{{0}}}:
+{1}", correlationState.ToString(), reply.ToString() );
+			else
+				this._logger.Trace( @"Response:
 {0}", reply.ToString() );
 		}
 	}


Documenting behavior and adding obsolete attribute to ToUtc method.

--- src/Nvelope/DateTimeExtensions.cs
+++ src/Nvelope/DateTimeExtensions.cs
@@ -27,6 +27,12 @@
                 return (int)age.TotalSeconds + " " + (age.TotalSeconds > 1 ? "Secs" : "Sec");
         }

+        /// <summary>
+        /// Takes the time and returns a *different* datetime by changing the kind of time without taking into account the offset.
+        /// </summary>
+        /// <param name="date"></param>
+        /// <returns>different</returns>
+        [Obsolete("Behaves oppositely to ToUniversalTime() in framework")]
         public static DateTime ToUtc(this DateTime date)
         {
             return


(Failing) Test to verify that embedded delegates are linked to the `Function` prototype

--- test/JavaScriptEngineSwitcher.Tests/ChakraCore/InteropTests.cs
+++ test/JavaScriptEngineSwitcher.Tests/ChakraCore/InteropTests.cs
@@ -1,4 +1,7 @@
-namespace JavaScriptEngineSwitcher.Tests.ChakraCore
+using System;
+using Xunit;
+
+namespace JavaScriptEngineSwitcher.Tests.ChakraCore
 {
 	public class InteropTests : InteropTestsBase
 	{
@@ -6,5 +9,26 @@
 		{
 			get { return "ChakraCoreJsEngine"; }
 		}
+
+		[Fact]
+		public void EmbeddedInstanceOfDelegateHasFunctionPrototype()
+		{
+			// Arrange
+			var someFunc = new Func<int>(() => 42);
+
+			const string input = "Object.getPrototypeOf(embeddedFunc) === Function.prototype";
+
+			// Act
+			bool output;
+
+			using (var jsEngine = CreateJsEngine())
+			{
+				jsEngine.EmbedHostObject("embeddedFunc", someFunc);
+				output = jsEngine.Evaluate<bool>(input);
+			}
+
+			// Assert
+			Assert.True(output);
+		}
 	}
 }


Refactor ResponsiveService for better clean code

--- src/Services/ResponsiveService.cs
+++ src/Services/ResponsiveService.cs
@@ -29,9 +29,7 @@
             _context = accessor.HttpContext;

             View = DefaultView(deviceService.Type, options.Responsive);
-            var preferView = PreferView();
-            if (preferView != Device.Unknown && preferView != View)
-                View = PreferView();
+            View = PreferView(_context, View);
         }

         public void PreferSet(Device desktop)
@@ -44,14 +42,20 @@
             => _context.SafeSession() != null
                && _context.SafeSession().Keys.Any(k => k == ResponsiveContextKey);

-        private Device PreferView()
+        private static Device PreferView(HttpContext context, Device defaultView)
         {
-            if (!IsPreferred())
-                return Device.Unknown;
+            if (context.SafeSession() == null)
+                return defaultView;
+            if (context.SafeSession().Keys.All(k => k != ResponsiveContextKey))
+                return defaultView;

-            _context.Session.TryGetValue(ResponsiveContextKey, out var raw);
-            Enum.TryParse<Device>(Encoding.ASCII.GetString(raw), out var preferred);
-            return preferred;
+            context.Session.TryGetValue(ResponsiveContextKey, out var raw);
+            Enum.TryParse<Device>(Encoding.ASCII.GetString(raw), out var preferView);
+
+            if (preferView != Device.Unknown && preferView != defaultView)
+                return preferView;
+
+            return defaultView;
         }

         private static Device DefaultView(Device device, ResponsiveOptions options)