ttAdd & ttLoop no longer creates/changes the queue, use tt( instead + improved comments

--- TeaTime.cs
+++ TeaTime.cs
@@ -357,37 +357,37 @@
     /// <summary>
     /// Appends a timed callback into a queue.
     /// </summary>
-    public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, float timeDelay, Action callback)
-    {
-        return instance.ttAdd(queueName, timeDelay, null, callback, null, false);
-    }
+    //public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, float timeDelay, Action callback)
+    //{
+    //    return instance.ttAdd(queueName, timeDelay, null, callback, null, false);
+    //}

     /// <summary>
     /// Appends a timed callback into a queue.
     /// </summary>
-    public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, float timeDelay, Action<ttHandler> callback)
-    {
-        return instance.ttAdd(queueName, timeDelay, null, null, callback, false);
-    }
+    //public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, float timeDelay, Action<ttHandler> callback)
+    //{
+    //    return instance.ttAdd(queueName, timeDelay, null, null, callback, false);
+    //}

     /// <summary>
     /// Appends a timed callback into a queue.
     /// </summary>
-    public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, YieldInstruction yieldToWait, Action callback)
-    {
-        return instance.ttAdd(queueName, 0, yieldToWait, callback, null, false);
-    }
+    //public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, YieldInstruction yieldToWait, Action callback)
+    //{
+    //    return instance.ttAdd(queueName, 0, yieldToWait, callback, null, false);
+    //}

     /// <summary>
     /// Appends a timed callback into a queue.
     /// </summary>
-    public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, YieldInstruction yieldToWait, Action<ttHandler> callback)
-    {
-        return instance.ttAdd(queueName, 0, yieldToWait, null, callback, false);
-    }
+    //public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, YieldInstruction yieldToWait, Action<ttHandler> callback)
+    //{
+    //    return instance.ttAdd(queueName, 0, yieldToWait, null, callback, false);
+    //}

     /// <summary>
@@ -437,10 +437,10 @@
     /// <summary>
     /// Appends a time interval into a queue.
     /// </summary>
-    public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, float interval)
-    {
-        return instance.ttAdd(queueName, interval, null, null, null, false);
-    }
+    //public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, float interval)
+    //{
+    //    return instance.ttAdd(queueName, interval, null, null, null, false);
+    //}

     /// <summary>
@@ -457,19 +457,19 @@
     /// <summary>
     /// Appends a callback into a queue.
     /// </summary>
-    public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, Action callback)
-    {
-        return instance.ttAdd(queueName, 0, null, callback, null, false);
-    }
+    //public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, Action callback)
+    //{
+    //    return instance.ttAdd(queueName, 0, null, callback, null, false);
+    //}

     /// <summary>
     /// Appends a callback into a queue.
     /// </summary>
-    public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, Action<ttHandler> callback)
-    {
-        return instance.ttAdd(queueName, 0, null, null, callback, false);
-    }
+    //public static MonoBehaviour ttAdd(this MonoBehaviour instance, string queueName, Action<ttHandler> callback)
+    //{
+    //    return instance.ttAdd(queueName, 0, null, null, callback, false);
+    //}

     /// <summary>
@@ -497,19 +497,19 @@
     /// <summary>
     /// Appends into a queue a callback that runs frame by frame for all his duration.
     /// </summary>
-    public static MonoBehaviour ttLoop(this MonoBehaviour instance, string queueName, float duration, Action<ttHandler> callback)
-    {
-        return instance.ttAdd(queueName, duration, null, null, callback, true);
-    }
+    //public static MonoBehaviour ttLoop(this MonoBehaviour instance, string queueName, float duration, Action<ttHandler> callback)
+    //{
+    //    return instance.ttAdd(queueName, duration, null, null, callback, true);
+    //}

     /// <summary>
     /// Appends into a queue a callback that runs frame by frame until ttHandler.Break().
     /// </summary>
-    public static MonoBehaviour ttLoop(this MonoBehaviour instance, string queueName, Action<ttHandler> callback)
-    {
-        return instance.ttAdd(queueName, 0, null, null, callback, true);
-    }
+    //public static MonoBehaviour ttLoop(this MonoBehaviour instance, string queueName, Action<ttHandler> callback)
+    //{
+    //    return instance.ttAdd(queueName, 0, null, null, callback, true);
+    //}

     /// <summary>
@@ -599,7 +599,7 @@
     /// <summary>
     /// Creates or changes the current queue.
     /// When used without name the queue will be anonymous and untrackable.
-    /// If 'resetQueue = true' the queue will be stopped and cleaned first, just like with 'TeaTime.Reset('.
+    /// If 'resetQueue = true' the queue will be stopped and overwritten.
     /// </summary>
     public static MonoBehaviour tt(this MonoBehaviour instance, string queueName = null, bool resetQueue = false)
     {
@@ -893,7 +893,7 @@
         {
             float delta = Time.deltaTime;

-            // Completion from 0 to 1
+            // Completion % from 0 to 1
             loopHandler.t += tRate * delta;

             // Custom delta based on duration


Updates the version number.

Updates the version number.

--- Version.cs
+++ Version.cs
@@ -24,5 +24,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.11.0.0")]
-[assembly: AssemblyFileVersion("0.11.0.0")]+[assembly: AssemblyVersion("0.12.0.0")]
+[assembly: AssemblyFileVersion("0.12.0.0")]


[android] enable arm64-v8a

[android] enable arm64-v8a

- This used to not work, but since we switched to using the prebuilt
Android NDK toolchains it seems to work now

--- binder/Compilation.cs
+++ binder/Compilation.cs
@@ -803,8 +803,7 @@
             var libName = $"lib{name}.so";
             var ndkPath = AndroidSdk.AndroidNdkPath;

-            //NOTE: "arm64-v8a" doesn't compile at the moment
-            foreach (var abi in new[] { "armeabi", "armeabi-v7a", "x86", "x86_64" })
+            foreach (var abi in new[] { "armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64" })
             {
                 string extra = string.Empty;
                 AndroidTargetArch targetArch;


Fix inc/dec of root counts in object not part of the heap

--- source/Cosmos.Core/GCImplementation.cs
+++ source/Cosmos.Core/GCImplementation.cs
@@ -4,9 +4,6 @@
 //#define COSMOSDEBUG
 using System;
 using Cosmos.Core.Memory;
-using Cosmos.Debug.Kernel;
-using IL2CPU.API;
-using IL2CPU.API.Attribs;

 namespace Cosmos.Core
 {
@@ -43,7 +40,7 @@
         /// </summary>
         public unsafe static uint AllocNewObject(uint aSize)
         {
-              return (uint)Heap.Alloc(aSize);
+            return (uint)Heap.Alloc(aSize);
         }
         /// <summary>
         /// Free Object from Memory
@@ -137,8 +134,11 @@
         /// <param name="aPtr"></param>
         public static unsafe void IncRootCount(ushort* aPtr)
         {
-            var rootCount = *(aPtr - 1) >> 1; // lowest bit is used to set if hit
-            *(aPtr - 1) = (ushort)((rootCount + 1) << 1); // loest bit can be zero since we shouldnt be doing this while gc is collecting
+            if (RAT.GetPageType(aPtr) != 0)
+            {
+                var rootCount = *(aPtr - 1) >> 1; // lowest bit is used to set if hit
+                *(aPtr - 1) = (ushort)((rootCount + 1) << 1); // loest bit can be zero since we shouldnt be doing this while gc is collecting
+            }
         }

         /// <summary>
@@ -147,8 +147,11 @@
         /// <param name="aPtr"></param>
         public static unsafe void DecRootCount(ushort* aPtr)
         {
-            var rootCount = *(aPtr - 1) >> 1; // lowest bit is used to set if hit
-            *(aPtr - 1) = (ushort)((rootCount - 1) << 1); // loest bit can be zero since we shouldnt be doing this while gc is collecting
+            if (RAT.GetPageType(aPtr) != 0)
+            {
+                var rootCount = *(aPtr - 1) >> 1; // lowest bit is used to set if hit
+                *(aPtr - 1) = (ushort)((rootCount - 1) << 1); // loest bit can be zero since we shouldnt be doing this while gc is collecting
+            }
         }

         /// <summary>


+ GetProfilePictureUrl, GetMyProfilePictureUrl Facebook Extension

--- src/FacebookSharp.Extensions/FacebookExtensions.cs
+++ src/FacebookSharp.Extensions/FacebookExtensions.cs
@@ -19,6 +19,8 @@
 // http://developers.facebook.com/docs/api. You can download the Facebook
 // JavaScript SDK at http://github.com/facebook/connect-js/.

+using System;
+
 namespace FacebookSharp.Extensions
 {
     using System.Collections.Generic;
@@ -217,5 +219,42 @@
             return facebook.Request(id, parameters, "POST");
         }

+        /// <summary>
+        /// Gets the profile picture url for the specified id.
+        /// </summary>
+        /// <param name="facebook">Id of the object to retrieve profile picture for.</param>
+        /// <param name="id"></param>
+        /// <returns>Url of the picture.</returns>
+        /// <remarks>
+        /// For security reasons, id cannot be passed as 'me'.
+        /// As this will be most probably used in website directly in the <img/> tag,
+        /// and passing the access token is quite risky out here.
+        /// incase you do want to use it, use GetMyProfilePictureUrl() instead,
+        /// this might be useful in desktop apps.
+        /// </remarks>
+        public static string GetProfilePictureUrl(this Facebook facebook, string id)
+        {
+            if (id.Equals("me", StringComparison.OrdinalIgnoreCase))
+                throw new FacebookSharpException("For security reason passing 'me' as id is not allowed.");
+            return string.Format("{0}{1}/picture", Facebook.GraphBaseUrl, id);
+        }
+
+        /// <summary>
+        /// Gets the profile picture url for the current facebook user.
+        /// </summary>
+        /// <param name="facebook"></param>
+        /// <returns>Url of the profile picture.</returns>
+        /// <remarks>
+        /// Try using GetProfilePictureUrl(id) as far as possible for security reasons.
+        /// </remarks>
+        public static string GetMyProfilePictureUrl(this Facebook facebook)
+        {
+            if (string.IsNullOrEmpty(facebook.Settings.AccessToken))
+                throw new ArgumentNullException("Settings.AccessToken",
+                                                "AccessToken must be specified inorder to invoke this method");
+            return string.Format("{0}me/picture?{1}={2}", Facebook.GraphBaseUrl, Facebook.Token,
+                                 facebook.Settings.AccessToken);
+        }
+
     }
 }


Improve documentation of LongLivedMarshalByRefObject.

--- src/Fixie/Execution/LongLivedMarshalByRefObject.cs
+++ src/Fixie/Execution/LongLivedMarshalByRefObject.cs
@@ -4,27 +4,36 @@
 namespace Fixie.Execution
 {
     /// <summary>
-    /// Normally, inheriting from MarshalByRefObject introduces an unexpected defect
-    /// in which your instances cease to exist after they get a few minutes old.
+    /// Simplifies the definition of MarshalByRefObject classes whose
+    /// instances need to live longer than the default lease lifetime
+    /// allows, such as implementations of Listener provided by test
+    /// runners.
     ///
-    /// For instance, when a runner provides a MarshalByRefObject to act as the test
-    /// Listener, that Listener may disappear after a long-running test finally finishes,
-    /// causing a runtime exception that interrupts the run. The Listener would no longer
-    /// be available to receive the test's results.
-    ///
-    /// Inheriting from this alternative to MarshalByRefObject allows the instance
-    /// to be kept alive indefinitely, but you must Dispose() of it yourself when
-    /// its natural lifetime has been reached.
+    /// Instances of LongLivedMarshalByRefObject have an infinite
+    /// lease lifetime so that they won't become defective after
+    /// several minutes.  As a consequence, instances must be disposed
+    /// to free up all resources.
     /// </summary>
     public class LongLivedMarshalByRefObject : MarshalByRefObject, IDisposable
     {
         public override sealed object InitializeLifetimeService()
         {
-            //Returning null here causes the instance to live indefinitely.
-
-            //A consequence of keeping a MarshalByRefObject alive like this is that
-            //it must be explicitly cleaned up with a call to RemotingServices.Disconnect(this).
-            //See Dispose().
+            // MarshalByRefObjects have lifetimes unlike normal objects.
+            // The default implementation of InitializeLifetimeService()
+            // causes instances to throw runtime exceptions when the
+            // instance lives for several minutes.
+            //
+            // This fact poses a problem for long-lived MarshalByRefObjects
+            // used in the cross-AppDomain communication between a Fixie
+            // runner and the running test assembly. Long-lived tests could
+            // cause a MarshalByRefObject Listener, for instance, to become
+            // defective when the running test finally finishes.
+            //
+            // This class provides a more familiar lifetime for such long-
+            // lived MarshalByRefObjects.  Instances claim an infinite
+            // lease lifetime by returning null here. To prevent memory leaks
+            // as a side effect, Dispose() in order to explicitly end the
+            // lifetime.

             return null;
         }


Generate url with startLine and endLine in correct order

--- src/GitHub.Exports/Models/SimpleRepositoryModel.cs
+++ src/GitHub.Exports/Models/SimpleRepositoryModel.cs
@@ -84,6 +84,14 @@
                     path = path.Substring(LocalPath.Length + 1);
             }

+            if (startLine > 0 && endLine > 0 && startLine > endLine)
+            {
+                // if startLine is greater than endLine and both are set, swap them
+                var temp = startLine;
+                startLine = endLine;
+                endLine = temp;
+            }
+
             return new UriString(GenerateUrl(CloneUrl.ToRepositoryUrl().AbsoluteUri, sha, path, startLine, endLine));
         }


Use invariant culture when formatting dates

--- src/GitReleaseNotes/Models/SemanticReleaseNotes.cs
+++ src/GitReleaseNotes/Models/SemanticReleaseNotes.cs
@@ -55,7 +55,7 @@
                     }
                     else if (release.When != null)
                     {
-                        builder.AppendLine(string.Format("# {0} ({1:dd MMMM yyyy})", release.ReleaseName,
+                        builder.AppendLine(string.Format(CultureInfo.InvariantCulture, "# {0} ({1:dd MMMM yyyy})", release.ReleaseName,
                             release.When.Value.Date));
                     }
                     else


Increase deploy delta keep

Increase deploy delta keep

--- osu.Desktop.Deploy/Program.cs
+++ osu.Desktop.Deploy/Program.cs
@@ -39,7 +39,7 @@
         /// <summary>
         /// How many previous build deltas we want to keep when publishing.
         /// </summary>
-        private const int keep_delta_count = 3;
+        private const int keep_delta_count = 4;

         private static string codeSigningCmd => string.IsNullOrEmpty(codeSigningPassword) ? "" : $"-n \"/a /f {codeSigningCertPath} /p {codeSigningPassword} /t http://timestamp.comodoca.com/authenticode\"";


Removed unnecessary finalizer.

Removed unnecessary finalizer.

--- contrib/Source/AutofacContrib.Multitenant/MultitenantContainer.cs
+++ contrib/Source/AutofacContrib.Multitenant/MultitenantContainer.cs
@@ -153,15 +153,6 @@
             }
             this.TenantIdentificationStrategy = tenantIdentificationStrategy;
             this.ApplicationContainer = applicationContainer;
-        }
-
-        /// <summary>
-        /// Releases unmanaged resources and performs other cleanup operations before the
-        /// <see cref="AutofacContrib.Multitenant.MultitenantContainer"/> is reclaimed by garbage collection.
-        /// </summary>
-        ~MultitenantContainer()
-        {
-            this.Dispose(false);
         }

         /// <summary>


Fixed a typo

Fixed a typo

--- pcolor.cs
+++ pcolor.cs
@@ -563,7 +563,7 @@
 							coloredStrings.Add(new ColoredString(lastFore, lastBack, m.Value));
 						}
 					} else {
-						if (!GetConsoleColor(color, out lastFore)) {
+						if (!GetConsoleColor(color, out lastBack)) {
 							// Not a valid structure, so output it as plain-text..
 							coloredStrings.Add(new ColoredString(lastFore, lastBack, m.Value));
 						}


Unit Tests fix

Unit Tests fix

--- sly/parser/parser/llparser/EBNFRecursiveDescentSyntaxParser.cs
+++ sly/parser/parser/llparser/EBNFRecursiveDescentSyntaxParser.cs
@@ -77,7 +77,7 @@

         private void InitStartingTokensWithZeroOrMore(Rule<IN> rule, ZeroOrMoreClause<IN> manyClause,
             Dictionary<string, NonTerminal<IN>> nonTerminals)
-        {
+        {
             if (manyClause.Clause is TerminalClause<IN>)
             {
                 TerminalClause<IN> term = manyClause.Clause as TerminalClause<IN>;
@@ -137,7 +137,7 @@
             {
                 if (rule.Clauses != null && rule.Clauses.Count > 0)
                 {
-                    children = new List<ISyntaxNode<IN>>();
+                    children = new List<ISyntaxNode<IN>>();
                     foreach (IClause<IN> clause in rule.Clauses)
                     {
                         if (clause is TerminalClause<IN> termClause)
@@ -202,7 +202,7 @@
                         }
                         else if (clause is OptionClause<IN> option)
                         {
-                            var optionResult = ParseOption(tokens, option, rule,currentPosition);
+                            var optionResult = ParseOption(tokens, option,rule, currentPosition);
                             currentPosition = optionResult.EndingPosition;
                             children.Add(optionResult.Root);
                         }
@@ -221,12 +221,7 @@
             if (!isError)
             {
                 SyntaxNode<IN> node = new SyntaxNode<IN>(nonTerminalName + "__" + rule.Key, children);
-                if (node.Name == "WhileParser_expressions__expr_10_PLUS_MINUS_OR_CONCAT_")
-                {
-                    ;
-                }
                 node = ManageExpressionRules(rule, node);
-                node.Visitor = rule.GetVisitor();
                 result.Root = node;
                 result.IsEnded = currentPosition >= tokens.Count - 1
                                  || currentPosition == tokens.Count - 2 &&
@@ -238,7 +233,7 @@

         public SyntaxParseResult<IN> ParseZeroOrMore(IList<Token<IN>> tokens, ZeroOrMoreClause<IN> clause, int position)
-        {
+        {
             SyntaxParseResult<IN> result = new SyntaxParseResult<IN>();
             ManySyntaxNode<IN> manyNode = new ManySyntaxNode<IN>("");
             int currentPosition = position;
@@ -282,7 +277,7 @@

             result.EndingPosition = currentPosition;
             result.IsError = false;
-            result.Errors= innerErrors;
+            result.Errors = innerErrors;
             result.Root = manyNode;
             result.IsEnded = lastInnerResult != null && lastInnerResult.IsEnded;
             return result;
@@ -349,7 +344,7 @@

             SyntaxParseResult<IN> innerResult = null;

-
+

             if (innerClause is TerminalClause<IN>)
             {
@@ -383,7 +378,7 @@
                     {
                         children.Clear();
                     }
-                    result.Root = new OptionSyntaxNode<IN>(rule.NonTerminalName + "__" + rule.Key,children,rule.GetVisitor());
+                    result.Root = new OptionSyntaxNode<IN>(rule.NonTerminalName + "__" + rule.Key, children, rule.GetVisitor());
                     result.EndingPosition = position;
                 }
             }
@@ -392,7 +387,7 @@
                 List<ISyntaxNode<IN>> children = new List<ISyntaxNode<IN>>() { innerResult.Root };
                 result.Root = new OptionSyntaxNode<IN>(rule.NonTerminalName + "__" + rule.Key, children, rule.GetVisitor());
                 result.EndingPosition = innerResult.EndingPosition;
-
+
             }

             return result;


Removed contract usage

Removed contract usage

Former-commit-id: e229dbca46566649902152771ce4dfc7c5e0b2e1

--- src/MassTransit/NewId/NewIdParsers/Base32Parser.cs
+++ src/MassTransit/NewId/NewIdParsers/Base32Parser.cs
@@ -13,7 +13,6 @@
 namespace MassTransit.NewIdParsers
 {
     using System;
-    using System.Diagnostics.Contracts;

     public class Base32Parser :
@@ -40,7 +39,8 @@

         public NewId Parse(string text)
         {
-            Contract.Requires(text.Length == 26);
+            if (string.IsNullOrEmpty(text))
+                throw new ArgumentException("The string was null or empty", "text");

             var buffer = new char[32];


git-svn-id: 5f83b1c70de5d206063ccb651337b8c9002d45c3@242 0d1dca7f-3429-0410-b39c-edaab0c29397

--- src/Microsoft.Xna.Framework/GamerServices/Enums.cs
+++ src/Microsoft.Xna.Framework/GamerServices/Enums.cs
@@ -9,4 +9,118 @@
         Medium = 1,
         High = 2,
     }
+
+    public enum GameDifficulty
+    {
+        Easy,
+        Normal,
+        Hard
+    }
+
+    public enum GamerPresenceMode
+    {
+        None,
+        SinglePlayer,
+        Multiplayer,
+        LocalCoOp,
+        LocalVersus,
+        OnlineCoOp,
+        OnlineVersus,
+        VersusComputer,
+        Stage,
+        Level,
+        CoOpStage,
+        CoOpLevel,
+        ArcadeMode,
+        CampaignMode,
+        ChallengeMode,
+        ExplorationMode,
+        PracticeMode,
+        PuzzleMode,
+        ScenarioMode,
+        StoryMode,
+        SurvivalMode,
+        TutorialMode,
+        DifficultyEasy,
+        DifficultyMedium,
+        DifficultyHard,
+        DifficultyExtreme,
+        Score,
+        VersusScore,
+        Winning,
+        Losing,
+        ScoreIsTied,
+        Outnumbered,
+        OnARoll,
+        InCombat,
+        BattlingBoss,
+        TimeAttack,
+        TryingForRecord,
+        FreePlay,
+        WastingTime,
+        StuckOnAHardBit,
+        NearlyFinished,
+        LookingForGames,
+        WaitingForPlayers,
+        WaitingInLobby,
+        SettingUpMatch,
+        PlayingWithFriends,
+        AtMenu,
+        StartingGame,
+        Paused,
+        GameOver,
+        WonTheGame,
+        ConfiguringSettings,
+        CustomizingPlayer,
+        EditingLevel,
+        InGameStore,
+        WatchingCutscene,
+        WatchingCredits,
+        PlayingMinigame,
+        FoundSecret,
+        CornflowerBlue
+    }
+
+    public enum GamerPrivilegeSetting
+    {
+        Blocked,
+        FriendsOnly,
+        Everyone
+    }
+    public enum GamerZone
+    {
+        Unknown,
+        Recreation,
+        Pro,
+        Family,
+        Underground
+    }
+
+    public enum RacingCameraAngle
+    {
+        Back,
+        Front,
+        Inside
+    }
+    public enum MessageBoxIcon
+    {
+        None,
+        Error,
+        Warning,
+        Alert
+    }
+
+    public enum NotificationPosition
+    {
+        TopLeft,
+        TopCenter,
+        TopRight,
+        CenterLeft,
+        Center,
+        CenterRight,
+        BottomLeft,
+        BottomCenter,
+        BottomRight
+    }
+
 }


Dispatch concurrently

Dispatch concurrently

--- src/NServiceBus.Kafka/Sending/MessageDispatcher.cs
+++ src/NServiceBus.Kafka/Sending/MessageDispatcher.cs
@@ -2,7 +2,6 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
 using System.Threading.Tasks;
 using NServiceBus.Extensibility;
 using NServiceBus.Transports.Kafka.Connection;
@@ -26,48 +25,45 @@
             this.producerFactory = producerFactory;
         }

-        public async Task Dispatch(TransportOperations outgoingMessages, TransportTransaction transaction, ContextBag context)
+        public Task Dispatch(TransportOperations outgoingMessages, TransportTransaction transaction,
+            ContextBag context)
         {
-
+            var unicastTransportOperations = outgoingMessages.UnicastTransportOperations;
+            var multicastTransportOperations = outgoingMessages.MulticastTransportOperations;

-            try
+            var tasks = new List<Task>(unicastTransportOperations.Count + multicastTransportOperations.Count);
+
+            // ReSharper disable once LoopCanBeConvertedToQuery
+            foreach (var operation in unicastTransportOperations)
             {
-                var unicastTransportOperations = outgoingMessages.UnicastTransportOperations;
-                var multicastTransportOperations = outgoingMessages.MulticastTransportOperations;
+                tasks.Add(SendMessage(operation));
+            }

-                var tasks = new List<Task>(unicastTransportOperations.Count + multicastTransportOperations.Count);
+            // ReSharper disable once LoopCanBeConvertedToQuery
+            foreach (var operation in multicastTransportOperations)
+            {
+                tasks.Add(PublishMessage(operation));
+            }

-                foreach (var operation in unicastTransportOperations)
-                {
-                    tasks.Add(SendMessage(operation));
-                }
-
-                foreach (var operation in multicastTransportOperations)
-                {
-                    tasks.Add(PublishMessage(operation));
-                }
-
-                await Task.WhenAll(tasks).ConfigureAwait(false);
-            }
-            finally
-            {
-
-            }
+            return Task.WhenAll(tasks);
         }

-        async Task SendMessage(UnicastTransportOperation transportOperation)
+        Task SendMessage(UnicastTransportOperation transportOperation)
         {
-            Logger.Debug("Send to "+ transportOperation.Destination);
+            Logger.Debug("Send to " + transportOperation.Destination);

             var toBeReceived = transportOperation.GetTimeToBeReceived();
-            var timeToBeReceived = toBeReceived.HasValue && toBeReceived.Value < TimeSpan.MaxValue ? toBeReceived : null;
+            var timeToBeReceived = toBeReceived.HasValue && toBeReceived.Value < TimeSpan.MaxValue
+                ? toBeReceived
+                : null;

             if (timeToBeReceived != null && timeToBeReceived.Value == TimeSpan.Zero)
             {
                 var messageType = transportOperation.Message.Headers[Headers.EnclosedMessageTypes].Split(',').First();
-                Logger.WarnFormat("TimeToBeReceived is set to zero for message of type '{0}'. Cannot send operation.", messageType);
-                return;
-            }
+                Logger.WarnFormat("TimeToBeReceived is set to zero for message of type '{0}'. Cannot send operation.",
+                    messageType);
+                return Task.FromResult(0);
+            }

             // TimeToBeReceived was not specified on message - go for maximum set by SDK
             if (timeToBeReceived == TimeSpan.MaxValue)
@@ -75,44 +71,48 @@
                 timeToBeReceived = null;
             }

-
             var messageWrapper = BuildMessageWrapper(transportOperation, toBeReceived, transportOperation.Destination);

             var topic = producerFactory.GetProducer().Topic(transportOperation.Destination);

             var messageStream = new MemoryStream();
-            KafkaTransportInfrastructure.GetSerializer().Serialize(messageWrapper, messageStream);
-
-            await topic.Produce(messageStream.ToArray()).ConfigureAwait(false);
-
+            KafkaTransportInfrastructure.GetSerializer().Serialize(messageWrapper, messageStream);
+
+            return topic.Produce(messageStream.ToArray());
         }

-        async Task PublishMessage(MulticastTransportOperation transportOperation)
+        Task PublishMessage(MulticastTransportOperation transportOperation)
         {
-
-            var messageWrapper = BuildMessageWrapper(transportOperation, TimeSpan.MaxValue, transportOperation.MessageType.ToString());
+            var messageWrapper = BuildMessageWrapper(transportOperation, TimeSpan.MaxValue,
+                transportOperation.MessageType.ToString());

             var topicsToSendTo = SubscriptionManager.GetTypeHierarchy(transportOperation.MessageType);

             var messageStream = new MemoryStream();
             KafkaTransportInfrastructure.GetSerializer().Serialize(messageWrapper, messageStream);

+            var publishTasks = new List<Task>(topicsToSendTo.Count);
+
             foreach (var t in topicsToSendTo)
             {
                 Logger.Debug("Publish to " + t);
-                var topic = producerFactory.GetProducer().Topic(t);
+                var topic = producerFactory.GetProducer().Topic(t);

-                await topic.Produce(messageStream.ToArray()).ContinueWith(result => Logger.Info("new partition and offset: "+result.Result.Partition+" "+result.Result.Offset));
+                publishTasks.Add(topic.Produce(messageStream.ToArray())
+                    .ContinueWith(
+                        result => Logger.Info("new partition and offset: " + result.Result.Partition + " " +
+                                              result.Result.Offset), TaskContinuationOptions.ExecuteSynchronously));
             }

-
+            return Task.WhenAll(publishTasks);
         }

-        MessageWrapper BuildMessageWrapper(IOutgoingTransportOperation operation, TimeSpan? timeToBeReceived, string destinationQueue)
+        static MessageWrapper BuildMessageWrapper(IOutgoingTransportOperation operation, TimeSpan? timeToBeReceived,
+            string destinationQueue)
         {
             var msg = operation.Message;
             var headers = new Dictionary<string, string>(msg.Headers);
-
+
             var messageIntent = default(MessageIntentEnum);
             string messageIntentString;
             if (headers.TryGetValue(Headers.MessageIntent, out messageIntentString))
@@ -136,7 +136,8 @@

     static class DictionaryExtensions
     {
-        public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue defaultValue = default(TValue))
+        public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key,
+            TValue defaultValue = default(TValue))
         {
             TValue value;
             return dictionary.TryGetValue(key, out value) ? value : defaultValue;
@@ -156,4 +157,4 @@
             return operation.DeliveryConstraints.OfType<T>().FirstOrDefault();
         }
     }
-}
+}


JimEvans: Fixing .NET TypingTest.cs so that arguments to Assert.AreEqual have the correct order (expected, *then* actual, not the other way around).

r18418

--- dotnet/test/WebDriver.Common.Tests/TypingTest.cs
+++ dotnet/test/WebDriver.Common.Tests/TypingTest.cs
@@ -18,7 +18,8 @@
             keyReporter.SendKeys("a");

             IWebElement result = driver.FindElement(By.Id("result"));
-            Assert.IsTrue(result.Text.Contains("press:"));
+            string text = result.Text;
+            Assert.IsTrue(text.Contains("press:"), "Text should contain 'press:'. Actual text: {0}", text);
         }

         [Test]
@@ -31,7 +32,8 @@
             keyReporter.SendKeys("I");

             IWebElement result = driver.FindElement(By.Id("result"));
-            Assert.IsTrue(result.Text.Contains("down:"));
+            string text = result.Text;
+            Assert.IsTrue(text.Contains("down:"), "Text should contain 'down:'. Actual text: {0}", text);
         }

         [Test]
@@ -44,7 +46,8 @@
             keyReporter.SendKeys("a");

             IWebElement result = driver.FindElement(By.Id("result"));
-            Assert.IsTrue(result.Text.Contains("up:"));
+            string text = result.Text;
+            Assert.IsTrue(text.Contains("up:"), "Text should contain 'up:'. Actual text: {0}", text);
         }

         [Test]
@@ -55,7 +58,7 @@
             IWebElement keyReporter = driver.FindElement(By.Id("keyReporter"));
             keyReporter.SendKeys("abc def");

-            Assert.AreEqual(keyReporter.GetAttribute("value"), "abc def");
+            Assert.AreEqual("abc def", keyReporter.GetAttribute("value"));
         }

         [Test]
@@ -66,7 +69,7 @@
             IWebElement keyReporter = driver.FindElement(By.Id("keyReporter"));
             keyReporter.SendKeys("ABC DEF");

-            Assert.AreEqual(keyReporter.GetAttribute("value"), "ABC DEF");
+            Assert.AreEqual("ABC DEF", keyReporter.GetAttribute("value"));
         }

         [Test]
@@ -77,7 +80,7 @@
             IWebElement keyReporter = driver.FindElement(By.Id("keyReporter"));
             keyReporter.SendKeys("\"");

-            Assert.AreEqual(keyReporter.GetAttribute("value"), "\"");
+            Assert.AreEqual("\"", keyReporter.GetAttribute("value"));
         }

         [Test]
@@ -94,7 +97,7 @@
             IWebElement keyReporter = driver.FindElement(By.Id("keyReporter"));
             keyReporter.SendKeys("@");

-            Assert.AreEqual(keyReporter.GetAttribute("value"), "@");
+            Assert.AreEqual("@", keyReporter.GetAttribute("value"));
         }

         [Test]
@@ -105,7 +108,7 @@
             IWebElement keyReporter = driver.FindElement(By.Id("keyReporter"));
             keyReporter.SendKeys("me@eXample.com");

-            Assert.AreEqual(keyReporter.GetAttribute("value"), "me@eXample.com");
+            Assert.AreEqual("me@eXample.com", keyReporter.GetAttribute("value"));
         }

         [Test]
@@ -117,7 +120,7 @@
             IWebElement keyReporter = driver.FindElement(By.Id("keyReporter"));
             keyReporter.SendKeys(Keys.ArrowLeft);

-            Assert.AreEqual(keyReporter.GetAttribute("value"), "");
+            Assert.AreEqual(string.Empty, keyReporter.GetAttribute("value"));
         }

         [Test]
@@ -129,7 +132,7 @@
             IWebElement keyReporter = driver.FindElement(By.Id("keyReporter"));
             keyReporter.SendKeys("Tet" + Keys.ArrowLeft + "s");

-            Assert.AreEqual(keyReporter.GetAttribute("value"), "Test");
+            Assert.AreEqual("Test", keyReporter.GetAttribute("value"));
         }

         [Test]
@@ -142,7 +145,7 @@
             element.SendKeys("I like cheese");

             IWebElement result = driver.FindElement(By.Id("result"));
-            Assert.AreEqual(result.Text, "I like cheese");
+            Assert.AreEqual("I like cheese", result.Text);
         }

         [Test]
@@ -157,7 +160,7 @@
             IWebElement result = driver.FindElement(By.Id("result"));
             // Because the key down gets the result before the input element is
             // filled, we're a letter short here
-            Assert.AreEqual(result.Text, "I like chees");
+            Assert.AreEqual("I like chees", result.Text);
         }

         [Test]
@@ -172,7 +175,7 @@
             IWebElement result = driver.FindElement(By.Id("result"));
             // Because the key down gets the result before the input element is
             // filled, we're a letter short here
-            Assert.AreEqual(result.Text, "I like chees");
+            Assert.AreEqual("I like chees", result.Text);
         }

         [Test]
@@ -185,7 +188,7 @@
             element.SendKeys("I like cheese");

             IWebElement result = driver.FindElement(By.Id("result"));
-            Assert.AreEqual(result.Text, "I like cheese");
+            Assert.AreEqual("I like cheese", result.Text);
         }

         [Test]
@@ -200,7 +203,7 @@
             IWebElement result = driver.FindElement(By.Id("result"));
             // Because the key down gets the result before the input element is
             // filled, we're a letter short here
-            Assert.AreEqual(result.Text, "I like chees");
+            Assert.AreEqual("I like chees", result.Text);
         }

         [Test]
@@ -215,7 +218,7 @@
             IWebElement result = driver.FindElement(By.Id("result"));
             // Because the key down gets the result before the input element is
             // filled, we're a letter short here
-            Assert.AreEqual(result.Text, "I like chees");
+            Assert.AreEqual("I like chees", result.Text);
         }

         [Test]
@@ -229,7 +232,7 @@
             IWebElement element = driver.FindElement(By.Id("theworks"));

             element.SendKeys("a");
-            Assert.AreEqual(result.Text.Trim(), "focus keydown keypress keyup");
+            Assert.AreEqual("focus keydown keypress keyup", result.Text.Trim());
         }

         [Test]
@@ -246,19 +249,19 @@
             IWebElement element = driver.FindElement(By.Id("keyReporter"));

             element.SendKeys(Keys.ArrowDown);
-            Assert.AreEqual(result.Text.Trim(), "down: 40 press: 40 up: 40");
+            Assert.AreEqual("down: 40 press: 40 up: 40", result.Text.Trim());

             element.SendKeys(Keys.ArrowUp);
-            Assert.AreEqual(result.Text.Trim(), "down: 38 press: 38 up: 38");
+            Assert.AreEqual("down: 38 press: 38 up: 38", result.Text.Trim());

             element.SendKeys(Keys.ArrowLeft);
-            Assert.AreEqual(result.Text.Trim(), "down: 37 press: 37 up: 37");
+            Assert.AreEqual("down: 37 press: 37 up: 37", result.Text.Trim());

             element.SendKeys(Keys.ArrowRight);
-            Assert.AreEqual(result.Text.Trim(), "down: 39 press: 39 up: 39");
+            Assert.AreEqual("down: 39 press: 39 up: 39", result.Text.Trim());

             // And leave no rubbish/printable keys in the "keyReporter"
-            Assert.AreEqual(element.GetAttribute("value"), "");
+            Assert.AreEqual(string.Empty, element.GetAttribute("value"));
         }

         [Test]
@@ -273,23 +276,27 @@
             IWebElement element = driver.FindElement(By.Id("keyReporter"));

             element.SendKeys(Keys.ArrowDown);
-            Assert.IsTrue(result.Text.Trim().Contains("down: 40"));
-            Assert.IsTrue(result.Text.Trim().Contains("up: 40"));
+            string text = result.Text.Trim();
+            Assert.IsTrue(text.Contains("down: 40"), "Text should contain 'down: 40'. Actual text: {}", text);
+            Assert.IsTrue(text.Contains("up: 40"), "Text should contain 'up: 40'. Actual text: {}", text);

             element.SendKeys(Keys.ArrowUp);
-            Assert.IsTrue(result.Text.Trim().Contains("down: 38"));
-            Assert.IsTrue(result.Text.Trim().Contains("up: 38"));
+            text = result.Text.Trim();
+            Assert.IsTrue(text.Trim().Contains("down: 38"), "Text should contain 'down: 38'. Actual text: {}", text);
+            Assert.IsTrue(text.Trim().Contains("up: 38"), "Text should contain 'up: 38'. Actual text: {}", text);

             element.SendKeys(Keys.ArrowLeft);
-            Assert.IsTrue(result.Text.Trim().Contains("down: 37"));
-            Assert.IsTrue(result.Text.Trim().Contains("up: 37"));
+            text = result.Text.Trim();
+            Assert.IsTrue(text.Trim().Contains("down: 37"), "Text should contain 'down: 37'. Actual text: {}", text);
+            Assert.IsTrue(text.Trim().Contains("up: 37"), "Text should contain 'up: 37'. Actual text: {}", text);

             element.SendKeys(Keys.ArrowRight);
-            Assert.IsTrue(result.Text.Trim().Contains("down: 39"));
-            Assert.IsTrue(result.Text.Trim().Contains("up: 39"));
+            text = result.Text.Trim();
+            Assert.IsTrue(text.Trim().Contains("down: 39"), "Text should contain 'down: 39'. Actual text: {}", text);
+            Assert.IsTrue(text.Trim().Contains("up: 39"), "Text should contain 'up: 39'. Actual text: {}", text);

             // And leave no rubbish/printable keys in the "keyReporter"
-            Assert.AreEqual(element.GetAttribute("value"), string.Empty);
+            Assert.AreEqual(string.Empty, element.GetAttribute("value"));
         }

         [Test]
@@ -300,10 +307,10 @@

             IWebElement element = driver.FindElement(By.Id("keyReporter"));

-            String numericLineCharsNonShifted = "`1234567890-=[]\\;,.'/42";
+            string numericLineCharsNonShifted = "`1234567890-=[]\\;,.'/42";
             element.SendKeys(numericLineCharsNonShifted);

-            Assert.AreEqual(element.GetAttribute("value"), numericLineCharsNonShifted);
+            Assert.AreEqual(numericLineCharsNonShifted, element.GetAttribute("value"));
         }

         [Test]
@@ -316,11 +323,12 @@
             IWebElement result = driver.FindElement(By.Id("result"));
             IWebElement element = driver.FindElement(By.Id("keyReporter"));

-            String numericShiftsEtc = "~!@#$%^&*()_+{}:\"<>?|END~";
+            string numericShiftsEtc = "~!@#$%^&*()_+{}:\"<>?|END~";
             element.SendKeys(numericShiftsEtc);

-            Assert.AreEqual(element.GetAttribute("value"), numericShiftsEtc);
-            Assert.IsTrue(result.Text.Trim().Contains(" up: 16"));
+            Assert.AreEqual(numericShiftsEtc, element.GetAttribute("value"));
+            string text = result.Text.Trim();
+            Assert.IsTrue(text.Contains(" up: 16"), "Text should contain ' up: 16'. Actual text: {0}", text);
         }

         [Test]
@@ -334,7 +342,7 @@
             String lowerAlphas = "abcdefghijklmnopqrstuvwxyz";
             element.SendKeys(lowerAlphas);

-            Assert.AreEqual(element.GetAttribute("value"), lowerAlphas);
+            Assert.AreEqual(lowerAlphas, element.GetAttribute("value"));
         }

         [Test]
@@ -350,8 +358,9 @@
             String upperAlphas = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
             element.SendKeys(upperAlphas);

-            Assert.AreEqual(element.GetAttribute("value"), upperAlphas);
-            Assert.IsTrue(result.Text.Trim().Contains(" up: 16"));
+            Assert.AreEqual(upperAlphas, element.GetAttribute("value"));
+            string text = result.Text.Trim();
+            Assert.IsTrue(text.Contains(" up: 16"), "Text should contain ' up: 16'. Actual text: {0}", text);
         }

         [Test]
@@ -369,8 +378,9 @@
                 "PQRSTUVWXYZ [\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
             element.SendKeys(allPrintable);

-            Assert.AreEqual(element.GetAttribute("value"), allPrintable);
-            Assert.IsTrue(result.Text.Trim().Contains(" up: 16"));
+            Assert.AreEqual(allPrintable, element.GetAttribute("value"));
+            string text = result.Text.Trim();
+            Assert.IsTrue(text.Contains(" up: 16"), "Text should contain ' up: 16'. Actual text: {0}", text);
         }

         [Test]
@@ -383,7 +393,7 @@

             element.SendKeys("a" + Keys.Left + "b" + Keys.Right +
                              Keys.Up + Keys.Down + Keys.PageUp + Keys.PageDown + "1");
-            Assert.AreEqual(element.GetAttribute("value"), "ba1");
+            Assert.AreEqual("ba1", element.GetAttribute("value"));
         }

         [Test]
@@ -404,7 +414,7 @@
             element.SendKeys("abc" + Keys.Home + "0" + Keys.Left + Keys.Right +
                              Keys.PageUp + Keys.PageDown + Keys.End + "1" + Keys.Home +
                              "0" + Keys.PageUp + Keys.End + "111" + Keys.Home + "00");
-            Assert.AreEqual(element.GetAttribute("value"), "0000abc1111");
+            Assert.AreEqual("0000abc1111", element.GetAttribute("value"));
         }

         [Test]
@@ -417,13 +427,13 @@
             IWebElement element = driver.FindElement(By.Id("keyReporter"));

             element.SendKeys("abcdefghi");
-            Assert.AreEqual(element.GetAttribute("value"), "abcdefghi");
+            Assert.AreEqual("abcdefghi", element.GetAttribute("value"));

             element.SendKeys(Keys.Left + Keys.Left + Keys.Delete);
-            Assert.AreEqual(element.GetAttribute("value"), "abcdefgi");
+            Assert.AreEqual("abcdefgi", element.GetAttribute("value"));

             element.SendKeys(Keys.Left + Keys.Left + Keys.Backspace);
-            Assert.AreEqual(element.GetAttribute("value"), "abcdfgi");
+            Assert.AreEqual("abcdfgi", element.GetAttribute("value"));
         }

         [Test]
@@ -436,7 +446,7 @@
             IWebElement element = driver.FindElement(By.Id("keyReporter"));

             element.SendKeys("abcd" + Keys.Space + "fgh" + Keys.Space + "ij");
-            Assert.AreEqual(element.GetAttribute("value"), "abcd fgh ij");
+            Assert.AreEqual("abcd fgh ij", element.GetAttribute("value"));
         }

         [Test]
@@ -452,7 +462,7 @@
                              Keys.Decimal + Keys.Separator + Keys.NumberPad0 + Keys.NumberPad9 +
                              Keys.Add + Keys.Semicolon + Keys.Equal + Keys.Divide +
                              Keys.NumberPad3 + "abcd");
-            Assert.AreEqual(element.GetAttribute("value"), "abcd*-+.,09+;=/3abcd");
+            Assert.AreEqual("abcd*-+.,09+;=/3abcd", element.GetAttribute("value"));
         }

         [Test]
@@ -466,7 +476,7 @@

             element.SendKeys("FUNCTION" + Keys.F4 + "-KEYS" + Keys.F4);
             element.SendKeys("" + Keys.F4 + "-TOO" + Keys.F4);
-            Assert.AreEqual(element.GetAttribute("value"), "FUNCTION-KEYS-TOO");
+            Assert.AreEqual("FUNCTION-KEYS-TOO", element.GetAttribute("value"));
         }

         [Test]
@@ -484,7 +494,7 @@
             //Could be chord problem
             element.SendKeys(Keys.Shift + Keys.Left + Keys.Left + Keys.Left);
             element.SendKeys(Keys.Delete);
-            Assert.AreEqual(element.GetAttribute("value"), "abcd e");
+            Assert.AreEqual("abcd e", element.GetAttribute("value"));
         }

         [Test]
@@ -508,8 +518,9 @@
             element.SendKeys(Keys.Home);
             element.SendKeys("" + Keys.Shift + Keys.End + Keys.Delete);

-            Assert.AreEqual(element.GetAttribute("value"), string.Empty);
-            Assert.IsTrue(result.Text.Contains(" up: 16"));
+            Assert.AreEqual(string.Empty, element.GetAttribute("value"));
+            string text = result.Text.Trim();
+            Assert.IsTrue(text.Contains(" up: 16"), "Text should contain ' up: 16'. Actual text: {0}", text);
         }

         [Test]
@@ -528,22 +539,23 @@
             IWebElement element = driver.FindElement(By.Id("keyReporter"));

             element.SendKeys("done" + Keys.Home);
-            Assert.AreEqual(element.GetAttribute("value"), "done");
+            Assert.AreEqual("done", element.GetAttribute("value"));

             //Sending chords
             element.SendKeys("" + Keys.Shift + "ALL " + Keys.Home);
-            Assert.AreEqual(element.GetAttribute("value"), "ALL done");
+            Assert.AreEqual("ALL done", element.GetAttribute("value"));

             element.SendKeys(Keys.Delete);
-            Assert.AreEqual(element.GetAttribute("value"), "done");
+            Assert.AreEqual("done", element.GetAttribute("value"), "done");

             element.SendKeys("" + Keys.End + Keys.Shift + Keys.Home);
-            Assert.AreEqual(element.GetAttribute("value"), "done");
+            Assert.AreEqual("done", element.GetAttribute("value"));
             // Note: trailing SHIFT up here
-            Assert.IsTrue(result.Text.Trim().Contains(" up: 16"));
+            string text = result.Text.Trim();
+            Assert.IsTrue(text.Contains(" up: 16"), "Text should contain ' up: 16'. Actual text: {0}", text);

             element.SendKeys("" + Keys.Delete);
-            Assert.AreEqual(element.GetAttribute("value"), string.Empty);
+            Assert.AreEqual(string.Empty, element.GetAttribute("value"));
         }

         // control-x control-v here for cut & paste tests, these work on windows
@@ -567,28 +579,29 @@

             String paste = "!\"#$%&'()*+,-./0123456789:;<=>?@ ABCDEFG";
             element.SendKeys(paste);
-            Assert.AreEqual(element.GetAttribute("value"), paste);
+            Assert.AreEqual(paste, element.GetAttribute("value"));

             //Chords
             element.SendKeys("" + Keys.Home + Keys.Shift + Keys.End);
-            Assert.IsTrue(result.Text.Trim().Contains(" up: 16"));
+            string text = result.Text.Trim();
+            Assert.IsTrue(text.Contains(" up: 16"), "Text should contain ' up: 16'. Actual text: {0}", text);

             element.SendKeys(Keys.Control + "x");
-            Assert.AreEqual(element.GetAttribute("value"), string.Empty);
+            Assert.AreEqual(string.Empty, element.GetAttribute("value"));

             element.SendKeys(Keys.Control + "v");
-            Assert.AreEqual(element.GetAttribute("value"), paste);
+            Assert.AreEqual(paste, element.GetAttribute("value"));

             element.SendKeys("" + Keys.Left + Keys.Left + Keys.Left +
                              Keys.Shift + Keys.End);
             element.SendKeys(Keys.Control + "x" + "v");
-            Assert.AreEqual(element.GetAttribute("value"), paste);
+            Assert.AreEqual(paste, element.GetAttribute("value"));

             element.SendKeys(Keys.Home);
             element.SendKeys(Keys.Control + "v");
             element.SendKeys(Keys.Control + "v" + "v");
             element.SendKeys(Keys.Control + "v" + "v" + "v");
-            Assert.AreEqual(element.GetAttribute("value"), "EFGEFGEFGEFGEFGEFG" + paste);
+            Assert.AreEqual("EFGEFGEFGEFGEFGEFG" + paste, element.GetAttribute("value"));

             element.SendKeys("" + Keys.End + Keys.Shift + Keys.Home +
                              Keys.Null + Keys.Delete);
@@ -604,7 +617,7 @@
             IWebElement element = driver.FindElement(By.Id("no-type"));

             element.SendKeys("Should Say Cheese");
-            Assert.AreEqual(element.GetAttribute("value"), "Should Say Cheese");
+            Assert.AreEqual("Should Say Cheese", element.GetAttribute("value"));
         }

         [Test]
@@ -616,7 +629,7 @@
             IWebElement silent = driver.FindElement(By.Name("suppress"));

             silent.SendKeys("s");
-            Assert.AreEqual(silent.GetAttribute("value"), string.Empty);
+            Assert.AreEqual(string.Empty, silent.GetAttribute("value"));
         }

         [Test]
@@ -632,7 +645,8 @@
             IWebElement result = driver.FindElement(By.Id("result"));

             silent.SendKeys("s");
-            Assert.IsTrue(result.Text.Contains("press"));
+            string text = result.Text;
+            Assert.IsTrue(text.Contains("press"), "Text should contain 'press'. Actual text: {0}", text);
         }

         [Test]
@@ -652,8 +666,8 @@
             IWebElement trusted = driver.FindElement(By.Id("istrusted"));
             IWebElement id = driver.FindElement(By.Id("tagId"));

-            Assert.AreEqual("[true]", trusted.Text);
-            Assert.AreEqual("[frameHtml]", id.Text);
+            Assert.AreEqual(trusted.Text, "[true]");
+            Assert.AreEqual(id.Text, "[frameHtml]");
         }

         [Test]
@@ -677,7 +691,7 @@
             element.SendKeys("Dishy" + Keys.Backspace + Keys.Left + Keys.Left);
             element.SendKeys(Keys.Left + Keys.Left + "F" + Keys.Delete + Keys.End + "ee!");

-            Assert.AreEqual("Fishee!", element.Text);
+            Assert.AreEqual(element.Text, "Fishee!");
         }
     }
 }


Improve GitVersionAttribute to issue a warning on UNIX systems.

--- source/Nuke.Common/Tools/GitVersion/GitVersionAttribute.cs
+++ source/Nuke.Common/Tools/GitVersion/GitVersionAttribute.cs
@@ -23,10 +23,17 @@
         [CanBeNull]
         public override object GetStaticValue ()
         {
+            // TODO: https://github.com/GitTools/GitVersion/issues/1097
+            if (EnvironmentInfo.IsUnix)
+            {
+                Logger.Warn($"{nameof(GitVersion)} does not work in UNIX environments.");
+                return null;
+            }
+
             return Value = Value ??
-                           (EnvironmentInfo.IsWin && GitVersionTasks.DefaultGitVersion.HasValidToolPath()
-                               ? GitVersionTasks.GitVersion(s => GitVersionTasks.DefaultGitVersion, new ProcessSettings().EnableRedirectOutput())
-                               : null);
+                           GitVersionTasks.GitVersion(
+                               s => GitVersionTasks.DefaultGitVersion,
+                               new ProcessSettings().EnableRedirectOutput());
         }
     }
 }


Fixed a little bug which caused verifications to not be saved.

--- src/NadekoBot/Modules/Verification/Verification.cs
+++ src/NadekoBot/Modules/Verification/Verification.cs
@@ -107,6 +107,7 @@
                 var roleid = _service.GetVerifiedRoleId(Context.Guild.Id);
                 var role = roleid != null ? Context.Guild.GetRole(roleid.Value) : null;
                 if (role != null && Context.User is IGuildUser guildUser) await guildUser.AddRoleAsync(role);
+                await uow.CompleteAsync();
             }
             _service.ValidationKeys.TryRemove(key);
             var ch = await Context.User.GetOrCreateDMChannelAsync();


Fix a pretty dumb mistake w/repair time calculation

--- source/Grabacr07.KanColleWrapper/Models/Ship.cs
+++ source/Grabacr07.KanColleWrapper/Models/Ship.cs
@@ -65,7 +65,7 @@
 			TimeSpan.FromSeconds(Math.Floor(BaseRepairTime(this.Level) * (this.HP.Maximum - this.HP.Current) * this.Info.ShipType.RepairMultiplier) + 30);

 		public TimeSpan RepairTimeFacility =>
-			(BaseRepairTime() < 1200) ? this.RepairTimeDock : TimeSpan.FromMinutes((this.HP.Maximum - this.HP.Current) * 20);
+			(BaseRepairTime(this.Level) < 1200) ? this.RepairTimeDock : TimeSpan.FromMinutes((this.HP.Maximum - this.HP.Current) * 20);

 		#region HP 変更通知プロパティ

@@ -393,7 +393,7 @@
 			this.HP = this.HP.Update(max);
 		}

-		private double BaseRepairTime(double level = 1.0) =>
+		private double BaseRepairTime(double level) =>
 			(Math.Min(level, 150) * ((level < 12) ? 10 : 5) + ((level < 12) ? 0 : (Math.Floor(Math.Sqrt(level - 11) * 10 + 50))));

 		public override string ToString()


Fixes #48

Fixes #48

--- source/Pulsar/Assets/Graphics/Models/SubMesh.cs
+++ source/Pulsar/Assets/Graphics/Models/SubMesh.cs
@@ -89,7 +89,7 @@
         /// <summary>
         /// Get the material attached to this sub mesh
         /// </summary>
-        public Material Material { get; internal set; }
+        public Material Material { get; set; }

         /// <summary>
         /// Get or set the bounding volume data


Fixing namespace.

Fixing namespace.

--- src/Orchard.Web/Modules/Orchard.Pages/AdminMenu.cs
+++ src/Orchard.Web/Modules/Orchard.Pages/AdminMenu.cs
@@ -1,7 +1,7 @@
 using Orchard.Localization;
 using Orchard.UI.Navigation;

-namespace Orchard.Core.Dashboard {
+namespace Orchard.Pages {
     public class AdminMenu : INavigationProvider {
         public Localizer T { get; set; }
         public string MenuName { get { return "admin"; } }


Fixing setup

Fixing setup

--HG--
branch : 1.x

--- src/Orchard.Web/Modules/Orchard.Setup/SetupMode.cs
+++ src/Orchard.Web/Modules/Orchard.Setup/SetupMode.cs
@@ -30,6 +30,7 @@
 using Orchard.Mvc.ViewEngines.WebForms;
 using Orchard.Recipes.Services;
 using Orchard.Settings;
+using Orchard.Tasks;
 using Orchard.Themes;
 using Orchard.UI.Notify;
 using Orchard.UI.PageClass;
@@ -67,6 +68,7 @@
             builder.RegisterType<ResourceManager>().As<IResourceManager>().InstancePerLifetimeScope();
             builder.RegisterType<ResourceFilter>().As<IFilterProvider>().InstancePerLifetimeScope();
             builder.RegisterType<DefaultOrchardShell>().As<IOrchardShell>().InstancePerMatchingLifetimeScope("shell");
+            builder.RegisterType<SweepGenerator>().As<ISweepGenerator>().SingleInstance();

             // setup mode specific implementations of needed service interfaces
             builder.RegisterType<SafeModeThemeService>().As<IThemeManager>().InstancePerLifetimeScope();


GetLeague now works

GetLeague now works

String manipulation ftw

--- LeagueOfLegendsLibrary/LolInfo.cs
+++ LeagueOfLegendsLibrary/LolInfo.cs
@@ -15,7 +15,7 @@
         public static DateTime EpochToDateTime(double epoch)
         {
             DateTime t = new DateTime(1970, 1, 1, 0, 0, 0);
-            return t.AddMilliseconds(epoch);
+            return t.AddMilliseconds(epoch).ToLocalTime();
         }
     }
 }


(GH-45) Add link to release notes in outgoing communication

--- build/parameters.cake
+++ build/parameters.cake
@@ -99,7 +99,7 @@
     {
         get
         {
-            return "@/all Version " + Version.SemVersion + " of the Chocolatey VSCode Extension has just been released, https://marketplace.visualstudio.com/items?itemName=gep13.chocolatey-vscode.";
+            return "@/all Version " + Version.SemVersion + " of the Chocolatey VSCode Extension has just been released, https://marketplace.visualstudio.com/items?itemName=gep13.chocolatey-vscode.  Full release notes: https://github.com/gep13/chocolatey-vscode/releases/tag/" + Version.SemVersion;
         }
     }

@@ -107,7 +107,7 @@
     {
         get
         {
-            return "Version " + Version.SemVersion + " of the Chocolatey VSCode Extension has just been released, https://marketplace.visualstudio.com/items?itemName=gep13.chocolatey-vscode. @chocolateynuget @code";
+            return "Version " + Version.SemVersion + " of the Chocolatey VSCode Extension has just been released, https://marketplace.visualstudio.com/items?itemName=gep13.chocolatey-vscode. @chocolateynuget @code  Full release notes: https://github.com/gep13/chocolatey-vscode/releases/tag/" + Version.SemVersion;
         }
     }


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/CompressionMethod.cs
+++ websocket-sharp/CompressionMethod.cs
@@ -4,7 +4,7 @@
  *
  * The MIT License
  *
- * Copyright (c) 2013-2014 sta.blockhead
+ * Copyright (c) 2013-2015 sta.blockhead
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -31,22 +31,21 @@
 namespace WebSocketSharp
 {
   /// <summary>
-  /// Contains the values of the compression method used to compress the message on the WebSocket
-  /// connection.
+  /// Specifies the compression method used to compress a message on the WebSocket connection.
   /// </summary>
   /// <remarks>
-  /// The values of the compression method are defined in
-  /// <see href="http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-09">Compression
-  /// Extensions for WebSocket</see>.
+  /// The compression methods are defined in
+  /// <see href="http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-19">
+  /// Compression Extensions for WebSocket</see>.
   /// </remarks>
   public enum CompressionMethod : byte
   {
     /// <summary>
-    /// Indicates non compression.
+    /// Specifies non compression.
     /// </summary>
     None,
     /// <summary>
-    /// Indicates using DEFLATE.
+    /// Specifies DEFLATE.
     /// </summary>
     Deflate
   }


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Server/HttpServer.cs
+++ websocket-sharp/Server/HttpServer.cs
@@ -1196,10 +1196,10 @@
     ///   <paramref name="path"/> is already in use.
     ///   </para>
     /// </exception>
-    public void AddWebSocketService<TBehaviorWithNew> (string path)
-      where TBehaviorWithNew : WebSocketBehavior, new ()
-    {
-      _services.AddService<TBehaviorWithNew> (path, null);
+    public void AddWebSocketService<TBehavior> (string path)
+      where TBehavior : WebSocketBehavior, new ()
+    {
+      _services.AddService<TBehavior> (path, null);
     }

     /// <summary>


Only delete on successful import.

Only delete on successful import.

--- osu.Game/Database/BeatmapDatabase.cs
+++ osu.Game/Database/BeatmapDatabase.cs
@@ -126,13 +126,7 @@
                     BeatmapSetInfo set = importBeatmapSet(p);

                     sets.Push(set);
-                }
-                catch (Exception e)
-                {
-                    Logger.Error(e, $@"Could not import beatmap set");
-                }
-                finally
-                {
+
                     // We may or may not want to delete the file depending on where it is stored.
                     //  e.g. reconstructing/repairing database with beatmaps from default storage.
                     // TODO: Add a check to prevent files from storage to be deleted.
@@ -144,6 +138,10 @@
                     {
                         Logger.Error(e, $@"Could not delete file at {p}");
                     }
+                }
+                catch (Exception e)
+                {
+                    Logger.Error(e, $@"Could not import beatmap set");
                 }

             // Batch commit with multiple sets to database


Check if graph DrawSize changed

Check if graph DrawSize changed

--- osu.Game/Screens/Play/SquareGraph.cs
+++ osu.Game/Screens/Play/SquareGraph.cs
@@ -78,11 +78,13 @@
         private readonly LayoutValue layout = new LayoutValue(Invalidation.DrawSize);
         private ScheduledDelegate scheduledCreate;

+        private Vector2 previousDrawSize;
+
         protected override void Update()
         {
             base.Update();

-            if (values != null && !layout.IsValid)
+            if (values != null && !layout.IsValid && DrawSize != previousDrawSize)
             {
                 columns?.FadeOut(500, Easing.OutQuint).Expire();

@@ -90,6 +92,7 @@
                 scheduledCreate = Scheduler.AddDelayed(RecreateGraph, 500);

                 layout.Validate();
+                previousDrawSize = DrawSize;
             }
         }


Update `SkinnableSprite` to match more broad usage

--- osu.Game/Skinning/SkinnableSprite.cs
+++ osu.Game/Skinning/SkinnableSprite.cs
@@ -15,7 +15,7 @@
 namespace osu.Game.Skinning
 {
     /// <summary>
-    /// A skinnable element which uses a stable sprite and can therefore share implementation logic.
+    /// A skinnable element which uses a single texture backing.
     /// </summary>
     public class SkinnableSprite : SkinnableDrawable, ISkinnableDrawable
     {


Added attribute arguments

Added attribute arguments

--- src/ApiContractGenerator/CSharpTextFormatter.cs
+++ src/ApiContractGenerator/CSharpTextFormatter.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
@@ -394,7 +395,7 @@
             switch (metadataConstantValue.TypeCode)
             {
                 case ConstantTypeCode.Boolean:
-                    WriteStringLiteral(metadataConstantValue.GetValueAsBoolean() ? "true" : "false");
+                    writer.Write(metadataConstantValue.GetValueAsBoolean() ? "true" : "false");
                     break;
                 case ConstantTypeCode.Char:
                     WriteCharLiteral(metadataConstantValue.GetValueAsChar());
@@ -959,6 +960,123 @@
             return null;
         }

+        private void WriteAttributeArgumentValue(MetadataTypeReference type, object value, string currentNamespace)
+        {
+            switch (value)
+            {
+                case null:
+                    writer.Write("null");
+                    break;
+
+                case MetadataTypeReference typeRef:
+                    writer.Write("typeof(");
+                    Write(typeRef, currentNamespace);
+                    writer.Write(')');
+                    break;
+
+                default:
+                    switch (type)
+                    {
+                        case PrimitiveTypeReference primitiveType:
+                            switch (primitiveType.Code)
+                            {
+                                case PrimitiveTypeCode.Boolean:
+                                    writer.Write((bool)value ? "true" : "false");
+                                    break;
+                                case PrimitiveTypeCode.Char:
+                                    WriteCharLiteral((char)value);
+                                    break;
+                                case PrimitiveTypeCode.SByte:
+                                    writer.Write((sbyte)value);
+                                    break;
+                                case PrimitiveTypeCode.Byte:
+                                    writer.Write((byte)value);
+                                    break;
+                                case PrimitiveTypeCode.Int16:
+                                    writer.Write((short)value);
+                                    break;
+                                case PrimitiveTypeCode.UInt16:
+                                    writer.Write((ushort)value);
+                                    break;
+                                case PrimitiveTypeCode.Int32:
+                                    writer.Write((int)value);
+                                    break;
+                                case PrimitiveTypeCode.UInt32:
+                                    writer.Write((uint)value);
+                                    break;
+                                case PrimitiveTypeCode.Int64:
+                                    writer.Write((long)value);
+                                    break;
+                                case PrimitiveTypeCode.UInt64:
+                                    writer.Write((ulong)value);
+                                    break;
+                                case PrimitiveTypeCode.Single:
+                                    writer.Write((float)value);
+                                    break;
+                                case PrimitiveTypeCode.Double:
+                                    writer.Write((double)value);
+                                    break;
+                                case PrimitiveTypeCode.String:
+                                    WriteStringLiteral((string)value);
+                                    break;
+                                case PrimitiveTypeCode.IntPtr:
+                                    writer.Write("(System.IntPtr)");
+                                    var valueAsLong = (long)(IntPtr)value;
+                                    if (valueAsLong < 0) writer.Write('(');
+                                    writer.Write(valueAsLong);
+                                    if (valueAsLong < 0) writer.Write(')');
+                                    break;
+                                case PrimitiveTypeCode.UIntPtr:
+                                    writer.Write("(System.UIntPtr)");
+                                    writer.Write((ulong)(UIntPtr)value);
+                                    break;
+                                default:
+                                    throw new NotImplementedException();
+                            }
+                            break;
+
+                        case ArrayTypeReference arrayType:
+                            writer.Write("new ");
+                            if (arrayType.Dimensions != 1) throw new NotImplementedException();
+                            Write(arrayType, currentNamespace);
+                            writer.Write(" { ");
+
+                            var isFirst = true;
+
+                            // TODO: stop MetadataReaderSource implementation details leaking. Need MetadataValue type hierarchy.
+                            foreach (CustomAttributeTypedArgument<MetadataTypeReference> item in (IEnumerable)value)
+                            {
+                                if (isFirst) isFirst = false;
+                                else writer.Write(", ");
+                                WriteAttributeArgumentValue(item.Type, item.Value, currentNamespace);
+                            }
+
+                            writer.Write(" }");
+                            break;
+
+                        case TopLevelTypeReference _:
+                        case NestedTypeReference _:
+                            if (!(value is int || value is uint || value is long || value is ulong || value is byte || value is sbyte || value is short || value is ushort))
+                                throw new NotImplementedException();
+
+                            WriteEnumReferenceValue(type, value, currentNamespace);
+                            break;
+
+                        default:
+                            throw new NotImplementedException();
+                    }
+                    break;
+            }
+        }
+
+        private void WriteEnumReferenceValue(MetadataTypeReference enumType, object value, string currentNamespace)
+        {
+            writer.Write('(');
+            Write(enumType, currentNamespace);
+            writer.Write(')');
+            writer.Write(value);
+        }
+
         private void WriteAttributes(IReadOnlyList<IMetadataAttribute> attributes, string currentNamespace, bool newLines)
         {
             if (attributes.Count == 0) return;
@@ -989,7 +1107,21 @@
                 {
                     writer.Write('(');

-
+                    var isFirst = true;
+
+                    foreach (var arg in fixedArgs)
+                    {
+                        if (isFirst) isFirst = false; else writer.Write(", ");
+                        WriteAttributeArgumentValue(arg.ValueType, arg.Value, currentNamespace);
+                    }
+
+                    foreach (var arg in namedArgs)
+                    {
+                        if (isFirst) isFirst = false; else writer.Write(", ");
+                        writer.Write(arg.Name);
+                        writer.Write(" = ");
+                        WriteAttributeArgumentValue(arg.ValueType, arg.Value, currentNamespace);
+                    }

                     writer.Write(')');
                 }


Fixed native maps two way binding bug

Fixed native maps two way binding bug

--- src/AppShell.NativeMaps.Mobile/Views/MapPage.cs
+++ src/AppShell.NativeMaps.Mobile/Views/MapPage.cs
@@ -21,28 +21,23 @@
         }

         public static void ZoomLevelPropertyChanged(BindableObject d, double oldValue, double newValue)
-        {
-            if (oldValue == newValue)
-                return;
-
+        {
             MapPage mapPage = d as MapPage;
-
-            if (mapPage.map.VisibleRegion != null)
+
+            if (mapPage.map.VisibleRegion != null && !mapPage.ignoreInternalUpdate)
                 mapPage.map.MoveToRegion(MapSpan.FromCenterAndRadius(mapPage.map.VisibleRegion.Center, new Distance(mapPage.Radius)));
         }

         public static void CenterPropertyChanged(BindableObject d, Location oldValue, Location newValue)
         {
-            if (oldValue == newValue)
-                return;
-
             MapPage mapPage = d as MapPage;
-
-            if (newValue != null)
+
+            if (newValue != null && !mapPage.ignoreInternalUpdate)
                 mapPage.map.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(newValue.Latitude, newValue.Longitude), new Distance(mapPage.Radius)));
         }

         private Map map;
+        private bool ignoreInternalUpdate;

         public MapPage()
         {
@@ -61,8 +56,10 @@

             if (e.PropertyName == "VisibleRegion" && map != null && map.VisibleRegion != null)
             {
+                ignoreInternalUpdate = true;
                 Center = new Location(map.VisibleRegion.Center.Latitude, map.VisibleRegion.Center.Longitude);
                 Radius = map.VisibleRegion.Radius.Meters;
+                ignoreInternalUpdate = false;
             }
         }
     }


responsive nav header fix

responsive nav header fix

--- src/BolfTracker.Web/Views/Shared/_Layout.cshtml
+++ src/BolfTracker.Web/Views/Shared/_Layout.cshtml
@@ -18,40 +18,46 @@
   </script>
   }

-
-

-

-

-        @Html.ActionLink("Bolf Tracker", "Index", "Home", null, new { @class = "navbar-brand" })
-

-

-

-
@Html.ActionLink("Rankings", "Index", "Ranking")

-
@Html.ActionLink("Games", "Index", "Game")

-
@Html.ActionLink("Players", "Index", "Player")

-
@Html.ActionLink("Holes", "Index", "Hole")

-

-

-          @if (HttpContext.Current.User.Identity.IsAuthenticated) {
-
@Html.ActionLink("League Manager", "Index", "Admin")

-          }
-
@(HttpContext.Current.User.Identity.IsAuthenticated ? Html.ActionLink("Logout", "SignOut", "Player") : Html.ActionLink("Login", "Login", "Player"))

-

+
+

+

+

+          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
+
+
+
+          </button>
+          @Html.ActionLink("Bolf Tracker", "Index", "Home", null, new { @class = "navbar-brand" })
+

+

+

+
@Html.ActionLink("Rankings", "Index", "Ranking")

+
@Html.ActionLink("Games", "Index", "Game")

+
@Html.ActionLink("Players", "Index", "Player")

+
@Html.ActionLink("Holes", "Index", "Hole")

+

+

+                @if (HttpContext.Current.User.Identity.IsAuthenticated) {
+
@Html.ActionLink("League Manager", "Index", "Admin")

+                }
+
@(HttpContext.Current.User.Identity.IsAuthenticated ? Html.ActionLink("Logout", "SignOut", "Player") : Html.ActionLink("Login", "Login", "Player"))

+

+

-

-

-    @RenderBody()
-

-
-

-

-        Designed and built by @@mkchandler and friends.

-        Code licensed under the MIT License and is available on GitHub.
-

-

-
-  @Scripts.Render("~/bundles/js")
-  @RenderSection("javascript", required: false)
-
+
+

+            @RenderBody()
+

+
+

+

+                    Designed and built by @@mkchandler and friends.

+                                                                                Code licensed under the MIT License and is available on GitHub.
+

+

+
+        @Scripts.Render("~/bundles/js")
+        @RenderSection("javascript", required: false)
+


field naming conventions

field naming conventions

git-svn-id: fcce7d6ce0ac15bf24f68871b5145d46fc068279@2542 2c1201b4-01cd-e047-a400-b836ae1fbc61

--- src/Boo.Lang/Runtime/MethodDispatcherEmitter.cs
+++ src/Boo.Lang/Runtime/MethodDispatcherEmitter.cs
@@ -40,17 +40,17 @@

 	internal class MethodDispatcherEmitter
 	{
-		private readonly CandidateMethod found;
-		private readonly Type[] argumentTypes;
-		private readonly DynamicMethod method;
-		private readonly ILGenerator il;
+		private readonly CandidateMethod _found;
+		private readonly Type[] _argumentTypes;
+		private readonly DynamicMethod _method;
+		private readonly ILGenerator _il;

 		public MethodDispatcherEmitter(Type owner, CandidateMethod found, Type[] argumentTypes)
 		{
-			this.found = found;
-			this.argumentTypes = argumentTypes;
-			method = new DynamicMethod(string.Empty, typeof(object), new Type[] { typeof(object), typeof(object[]) }, owner);
-			il = method.GetILGenerator();
+			_found = found;
+			_argumentTypes = argumentTypes;
+			_method = new DynamicMethod(string.Empty, typeof(object), new Type[] { typeof(object), typeof(object[]) }, owner);
+			_il = _method.GetILGenerator();
 		}

 		public MethodDispatcher Emit()
@@ -58,26 +58,31 @@
 			EmitLoadTargetObject();
 			EmitMethodArguments();
 			EmitMethodCall();
-			EmitMethodReturn();
-			return (MethodDispatcher)method.CreateDelegate(typeof(MethodDispatcher));
+			EmitMethodReturn();
+			return CreateMethodDispatcher();
+		}
+
+		private MethodDispatcher CreateMethodDispatcher()
+		{
+			return (MethodDispatcher)_method.CreateDelegate(typeof(MethodDispatcher));
 		}

 		private void EmitMethodCall()
 		{
-			il.Emit(found.Method.IsStatic ? OpCodes.Call : OpCodes.Callvirt, found.Method);
+			_il.Emit(_found.Method.IsStatic ? OpCodes.Call : OpCodes.Callvirt, _found.Method);
 		}

 		private void EmitMethodArguments()
 		{
 			EmitFixedMethodArguments();
-			if (found.VarArgs) EmitVarArgsMethodArguments();
+			if (_found.VarArgs) EmitVarArgsMethodArguments();
 		}

 		private void EmitFixedMethodArguments()
 		{
-			for (int i = 0; i < found.MinimumArgumentCount; ++i)
-			{
-				Type paramType = found.GetParameterType(i);
+			for (int i = 0; i < _found.MinimumArgumentCount; ++i)
+			{
+				Type paramType = _found.GetParameterType(i);

 				EmitMethodArgument(i, paramType);
 			}
@@ -85,25 +90,25 @@

 		private void EmitVarArgsMethodArguments()
 		{
-			int varArgCount = argumentTypes.Length - found.MinimumArgumentCount;
-			Type varArgType = found.VarArgsParameterType;
+			int varArgCount = _argumentTypes.Length - _found.MinimumArgumentCount;
+			Type varArgType = _found.VarArgsParameterType;
 			OpCode storeOpCode = GetStoreElementOpCode(varArgType);
-			il.Emit(OpCodes.Ldc_I4, varArgCount);
-			il.Emit(OpCodes.Newarr, varArgType);
+			_il.Emit(OpCodes.Ldc_I4, varArgCount);
+			_il.Emit(OpCodes.Newarr, varArgType);
 			for (int i = 0; i < varArgCount; ++i)
 			{
-				il.Emit(OpCodes.Dup);
-				il.Emit(OpCodes.Ldc_I4, i);
+				_il.Emit(OpCodes.Dup);
+				_il.Emit(OpCodes.Ldc_I4, i);
 				if (IsStobj(storeOpCode))
 				{
-					il.Emit(OpCodes.Ldelema, varArgType);
-					EmitMethodArgument(found.MinimumArgumentCount + i, varArgType);
-					il.Emit(storeOpCode, varArgType);
+					_il.Emit(OpCodes.Ldelema, varArgType);
+					EmitMethodArgument(_found.MinimumArgumentCount + i, varArgType);
+					_il.Emit(storeOpCode, varArgType);
 				}
 				else
 				{
-					EmitMethodArgument(found.MinimumArgumentCount + i, varArgType);
-					il.Emit(storeOpCode);
+					EmitMethodArgument(_found.MinimumArgumentCount + i, varArgType);
+					_il.Emit(storeOpCode);
 				}
 			}
 		}
@@ -141,20 +146,20 @@

 		private void EmitMethodArgument(int argumentIndex, Type paramType)
 		{
-			il.Emit(OpCodes.Ldarg_1);
-			il.Emit(OpCodes.Ldc_I4, argumentIndex);
-			il.Emit(OpCodes.Ldelem_Ref);
-
-			switch (found.ArgumentScores[argumentIndex])
+			_il.Emit(OpCodes.Ldarg_1);
+			_il.Emit(OpCodes.Ldc_I4, argumentIndex);
+			_il.Emit(OpCodes.Ldelem_Ref);
+
+			switch (_found.ArgumentScores[argumentIndex])
 			{
 				case CandidateMethod.PromotionScore:
-					il.Emit(OpCodes.Castclass, typeof(IConvertible));
-					il.Emit(OpCodes.Ldnull);
-					il.Emit(OpCodes.Callvirt, GetPromotionMethod(paramType));
+					_il.Emit(OpCodes.Castclass, typeof(IConvertible));
+					_il.Emit(OpCodes.Ldnull);
+					_il.Emit(OpCodes.Callvirt, GetPromotionMethod(paramType));
 					break;
 				case CandidateMethod.ImplicitConversionScore:
-					EmitCastOrUnbox(argumentTypes[argumentIndex]);
-					il.Emit(OpCodes.Call, found.GetArgumentConversion(argumentIndex));
+					EmitCastOrUnbox(_argumentTypes[argumentIndex]);
+					_il.Emit(OpCodes.Call, _found.GetArgumentConversion(argumentIndex));
 					break;
 				default:
 					EmitCastOrUnbox(paramType);
@@ -164,37 +169,37 @@

 		private void EmitLoadTargetObject()
 		{
-			if (found.Method.IsStatic) return;
-			il.Emit(OpCodes.Ldarg_0); // target object is the first argument
+			if (_found.Method.IsStatic) return;
+			_il.Emit(OpCodes.Ldarg_0); // target object is the first argument
 		}

 		private void EmitMethodReturn()
 		{
-			Type returnType = found.Method.ReturnType;
+			Type returnType = _found.Method.ReturnType;
 			if (returnType == typeof(void))
 			{
-				il.Emit(OpCodes.Ldnull);
+				_il.Emit(OpCodes.Ldnull);
 			}
 			else
 			{
 				if (returnType.IsValueType)
 				{
-					il.Emit(OpCodes.Box, returnType);
-				}
-			}
-			il.Emit(OpCodes.Ret);
+					_il.Emit(OpCodes.Box, returnType);
+				}
+			}
+			_il.Emit(OpCodes.Ret);
 		}

 		private void EmitCastOrUnbox(Type type)
 		{
 			if (type.IsValueType)
 			{
-				il.Emit(OpCodes.Unbox, type);
-				il.Emit(OpCodes.Ldobj, type);
+				_il.Emit(OpCodes.Unbox, type);
+				_il.Emit(OpCodes.Ldobj, type);
 			}
 			else
 			{
-				il.Emit(OpCodes.Castclass, type);
+				_il.Emit(OpCodes.Castclass, type);
 			}
 		}


Add support for quoted strings

Add support for quoted strings

--- src/Carbon.Css/Parser/Tokenizer/CssTokenizer.cs
+++ src/Carbon.Css/Parser/Tokenizer/CssTokenizer.cs
@@ -72,6 +72,9 @@
                 case ':':
                     // ::placeholder {
                     // :-ms-placeholder {
+
+                    // :not(
+
                     if (reader.Peek() == ':' || reader.Peek() == '-')
                     {
                         return ReadValue();
@@ -84,9 +87,19 @@
                     }

                 case ',': return new CssToken(TokenKind.Comma, reader.Read(), reader.Position);
-                case ';': LeaveValueMode(); return new CssToken(TokenKind.Semicolon, reader.Read(), reader.Position);
-                case '{': mode.Enter(LexicalMode.Block); return new CssToken(TokenKind.BlockStart, reader.Read(), reader.Position);
-                case '}': LeaveValueMode(); mode.Leave(LexicalMode.Block, this); return new CssToken(TokenKind.BlockEnd, reader.Read(), reader.Position);
+                case ';':
+                    LeaveValueMode();
+                    return new CssToken(TokenKind.Semicolon, reader.Read(), reader.Position);
+                case '{':
+                    mode.Enter(LexicalMode.Block);
+
+                    return new CssToken(TokenKind.BlockStart, reader.Read(), reader.Position);
+                case '}':
+                    LeaveValueMode();
+
+                    mode.Leave(LexicalMode.Block, this);
+
+                    return new CssToken(TokenKind.BlockEnd, reader.Read(), reader.Position);

                 case '(': return new CssToken(TokenKind.LeftParenthesis, reader.Read(), reader.Position);
                 case ')': return new CssToken(TokenKind.RightParenthesis, reader.Read(), reader.Position);
@@ -129,6 +142,10 @@
                         return new CssToken(TokenKind.Subtract, reader.Read(), reader.Position);
                     else
                         break;
+
+                case '\'':
+                case '"':
+                    return ReadQuotedString(reader.Current);

                 case '0':
                 case '1':
@@ -146,10 +163,10 @@

             switch (mode.Current)
             {
-                case LexicalMode.Symbol: return ReadSymbol();
-                case LexicalMode.Value: return ReadValue();
-                case LexicalMode.Unit: return ReadUnit();
-                default: return ReadName();
+                case LexicalMode.Symbol : return ReadSymbol();
+                case LexicalMode.Value  : return ReadValue();
+                case LexicalMode.Unit   : return ReadUnit();
+                default                 : return ReadName();
             }
         }

@@ -219,12 +236,34 @@
             }
         }

+        private CssToken ReadQuotedString(char quoteChar)
+        {
+            reader.Mark();
+
+            reader.Next(); // "
+
+            while (reader.Current != quoteChar && !reader.IsEof)
+            {
+                reader.Next();
+            }
+
+            reader.Next(); // "
+
+            return new CssToken(TokenKind.String, reader.Unmark(), reader.MarkStart);
+        }
+
         private CssToken ReadValue()
         {
             reader.Mark();

-            while (!reader.IsWhiteSpace && reader.Current != '{' && reader.Current != '}'
-                && reader.Current != ')' && reader.Current != '(' && reader.Current != ';' && reader.Current != ',' && !reader.IsEof)
+            while (!reader.IsWhiteSpace &&
+                reader.Current != '{' &&
+                reader.Current != '}'&&
+                reader.Current != ')' &&
+                reader.Current != '(' &&
+                reader.Current != ';' &&
+                reader.Current != ',' &&
+                !reader.IsEof)
             {
                 reader.Next();
             }


fix: namespace

fix: namespace

--- src/Code.Library/Extensions/StringExtensions.cs
+++ src/Code.Library/Extensions/StringExtensions.cs
@@ -1,15 +1,15 @@
-namespace Code.Library
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Net;
+using System.Security.Cryptography;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading;
+
+namespace Code.Library.Extensions
 {
-    using System;
-    using System.Collections.Generic;
-    using System.Globalization;
-    using System.Linq;
-    using System.Net;
-    using System.Security.Cryptography;
-    using System.Text;
-    using System.Text.RegularExpressions;
-    using System.Threading;
-
     /// <summary>
     /// All String extensions.
     /// </summary>


Make Debug.Assert always print to stderr

The purpose of previously adding COMPlus_DebugWriteToStdErr was to shield stderr from lots of tracing done with Debug.WriteLine.  But for failed asserts with Debug.Assert, we really want to always see those errors.

--- src/Common/src/System/Diagnostics/Debug.Unix.cs
+++ src/Common/src/System/Diagnostics/Debug.Unix.cs
@@ -33,7 +33,15 @@
                 else
                 {
                     // TODO: #3708 Determine if/how to put up a dialog instead.
-                    throw new DebugAssertException(message, detailMessage, stackTrace);
+                    var exc = new DebugAssertException(message, detailMessage, stackTrace);
+                    if (!s_shouldWriteToStdErr)
+                    {
+                        // We always want to print out Debug.Assert failures to stderr, even if
+                        // !s_shouldWriteToStdErr, so if it wouldn't have been printed in
+                        // WriteCore (only when s_shouldWriteToStdErr), print it here.
+                        WriteToStderr(exc.Message);
+                    }
+                    throw exc;
                 }
             }


Change terms of use.

Change terms of use.

--- src/CompetitionPlatform/Views/Home/Terms.cshtml
+++ src/CompetitionPlatform/Views/Home/Terms.cshtml
@@ -55,6 +55,29 @@
         Awards are given in Lykke coins via the Lykke wallet, which may then be turned into cash. We encourage multiple awards. The earlier the stage, the more small awards there should be. There can be two stages, so award winners can progress to the next stage and flesh out their submission. After that it usually goes to a direct contract.

+

+        Tenders
+

+

+        Any organization can take part in the tender.
+

+

+        Bidders must provide a full package of documents according to the tender requirements. Bidders who provide an incomplete package may be excluded from the procedure.
+

+

+        The organizer of the tender may at its sole discretion decide on closing the tender without selecting the winner.
+

+
+

+        Vacancies
+

+

+        By registering for a project or for a job, you agree to the transfer of your personal data.
+

+

+        The organizer of the contest may at its sole discretion close the project or the vacancy without selecting the winner.
+

+

         How to participate?


let's dispose the webclient like a real man.

--- src/DiscordBot/Modules/Waifu2x/Waifu2xModule.cs
+++ src/DiscordBot/Modules/Waifu2x/Waifu2xModule.cs
@@ -69,10 +69,9 @@

                         if (ext == ".png" || ext == ".jpg" || ext == ".jepg") // ?? who uses bmp and shit anyway
                         {
-
-                            if(_isRunning)
-                            {
-                                await _client.ReplyError(e,"I'm running w2x somewhere already, please try again later.");
+                            if (_isRunning)
+                            {
+                                await _client.ReplyError(e, "I'm running w2x somewhere already, please try again later.");
                                 return;
                             }

@@ -97,16 +96,14 @@
                             param.Add("scale", $"{scale}");
                             param.Add("noise", $"{(int)noise}");

-                            await _client.Reply(e, $"Trying to Upscale image `{amount}` {(amount == 1 ? "time" : "times...")}");
-
-
+                            string file = "temp";
+                            int ih = 0;
+                            int iw = 0;
+
                             using (WebClient cli = new WebClient())
                             {
-                                string file = "temp";
-                                int ih = 0;
-                                int iw = 0;
                                 cli.QueryString = param;
-
+                                await _client.Reply(e, $"Trying to Upscale image `{amount}` {(amount == 1 ? "time" : "times...")}");
                                 for (int i = 0; i < amount; i++)
                                 {
                                     try
@@ -143,9 +140,13 @@
                                             await Task.Delay(1000);
                                         }
                                     }
-                                    catch (FileLoadException)
+                                    catch (WebException)
                                     {
                                         throw;
+                                    }
+                                    finally
+                                    {
+                                        cli.Dispose();
                                     }
                                 }


Split Aggregate functionality up to two methode, of which one will be used for a future Aggregate overload.

--- src/ExRam.Gremlinq.Core/Queries/GremlinQuery.cs
+++ src/ExRam.Gremlinq.Core/Queries/GremlinQuery.cs
@@ -416,8 +416,14 @@
             where TTargetQuery : IGremlinQueryBase
         {
             return continuation(
-                AddStep(new AggregateStep(scope, stepLabel)),
+                Aggregate(scope, stepLabel),
                 stepLabel);
+        }
+
+        private GremlinQuery<TElement, TOutVertex, TInVertex, TScalar, TMeta, TFoldedQuery> Aggregate<TStepLabel>(Scope scope, TStepLabel stepLabel)
+            where TStepLabel : StepLabel
+        {
+            return AddStep(new AggregateStep(scope, stepLabel));
         }

         private GremlinQuery<TElement, TOutVertex, TInVertex, TScalar, TMeta, TFoldedQuery> And(params Func<GremlinQuery<TElement, TOutVertex, TInVertex, TScalar, TMeta, TFoldedQuery>, IGremlinQueryBase>[] andTraversalTransformations)


Get rid of GetKeys, it does the same as a sequence of GetKey.

--- src/ExRam.Gremlinq.Core/Queries/GremlinQuery.cs
+++ src/ExRam.Gremlinq.Core/Queries/GremlinQuery.cs
@@ -906,21 +906,11 @@
             throw new InvalidOperationException($"Invalid use of unknown {nameof(StepLabel)} in {nameof(Select)}. Make sure you only pass in a {nameof(StepLabel)} that comes from a previous {nameof(As)}-continuation or has previously been passed to an appropriate overload of {nameof(As)}.");
         }

-        private ImmutableArray<Key> GetKeys(params Expression[] projections)
-        {
-            return projections
-                .Select(projection => projection switch
-                {
-                    LambdaExpression { Body: MemberExpression memberExpression } lambdaExpression when memberExpression.Expression == lambdaExpression.Parameters[0] => (Key)memberExpression.Member.Name,
-                    MemberExpression memberExpression when memberExpression.Expression is ParameterExpression => (Key)memberExpression.Member.Name,
-                    _ => throw new ExpressionNotSupportedException(projection)
-                })
-                .ToImmutableArray();
-        }
-
         private TTargetQuery Select<TTargetQuery>(params Expression[] projections)
         {
-            return AddStep(new SelectKeysStep(GetKeys(projections)))
+            return AddStep(new SelectKeysStep(projections
+                    .Select(GetKey)
+                    .ToImmutableArray()))
                 .ChangeQueryType<TTargetQuery>();
         }

@@ -1240,7 +1230,7 @@

                                     return AddStep(
                                         new WhereTraversalStep(ImmutableArray.Create<Step>(
-                                            new SelectKeysStep(GetKeys(unaryExpression.Operand)),
+                                            new SelectKeysStep(ImmutableArray.Create(GetKey(unaryExpression.Operand))),
                                             countStep,
                                             new IsStep(effectivePredicate))));
                                 }