changed to BytesConversion

changed to BytesConversion

--- Languages/IronPython/IronPython.Modules/nt.cs
+++ Languages/IronPython/IronPython.Modules/nt.cs
@@ -180,7 +180,7 @@
             if (pf.IsConsole) {
                 return new stat_result(8192);
             }
-            return lstat(context, pf.name);
+            return lstat(pf.name);
         }

         public static string getcwd(CodeContext/*!*/ context) {
@@ -284,9 +284,9 @@
         /// Like stat(path), but do not follow symbolic links.
         /// </summary>
         [LightThrowing]
-        public static object lstat(CodeContext context, object path) {
+        public static object lstat([BytesConversion]string path) {
             // TODO: detect links
-            return stat(context, path);
+            return stat(path);
         }

 #if FEATURE_FILESYSTEM
@@ -1147,41 +1147,29 @@

         [Documentation("stat(path) -> stat result\nGathers statistics about the specified file or directory")]
         [LightThrowing]
-        public static object stat(CodeContext context, object path) {
+        public static object stat([BytesConversion]string path) {
             if (path == null) {
                 return LightExceptions.Throw(PythonOps.TypeError("expected string, got NoneType"));
             }

             stat_result sr;

-            string strPath;
-            if (path is string) {
-                strPath = (string)path;
-            } else if (path is ExtensibleString) {
-                strPath = ((ExtensibleString)path).Value;
-            } else if (path is Bytes) {
-                var tmp = (Bytes)path;
-                strPath = tmp.decode(context, (string)SysModule.getfilesystemencoding(), "strict");
-            } else {
-                return LightExceptions.Throw(PythonOps.TypeError("can not convert path to string: " + path.GetType()));
-            }
-
-            try {
-                FileInfo fi = new FileInfo(strPath);
+            try {
+                FileInfo fi = new FileInfo(path);
                 int mode = 0;
                 long size;

-                if (Directory.Exists(strPath)) {
+                if (Directory.Exists(path)) {
                     size = 0;
                     mode = 0x4000 | S_IEXEC;
-                } else if (File.Exists(strPath)) {
+                } else if (File.Exists(path)) {
                     size = fi.Length;
                     mode = 0x8000;
-                    if (HasExecutableExtension(strPath)) {
+                    if (HasExecutableExtension(path)) {
                         mode |= S_IEXEC;
                     }
                 } else {
-                    return LightExceptions.Throw(PythonExceptions.CreateThrowable(WindowsError, PythonExceptions._WindowsError.ERROR_PATH_NOT_FOUND, "file does not exist: " + strPath));
+                    return LightExceptions.Throw(PythonExceptions.CreateThrowable(WindowsError, PythonExceptions._WindowsError.ERROR_PATH_NOT_FOUND, "file does not exist: " + path));
                 }

                 long st_atime = (long)PythonTime.TicksToTimestamp(fi.LastAccessTime.ToUniversalTime().Ticks);
@@ -1194,9 +1182,9 @@

                 sr = new stat_result(mode, size, st_atime, st_mtime, st_ctime);
             } catch (ArgumentException) {
-                return LightExceptions.Throw(PythonExceptions.CreateThrowable(WindowsError, PythonExceptions._WindowsError.ERROR_INVALID_NAME, "The path is invalid: " + strPath));
-            } catch (Exception e) {
-                return LightExceptions.Throw(ToPythonException(e, strPath));
+                return LightExceptions.Throw(PythonExceptions.CreateThrowable(WindowsError, PythonExceptions._WindowsError.ERROR_INVALID_NAME, "The path is invalid: " + path));
+            } catch (Exception e) {
+                return LightExceptions.Throw(ToPythonException(e, path));
             }

             return sr;


Avoid shutdown exception

Avoid shutdown exception

--- src/Miningcore/Mining/ShareRecorder.cs
+++ src/Miningcore/Mining/ShareRecorder.cs
@@ -308,8 +308,8 @@
         {
             logger.Info(() => "Stopping ..");

-            queueSub.Dispose();
-            queue.Dispose();
+            queueSub?.Dispose();
+            queue?.Dispose();

             logger.Info(() => "Stopped");
         }


More cleanup.

More cleanup.

--- zgw_search/Program.cs
+++ zgw_search/Program.cs
@@ -21,10 +21,7 @@
 SOFTWARE.*/

 using System;
-using System.Collections.Generic;
 using System.Linq;
-using System.Threading.Tasks;
-using System.Windows.Forms;
 using System.Net;
 using System.Net.Sockets;
 using System.Text;
@@ -87,16 +84,11 @@
                     }
                 }
             }
-            //MessageBox.Show("Message sent", "My Application",
-            //MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);
         }

         [STAThread]
          static void Main()
         {
-            /*Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new Form1()); */
             Trace.Listeners.Add(new ConsoleTraceListener());
             //Trace.Listeners.Add(new TextWriterTraceListener(new System.IO.StreamWriter(@".\zgw_search.log", false)));


Dispose() correctly disposing now. Fixed potential threading issue internally.

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

--- src/MonoTorrent/Client/ClientEngine.cs
+++ src/MonoTorrent/Client/ClientEngine.cs
@@ -120,7 +120,6 @@
         }

-#warning Make this threadsafe usage
         /// <summary>
         /// The TorrentManager's loaded into the engine
         /// </summary>
@@ -171,10 +170,10 @@
         {
             if (torrent == null)
                 return false;
-
-            for (int i = 0; i < this.torrents.Count; i++)
-                if (Toolbox.ByteMatch(this.torrents[i].Torrent.infoHash, torrent.infoHash))
-                    return true;
+            using (new ReaderLock(this.torrentsLock))
+                for (int i = 0; i < this.torrents.Count; i++)
+                    if (Toolbox.ByteMatch(this.torrents[i].Torrent.infoHash, torrent.infoHash))
+                        return true;

             return false;
         }
@@ -187,10 +186,7 @@
         /// <returns></returns>
         public bool Contains(TorrentManager manager)
         {
-            if (manager == null)
-                return false;
-
-            return Contains(manager.Torrent);
+            return manager == null ? false : Contains(manager.Torrent);
         }

@@ -203,10 +199,12 @@
             {
                 while (this.torrents.Count > 0)
                 {
-                    if (torrents[0].State != TorrentState.Stopped)
-                        torrents[0].Stop().WaitOne();
-
-                    Unregister(torrents[0]);
+                    TorrentManager t = torrents[0];
+                    if (t.State != TorrentState.Stopped)
+                        t.Stop().WaitOne();
+
+                    Unregister(t);
+                    t.Dispose();
                 }
             }


- Some more tests around parameter order in event handler dispatch.

--HG--
branch : dev

--- src/Orchard.Tests/Events/EventTests.cs
+++ src/Orchard.Tests/Events/EventTests.cs
@@ -61,6 +61,16 @@
         }

         [Test]
+        public void EventParametersArePassedInCorrectOrderToEventHandlers() {
+            Assert.That(_eventHandler.Result, Is.EqualTo(0));
+            Dictionary<string, object> arguments = new Dictionary<string, object>();
+            arguments["a"] = 2600;
+            arguments["b"] = 5200;
+            _eventBus.Notify("ITestEventHandler.Substract", arguments);
+            Assert.That(_eventHandler.Result, Is.EqualTo(-2600));
+        }
+
+        [Test]
         public void EventBusThrowsIfMessageNameIsNotCorrectlyFormatted() {
             Assert.Throws<ArgumentException>(() => _eventBus.Notify("StubEventHandlerIncrement", new Dictionary<string, object>()));
         }


Save chart/plot in var.

Save chart/plot in var.

--- ML.TypingClassifier/Views/Home/Results.cshtml
+++ ML.TypingClassifier/Views/Home/Results.cshtml
@@ -6,7 +6,8 @@
   <script type="text/javascript">
     $(function() {
       var points
-        , features;
+        , features
+        , plot;

       $.getJSON('/sink/points', function(data) {
         points = data;
@@ -19,11 +20,11 @@
         };
         console.log(data);
         console.log(features);
-        render();
+        plot = render();
       });

       function render() {
-        c3.generate({
+        return c3.generate({
           bindto: '#chart',
           data: {
             columns: [features.wpm, features.averageKeyPressDuration],


fixed test

fixed test

--- Manatee.Trello.IntegrationTests/BoardTests.cs
+++ Manatee.Trello.IntegrationTests/BoardTests.cs
@@ -95,6 +95,7 @@

 				board.Lists[listName].Should().BeNull();
 				TrelloConfiguration.EnableConsistencyProcessing = true;
+				TrelloConfiguration.Cache.Remove(card);

 				await board.Refresh(true);


Pass in TypeRef's module to Resolve() if sourceModule is null

--- src/DotNet/TypeRef.cs
+++ src/DotNet/TypeRef.cs
@@ -308,7 +308,7 @@
 		public TypeDef Resolve(ModuleDef sourceModule) {
 			if (module == null)
 				return null;
-			return module.Context.Resolver.Resolve(this, sourceModule);
+			return module.Context.Resolver.Resolve(this, sourceModule ?? module);
 		}

 		/// <summary>


Add in-code doc for tuple extensions

Add in-code doc for tuple extensions

--- Monacs.Core/Tuples/Result.Tuple.Extensions.cs
+++ Monacs.Core/Tuples/Result.Tuple.Extensions.cs
@@ -5,27 +5,93 @@
 {
     public static class Result
     {
-        /* Map2 */
-        public static Result<TResult> Map2<TResult, T1, T2>(this Result<(T1, T2)> result, Func<T1, T2, TResult> func) =>
-            result.IsOk ? Ok(func(result.Value.Item1, result.Value.Item2)) : Error<TResult>(result.Error);
+        /* Map */

-        /* Map3 */
-        public static Result<TResult> Map3<TResult, T1, T2, T3>(this Result<(T1, T2, T3)> result, Func<T1, T2, T3, TResult> func) =>
-            result.IsOk ? Ok(func(result.Value.Item1, result.Value.Item2, result.Value.Item3)) : Error<TResult>(result.Error);
+        /// <summary>
+        /// Maps the value of the <paramref name="result"/> into another <see cref="Result{T}"/> using the <paramref name="mapper"/> function.
+        /// <para /> If the input result is Ok, returns the Ok case with the value of the mapper call (which is <typeparamref name="TResult"/>).
+        /// Otherwise returns Error case of the Result of <typeparamref name="TResult"/>.
+        /// </summary>
+        /// <typeparam name="TResult">Type of the value in the returned result.</typeparam>
+        /// <typeparam name="TFst">Type of first value in input result.</typeparam>
+        /// <typeparam name="TSnd">Type of second value in input result.</typeparam>
+        /// <param name="result">The result to map on.</param>
+        /// <param name="mapper">Function called with the input result value if it's Ok case.</param>
+        public static Result<TResult> Map2<TResult, TFst, TSnd>(this Result<(TFst fst, TSnd snd)> result, Func<TFst, TSnd, TResult> mapper) =>
+            result.IsOk ? Ok(mapper(result.Value.fst, result.Value.snd)) : Error<TResult>(result.Error);

-        /* Match2 */
-        public static TVal Match2<TFst, TSnd, TVal>(this Result<(TFst fst, TSnd snd)> result, Func<TFst, TSnd, TVal> ok, Func<ErrorDetails, TVal> error) =>
+        /// <summary>
+        /// Maps the value of the <paramref name="result"/> into another <see cref="Result{T}"/> using the <paramref name="mapper"/> function.
+        /// <para /> If the input result is Ok, returns the Ok case with the value of the mapper call (which is <typeparamref name="TResult"/>).
+        /// Otherwise returns Error case of the Result of <typeparamref name="TOut"/>.
+        /// </summary>
+        /// <typeparam name="TResult">Type of the value in the returned result.</typeparam>
+        /// <typeparam name="TFst">Type of first value in input result.</typeparam>
+        /// <typeparam name="TSnd">Type of second value in input result.</typeparam>
+        /// <typeparam name="TTrd">Type of third value in input result.</typeparam>
+        /// <param name="result">The result to map on.</param>
+        /// <param name="mapper">Function called with the input result value if it's Ok case.</param>
+        public static Result<TResult> Map3<TResult, TFst, TSnd, TTrd>(this Result<(TFst fst, TSnd snd, TTrd trd)> result, Func<TFst, TSnd, TTrd, TResult> mapper) =>
+            result.IsOk ? Ok(mapper(result.Value.fst, result.Value.snd, result.Value.trd)) : Error<TResult>(result.Error);
+
+        /* Match */
+
+        /// <summary>
+        /// Does the pattern matching on the <see cref="Result{T}"/> type.
+        /// If the <paramref name="result"/> is Ok, calls <paramref name="ok"/> function
+        /// with the value from the result as a parameter and returns its result.
+        /// Otherwise calls <paramref name="error"/> function and returns its result.
+        /// </summary>
+        /// <typeparam name="TResult">Type of the returned value.</typeparam>
+        /// <typeparam name="TFst">Type of the first tuple value in the result.</typeparam>
+        /// <typeparam name="TSnd">Type of the second tuple value in the result.</typeparam>
+        /// <param name="result">The result to match on.</param>
+        /// <param name="ok">Function called for the Ok case.</param>
+        /// <param name="error">Function called for the Error case.</param>
+        public static TResult Match2<TResult, TFst, TSnd>(this Result<(TFst fst, TSnd snd)> result, Func<TFst, TSnd, TResult> ok, Func<ErrorDetails, TResult> error) =>
             result.IsOk ? ok(result.Value.fst, result.Value.snd) : error(result.Error);

-        /* Match3 */
-        public static TVal Match3<TFst, TSnd, TTrd, TVal>(this Result<(TFst fst, TSnd snd, TTrd trd)> result, Func<TFst, TSnd, TTrd, TVal> ok, Func<ErrorDetails, TVal> error) =>
+        /// <summary>
+        /// Does the pattern matching on the <see cref="Result{T}"/> type.
+        /// If the <paramref name="result"/> is Ok, calls <paramref name="ok"/> function
+        /// with the value from the result as a parameter and returns its result.
+        /// Otherwise calls <paramref name="error"/> function and returns its result.
+        /// </summary>
+        /// <typeparam name="TResult">Type of the returned value.</typeparam>
+        /// <typeparam name="TFst">Type of the first tuple value in the result.</typeparam>
+        /// <typeparam name="TSnd">Type of the second tuple value in the result.</typeparam>
+        /// <typeparam name="TTrd">Type of the third tuple value in the result.</typeparam>
+        /// <param name="result">The result to match on.</param>
+        /// <param name="ok">Function called for the Ok case.</param>
+        /// <param name="error">Function called for the Error case.</param>
+        public static TResult Match3<TResult, TFst, TSnd, TTrd>(this Result<(TFst fst, TSnd snd, TTrd trd)> result, Func<TFst, TSnd, TTrd, TResult> ok, Func<ErrorDetails, TResult> error) =>
             result.IsOk ? ok(result.Value.fst, result.Value.snd, result.Value.trd) : error(result.Error);

-        /* MatchTo2 */
-        public static TVal MatchTo2<TFst, TSnd, TVal>(this Result<(TFst fst, TSnd snd)> result, TVal some, TVal none) =>
-            result.IsOk ? some : none;
+        /// <summary>
+        /// Does the pattern matching on the <see cref="Result{T}"/> type.
+        /// If the <paramref name="result"/> is Ok, returns <paramref name="ok"/> value.
+        /// Otherwise returns <paramref name="error"/> value.
+        /// </summary>
+        /// <typeparam name="TResult">Type of the returned value.</typeparam>
+        /// <typeparam name="TFst">Type of the first tuple value in the result.</typeparam>
+        /// <typeparam name="TSnd">Type of the second tuple value in the result.</typeparam>
+        /// <param name="result">The result to match on.</param>
+        /// <param name="ok">Value returned for the Ok case.</param>
+        /// <param name="error">Value returned for the Error case.</param>
+        public static TResult MatchTo2<TResult, TFst, TSnd>(this Result<(TFst fst, TSnd snd)> result, TResult ok, TResult error) =>
+            result.IsOk ? ok : error;

-        /* Do2 */
+        /* Do */
+
+        /// <summary>
+        /// Performs action if the given result is on the succesful path.
+        /// The action takes given result as an argument.
+        /// </summary>
+        /// <typeparam name="TFst">Type of first tuple result value.</typeparam>
+        /// <typeparam name="TSnd">Type of second tuple result value.</typeparam>
+        /// <param name="result">Given result.</param>
+        /// <param name="action">Action to perform.</param>
+        /// <returns>Result passed to the method as an argument.</returns>
         public static Result<(TFst, TSnd)> Do2<TFst, TSnd>(this Result<(TFst fst, TSnd snd)> result, Action<TFst, TSnd> action)
         {
             if (result.IsOk)
@@ -33,7 +99,16 @@
             return result;
         }

-        /* Do3 */
+        /// <summary>
+        /// Performs action if the given result is on the succesful path.
+        /// The action takes given result as an argument.
+        /// </summary>
+        /// <typeparam name="TFst">Type of first tuple result value.</typeparam>
+        /// <typeparam name="TSnd">Type of second tuple result value.</typeparam>
+        /// <typeparam name="TTrd">Type of third tuple result value.</typeparam>
+        /// <param name="result">Given result.</param>
+        /// <param name="action">Action to perform.</param>
+        /// <returns>Result passed to the method as an argument.</returns>
         public static Result<(TFst, TSnd, TTrd)> Do3<TFst, TSnd, TTrd>(this Result<(TFst fst, TSnd snd, TTrd trd)> result, Action<TFst, TSnd, TTrd> action)
         {
             if (result.IsOk)
@@ -41,27 +116,71 @@
             return result;
         }

-        /* TryCatch2 */
-        public static Result<TValue> TryCatch2<TValue, TFst, TSnd>(
+        /* TryCatch */
+
+        /// <summary>
+        /// Invokes function in try/catch block and returns its result.
+        /// If any <see cref="Exception"/> is raised during execution, error handler is invoked and error details are returned.
+        /// </summary>
+        /// <typeparam name="TResult">Type of value returned by invoked function.</typeparam>
+        /// <typeparam name="TFst">Type of first tuple result value.</typeparam>
+        /// <typeparam name="TSnd">Type of second tuple result value.</typeparam>
+        /// <param name="tryFunc">The function to be invoked in 'try' block.</param>
+        /// <param name="errorHandler">Handler invoked in 'catch' block on any raised exception.</param>
+        /// <returns><see cref="Result{TValue}"/> of invoked function in try block or <see cref="ErrorDetails"/> if any exception occurs.</returns>
+        public static Result<TResult> TryCatch2<TResult, TFst, TSnd>(
             this Result<(TFst fst, TSnd snd)> result,
-                 Func<TFst, TSnd, TValue> tryFunc,
+                 Func<TFst, TSnd, TResult> tryFunc,
                  Func<TFst, TSnd, Exception, ErrorDetails> errorHandler) =>
                      result.Bind(value => TryCatch(func: () => tryFunc(value.fst, value.snd),
                                  errorHandler: err => errorHandler(value.fst, value.snd, err)));
-
-        /* TryCatch3 */
-        public static Result<TValue> TryCatch3<TValue, TFst, TSnd, TTrd>(
+
+        /// <summary>
+        /// Invokes function in try/catch block and returns its result.
+        /// If any <see cref="Exception"/> is raised during execution, error handler is invoked and error details are returned.
+        /// </summary>
+        /// <typeparam name="TResult">Type of value returned by invoked function.</typeparam>
+        /// <typeparam name="TFst">Type of first tuple result value.</typeparam>
+        /// <typeparam name="TSnd">Type of second tuple result value.</typeparam>
+        /// <typeparam name="TTrd">Type of third tuple result value.</typeparam>
+        /// <param name="tryFunc">The function to be invoked in 'try' block.</param>
+        /// <param name="errorHandler">Handler invoked in 'catch' block on any raised exception.</param>
+        /// <returns><see cref="Result{TValue}"/> of invoked function in try block or <see cref="ErrorDetails"/> if any exception occurs.</returns>
+        public static Result<TResult> TryCatch3<TResult, TFst, TSnd, TTrd>(
             this Result<(TFst fst, TSnd snd, TTrd trd)> result,
-                 Func<TFst, TSnd, TTrd, TValue> tryFunc,
+                 Func<TFst, TSnd, TTrd, TResult> tryFunc,
                  Func<TFst, TSnd, TTrd, Exception, ErrorDetails> errorHandler) =>
                      result.Bind(value => TryCatch(func: () => tryFunc(value.fst, value.snd, value.trd),
                                  errorHandler: err => errorHandler(value.fst, value.snd, value.trd, err)));

-        /* Bind2 */
+        /* Bind */
+
+        /// <summary>
+        /// Applies railway pattern and binds two functions.
+        /// <para />If the result of the previous function is on the success path, the received result is taken as an argument and the next function is invoked.
+        /// <para />If the result of the previous function is on the failure path, the new error is created to match generic result type, but the error details remain the same.
+        /// </summary>
+        /// <typeparam name="TFst">Type of the first output tuple value received from previous function.</typeparam>
+        /// <typeparam name="TSnd">Type of the second output tuple value received from previous function.</typeparam>
+        /// <typeparam name="TOut">Type of the output value.</typeparam>
+        /// <param name="result">Output of previous function</param>
+        /// <param name="binder">Passes the output of first function to the next one.</param>
+        /// <returns>Result of the second function or error received from the first function.</returns>
         public static Result<TOut> Bind2<TOut, TFst, TSnd>(this Result<(TFst fst, TSnd snd)> result, Func<TFst, TSnd, Result<TOut>> binder) =>
             result.IsOk ? binder(result.Value.fst, result.Value.snd) : Error<TOut>(result.Error);

-        /* Bind3 */
+        /// <summary>
+        /// Applies railway pattern and binds two functions.
+        /// <para />If the result of the previous function is on the success path, the received result is taken as an argument and the next function is invoked.
+        /// <para />If the result of the previous function is on the failure path, the new error is created to match generic result type, but the error details remain the same.
+        /// </summary>
+        /// <typeparam name="TFst">Type of the first output tuple value received from previous function.</typeparam>
+        /// <typeparam name="TSnd">Type of the second output tuple value received from previous function.</typeparam>
+        /// <typeparam name="TTrd">Type of the second output tuple value received from previous function.</typeparam>
+        /// <typeparam name="TOut">Type of the output value.</typeparam>
+        /// <param name="result">Output of previous function</param>
+        /// <param name="binder">Passes the output of first function to the next one.</param>
+        /// <returns>Result of the second function or error received from the first function.</returns>
         public static Result<TOut> Bind3<TOut, TFst, TSnd, TTrd>(this Result<(TFst fst, TSnd snd, TTrd trd)> result, Func<TFst, TSnd, TTrd, Result<TOut>> binder) =>
             result.IsOk ? binder(result.Value.fst, result.Value.snd, result.Value.trd) : Error<TOut>(result.Error);


Add not supported errors

Add not supported errors

--- MonoTouch/Xamarin.Mobile/Media/MediaPicker.cs
+++ MonoTouch/Xamarin.Mobile/Media/MediaPicker.cs
@@ -46,11 +46,19 @@

 		public Task<MediaFile> PickPhotoAsync()
 		{
+			if (!PhotosSupported)
+				throw new NotSupportedException();
+
 			return TakeMedia (UIImagePickerControllerSourceType.PhotoLibrary, TypeImage);
 		}

 		public Task<MediaFile> TakePhotoAsync (StoreCameraMediaOptions options)
 		{
+			if (!PhotosSupported)
+				throw new NotSupportedException();
+			if (!IsCameraAvailable)
+				throw new NotSupportedException();
+
 			VerifyCameraOptions (options);

 			return TakeMedia (UIImagePickerControllerSourceType.Camera, TypeImage, options);
@@ -58,11 +66,19 @@

 		public Task<MediaFile> PickVideoAsync()
 		{
+			if (!VideosSupported)
+				throw new NotSupportedException();
+
 			return TakeMedia (UIImagePickerControllerSourceType.PhotoLibrary, TypeMovie);
 		}

 		public Task<MediaFile> TakeVideoAsync (StoreVideoOptions options)
 		{
+			if (!VideosSupported)
+				throw new NotSupportedException();
+			if (!IsCameraAvailable)
+				throw new NotSupportedException();
+
 			VerifyCameraOptions (options);

 			return TakeMedia (UIImagePickerControllerSourceType.Camera, TypeMovie, options);


Use Task.CompletedTask

Use Task.CompletedTask

--- osu.Framework/Audio/AudioComponent.cs
+++ osu.Framework/Audio/AudioComponent.cs
@@ -28,7 +28,7 @@

             if (!acceptingActions)
                 // we don't want consumers to block on operations after we are disposed.
-                return Task.Run(() => { });
+                return Task.CompletedTask;

             PendingActions.Enqueue(task);
             return task;


Fix base call in Video

Fix base call in Video

--- osu.Framework/Graphics/Video/Video.cs
+++ osu.Framework/Graphics/Video/Video.cs
@@ -99,6 +99,7 @@
         /// <param name="stream">The video file stream.</param>
         /// <param name="startAtCurrentTime">Whether the current clock time should be assumed as the 0th video frame.</param>
         public Video([NotNull] Stream stream, bool startAtCurrentTime = true)
+            : base(startAtCurrentTime)
         {
             this.stream = stream ?? throw new ArgumentNullException(nameof(stream));
         }


Updated Myre.graphics version

Updated Myre.graphics version

Signed-off-by: Martin Evans <fbe68550a3878a44ead7fa06f7b29f9942900ad3@gmail.com>

--- Myre/Myre.Graphics/Properties/AssemblyInfo.cs
+++ Myre/Myre.Graphics/Properties/AssemblyInfo.cs
@@ -30,4 +30,4 @@
 //      Build Number
 //      Revision
 //
-[assembly: AssemblyVersion("3.11.0")]
+[assembly: AssemblyVersion("3.11.1m")]


Oops

Oops

--- osu.Framework/IO/Stores/GlyphStore.cs
+++ osu.Framework/IO/Stores/GlyphStore.cs
@@ -88,7 +88,7 @@

             Character c;

-            if (font.Characters.TryGetValue(name.Last(), out c))
+            if (!font.Characters.TryGetValue(name.Last(), out c))
                 return null;

             RawTexture page = getTexturePage(c.TexturePage);


Clean up DisplayMode struct

Clean up DisplayMode struct

--- osu.Framework/Platform/DisplayMode.cs
+++ osu.Framework/Platform/DisplayMode.cs
@@ -9,7 +9,7 @@
     /// <summary>
     /// Represents a display mode on a given <see cref="Display"/>.
     /// </summary>
-    public readonly struct DisplayMode : IEquatable<DisplayMode>
+    public readonly struct DisplayMode
     {
         /// <summary>
         /// The pixel format of the display mode, if available.
@@ -31,8 +31,14 @@
         /// </summary>
         public readonly int RefreshRate;

+        /// <summary>
+        /// The index of the display mode as determined by the windowing backend.
+        /// </summary>
         public readonly int Index;

+        /// <summary>
+        /// The index of the display this mode belongs to as determined by the windowing backend.
+        /// </summary>
         public readonly int DisplayIndex;

         public DisplayMode(string format, Size size, int bitsPerPixel, int refreshRate, int index, int displayIndex)
@@ -45,8 +51,6 @@
             DisplayIndex = displayIndex;
         }

-        public override string ToString() => $"Size: {Size}, BitsPerPixel: {BitsPerPixel}, RefreshRate: {RefreshRate}, Format: {Format}";
-
-        public bool Equals(DisplayMode other) => Index == other.Index && DisplayIndex == other.DisplayIndex;
+        public override string ToString() => $"Size: {Size}, BitsPerPixel: {BitsPerPixel}, RefreshRate: {RefreshRate}, Format: {Format}, Index: {Index}, DisplayIndex: {DisplayIndex}";
     }
 }


Update time ramp preview on setting change

--- osu.Game/Rulesets/Mods/ModTimeRamp.cs
+++ osu.Game/Rulesets/Mods/ModTimeRamp.cs
@@ -35,6 +35,12 @@

         private Track track;

+        public ModTimeRamp()
+        {
+            // for preview purpose at song select. eventually we'll want to be able to update every frame.
+            FinalRate.BindValueChanged(val => applyAdjustment(1), true);
+        }
+
         public void ApplyToTrack(Track track)
         {
             this.track = track;


Fix incorrect delay for non-theme music on "welcome" intro

--- osu.Game/Screens/Menu/IntroWelcome.cs
+++ osu.Game/Screens/Menu/IntroWelcome.cs
@@ -78,13 +78,17 @@
                     if (reverbChannel != null)
                         intro.LogoVisualisation.AddAmplitudeSource(reverbChannel);

+                    if (!UsingThemedIntro)
+                        StartTrack();
+
                     Scheduler.AddDelayed(() =>
                     {
-                        StartTrack();
-
-                        // this classic intro loops forever.
                         if (UsingThemedIntro)
+                        {
+                            StartTrack();
+                            // this classic intro loops forever.
                             Track.Looping = true;
+                        }

                         const float fade_in_time = 200;


* Updated SccStamp to ignore those SccAttribute where the Id is the unexpanded "$Id$" string, which will be the case to new and uncommitted sources.

--- src/Elmah/SccStamp.cs
+++ src/Elmah/SccStamp.cs
@@ -33,6 +33,7 @@

     using System;
     using System.Collections;
+    using System.Globalization;
     using System.Reflection;
     using System.Text.RegularExpressions;

@@ -131,7 +132,8 @@
             foreach (SccAttribute attribute in attributes)
             {
                 string id = attribute.Id.Trim();
-                if (id.Length > 0)
+
+                if (id.Length > 0 && string.Compare("$Id$", id, true, CultureInfo.InvariantCulture) != 0)
                     list.Add(new SccStamp(id));
             }


* Copy/SpaceBorder Fix attempt number 3, hopefully the last

--- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -421,10 +421,16 @@
                         //If there are no more geometries in the sub-space, we don't need it in the main space anymore
                         if (d.SpaceGetNumGeoms(((OdePrim)prim).m_targetSpace) == 0)
                         {
-                            d.SpaceRemove(space, ((OdePrim)prim).m_targetSpace);
-                            // free up memory used by the space.
-                            d.SpaceDestroy(((OdePrim)prim).m_targetSpace);
-                            resetSpaceArrayItemToZero(calculateSpaceArrayItemFromPos(((OdePrim)prim).Position));
+                            if (!(((OdePrim)prim).m_targetSpace.Equals(null)))
+                            {
+                                if (d.GeomIsSpace(((OdePrim)prim).m_targetSpace))
+                                {
+                                    d.SpaceRemove(space, ((OdePrim)prim).m_targetSpace);
+                                    // free up memory used by the space.
+                                    d.SpaceDestroy(((OdePrim)prim).m_targetSpace);
+                                    resetSpaceArrayItemToZero(calculateSpaceArrayItemFromPos(((OdePrim)prim).Position));
+                                }
+                            }
                         }
                     }

@@ -461,8 +467,8 @@
             {
                 if (d.SpaceQuery(currentspace, geom) && currentspace != (IntPtr)0)
                 {
-
-                    d.SpaceRemove(currentspace, geom);
+                    if (d.GeomIsSpace(currentspace))
+                        d.SpaceRemove(currentspace, geom);
                 }
                 else
                 {
@@ -481,10 +487,13 @@
                 {
                     if (currentspace != (IntPtr)0)
                     {
-                        d.SpaceRemove(space, currentspace);
-                        // free up memory used by the space.
-                        d.SpaceDestroy(currentspace);
-                        resetSpaceArrayItemToZero(currentspace);
+                        if (d.GeomIsSpace(currentspace))
+                        {
+                            d.SpaceRemove(space, currentspace);
+                            // free up memory used by the space.
+                            d.SpaceDestroy(currentspace);
+                            resetSpaceArrayItemToZero(currentspace);
+                        }
                     }
                 }
             }
@@ -503,7 +512,8 @@
                     {
                         if (sGeomIsIn != (IntPtr)0)
                         {
-                            d.SpaceRemove(sGeomIsIn, geom);
+                            if (d.GeomIsSpace(sGeomIsIn))
+                                   d.SpaceRemove(sGeomIsIn, geom);
                         }
                     }
                 }


added some POS gravity

added some POS gravity

--- OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
+++ OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
@@ -65,6 +65,7 @@
     {
         private List<POSActor> _actors = new List<POSActor>();
         private float[] _heightMap;
+        private const float gravity = -1.0f;

         public POSScene()
         {
@@ -119,8 +120,24 @@
         {
             foreach (POSActor actor in _actors)
             {
-                actor.Position.X = actor.Position.X + (actor.Velocity.X*timeStep);
-                actor.Position.Y = actor.Position.Y + (actor.Velocity.Y*timeStep);
+                actor.Position.X += actor.Velocity.X * timeStep;
+                actor.Position.Y += actor.Velocity.Y * timeStep;
+                actor.Position.Z += actor.Velocity.Z * timeStep;
+
+                if (!actor.Flying)
+                {
+                    actor.Velocity.Z += gravity;
+                }
+
+                if (actor.Position.X < 0)
+                {
+                    actor.Position.X = 0.1F;
+                }
+                else if (actor.Position.X > 256)
+                {
+                    actor.Position.X = 255.9F;
+                }
+
                 if (actor.Position.Y < 0)
                 {
                     actor.Position.Y = 0.1F;
@@ -130,32 +147,10 @@
                     actor.Position.Y = 255.9F;
                 }

-                if (actor.Position.X < 0)
-                {
-                    actor.Position.X = 0.1F;
-                }
-                else if (actor.Position.X > 256)
-                {
-                    actor.Position.X = 255.9F;
-                }
-
-                float height = _heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 1.0f;
-                if (actor.Flying)
-                {
-                    if (actor.Position.Z + (actor.Velocity.Z*timeStep) <
-                        _heightMap[(int) actor.Position.Y*256 + (int) actor.Position.X] + 2)
-                    {
-                        actor.Position.Z = height;
-                        actor.Velocity.Z = 0;
-                    }
-                    else
-                    {
-                        actor.Position.Z = actor.Position.Z + (actor.Velocity.Z*timeStep);
-                    }
-                }
-                else
-                {
-                    actor.Position.Z = height;
+                float terrainheight = _heightMap[(int) actor.Position.Y * 256 + (int) actor.Position.X];
+                if (actor.Position.Z + (actor.Velocity.Z * timeStep) < terrainheight + 2)
+                {
+                    actor.Position.Z = terrainheight + 1.0f;
                     actor.Velocity.Z = 0;
                 }
             }


Fix tests

Fix tests

--- src/EditorFeatures/CSharpTest/Formatting/FormattingEngineTests.cs
+++ src/EditorFeatures/CSharpTest/Formatting/FormattingEngineTests.cs
@@ -163,7 +163,7 @@

         [WorkItem(977133, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/977133")]
         [WpfFact, Trait(Traits.Feature, Traits.Features.Formatting)]
-        public async Task DoNotFormatRangeButFormatTokenOnOpenBrace()
+        public async Task DoNotFormatRangeOrFormatTokenOnOpenBraceOnSameLine()
         {
             var code = @"class C
 {
@@ -176,7 +176,30 @@
 {
     public void M()
     {
-        if (true) {
+        if (true)        {
+    }
+}";
+            await AssertFormatAfterTypeCharAsync(code, expected);
+        }
+
+        [WorkItem(14491, "https://github.com/dotnet/roslyn/pull/14491")]
+        [WpfFact, Trait(Traits.Feature, Traits.Features.Formatting)]
+        public async Task DoNotFormatRangeButFormatTokenOnOpenBraceOnNextLine()
+        {
+            var code = @"class C
+{
+    public void M()
+    {
+        if (true)
+            {$$
+    }
+}";
+            var expected = @"class C
+{
+    public void M()
+    {
+        if (true)
+        {
     }
 }";
             await AssertFormatAfterTypeCharAsync(code, expected);


Fix NullReferenceException in GetSuggestedActionCategoriesAsync

--- src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
+++ src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs
@@ -623,6 +623,17 @@
                 }

                 var provider = _owner;
+
+                // The _owner flag is cleared on Dispose. This should only occur when cancellation has already been
+                // requested, but at least in 16.8 Preview 3.0 it was not always the case.
+                cancellationToken.ThrowIfCancellationRequested();
+                //Assumes.Present(provider);
+                if (provider is null)
+                {
+                    // The object was unexpectedly disposed while still in use (caller error)
+                    return null;
+                }
+
                 using var asyncToken = provider.OperationListener.BeginAsyncOperation(nameof(GetSuggestedActionCategoriesAsync));
                 var document = range.Snapshot.GetOpenDocumentInCurrentContextWithChanges();
                 if (document == null)


Fix MySqlQuoterTest  quote value char

Fix MySqlQuoterTest  quote value char

--- src/FluentMigrator.Tests/Unit/Generators/MySql/MySqlQuoterTest.cs
+++ src/FluentMigrator.Tests/Unit/Generators/MySql/MySqlQuoterTest.cs
@@ -30,7 +30,7 @@
         public void TimeSpanIsFormattedQuotes()
         {
             quoter.QuoteValue(new TimeSpan(1,2, 13, 65))
-                .ShouldBe("`26:14:05`");
+                .ShouldBe("'26:14:05'");
         }
     }
 }


Removed unused using.

Removed unused using.

--- src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs
+++ src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs
@@ -1,9 +1,7 @@
 using System;
-using ICU4NET;

 namespace Lucene.Net.Analysis.Util
 {
-
     /*
      * Licensed to the Apache Software Foundation (ASF) under one or more
      * contributor license agreements.  See the NOTICE file distributed with


Lucene.Net.Analysis.Util.OpenStringBuilder: Added WritableArray attribute to Array property

--- src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs
+++ src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs
@@ -57,7 +57,8 @@
             this.len = end;
         }

-        public virtual char[] Array // LUCENENET TODO: change to GetArray()
+        [WritableArray]
+        public virtual char[] Array
         {
             get
             {


restore same public api of xaml loader before portable.xaml

--- src/Markup/Avalonia.Markup.Xaml/AvaloniaXamlLoaderPortableXaml.cs
+++ src/Markup/Avalonia.Markup.Xaml/AvaloniaXamlLoaderPortableXaml.cs
@@ -105,7 +105,7 @@
                         initialize?.BeginInit();
                         try
                         {
-                            return Load(stream, type, rootInstance, uri);
+                            return Load(stream, rootInstance, uri);
                         }
                         finally
                         {
@@ -143,7 +143,7 @@

             using (var stream = assetLocator.Open(uri, baseUri))
             {
-                return Load(stream, null, rootInstance, uri);
+                return Load(stream, rootInstance, uri);
             }
         }

@@ -155,13 +155,13 @@
         /// The optional instance into which the XAML should be loaded.
         /// </param>
         /// <returns>The loaded object.</returns>
-        public object Load(string xaml, Type type = null, object rootInstance = null)
+        public object Load(string xaml, object rootInstance = null)
         {
             Contract.Requires<ArgumentNullException>(xaml != null);

             using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(xaml)))
             {
-                return Load(stream, type, rootInstance);
+                return Load(stream, rootInstance);
             }
         }

@@ -174,7 +174,7 @@
         /// </param>
         /// <param name="uri">The URI of the XAML</param>
         /// <returns>The loaded object.</returns>
-        public object Load(Stream stream, Type type = null, object rootInstance = null, Uri uri = null)
+        public object Load(Stream stream, object rootInstance = null, Uri uri = null)
         {
             try
             {
@@ -185,10 +185,7 @@

                 var readerSettings = new XamlXmlReaderSettings();

-                if (rootInstance != null && type == null)
-                {
-                    type = rootInstance.GetType();
-                }
+                Type type = rootInstance?.GetType();

                 if (type != null)
                 {


softening more tests

softening more tests

--- src/Marten.Testing/Schema/DocumentMapping_schema_patch_writing.cs
+++ src/Marten.Testing/Schema/DocumentMapping_schema_patch_writing.cs
@@ -115,6 +115,7 @@
                 patch.RollbackDDL.ShouldContain("CREATE INDEX mt_doc_user_idx_user_name ON");
                 patch.RollbackDDL.ShouldContain("mt_doc_user USING btree (user_name);");

+
             }
         }


Missing virtual keywords on ExceptionFilterAttribute's OnException & OnExceptionAsync methods #552.

--- src/Microsoft.AspNet.Mvc.Core/Filters/ExceptionFilterAttribute.cs
+++ src/Microsoft.AspNet.Mvc.Core/Filters/ExceptionFilterAttribute.cs
@@ -12,13 +12,13 @@
         public int Order { get; set; }

         #pragma warning disable 1998
-        public async Task OnExceptionAsync([NotNull] ExceptionContext context)
+        public virtual async Task OnExceptionAsync([NotNull] ExceptionContext context)
         {
             OnException(context);
         }
         #pragma warning restore 1998

-        public void OnException([NotNull] ExceptionContext context)
+        public virtual void OnException([NotNull] ExceptionContext context)
         {
         }
     }


continue to fix report toc metadata dependency perf (#1385)

* continue to fix report toc metadata dependency perf

* resolve comments

--- src/Microsoft.DocAsCode.Build.TableOfContents/BuildTocDocument.cs
+++ src/Microsoft.DocAsCode.Build.TableOfContents/BuildTocDocument.cs
@@ -8,8 +8,8 @@
     using System.Collections.Generic;
     using System.Collections.Immutable;
     using System.Composition;
-    using System.IO;
     using System.Linq;
+    using System.Threading.Tasks;

     using Microsoft.DocAsCode.Build.Common;
     using Microsoft.DocAsCode.Common;
@@ -242,7 +242,7 @@
             parallelism);

             // handle not-in-toc items
-            UpdateNearestTocForNotInTocItem(models, host, nearest);
+            UpdateNearestTocForNotInTocItem(models, host, nearest, parallelism);

             foreach (var item in nearest)
             {
@@ -287,27 +287,30 @@
             }
         }

-        private void UpdateNearestTocForNotInTocItem(ImmutableList<FileModel> models, IHostService host, ConcurrentDictionary<string, Toc> nearest)
+        private void UpdateNearestTocForNotInTocItem(ImmutableList<FileModel> models, IHostService host, ConcurrentDictionary<string, Toc> nearest, int parallelism)
         {
             var allSourceFiles = host.SourceFiles;
-            foreach (var item in allSourceFiles.Keys.Except(nearest.Keys).ToList())
-            {
-                var itemOutputFile = GetOutputPath(allSourceFiles[item]);
-                var near = (from m in models
-                            let outputFile = GetOutputPath(m.FileAndType)
-                            let rel = outputFile.MakeRelativeTo(itemOutputFile)
-                            where rel.SubdirectoryCount == 0
-                            orderby rel.ParentDirectoryCount
-                            select new Toc
-                            {
-                                Model = m,
-                                OutputPath = rel,
-                            }).FirstOrDefault();
-                if (near != null)
-                {
-                    nearest[item] = near;
-                }
-            }
+            Parallel.ForEach(
+                allSourceFiles.Keys.Except(nearest.Keys, FilePathComparer.OSPlatformSensitiveStringComparer).ToList(),
+                new ParallelOptions { MaxDegreeOfParallelism = parallelism },
+                item =>
+                {
+                    var itemOutputFile = GetOutputPath(allSourceFiles[item]);
+                    var near = (from m in models
+                                let outputFile = GetOutputPath(m.FileAndType)
+                                let rel = outputFile.MakeRelativeTo(itemOutputFile)
+                                where rel.SubdirectoryCount == 0
+                                orderby rel.ParentDirectoryCount
+                                select new Toc
+                                {
+                                    Model = m,
+                                    OutputPath = rel,
+                                }).FirstOrDefault();
+                    if (near != null)
+                    {
+                        nearest[item] = near;
+                    }
+                });
         }

         private void UpdateNearestTocCore(IHostService host, string item, FileModel toc, ConcurrentDictionary<string, Toc> nearest)


updated diagnostics - reported names and spans

--- src/Peachpie.CodeAnalysis/FlowAnalysis/Passes/DiagnosticWalker.cs
+++ src/Peachpie.CodeAnalysis/FlowAnalysis/Passes/DiagnosticWalker.cs
@@ -822,25 +822,37 @@
             return name;
         }

-        void CheckObsoleteSymbol(LangElement node, Symbol target, bool isMemberCall)
+        static TextSpan GetMemberNameSpanForDiagnostic(LangElement node)
+        {
+            if (node is FunctionCall fnc)
+            {
+                return fnc.NameSpan.ToTextSpan();
+            }
+            else
+            {
+                return node.Span.ToTextSpan();
+            }
+        }
+
+        void CheckObsoleteSymbol(LangElement syntax, Symbol target, bool isMemberCall)
         {
             var obsolete = target?.ObsoleteAttributeData;
             if (obsolete != null)
             {
-                _diagnostics.Add(_routine, node, ErrorCode.WRN_SymbolDeprecated, target.Kind.ToString(), GetMemberNameForDiagnostic(target, isMemberCall), obsolete.Message);
+                _diagnostics.Add(_routine, GetMemberNameSpanForDiagnostic(syntax), ErrorCode.WRN_SymbolDeprecated, target.Kind.ToString(), GetMemberNameForDiagnostic(target, isMemberCall), obsolete.Message);
             }
         }

         private void CheckUndefinedFunctionCall(BoundGlobalFunctionCall x)
         {
-            if (x.Name.IsDirect && x.TargetMethod.IsErrorMethodOrNull())
-            {
-                var errmethod = (ErrorMethodSymbol)x.TargetMethod;
-                if (errmethod != null && errmethod.ErrorKind == ErrorMethodKind.Missing)
-                {
-                    var span = x.PhpSyntax is FunctionCall fnc ? fnc.NameSpan : x.PhpSyntax.Span;
-                    _diagnostics.Add(_routine, span.ToTextSpan(), ErrorCode.WRN_UndefinedFunctionCall, x.Name.NameValue.ToString());
-                }
+            if (x.Name.IsDirect &&
+                x.TargetMethod is ErrorMethodSymbol errmethod && errmethod.ErrorKind == ErrorMethodKind.Missing)
+            {
+                var originalName = (x.PhpSyntax is DirectFcnCall fnc)
+                    ? fnc.FullName.OriginalName
+                    : x.Name.NameValue;
+
+                _diagnostics.Add(_routine, GetMemberNameSpanForDiagnostic(x.PhpSyntax), ErrorCode.WRN_UndefinedFunctionCall, originalName.ToString());
             }
         }


Raj fixed route integration unit test

Raj fixed route integration unit test

--- src/StockportWebapp/Views/healthystockport/StartPage/Index.cshtml
+++ src/StockportWebapp/Views/healthystockport/StartPage/Index.cshtml
@@ -6,9 +6,9 @@
     ViewData["og:title"] =  Model.Title;
 }

-@section BackgroundImage {
+@*@section BackgroundImage {
     style="background-image:url('@Model.BackgroundImage')"
-}
+}*@

 @Html.Partial("DisplayTemplates/Gutter", Model.Icon)
 <section aria-label="@Model.Title content" class="grid-90 mobile-grid-100">


Fails/Succeeds(Once or Twice or Times(3) or Always) now works as expected

--- src/Tests/Framework/VirtualClustering/VirtualClusterConnection.cs
+++ src/Tests/Framework/VirtualClustering/VirtualClusterConnection.cs
@@ -14,7 +14,7 @@
 	public class VirtualClusterConnection : InMemoryConnection
 	{
 		private static readonly object _lock = new object();
-		private class State { public int Pinged = 0; public int Sniffed = 0; public int Called = 0; }
+		private class State { public int Pinged = 0; public int Sniffed = 0; public int Called = 0; public int Successes = 0; public int Failures = 0; }
 		private IDictionary<int, State> Calls = new Dictionary<int, State> { };

 		private VirtualCluster _cluster;
@@ -75,29 +75,61 @@
 			Func<byte[]> successResponse
 			) where TReturn : class where TRule : IRule
 		{
+			var state = this.Calls[requestData.Uri.Port];
 			foreach (var rule in rules.Where(s => s.OnPort.HasValue))
 			{
+				var always = rule.Times.Match(t => true, t => false);
+				var times = rule.Times.Match(t => -1, t => t);
 				if (rule.OnPort.Value == requestData.Uri.Port)
 				{
-					if (rule.Succeeds)
-					{
-						beforeReturn?.Invoke(rule);
-						return this.ReturnConnectionStatus<TReturn>(requestData, successResponse());
-					}
-					throw new ElasticsearchException(PipelineFailure.BadResponse, (Exception)null);
+					if (always)
+						return rule.Succeeds
+							? Success<TReturn, TRule>(requestData, beforeReturn, successResponse, rule)
+							: Fail<TReturn>(requestData);
+
+					return Sometimes<TReturn, TRule>(requestData, beforeReturn, successResponse, state, rule, times);
 				}
 			}
 			foreach (var rule in rules.Where(s => !s.OnPort.HasValue))
 			{
-				//is a rule describing always
-				if (!rule.Times.Match(t => true, t => false)) continue;
-				if (rule.Succeeds)
-				{
-					beforeReturn?.Invoke(rule);
-					return this.ReturnConnectionStatus<TReturn>(requestData, successResponse());
-				}
-				throw new ElasticsearchException(PipelineFailure.BadResponse, (Exception)null);
+				var always = rule.Times.Match(t => true, t => false);
+				var times = rule.Times.Match(t => -1, t => t);
+				if (always)
+					return rule.Succeeds
+						? Success<TReturn, TRule>(requestData, beforeReturn, successResponse, rule)
+						: Fail<TReturn>(requestData);
+				return Sometimes<TReturn, TRule>(requestData, beforeReturn, successResponse, state, rule, times);
 			}
+			return this.ReturnConnectionStatus<TReturn>(requestData, successResponse());
+		}
+
+		private ElasticsearchResponse<TReturn> Sometimes<TReturn, TRule>(RequestData requestData, Action<TRule> beforeReturn, Func<byte[]> successResponse, State state, TRule rule, int times)
+			where TReturn : class
+			where TRule : IRule
+		{
+			if (rule.Succeeds && times >= state.Successes)
+				return Success<TReturn, TRule>(requestData, beforeReturn, successResponse, rule);
+			else if (rule.Succeeds) return Fail<TReturn>(requestData);
+
+			if (!rule.Succeeds && times >= state.Failures)
+				return Fail<TReturn>(requestData);
+			return Success<TReturn, TRule>(requestData, beforeReturn, successResponse, rule);
+		}
+
+		private ElasticsearchResponse<TReturn> Fail<TReturn>(RequestData requestData)
+		{
+			var state = this.Calls[requestData.Uri.Port];
+			var failed = Interlocked.Increment(ref state.Failures);
+			throw new ElasticsearchException(PipelineFailure.BadResponse, (Exception)null);
+		}
+
+		private ElasticsearchResponse<TReturn> Success<TReturn, TRule>(RequestData requestData, Action<TRule> beforeReturn, Func<byte[]> successResponse, TRule rule)
+			where TReturn : class
+			where TRule : IRule
+		{
+			var state = this.Calls[requestData.Uri.Port];
+			var succeeded = Interlocked.Increment(ref state.Successes);
+			beforeReturn?.Invoke(rule);
 			return this.ReturnConnectionStatus<TReturn>(requestData, successResponse());
 		}


prova fix coordinate centro mappa

prova fix coordinate centro mappa

--- src/backend/SO115App.Persistence.MongoDB/Marker/GetCentroMappa.cs
+++ src/backend/SO115App.Persistence.MongoDB/Marker/GetCentroMappa.cs
@@ -15,9 +15,8 @@
         {
             var coordinate = _service.Get(codiceSede);

-            //coordinate.Latitudine = Convert.ToDouble(coordinate.Latitudine.ToString().Replace('.',','));
-            //coordinate.Longitudine = Convert.ToDouble(coordinate.Longitudine.ToString().Replace('.', ','));
-
+            coordinate.Latitudine = double.Parse(coordinate.Latitudine.ToString().Replace('.', ','));
+            coordinate.Longitudine = double.Parse(coordinate.Longitudine.ToString().Replace('.', ','));

             var centroMappa = new CentroMappa()
             {


Adjustet test GetGroupByName

Adjustet test GetGroupByName

--- src/biz.dfch.CS.Osram.Lightify.Client.Tests/ClientGetGroupTest.cs
+++ src/biz.dfch.CS.Osram.Lightify.Client.Tests/ClientGetGroupTest.cs
@@ -61,7 +61,26 @@
                 SecurityToken = Constants.SECURITY_TOKEN
             };

-            string response = @"
+            string responseFirstMock = @"
+                [{
+	                ""groupId"": 1,
+	                ""name"": ""testgroup"",
+	                ""devices"": [2,
+	                1],
+	                ""scenes"": {
+
+	                }
+                },
+                {
+	                ""groupId"": 2,
+	                ""name"": ""Third Lamp"",
+	                ""devices"": [3],
+	                ""scenes"": {
+
+	                }
+                }]";
+
+            string responseSecondMock = @"
                             {
 	            ""groupId"": 1,
 	            ""name"": ""testgroup"",
@@ -75,8 +94,12 @@
             var restCallExecutor = Mock.Create<RestCallExecutor>();
             Mock.Arrange(() => restCallExecutor.Invoke(HttpMethod.Get, Arg.AnyString, Arg.IsAny<Dictionary<string, string>>(), ""))
                 .IgnoreInstance()
-                .Returns(response)
-                .OccursOnce();
+                .Returns(responseFirstMock)
+                .InSequence();
+            Mock.Arrange(() => restCallExecutor.Invoke(HttpMethod.Get, Arg.AnyString, Arg.IsAny<Dictionary<string, string>>(), ""))
+                            .IgnoreInstance()
+                            .Returns(responseSecondMock)
+                            .InSequence();

             var result = sut.GetGroupByName("testgroup");


Once again set DefaultBlendState-SourceAlphaBlend (this time to One)

--- Core/Rendering/BaseRenderer.cs
+++ Core/Rendering/BaseRenderer.cs
@@ -557,7 +557,7 @@
                     blendStateDescription.RenderTarget[0].SourceBlend = BlendOption.SourceAlpha;
                     blendStateDescription.RenderTarget[0].DestinationBlend = BlendOption.InverseSourceAlpha;
                     blendStateDescription.RenderTarget[0].BlendOperation = BlendOperation.Add;
-                    blendStateDescription.RenderTarget[0].SourceAlphaBlend = BlendOption.SourceAlpha;
+                    blendStateDescription.RenderTarget[0].SourceAlphaBlend = BlendOption.One;
                     blendStateDescription.RenderTarget[0].DestinationAlphaBlend = BlendOption.InverseSourceAlpha;
                     blendStateDescription.RenderTarget[0].AlphaBlendOperation = BlendOperation.Add;
                     blendStateDescription.RenderTarget[0].RenderTargetWriteMask = ColorWriteMaskFlags.All;


cleanup

cleanup

--- Crypto/openpgp/PgpPublicKey.cs
+++ Crypto/openpgp/PgpPublicKey.cs
@@ -611,12 +611,12 @@
         /// <returns>
         /// The re-certified key.
         /// </returns>
-        public static PgpPublicKey AddCertification(IPgpPublicKey key, IPgpUserAttributeSubpacketVector userAttributes, PgpSignature certification)
+        public static PgpPublicKey AddCertification(IPgpPublicKey key, IPgpUserAttributeSubpacketVector userAttributes, IPgpSignature certification)
         {
             return AddCert(key, userAttributes, certification);
         }

-        private static PgpPublicKey AddCert(IPgpPublicKey key, object id, PgpSignature certification)
+        private static PgpPublicKey AddCert(IPgpPublicKey key, object id, IPgpSignature certification)
         {
             var returnKey = new PgpPublicKey(key);
             IList<IPgpSignature> sigList = null;


Update BigQueryParameter.cs

Update BigQueryParameter.cs

--- BigQueryProvider/BigQueryParameter.cs
+++ BigQueryProvider/BigQueryParameter.cs
@@ -7,18 +7,18 @@
         BigQueryDbType? bigQueryDbType;
         DbType? dbType;
         object value;
-        ParameterDirection direction = ParameterDirection.Input;
+        ParameterDirection direction;

         public BigQueryParameter() {
             ResetDbType();
         }

-        public BigQueryParameter(string parameterName, object value) {
+        public BigQueryParameter(string parameterName, object value) : this() {
             ParameterName = parameterName;
             Value = value;
         }

-        public BigQueryParameter(string parameterName, DbType dbType) {
+        public BigQueryParameter(string parameterName, DbType dbType) : this() {
             ParameterName = parameterName;
             DbType = dbType;
         }
@@ -28,7 +28,7 @@
             SourceColumn = sourceColumn;
         }

-        public BigQueryParameter(string parameterName, BigQueryDbType bigQueryDbType) {
+        public BigQueryParameter(string parameterName, BigQueryDbType bigQueryDbType) : this() {
             ParameterName = parameterName;
             BigQueryDbType = bigQueryDbType;
         }
@@ -71,7 +71,6 @@
             set {
                 if (value != ParameterDirection.Input)
                     throw new ArgumentOutOfRangeException("value", value, "Only input parameters are supported.");
-                direction = value;
             }
         }


Actually use the changed text while processing the message....

--- Bot/Controllers/MessagesController.cs
+++ Bot/Controllers/MessagesController.cs
@@ -95,7 +95,7 @@
                                 if (text.Contains("</at>") && activity.ChannelId == "msteams")
                                 {
                                     // ignore the mention of us in the reply
-                                    activity.AsMessageActivity().Text = new Regex("<at>.*</at>").Replace(text, "").Trim();
+                                    text = new Regex("<at>.*</at>").Replace(text, "").Trim();
                                 }

                                 if (activity.ChannelId == "slack")
@@ -134,6 +134,8 @@
                                         Trace.WriteLine($"  Modified Conversation: {activity.Conversation.ConversationType}, id: {activity.Conversation.Id}, name: {activity.Conversation.Name}, role: {activity.Conversation.Role}, properties: {activity.Conversation.Properties}");
                                     }
                                 }
+
+                                activity.AsMessageActivity().Text = text;

                                 Trace.WriteLine($"Processing message: '{text}' from {activity.From.Id}/{activity.From.Name} on {activity.ChannelId}/{activity.Conversation.IsGroup.GetValueOrDefault()}");
                                 await Conversation.SendAsync(activity, () => new ExceptionHandlerDialog<object>(new BotDialog(Request.GetRequestUri()), true));


Added method OandaSymbolMapper.GetCompressedRawOandaDataFileName()

--- Brokerages/Oanda/OandaSymbolMapper.cs
+++ Brokerages/Oanda/OandaSymbolMapper.cs
@@ -945,5 +945,19 @@
             return leanSymbol.Insert(leanSymbol.Length - 3, "_");
         }

+        /// <summary>
+        /// Get the raw oanda file paths
+        /// </summary>
+        /// <param name="symbol">The symbol that is being patched</param>
+        /// <param name="date">The date that is being patched</param>
+        /// <returns>The oath to the oanda raw file</returns>
+        public static string GetCompressedRawOandaDataFileName(Symbol symbol, DateTime date)
+        {
+            var symbolMapper = new OandaSymbolMapper();
+            var brokerateSymbol = symbolMapper.GetBrokerageSymbol(symbol);
+            var rawFileName = "oanda_ticks_" + brokerateSymbol + "_" + date.ToString("yyyyMMdd") + ".txt.gz";
+
+            return rawFileName;
+        }
     }
 }


Sort it so people with big lists can find them easier

Closes #427

--- Purchasing.Mvc/Controllers/OrderController.cs
+++ Purchasing.Mvc/Controllers/OrderController.cs
@@ -2104,8 +2104,8 @@
                 Vendors = _repositoryFactory.WorkgroupVendorRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id && x.IsActive).OrderBy(a => a.Name).ToList(),
                 Addresses = _repositoryFactory.WorkgroupAddressRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id && x.IsActive).ToList(),
                 ShippingTypes = _repositoryFactory.ShippingTypeRepository.Queryable.Cache().ToList(),
-                Approvers = _repositoryFactory.WorkgroupPermissionRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id && x.Role.Id == Role.Codes.Approver && !x.IsAdmin).Select(x => x.User).ToList(),
-                AccountManagers = _repositoryFactory.WorkgroupPermissionRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id && x.Role.Id == Role.Codes.AccountManager && !x.IsAdmin).Select(x => x.User).ToList(),
+                Approvers = _repositoryFactory.WorkgroupPermissionRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id && x.Role.Id == Role.Codes.Approver && !x.IsAdmin).Select(x => x.User).OrderBy(a => a.LastName).ThenBy(a => a.FirstName).ToList(),
+                AccountManagers = _repositoryFactory.WorkgroupPermissionRepository.Queryable.Where(x => x.Workgroup.Id == workgroup.Id && x.Role.Id == Role.Codes.AccountManager && !x.IsAdmin).Select(x => x.User).OrderBy(a => a.LastName).ThenBy(a => a.FirstName).ToList(),
                 ConditionalApprovals = workgroup.AllConditionalApprovals,
                 CustomFields = _repositoryFactory.CustomFieldRepository.Queryable.Where(x => x.Organization.Id == workgroup.PrimaryOrganization.Id && x.IsActive).ToList() //call to list to exec the future batch
             };


Fix MultipleRuntimesTest.SingleBenchmarkCanBeExecutedForMultpleRuntimes

--- tests/BenchmarkDotNet.IntegrationTests/MultipleRuntimesTest.cs
+++ tests/BenchmarkDotNet.IntegrationTests/MultipleRuntimesTest.cs
@@ -51,8 +51,8 @@
                 .ExecuteResults
                 .Any());

-            Assert.Contains("Clr", summary.AllRuntimes);
-            Assert.Contains("Core", summary.AllRuntimes);
+            Assert.Contains(".NET Framework", summary.AllRuntimes);
+            Assert.Contains(".NET Core", summary.AllRuntimes);
         }
     }


Simplified code.

Simplified code.

--- ReClass.NET/CodeGenerator/CppCodeGenerator.cs
+++ ReClass.NET/CodeGenerator/CppCodeGenerator.cs
@@ -6,7 +6,6 @@
 using ReClassNET.Extensions;
 using ReClassNET.Logger;
 using ReClassNET.Nodes;
-using ReClassNET.Util;

 namespace ReClassNET.CodeGenerator
 {
@@ -117,7 +116,7 @@
 			return sb.ToString();
 		}

-		private IEnumerable<ClassNode> OrderByInheritance(IEnumerable<ClassNode> classes)
+		private static IEnumerable<ClassNode> OrderByInheritance(IEnumerable<ClassNode> classes)
 		{
 			Contract.Requires(classes != null);
 			Contract.Requires(Contract.ForAll(classes, c => c != null));
@@ -128,7 +127,7 @@
 			return classes.SelectMany(c => YieldReversedHierarchy(c, alreadySeen)).Distinct();
 		}

-		private IEnumerable<ClassNode> YieldReversedHierarchy(ClassNode node, HashSet<ClassNode> alreadySeen)
+		private static IEnumerable<ClassNode> YieldReversedHierarchy(ClassNode node, ISet<ClassNode> alreadySeen)
 		{
 			Contract.Requires(node != null);
 			Contract.Requires(alreadySeen != null);
@@ -187,9 +186,9 @@

 					yield return new MemberDefinition(member, type, count);
 				}
-				else if (member is BitFieldNode)
-				{
-					switch (((BitFieldNode)member).Bits)
+				else if (member is BitFieldNode bitFieldNode)
+				{
+					switch (bitFieldNode.Bits)
 					{
 						case 8:
 							type = Program.Settings.TypeUInt8;
@@ -205,27 +204,23 @@
 							break;
 					}

-					yield return new MemberDefinition(member, type);
-				}
-				else if (member is ClassInstanceArrayNode)
-				{
-					var instanceArray = (ClassInstanceArrayNode)member;
-
-					yield return new MemberDefinition(member, instanceArray.InnerNode.Name, instanceArray.Count);
-				}
-				else if (member is ClassInstanceNode)
-				{
-					yield return new MemberDefinition(member, ((ClassInstanceNode)member).InnerNode.Name);
-				}
-				else if (member is ClassPtrArrayNode)
-				{
-					var ptrArray = (ClassPtrArrayNode)member;
-
-					yield return new MemberDefinition(member, $"class {ptrArray.InnerNode.Name}*", ptrArray.Count);
-				}
-				else if (member is ClassPtrNode)
-				{
-					yield return new MemberDefinition(member, $"class {((ClassPtrNode)member).InnerNode.Name}*");
+					yield return new MemberDefinition(bitFieldNode, type);
+				}
+				else if (member is ClassInstanceArrayNode classInstanceArrayNode)
+				{
+					yield return new MemberDefinition(classInstanceArrayNode, classInstanceArrayNode.InnerNode.Name, classInstanceArrayNode.Count);
+				}
+				else if (member is ClassInstanceNode classInstanceNode)
+				{
+					yield return new MemberDefinition(classInstanceNode, classInstanceNode.InnerNode.Name);
+				}
+				else if (member is ClassPtrArrayNode ptrArrayNode)
+				{
+					yield return new MemberDefinition(ptrArrayNode, $"class {ptrArrayNode.InnerNode.Name}*", ptrArrayNode.Count);
+				}
+				else if (member is ClassPtrNode classPtrNode)
+				{
+					yield return new MemberDefinition(classPtrNode, $"class {classPtrNode.InnerNode.Name}*");
 				}
 				else
 				{
@@ -247,7 +242,7 @@
 			}
 		}

-		private string MemberDefinitionToString(MemberDefinition member)
+		private static string MemberDefinitionToString(MemberDefinition member)
 		{
 			Contract.Requires(member != null);


Replaced expensive call to DocumentSession.Advanced.HasChanges with simple boolean flag.

--- Regalo.RavenDB/DelayedWriteRavenEventStore.cs
+++ Regalo.RavenDB/DelayedWriteRavenEventStore.cs
@@ -13,6 +13,7 @@
     {
         private readonly IVersionHandler _versionHandler;

+        private bool _hasChanges;
         private IDocumentSession _documentSession;

         public DelayedWriteRavenEventStore(IDocumentStore documentStore, IVersionHandler versionHandler)
@@ -31,6 +32,8 @@
             _documentSession.Store(stream);

             SetRavenCollectionName(events, _documentSession, stream);
+
+            _hasChanges = true;
         }

         public void Update(Guid aggregateId, IEnumerable<object> events)
@@ -45,11 +48,14 @@
             }

             stream.Append(events);
+
+            _hasChanges = true;
         }

         public void Flush()
         {
             _documentSession.SaveChanges();
+            _hasChanges = false;
         }

         private static void SetRavenCollectionName(IEnumerable<object> events, IDocumentSession session, EventStream stream)
@@ -88,7 +94,7 @@
         {
             var events = Load(aggregateId).ToList();

-            if (!events.Any(x => _versionHandler.GetVersion(x) == maxVersion))
+            if (events.All(x => _versionHandler.GetVersion(x) != maxVersion))
             {
                 throw new ArgumentOutOfRangeException(
                     "maxVersion",
@@ -114,7 +120,7 @@
         {
             if (_documentSession != null)
             {
-                if (_documentSession.Advanced.HasChanges)
+                if (_hasChanges)
                 {
                     throw new InvalidOperationException("Disposing a delayed-write event store with pending changes. Be sure to call Flush() when all operations are completed.");
                 }


changed offset regex to capture shortcut and background-position

--- RequestReduce/Reducer/BackgroungImageClass.cs
+++ RequestReduce/Reducer/BackgroungImageClass.cs
@@ -30,7 +30,7 @@
     public class BackgroungImageClass
     {
         private static readonly Regex imageUrlPattern = new Regex(@"background(-image)?:[\s\w]*url[\s]*\([\s]*(?<url>[^\)]*)[\s]*\)[^;]*;", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
-        private static readonly Regex shortcutOffsetPattern = new Regex(@"background:[\s\w]*url[\s]*\([^\)]*\)[\s]+(?:[\-a-z]+[\s]+)?(?<offset1>right|left|bottom|top|center|(?:\-?\d+(?:%|px|in|cm|mm|em|ex|pt|pc)?))[\s;](?:(?<offset2>right|left|bottom|top|center|(?:\-?\d+(?:%|px|in|cm|mm|em|ex|pt|pc)?))[\s;])?", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
+        private static readonly Regex offsetPattern = new Regex(@"background(?:-position)?:(?:.*?)(?<offset1>right|left|bottom|top|center|(?:\-?\d+(?:%|px|in|cm|mm|em|ex|pt|pc)?))[\s;](?:(?<offset2>right|left|bottom|top|center|(?:\-?\d+(?:%|px|in|cm|mm|em|ex|pt|pc)?))[\s;])?", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
         private static readonly Regex repeatPattern = new Regex(@"\b((x-)|(y-)|(no-))?repeat\b", RegexOptions.Compiled | RegexOptions.IgnoreCase);
         private static readonly Regex widthPattern = new Regex(@"\b(max-)?width:[\s]*(?<width>[0-9]+)(px)?[\s]*;", RegexOptions.Compiled | RegexOptions.IgnoreCase);
         private static readonly Regex heightPattern = new Regex(@"\b(max-)?height:[\s]*(?<height>[0-9]+)(px)?[\s]*;", RegexOptions.Compiled | RegexOptions.IgnoreCase);
@@ -55,7 +55,7 @@
             var heightMatch = heightPattern.Matches(originalClassString);
             if (heightMatch.Count > 0)
                 Height = Int32.Parse(heightMatch[heightMatch.Count - 1].Groups["height"].Value);
-            var offsetMatch = shortcutOffsetPattern.Match(originalClassString);
+            var offsetMatch = offsetPattern.Match(originalClassString);
             if (offsetMatch.Success)
             {
                 var offset1 = offsetMatch.Groups["offset1"].Value;


IoC optim perfom

IoC optim perfom

--- DevTeam.Patterns.IoC/Binder.cs
+++ DevTeam.Patterns.IoC/Binder.cs
@@ -64,22 +64,32 @@
         private static ConstructorInfo GetConstructor(Type implementationType)
         {
             var implementationTypeInfo = implementationType.GetTypeInfo();
-            var resolvingConstructor = implementationTypeInfo.DeclaredConstructors.SingleOrDefault();
-            if (resolvingConstructor == null)
-            {
-                resolvingConstructor = (
+            var ctorCount = implementationTypeInfo.DeclaredConstructors.Count();
+            if (ctorCount == 1)
+            {
+                return implementationTypeInfo.DeclaredConstructors.First();
+            }
+
+            try
+            {
+                var resolvingConstructor = (
                     from ctor in implementationTypeInfo.DeclaredConstructors
                     let resolverAttribute = ctor.GetCustomAttribute<ResolverAttribute>()
                     where resolverAttribute != null
                     select ctor).SingleOrDefault();

-                if (resolvingConstructor == null)
+                if (resolvingConstructor != null)
                 {
-                    throw new InvalidOperationException("Resolving constructor was not found or there are many resolving constructors.");
+                    return resolvingConstructor;
                 }
             }
-
-            return resolvingConstructor;
+            catch (InvalidOperationException)
+            {
+                throw new InvalidOperationException("Too many resolving constructors.");
+            }
+
+
+            throw new InvalidOperationException("Resolving constructor was not found.");
         }

         private CtorInfo GetCtorInfo(Type stateType, ConstructorInfo resolvingConstructor)


Removed trial simulation

Removed trial simulation

--- DjvuApp/Pages/MainPage.xaml.cs
+++ DjvuApp/Pages/MainPage.xaml.cs
@@ -1,5 +1,4 @@
-#define TRIAL_SIMULATION
-using System;
+using System;
 using System.Diagnostics;
 using System.Threading.Tasks;
 using Windows.ApplicationModel;


replace Clock.Now with Now in internal call in VirtualClock

--- Domain.Testing/VirtualClock.cs
+++ Domain.Testing/VirtualClock.cs
@@ -124,7 +124,7 @@
                             var clockTrigger = configuration.SchedulerClockTrigger();

                             var appliedCommands = sqlSchedulerClocks
-                                .Select(c => clockTrigger.AdvanceClock(c.Name, Clock.Now()) // FIX: (WaitForScheduler) just Now()?
+                                .Select(c => clockTrigger.AdvanceClock(c.Name, Now())
                                                          .TimeoutAfter(Scenario.DefaultTimeout())
                                                          .Result)
                                 .SelectMany(result => result.SuccessfulCommands);


(maint) Switch to latest version of Kudu

This includes a fix for a private package reference.

--- Cake.Recipe/Content/toolsettings.cake
+++ Cake.Recipe/Content/toolsettings.cake
@@ -62,7 +62,7 @@
         string reportGeneratorGlobalTool = "#tool dotnet:?package=dotnet-reportgenerator-globaltool&version=4.6.7",
         string wyamGlobalTool = "#tool dotnet:?package=Wyam.Tool&version=2.2.9",
         // This is using an unofficial build of kudusync so that we can have a .Net Global tool version.  This was generated from this PR: https://github.com/projectkudu/KuduSync.NET/pull/27
-        string kuduSyncGlobalTool = "#tool dotnet:https://www.myget.org/F/cake-contrib/api/v3/index.json?package=KuduSync.Tool&version=1.5.4-gc5cc5a2a19"
+        string kuduSyncGlobalTool = "#tool dotnet:https://www.myget.org/F/cake-contrib/api/v3/index.json?package=KuduSync.Tool&version=1.5.4-g3916ad7218"
     )
     {
         CodecovTool = codecovTool;


Add service ServiceKnownTypes for object[] and Dictionary<string, object> so that basic arrays can be passed two and from functions

--- CefSharp/Internals/IBrowserProcess.cs
+++ CefSharp/Internals/IBrowserProcess.cs
@@ -2,11 +2,14 @@
 //
 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

+using System.Collections.Generic;
 using System.ServiceModel;

 namespace CefSharp.Internals
 {
     [ServiceContract(CallbackContract = typeof(IRenderProcess), SessionMode = SessionMode.Required)]
+    [ServiceKnownType(typeof(object[]))]
+    [ServiceKnownType(typeof(Dictionary<string, object>))]
     public interface IBrowserProcess
     {
         [OperationContract]


Tidy up sum a bit by moving where we cast and negate to the line below.

--- supermarketkata/engine/rules/PercentageDiscount.cs
+++ supermarketkata/engine/rules/PercentageDiscount.cs
@@ -24,8 +24,8 @@

                 if (item.Name.Equals(m_ApplicableItemName) && !item.UsedInOffer)
                 {
-                    var discountToApply =  -(int) Math.Ceiling(item.Price * m_Percentage / 100);
-                    discountedBasket.Add(string.Format("{0}:{1}% discount", m_ApplicableItemName, m_Percentage), discountToApply);
+                    var discountToApply =  Math.Ceiling(item.Price * m_Percentage / 100);
+                    discountedBasket.Add(string.Format("{0}:{1}% discount", m_ApplicableItemName, m_Percentage), (int) -discountToApply);
                 }
             }


adds support for constraining the .Height and .Width *properties*

--- EasyLayout.Forms/EasyLayout.cs
+++ EasyLayout.Forms/EasyLayout.cs
@@ -621,12 +621,15 @@
                 position = GetPosition(memExpr);

                 viewExpr = memExpr.Expression as MemberExpression;
-                viewExpr = viewExpr?.Expression as MemberExpression;
+                if (viewExpr?.Member.Name == nameof(View.Bounds))
+                {
+                    viewExpr = viewExpr?.Expression as MemberExpression;
+                }
             }

             if (viewExpr == null)
             {
-                throw new NotSupportedException("Constraints should use views's Top, Bottom, etc properties, or extension methods like GetCenter().  Did you forget to include '.Bounds' in your clause?");
+                throw new NotSupportedException("Constraints should use the supplied extension methods like Top(), Bottom(), etc.");
             }

             var view = GetView(viewExpr);


BL-5140 Another case where we need to  just log HttpListenerException

--- src/BloomExe/web/RequestInfo.cs
+++ src/BloomExe/web/RequestInfo.cs
@@ -88,13 +88,18 @@
 			}
 			catch (HttpListenerException e)
 			{
-				// We may well be unable to write if, while we were gathering the data, the user switched
-				// pages or something similar so that the page that requested the data is gone. This seems
-				// to produce this particular exception type.
-				Logger.WriteEvent("Could not write requested data to JavaScript: " + e.Message + e.StackTrace);
-				Debug.WriteLine(e.Message);
+				ReportHttpListenerProblem(e);
 			}
 			HaveOutput = true;
+		}
+
+		private static void ReportHttpListenerProblem(HttpListenerException e)
+		{
+			// We may well be unable to write if, while we were gathering the data, the user switched
+			// pages or something similar so that the page that requested the data is gone. This seems
+			// to produce this particular exception type.
+			Logger.WriteEvent("Could not write requested data to JavaScript: " + e.Message + e.StackTrace);
+			Debug.WriteLine(e.Message);
 		}

 		public bool HaveOutput { get; private set; }
@@ -164,11 +169,19 @@
 				else
 				{
 					// For really big (typically image) files, use the old buffered approach
-					var buffer = new byte[1024*512]; //512KB
-					int read;
-					while((read = fs.Read(buffer, 0, buffer.Length)) > 0)
-						_actualContext.Response.OutputStream.Write(buffer, 0, read);
-					_actualContext.Response.OutputStream.Close();
+					try
+					{
+						var buffer = new byte[1024 * 512]; //512KB
+						int read;
+						while ((read = fs.Read(buffer, 0, buffer.Length)) > 0)
+							_actualContext.Response.OutputStream.Write(buffer, 0, read);
+						_actualContext.Response.OutputStream.Close();
+					}
+					catch (HttpListenerException e)
+					{
+						// If the page is gone and no longer able to accept the data, just log it.
+						ReportHttpListenerProblem(e);
+					}
 				}

 			}


Move inProgress check out to InitializeWindow

--- Editor/CommandPaletteWindow.cs
+++ Editor/CommandPaletteWindow.cs
@@ -59,6 +59,11 @@
 		}

 		public static void InitializeWindow(string title, CommandManager commandManager, bool clearInput = false) {
+			if (inProgressCommand_ != null) {
+				Debug.LogWarning("CommandPaletteWindow: Failed to open because of inProgressCommand_!");
+				return;
+			}
+
 			if (commandManager == null) {
 				Debug.LogError("CommandPaletteWindow: Can't initialize a window without a command manager!");
 				return;
@@ -92,11 +97,6 @@
 		private static InProgressCommand inProgressCommand_;

 		private void OnGUI() {
-			if (inProgressCommand_ != null) {
-				CloseIfNotClosing();
-				return;
-			}
-
 			Event e = Event.current;
 			switch (e.type) {
 				case EventType.KeyDown:


Finally confirmed a working alternative to the PlayerSettings.applicationIdentifier race condition.

Summary: Finally confirmed a working alternative to the PlayerSettings.applicationIdentifier race condition.

Test Plan: Jenker!  (Specifically re-enable the 5.6 job)

Reviewers: Marco.Williams

Subscribers: jenkins, #sdkdiff-unitysdk

Maniphest Tasks: T2714

Differential Revision: https://phab.playfabdev.com/D3460

--- targets/unity-v2/Testing/Editor/PlayFabPackager.cs
+++ targets/unity-v2/Testing/Editor/PlayFabPackager.cs
@@ -40,10 +40,10 @@
         #endregion Utility Functions

         #region Unity Multi-version Utilities
-        private static void SetIdentifier(string identifier)
+        private static void SetIdentifier(BuildTargetGroup targetGroup, string identifier)
         {
 #if UNITY_5_6_OR_NEWER
-            PlayerSettings.applicationIdentifier = identifier;
+            PlayerSettings.SetApplicationIdentifier(targetGroup, identifier);
 #else
             PlayerSettings.bundleIdentifier = identifier;
 #endif
@@ -85,7 +85,7 @@
         {
             get
             {
-#if UNITY_5_2 || UNITY_5_3 || UNITY_5_4 || UNITY_5_5 || UNITY_5_6 || UNITY_5_7
+#if UNITY_5_2 || UNITY_5_3_OR_NEWER
                 return BuildTarget.WSAPlayer;
 #else
                 return BuildTarget.WP8Player;
@@ -96,7 +96,7 @@
         {
             get
             {
-#if UNITY_5_2 || UNITY_5_3 || UNITY_5_4 || UNITY_5_5 || UNITY_5_6 || UNITY_5_7
+#if UNITY_5_2 || UNITY_5_3_OR_NEWER
                 return BuildTargetGroup.WSA;
 #else
                 return BuildTargetGroup.WP8;
@@ -120,7 +120,7 @@
         {
             Setup();
             SetScriptingBackend(ScriptingImplementation.Mono2x, BuildTarget.Android, BuildTargetGroup.Android); // Ideal setting for Android
-            SetIdentifier("com.PlayFab.PlayFabTest");
+            SetIdentifier(BuildTargetGroup.Android, "com.PlayFab.PlayFabTest");
             var androidPackage = Path.Combine(GetBuildPath(), "PlayFabAndroid.apk");
             MkDir(GetBuildPath());
             BuildPipeline.BuildPlayer(TestScenes, androidPackage, BuildTarget.Android, BuildOptions.None);
@@ -134,7 +134,7 @@
             Setup();
             // SetScriptingBackend(ScriptingImplementation.IL2CPP, AppleBuildTarget, AppleBuildTargetGroup); // Ideally we should be testing both at some point, but ...
             SetScriptingBackend(ScriptingImplementation.Mono2x, AppleBuildTarget, AppleBuildTargetGroup); // Mono2x is traditionally the one with issues, and it's a lot faster to build/test
-            SetIdentifier("com.PlayFab.PlayFabTest");
+            SetIdentifier(AppleBuildTargetGroup, "com.PlayFab.PlayFabTest");
             var iosPath = Path.Combine(GetBuildPath(), "PlayFabIOS");
             MkDir(GetBuildPath());
             MkDir(iosPath);
@@ -147,7 +147,7 @@
         public static void MakeWp8Build()
         {
             Setup();
-#if UNITY_5_2 || UNITY_5_3 || UNITY_5_4 || UNITY_5_5 || UNITY_5_6 || UNITY_5_7
+#if UNITY_5_2 || UNITY_5_3_OR_NEWER
             EditorUserBuildSettings.wsaSDK = WSASDK.UniversalSDK81;
             EditorUserBuildSettings.wsaBuildAndRunDeployTarget = WSABuildAndRunDeployTarget.LocalMachineAndWindowsPhone;
             EditorUserBuildSettings.wsaGenerateReferenceProjects = true;


Revert to obscure return values for old api

--- src/CoreMedia/CMSampleBuffer.cs
+++ src/CoreMedia/CMSampleBuffer.cs
@@ -357,9 +357,9 @@
 		[DllImport(Constants.CoreMediaLibrary)]
 		extern static CMSampleBufferError CMSampleBufferSetOutputPresentationTimeStamp (IntPtr handle, CMTime outputPresentationTimeStamp);

-		public CMSampleBufferError SetOutputPresentationTimeStamp (CMTime outputPresentationTimeStamp)
-		{
-			return CMSampleBufferSetOutputPresentationTimeStamp (handle, outputPresentationTimeStamp);
+		public int /*CMSampleBufferError*/ SetOutputPresentationTimeStamp (CMTime outputPresentationTimeStamp)
+		{
+			return (int)CMSampleBufferSetOutputPresentationTimeStamp (handle, outputPresentationTimeStamp);
 		}

 		/*[DllImport(Constants.CoreMediaLibrary)]
@@ -454,9 +454,9 @@
 		[DllImport(Constants.CoreMediaLibrary)]
 		extern static CMSampleBufferError CMSampleBufferInvalidate (IntPtr handle);

-		public CMSampleBufferError Invalidate()
-		{
-			return CMSampleBufferInvalidate (handle);
+		public int /*CMSampleBufferError*/ Invalidate()
+		{
+			return (int)CMSampleBufferInvalidate (handle);
 		}

 		[DllImport(Constants.CoreMediaLibrary)]
@@ -473,22 +473,22 @@
 		[DllImport(Constants.CoreMediaLibrary)]
 		extern static CMSampleBufferError CMSampleBufferMakeDataReady (IntPtr handle);

-		public CMSampleBufferError MakeDataReady ()
-		{
-			return CMSampleBufferMakeDataReady (handle);
+		public int /*CMSampleBufferError*/ MakeDataReady ()
+		{
+			return (int)CMSampleBufferMakeDataReady (handle);
 		}

 		[DllImport(Constants.CoreMediaLibrary)]
 		extern static CMSampleBufferError CMSampleBufferSetDataBuffer (IntPtr handle, IntPtr dataBufferHandle);

-		public CMSampleBufferError SetDataBuffer (CMBlockBuffer dataBuffer)
+		public int /*CMSampleBufferError*/ SetDataBuffer (CMBlockBuffer dataBuffer)
 		{
 			var dataBufferHandle = IntPtr.Zero;
 			if (dataBuffer != null)
 			{
 				dataBufferHandle = dataBuffer.handle;
 			}
-			return CMSampleBufferSetDataBuffer (handle, dataBufferHandle);
+			return (int)CMSampleBufferSetDataBuffer (handle, dataBufferHandle);
 		}

 		/*[DllImport(Constants.CoreMediaLibrary)]
@@ -503,9 +503,9 @@
 		[DllImport(Constants.CoreMediaLibrary)]
 		extern static CMSampleBufferError CMSampleBufferSetDataReady (IntPtr handle);

-		public CMSampleBufferError SetDataReady ()
-		{
-			return CMSampleBufferSetDataReady (handle);
+		public int/*CMSampleBufferError*/ SetDataReady ()
+		{
+			return (int)CMSampleBufferSetDataReady (handle);
 		}

 		/*[DllImport(Constants.CoreMediaLibrary)]
@@ -518,13 +518,13 @@
 		[DllImport(Constants.CoreMediaLibrary)]
 		extern static CMSampleBufferError CMSampleBufferTrackDataReadiness (IntPtr handle, IntPtr handleToTrack);

-		public CMSampleBufferError TrackDataReadiness (CMSampleBuffer bufferToTrack)
+		public int/*CMSampleBufferError*/ TrackDataReadiness (CMSampleBuffer bufferToTrack)
 		{
 			var handleToTrack = IntPtr.Zero;
 			if (bufferToTrack != null) {
 				handleToTrack = bufferToTrack.handle;
 			}
-			return CMSampleBufferTrackDataReadiness (handle, handleToTrack);
+			return (int)CMSampleBufferTrackDataReadiness (handle, handleToTrack);
 		}

 	}


Remove unused catch exception parameters.

--- src/Docunet/Docunet/Document.cs
+++ src/Docunet/Docunet/Document.cs
@@ -303,7 +303,7 @@
                         collection = ((List<object>)data).Select(System.Convert.ToDecimal).ToList() as List<T>;
                         break;
                     case "DateTime":
-                        var list = ((IEnumerable)data).Cast<object>().ToList();;
+                        var list = ((IEnumerable)data).Cast<object>().ToList();

                         if (list.Count > 0)
                         {
@@ -778,11 +778,11 @@

                 return true;
             }
-            catch (NonExistingFieldException exception)
+            catch (NonExistingFieldException)
             {
                 return false;
             }
-            catch (IndexOutOfRangeException exception)
+            catch (IndexOutOfRangeException)
             {
                 return false;
             }
@@ -815,11 +815,11 @@

                 return false;
             }
-            catch (NonExistingFieldException exception)
+            catch (NonExistingFieldException)
             {
                 return false;
             }
-            catch (IndexOutOfRangeException exception)
+            catch (IndexOutOfRangeException)
             {
                 return false;
             }
@@ -844,11 +844,11 @@
                     return false;
                 }
             }
-            catch (NonExistingFieldException exception)
+            catch (NonExistingFieldException)
             {
                 return true;
             }
-            catch (IndexOutOfRangeException exception)
+            catch (IndexOutOfRangeException)
             {
                 return true;
             }
@@ -1255,7 +1255,7 @@
                 {
                     document.Drop(field);
                 }
-                catch(Exception exception)
+                catch(Exception)
                 {
                     // fail silently if the field doesn't exist
                 }
@@ -1278,7 +1278,7 @@
                 {
                     document.SetField(field, GetField(field));
                 }
-                catch(Exception exception)
+                catch(Exception)
                 {
                     // fail silently if the field doesn't exist
                 }


Rename parameters.

Rename parameters.

--- ClosedXML.Tests/Utils/StreamHelper.cs
+++ ClosedXML.Tests/Utils/StreamHelper.cs
@@ -114,31 +114,31 @@
         /// <param name="other"></param>
         /// /// <param name="stripColumnWidths"></param>
         /// <returns></returns>
-        public static bool Compare((string ContentType, Stream Stream) tuple1, (string ContentType, Stream Stream) tuple2, Uri partUri, bool stripColumnWidths)
+        public static bool Compare((string ContentType, Stream Stream) left, (string ContentType, Stream Stream) right, Uri partUri, bool stripColumnWidths)
         {
             #region Check

-            if (tuple1.ContentType == null || tuple1.Stream == null)
-            {
-                throw new ArgumentNullException(nameof(tuple1));
-            }
-            if (tuple2.ContentType == null || tuple2.Stream == null)
-            {
-                throw new ArgumentNullException(nameof(tuple2));
-            }
-            if (tuple1.Stream.Position != 0)
-            {
-                throw new ArgumentException("Must be in position 0", nameof(tuple1));
-            }
-            if (tuple2.Stream.Position != 0)
-            {
-                throw new ArgumentException("Must be in position 0", nameof(tuple2));
+            if (left.ContentType == null || left.Stream == null)
+            {
+                throw new ArgumentNullException(nameof(left));
+            }
+            if (right.ContentType == null || right.Stream == null)
+            {
+                throw new ArgumentNullException(nameof(right));
+            }
+            if (left.Stream.Position != 0)
+            {
+                throw new ArgumentException("Must be in position 0", nameof(left));
+            }
+            if (right.Stream.Position != 0)
+            {
+                throw new ArgumentException("Must be in position 0", nameof(right));
             }

             #endregion Check

-            var stringOne = new StreamReader(tuple1.Stream).ReadToEnd().RemoveIgnoredParts(partUri, stripColumnWidths, ignoreGuids: true);
-            var stringOther = new StreamReader(tuple2.Stream).ReadToEnd().RemoveIgnoredParts(partUri, stripColumnWidths, ignoreGuids: true);
+            var stringOne = new StreamReader(left.Stream).ReadToEnd().RemoveIgnoredParts(partUri, stripColumnWidths, ignoreGuids: true);
+            var stringOther = new StreamReader(right.Stream).ReadToEnd().RemoveIgnoredParts(partUri, stripColumnWidths, ignoreGuids: true);

             return stringOne == stringOther;
         }


Fix modifier of ANTLR parser.

Fix modifier of ANTLR parser.

--- Code2Xml.Tools/AntlrHelper/Program.cs
+++ Code2Xml.Tools/AntlrHelper/Program.cs
@@ -45,7 +45,7 @@
 			foreach (var arg in args) {
 				var path = Path.GetFullPath(arg);
 				var dir = Directory.Exists(path) ? path : Path.GetDirectoryName(path);
-				var grammarFiles = Directory.GetFiles(dir, "php.g", SearchOption.AllDirectories);
+				var grammarFiles = Directory.GetFiles(dir, "*.g", SearchOption.AllDirectories);
 				foreach (var grammarFile in grammarFiles) {
 					Console.WriteLine(grammarFile);
 					var info = new ProcessStartInfo {


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

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

--- src/Math/SoundMath.cs
+++ src/Math/SoundMath.cs
@@ -31,12 +31,23 @@
     /// </summary>
     public static class SoundMath
     {
-        #region -- Public Static Methods --
+        #region -- Public Static Methods --
+        /// <summary>
+        /// Sinc 関数の値を取得します。
+        /// </summary>
+        /// <param name="x">x の値。</param>
+        /// <returns>Sinc(x) の結果。</returns>
         public static double Sinc(double x)
         {
             return x == 0.0 ? 1.0 : Math.Sin(x) / x;
         }

+        /// <summary>
+        /// 第1種0次変形ベッセル関数の値を取得します。
+        /// </summary>
+        /// <param name="x">x の値。</param>
+        /// <param name="iterate">近似計算の反復回数。</param>
+        /// <returns>計算結果。</returns>
         public static double Bessel0(double x, int iterate = 100)
         {
             if (x < 0.0)
@@ -58,6 +69,11 @@
             return y;
         }

+        /// <summary>
+        /// n の階乗を逆数で計算します。
+        /// </summary>
+        /// <param name="n">階乗の整数パラメータ。</param>
+        /// <returns>n の階乗の逆数の値。</returns>
         public static double InvertedFactorial(int n)
         {
             double y = 1.0;


Fixed typo

Fixed typo

--- Chutzpah/UrlBuilder.cs
+++ Chutzpah/UrlBuilder.cs
@@ -90,7 +90,7 @@
             string parentPath = null;
             if (isBuiltInDependency)
             {
-                // We need a fully qualified url when using vitural server path
+                // We need a fully qualified url when using virtual server path
                 fullyQualified = true;

                 parentPath = fileProbe.BuiltInDependencyDirectory;


The dictionary .contains() method takes in a key, not a value. The type resolver was assuming it was the latter.

--- Compiler/Parser/ParseTree/DotField.cs
+++ Compiler/Parser/ParseTree/DotField.cs
@@ -349,7 +349,7 @@

                         case "clear": return BuildPrimitiveMethod(ResolvedType.VOID);
                         case "clone": return BuildPrimitiveMethod(rootType);
-                        case "contains": return BuildPrimitiveMethod(ResolvedType.BOOLEAN, valueType);
+                        case "contains": return BuildPrimitiveMethod(ResolvedType.BOOLEAN, keyType);
                         case "get": return BuildPrimitiveMethodWithOptionalArgs(valueType, 1, keyType, valueType);
                         case "keys": return BuildPrimitiveMethod(ResolvedType.ListOrArrayOf(keyType));
                         case "merge": return BuildPrimitiveMethod(ResolvedType.VOID, rootType);


Added missing test.

Added missing test.

--- ConsoleTwiterTests/Users/UserTests.cs
+++ ConsoleTwiterTests/Users/UserTests.cs
@@ -37,13 +37,23 @@

             userWall.Received().Posts(bob);
         }
-
+
         [Test]
         public void GivenAUserWhenAddFollowerIsCalledThenItAddsTheFollowerToItsListOfFollowers()
         {
+            bob.Posts();
+
+            userWall.Received().Posts(bob);
+        }
+
+        [Test]
+        public void GivenAUserWhenPostsIsCalledThenItCallsPostOnItsFollowers()
+        {
             bob.AddFollower(alice);

-            bob.Followers.Should().Contain(alice);
+            bob.Post("message");
+
+            userWall.Received().Post(alice, "message");
         }
     }
 }