[API] Implemented UsersEndpoint

[API] Implemented UsersEndpoint

--- Zermelo/Zermelo.API/Endpoints/UsersEndpoint.cs
+++ Zermelo/Zermelo.API/Endpoints/UsersEndpoint.cs
@@ -4,16 +4,80 @@
 using System.Text;
 using System.Threading.Tasks;
 using Zermelo.API.Interfaces;
+using Zermelo.API.Models;
 using Zermelo.API.Services.Interfaces;
+using Zermelo.API.Helpers;
+using Zermelo.API.Exceptions;

 namespace Zermelo.API.Endpoints
 {
     class UsersEndpoint : EndpointBase
     {
+        private const string _endpoint = "users";
+
         internal UsersEndpoint(IAuthentication auth, IUrlBuilder urlBuilder, IHttpService httpService, IJsonService jsonService)
             : base(auth, urlBuilder, httpService, jsonService)
         {

         }
+
+        /// <summary>
+        /// Get the current authenticated user.
+        /// </summary>
+        /// <param name="fields">
+        /// The fields (in original json names) to get. Defaults to <c>null</c>, which gets the server defaults.
+        /// An empty list will also result in the server defaults.
+        /// </param>
+        /// <returns>The current authenticated user.</returns>
+        public async Task<User> GetCurrentUserAsync(List<string> fields = null)
+        {
+            return await GetByCodeAsync("~me", fields);
+        }
+
+        /// <summary>
+        /// Get a user by it's code (a student number or teacher abbreviation).
+        /// </summary>
+        /// <param name="code">The code (a student number or teacher abbreviation) of the user.</param>
+        /// <param name="fields">
+        /// The fields (in original json names) to get. Defaults to <c>null</c>, which gets the server defaults.
+        /// An empty list will also result in the server defaults.
+        /// </param>
+        /// <returns>The requested user or, if the user's not found, null.</returns>
+        public async Task<User> GetByCodeAsync(string code, List<string> fields = null)
+        {
+            IEnumerable<User> result = await GetByCustomUrlOptionsAsync<User>($"{_endpoint}/{code}", null, fields);
+
+            if (result.Count() < 1)
+                return null;
+
+            return result.SingleOrDefault();
+        }
+
+        /// <summary>
+        /// Get a list of all users.
+        /// </summary>
+        /// <param name="fields">
+        /// The fields (in original json names) to get. Defaults to <c>null</c>, which gets the server defaults.
+        /// An empty list will also result in the server defaults.
+        /// </param>
+        /// <returns>A list of all users.</returns>
+        public async Task<IEnumerable<User>> GetAllAsync(List<string> fields = null)
+        {
+            return await GetByCustomUrlOptionsAsync(null, fields);
+        }
+
+        /// <summary>
+        /// Get users by a custom query.
+        /// </summary>
+        /// <param name="urlOptions">The options you want to be in the url.</param>
+        /// <param name="fields">
+        /// The fields (in original json names) to get. Defaults to <c>null</c>, which gets the server defaults.
+        /// An empty list will also result in the server defaults.
+        /// </param>
+        /// <returns>The requested users.</returns>
+        public async Task<IEnumerable<User>> GetByCustomUrlOptionsAsync(Dictionary<string, string> urlOptions, List<string> fields = null)
+        {
+            return await GetByCustomUrlOptionsAsync<User>(_endpoint, urlOptions, fields);
+        }
     }
 }


Remove debug...

Remove debug...

--- Aurora/Modules/Avatar/Friends/FriendsModule.cs
+++ Aurora/Modules/Avatar/Friends/FriendsModule.cs
@@ -239,7 +239,6 @@
                 GridInstantMessage im = new GridInstantMessage();
                 im.FromOSD((OSDMap) message["Message"]);
                 LocalFriendshipOffered(Friend, im);
-                System.Threading.Thread.Sleep(1000);
             }
             else if (message["Method"] == "FriendshipDenied")
             {


FIX THAT DEBUG!

FIX THAT DEBUG!

--- Babel/Assets/Core/Camera/CameraMovementArea.cs
+++ Babel/Assets/Core/Camera/CameraMovementArea.cs
@@ -20,7 +20,7 @@
 	}

 	void OnTriggerStay(Collider other) {
-		Debug.Log ("Inside");
+		//Debug.Log ("Inside");
 		isInsideArea = true;
 		lastPos = transform.position;
 		//Debug.Log (other);


Fix checkdigit summation and calculation, cleanup

--- BarcodeStandard/Symbologies/Interleaved2of5.cs
+++ BarcodeStandard/Symbologies/Interleaved2of5.cs
@@ -8,12 +8,12 @@
     /// </summary>
     class Interleaved2of5 : BarcodeCommon, IBarcode
     {
-        private readonly string[] I25_Code = { "NNWWN", "WNNNW", "NWNNW", "WWNNN", "NNWNW", "WNWNN", "NWWNN", "NNNWW", "WNNWN", "NWNWN" };
-        private readonly TYPE Encoded_Type = TYPE.UNSPECIFIED;
+        private readonly string[] _i25Code = { "NNWWN", "WNNNW", "NWNNW", "WWNNN", "NNWNW", "WNWNN", "NWWNN", "NNNWW", "WNNWN", "NWNWN" };
+        private readonly TYPE _encodedType;

-        public Interleaved2of5(string input, TYPE EncodedType)
+        public Interleaved2of5(string input, TYPE encodedType)
         {
-            Encoded_Type = EncodedType;
+            _encodedType = encodedType;
             Raw_Data = input;
         }
         /// <summary>
@@ -22,26 +22,26 @@
         private string Encode_Interleaved2of5()
         {
             //check length of input (only even if no checkdigit, else with check digit odd)
-            if (Raw_Data.Length % 2 != (Encoded_Type == TYPE.Interleaved2of5_Mod10 ? 1 : 0))
+            if (Raw_Data.Length % 2 != (_encodedType == TYPE.Interleaved2of5_Mod10 ? 1 : 0))
                 Error("EI25-1: Data length invalid.");

             if (!CheckNumericOnly(Raw_Data))
                 Error("EI25-2: Numeric Data Only");

-            string result = "1010";
-            string data = Raw_Data + (Encoded_Type == TYPE.Interleaved2of5_Mod10 ? CalculateMod10CheckDigit().ToString() : "");
+            var result = "1010";
+            var data = Raw_Data + (_encodedType == TYPE.Interleaved2of5_Mod10 ? CalculateMod10CheckDigit().ToString() : "");

             for (int i = 0; i < data.Length; i += 2)
             {
-                bool bars = true;
-                string patternbars = I25_Code[Int32.Parse(data[i].ToString())];
-                string patternspaces = I25_Code[Int32.Parse(data[i + 1].ToString())];
-                string patternmixed = "";
+                var bars = true;
+                var patternbars = _i25Code[Int32.Parse(data[i].ToString())];
+                var patternspaces = _i25Code[Int32.Parse(data[i + 1].ToString())];
+                var patternmixed = "";

                 //interleave
                 while (patternbars.Length > 0)
                 {
-                    patternmixed += patternbars[0].ToString() + patternspaces[0].ToString();
+                    patternmixed += patternbars[0] + patternspaces[0];
                     patternbars = patternbars.Substring(1);
                     patternspaces = patternspaces.Substring(1);
                 }//while
@@ -73,23 +73,20 @@

         private int CalculateMod10CheckDigit()
         {
-            int sum = 0;
-            bool even = true;
-            for (int i = Raw_Data.Length - 1; i >= 0; --i)
+            var sum = 0;
+            var even = true;
+            for (var i = Raw_Data.Length - 1; i >= 0; --i)
             {
-                sum += Raw_Data[i] * (even ? 3 : 1);
+                sum += Convert.ToInt32(Raw_Data[i]) * (even ? 3 : 1);
                 even = !even;
             }

-            return sum % 10;
+            return 10 - (sum % 10);
         }

         #region IBarcode Members

-        public string Encoded_Value
-        {
-            get { return this.Encode_Interleaved2of5(); }
-        }
+        public string Encoded_Value => this.Encode_Interleaved2of5();

         #endregion
     }


Implement BsControlType.CheckBoxList

Implement BsControlType.CheckBoxList

--- BootstrapForms/HtmlHelpers/SelectExtensions.cs
+++ BootstrapForms/HtmlHelpers/SelectExtensions.cs
@@ -158,7 +158,6 @@
                         break;
                     case BsControlType.CheckBoxList:
                         allowMultiple = true;
-                        //TODO: Implement CheckBoxList
                         htmlSelect = BsRadioListInternal(htmlHelper, name,
                             selectList, htmlAttributes, allowMultiple, bsCssClass).ToHtmlString();
                         break;
@@ -374,14 +373,14 @@
                     });
                 }

-                var radio = htmlHelper.RadioButton(name, item.Value, radioHtmlAttributes).ToHtmlString();
+                var input = allowMultiple ? htmlHelper.CheckBox(name, item.Selected, radioHtmlAttributes).ToHtmlString() : htmlHelper.RadioButton(name, item.Value, radioHtmlAttributes).ToHtmlString();

                 // Create the html string
                 // e.g. <input data-val="true" data-val-required="You must select an option" id="TestRadio_1" name="TestRadio" type="radio" value="1" /><label for="TestRadio_1">Line1</label>
                 var innerDivTag = new TagBuilder("div");
                 innerDivTag.AddCssClass("RadioButton");
                 html.Append(innerDivTag.ToString(TagRenderMode.StartTag));
-                html.Append(radio);
+                html.Append(input);
                 html.Append(label);
                 html.Append(innerDivTag.ToString(TagRenderMode.EndTag));
             }


WebRTC sample main program tweak.

WebRTC sample main program tweak.

--- sipsorcery-media/samples/WebRTCVideoServer/Program.cs
+++ sipsorcery-media/samples/WebRTCVideoServer/Program.cs
@@ -64,7 +64,6 @@
 c=IN IP4 {1}
 a=rtcp:{0} IN IP4 {1}
 a=candidate:2675262800 1 udp 2122194687 {1} {0} typ host generation 0
-a=candidate:2675262800 2 udp 2122194687 {1} {0} typ host generation 0
 a=ice-ufrag:{2}
 a=ice-pwd:{3}
 a=ice-options:google-ice
@@ -118,9 +117,9 @@
                 logger.Debug("Commencing listen to receiver WebRTC client on local socket " + receiverLocalEndPoint + ".");
                 ThreadPool.QueueUserWorkItem(delegate { ListenToReceiverWebRTCClient(_webRTCReceiverClient); });

-                ThreadPool.QueueUserWorkItem(delegate { RelayRTP(_rtpClient); });
-
-                //ThreadPool.QueueUserWorkItem(delegate { SendRTPFromCamera(); });
+                //ThreadPool.QueueUserWorkItem(delegate { RelayRTP(_rtpClient); });
+
+                ThreadPool.QueueUserWorkItem(delegate { SendRTPFromCamera(); });

                 //ThreadPool.QueueUserWorkItem(delegate { SendRTPFromRawRTPFile("rtpPackets.txt"); });


Clean code a bit

Clean code a bit

--- BaseConverter/BaseConverter.cs
+++ BaseConverter/BaseConverter.cs
@@ -8,7 +8,6 @@
 {
 	/// <summary>
 	/// Entry point
-	/// http://www.cs.trincoll.edu/~ram/cpsc110/inclass/conversions.html
 	/// </summary>
 	public class BaseConverter
 	{
@@ -16,7 +15,6 @@
 		/// Character values
 		/// </summary>
 		private readonly Dictionary<char, int> _charValues;
-		private long? _max;

 		/// <summary>
 		/// Current value
@@ -132,8 +130,6 @@
 			if (decimalValue == 0)
 				return new Value(0, _charValues.First(x => x.Value == 0).Key.ToString());

-			var isNegative = decimalValue < 0;
-
 			var sb = new StringBuilder();
 			var n = decimalValue;
 			while (n != 0)
@@ -141,9 +137,10 @@
 				n = Math.DivRem(n, Base, out var remainder);
 				sb.Append(_charValues.First(x => x.Value == Math.Abs(remainder)).Key);
 			}
-
+			if (decimalValue < 0)
+				sb.Append("-");
 			var baseValue = new string(sb.ToString().Reverse().ToArray());
-			return new Value(decimalValue, isNegative ? string.Concat("-", baseValue) : baseValue);
+			return new Value(decimalValue, baseValue);
 		}

@@ -176,7 +173,7 @@
 			{
 				for (var i = 0; i < charArray.Length; i++)
 				{
-					//math.pow gives double, casting that straight to long truncates it, giving invalid values for high numbers
+					//math.pow gives double, casting that straight to long truncates it, giving invalid values
 					//total += (long)Math.Round(_charValues[charArray[i]] * Math.Pow(Base, charArray.Length - i - 1L), 0);
 					total += _charValues[charArray[i]] * Pow(Base, charArray.Length - i - 1);
 				}
@@ -186,7 +183,7 @@

 		/// <summary>
 		/// Math.Pow() works on doubles, which inevitable means rounding and casting
-		/// <para>This is probably slower even though it works on long, but no casting, Math.Round() or rounding isses</para>
+		/// <para>This is probably slower even though it works on nonfractional numbers, but no casting, Math.Round() or rounding isses</para>
 		/// </summary>
 		[MethodImpl(MethodImplOptions.AggressiveInlining)]
 		private long Pow(long number, int power)
@@ -202,7 +199,7 @@
 		/// Convert value between decimal system and specified base.
 		/// <para>Specify one in the input and returned <see cref="Value"/> will have both</para>
 		/// <para>If both are set, the Value is returned without modification!</para>
-		/// <para>This does not affect Current/Next functionality</para>
+		/// <para>This does not affect Current/Next/Previous functionality</para>
 		/// <para>Invalid base values or larger than <see cref="long.MaxValue"/> will cause an exception!</para>
 		/// </summary>
 		public Value Convert(Value value)


whoops. Fixed processing. Frustration/spawning now works a little better

--- BellTowerEscape/Server/Game.cs
+++ BellTowerEscape/Server/Game.cs
@@ -343,13 +343,12 @@
                 _processingComplete = false;
                 this.elapsedTotalTurn = 0;
                 Turn++;
-                // add new Meeples
-                AddMeepleToFloors();
+
                 // publish viz update every turn
                 ClientManager.UpdateClientGame(this);
             }

-            if (Processing)
+            if (Processing && !_processingComplete)
             {
                 // for each floor move people to stopped elevators
                 for (var i = 0; i < Floors.Count; i++)
@@ -407,7 +406,10 @@
                             _authTokens[elevator.PlayerToken].Score++;
                         }
                     }
-                }
+                }
+
+                // add new Meeples
+                AddMeepleToFloors();

                 // clear state variables
                 foreach (var elevator in Elevators.Values)


Added ExtraFields property to Torrent to allow adding extra fields or merging data with the encoded output.

--- BencodeNET/Torrents/Torrent.cs
+++ BencodeNET/Torrents/Torrent.cs
@@ -17,6 +17,17 @@
     /// </summary>
     public class Torrent : BObject
     {
+        /// <summary>
+        /// Add any custom fields to this <see cref="BDictionary"/> and they will
+        /// be merged with the torrent data when encoded.
+        /// </summary>
+        /// <remarks>
+        /// Existing keys will be overwritten with the values from this property.
+        /// In the case the existing and new value are both <see cref="BList"/> the new list will be appended to the existing list.
+        /// In the case the existing and new value are both <see cref="BDictionary"/> they will be merged recursively.
+        /// </remarks>
+        public virtual BDictionary ExtraFields { get; set; }
+
         /// <summary>
         /// A list of list of trackers (announce URLs).
         /// Lists are processed in order of first to last. Trackers in a list are processed randomly.
@@ -164,6 +175,9 @@

             torrent[TorrentFields.Info] = CreateInfo(Encoding);

+            if (ExtraFields != null)
+                torrent.MergeWith(ExtraFields);
+
             return torrent;
         }


Add LoginNewAsync()

Add LoginNewAsync()

--- Learn.THU/Model/Web.cs
+++ Learn.THU/Model/Web.cs
@@ -3,9 +3,11 @@
 using System.IO;
 using System.Linq;
 using System.Net;
+using System.Net.Http;
 using System.Text;
 using System.Threading.Tasks;
 using System.Text.RegularExpressions;
+using System.Diagnostics;

 namespace LearnTHU.Model
 {
@@ -69,40 +71,86 @@
         {
             try
             {
-                string url1 = @"https://learn.cic.tsinghua.edu.cn/index";
+                string url1 = @"http://learn.cic.tsinghua.edu.cn/index";
                 HttpWebRequest req1 = (HttpWebRequest)WebRequest.Create(url1);
+                req1.CookieContainer = cc;
                 HttpWebResponse res1 = (HttpWebResponse)await req1.GetResponseAsync();
                 string html1 = await new StreamReader(res1.GetResponseStream()).ReadToEndAsync();
+                cc.Add(new Uri(@"http://learn.cic.tsinghua.edu.cn"), res1.Cookies);
                 res1.Dispose();
                 Regex reg = new Regex(@"method=""post"" action=(\S+?)>");
                 string url2 = reg.Match(html1).Groups[1].Value;
-
-                HttpWebRequest req2 = (HttpWebRequest)WebRequest.Create(url2);
-                req2.Method = "POST";
-                string form = String.Format(@"i_user={0}&i_pass={1}",
-                    WebUtility.UrlEncode(userId), WebUtility.UrlEncode(userPwd));
-                req2.ContentType = @"application/x-www-form-urlencoded";
-                req2.CookieContainer = cc;
-                using (Stream requestStream = await req2.GetRequestStreamAsync())
+
+                HttpClientHandler hch = new HttpClientHandler();
+                hch.AllowAutoRedirect = false;
+                hch.CookieContainer = cc;
+                hch.UseCookies = true;
+                HttpClient hc = new HttpClient(hch);
+                string form = String.Format(@"i_user={0}&i_pass={1}", userId, WebUtility.UrlEncode(userPwd));
+                StringContent sc = new StringContent(form);
+                sc.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(@"application/x-www-form-urlencoded");
+                HttpResponseMessage hrm = await hc.PostAsync(url2, sc);
+                if (hrm.StatusCode != HttpStatusCode.Redirect && hrm.StatusCode != HttpStatusCode.MovedPermanently)
                 {
-                    StreamWriter requestStreamWriter = new StreamWriter(requestStream);
-                    requestStreamWriter.Write(form);
-                    requestStreamWriter.Flush();
-                    requestStream.Flush();
-                    requestStreamWriter.Dispose();
+                    return LoginResult.Error;
                 }
-                HttpWebResponse res2 = (HttpWebResponse)await req2.GetResponseAsync();
+                string url3 = hrm.Headers.Location.ToString();
+                if (url3.Contains(@"SUCCESS"))
+                {
+                    await Request(url3);
+                    return LoginResult.Success;
+                }
+                else
+                {
+                    return LoginResult.Failed;
+                }
             }
             catch
             {
                 return LoginResult.Error;
             }
-            return LoginResult.Success;
         }

         public enum LoginResult
         {
             Success, Failed, Error
         }
+
+        public async Task<string> Request(string url)
+        {
+            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
+            req.CookieContainer = cc;
+            HttpWebResponse res = (HttpWebResponse)await req.GetResponseAsync();
+            string html;
+            if (res.ContentLength == -1)
+            {
+                html = await ReadAllAsync(res.GetResponseStream());
+            }
+            else
+            {
+                html = await new StreamReader(res.GetResponseStream()).ReadToEndAsync();
+            }
+            if (res.Cookies.Count > 0)
+            {
+                cc.Add(new Uri(@"http://" + new Uri(url).Host), res.Cookies);
+            }
+            res.Dispose();
+            return html;
+        }
+
+        private async Task<string> ReadAllAsync(Stream stream)
+        {
+            byte[] buf = new byte[4096];
+            Stream ms = new MemoryStream();
+            int count = await stream.ReadAsync(buf, 0, 4096);
+            while (count > 0)
+            {
+                ms.Write(buf, 0, count);
+                count = stream.Read(buf, 0, 4096);
+            }
+            ms.Seek(0, SeekOrigin.Begin);
+            string a = new StreamReader(ms, Encoding.UTF8).ReadToEnd();
+            return a;
+        }
     }
 }


Vertical section column processing improvement

--- Core/OfficeDevPnP.Core/Pages/ClientSidePage.cs
+++ Core/OfficeDevPnP.Core/Pages/ClientSidePage.cs
@@ -1673,7 +1673,8 @@

             // Perform vertical section column matchup if that did not happen yet
             var verticalSectionColumn = this.sections.Where(p => p.VerticalSectionColumn != null).FirstOrDefault();
-            if (verticalSectionColumn != null)
+            // Only continue if the vertical section column we found was "standalone" and not yet matched with other columns
+            if (verticalSectionColumn != null && verticalSectionColumn.Columns.Count == 1)
             {
                 // find another, non vertical section, column with the same zoneindex
                 var matchedUpSection = this.sections.Where(p => p.VerticalSectionColumn == null && p.Order == verticalSectionColumn.Order).FirstOrDefault();


Some odd changes to image processing to try and hunt down a memory leak.

--- Coremero/Coremero.Plugin.Image/ImageProcess.cs
+++ Coremero/Coremero.Plugin.Image/ImageProcess.cs
@@ -1,17 +1,27 @@
 using System;
+using System.Buffers;
+using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using System.Reflection;
 using System.Threading.Tasks;
 using Coremero.Commands;
 using Coremero.Messages;
 using Coremero.Utilities;
 using ImageSharp;
+using ImageSharp.Formats;
 using ImageSharp.Processing.Processors;

 namespace Coremero.Plugin.Image
 {
     public class ImageProcess : IPlugin
     {
+
+        public ImageProcess()
+        {
+            Configuration.Default.ParallelOptions.MaxDegreeOfParallelism = 4;
+        }
+
         [Command("contrast", Arguments = "Contrast Value",
             Help = "Increases or decreases the contrast in the attached images. Values between -100 and 100.")]
         public IMessage Contrast(IInvocationContext context, IMessage message)
@@ -26,7 +36,7 @@

             using (ImageSharp.Image image = new ImageSharp.Image(message.Attachments[0].Contents))
             {
-                image.Contrast(val).Save(ms);
+                image.Contrast(val).Save(ms).Dispose();
             }
             ms.Seek(0, SeekOrigin.Begin);
             return Message.Create(null, new StreamAttachment(ms, message.Attachments[0].Name));
@@ -46,7 +56,7 @@

             using (ImageSharp.Image image = new ImageSharp.Image(message.Attachments[0].Contents))
             {
-                image.Saturation(val).Save(ms);
+                image.Saturation(val).Save(ms).Dispose();
             }
             ms.Seek(0, SeekOrigin.Begin);
             return Message.Create(null, new StreamAttachment(ms, message.Attachments[0].Name));
@@ -66,7 +76,7 @@

             using (ImageSharp.Image image = new ImageSharp.Image(message.Attachments[0].Contents))
             {
-                image.Brightness(val).Save(ms);
+                image.Brightness(val).Save(ms).Dispose();
             }
             ms.Seek(0, SeekOrigin.Begin);
             return Message.Create(null, new StreamAttachment(ms, message.Attachments[0].Name));
@@ -86,7 +96,7 @@

             using (ImageSharp.Image image = new ImageSharp.Image(message.Attachments[0].Contents))
             {
-                image.Pixelate(val).Save(ms);
+                image.Pixelate(val).Save(ms).Dispose();
             }
             ms.Seek(0, SeekOrigin.Begin);
             return Message.Create(null, new StreamAttachment(ms, message.Attachments[0].Name));
@@ -106,7 +116,7 @@

             using (ImageSharp.Image image = new ImageSharp.Image(message.Attachments[0].Contents))
             {
-                image.GaussianSharpen(val).Save(ms);
+                image.GaussianSharpen(val).Save(ms).Dispose();
             }
             ms.Seek(0, SeekOrigin.Begin);
             return Message.Create(null, new StreamAttachment(ms, message.Attachments[0].Name));
@@ -126,7 +136,7 @@

             using (ImageSharp.Image image = new ImageSharp.Image(message.Attachments[0].Contents))
             {
-                image.Hue(val).Save(ms);
+                image.Hue(val).Save(ms).Dispose();
             }
             ms.Seek(0, SeekOrigin.Begin);
             return Message.Create(null, new StreamAttachment(ms, message.Attachments[0].Name));
@@ -139,7 +149,7 @@

             using (ImageSharp.Image image = new ImageSharp.Image(message.Attachments[0].Contents))
             {
-                image.DetectEdges().Save(ms);
+                image.DetectEdges().Save(ms).Dispose();
             }
             ms.Seek(0, SeekOrigin.Begin);
             return Message.Create(null, new StreamAttachment(ms, message.Attachments[0].Name));
@@ -152,7 +162,7 @@

             using (ImageSharp.Image image = new ImageSharp.Image(message.Attachments[0].Contents))
             {
-                image.Invert().Save(ms);
+                image.Invert().Save(ms).Dispose();
             }
             ms.Seek(0, SeekOrigin.Begin);
             return Message.Create(null, new StreamAttachment(ms, message.Attachments[0].Name));
@@ -165,7 +175,7 @@

             using (ImageSharp.Image image = new ImageSharp.Image(message.Attachments[0].Contents))
             {
-                image.Glow().Save(ms);
+                image.Glow().Save(ms).Dispose();
             }
             ms.Seek(0, SeekOrigin.Begin);
             return Message.Create(null, new StreamAttachment(ms, message.Attachments[0].Name));
@@ -176,6 +186,8 @@
         {
             if (message.Attachments?.Count >= 2)
             {
+                int blendAmount = 50;
+                int.TryParse(message.Text, out blendAmount);
                 MemoryStream ms = new MemoryStream();

                 using (ImageSharp.Image imageSource = new ImageSharp.Image(message.Attachments[0].Contents))
@@ -190,14 +202,22 @@
                     {
                         using (ImageSharp.Image imageTarget = new ImageSharp.Image(attachment.Contents))
                         {
-                            ms.Dispose();
-                            ms = new MemoryStream(); // Reinit the stream. This is also insane.
-                            imageSource.DrawImage(imageTarget.Resize(imageSource.Width, imageSource.Height), 50, default(Size), default(Point)).Save(ms);
+                            using (var resizedImage = imageTarget.Resize(imageSource.Width,
+                                    imageSource.Height))
+                            {
+                                ms.Dispose();
+                                ms = new MemoryStream(); // Reinit the stream. This is also insane.
+                                var blendedImage = imageSource.DrawImage(resizedImage, blendAmount, default(Size), default(Point));
+                                blendedImage.Save(ms);
+                                blendedImage.Dispose();
+                            }
                         }
                     }
                     ms.Seek(0, SeekOrigin.Begin);
                 }

+                // Sneak in to the ArrayPool.
+
                 return Message.Create(null, new StreamAttachment(ms, message.Attachments[0].Name));
             }
             return null;


Fixed migration cmd error

Fixed migration cmd error

--- DBMigratorVsix/DBMigratorWindowControl.xaml.cs
+++ DBMigratorVsix/DBMigratorWindowControl.xaml.cs
@@ -52,7 +52,7 @@
             if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
                 cmd += $" -u {username} -p {password}";

-            cmd += $"-f {path}";
+            cmd += $" -f {path}";

             if (!string.IsNullOrEmpty(version))
                 cmd += $" -v {version}";


await 置き換え Step2

await 置き換え Step2

--- Demo/2018/AsyncInternal/AwaitCodeGeneration.cs
+++ Demo/2018/AsyncInternal/AwaitCodeGeneration.cs
@@ -6,26 +6,31 @@
 {
     class AwaitCodeGeneration
     {
-        // Step1: foreach とかは、if, goto に展開
+        // Step2: メソッド全体を包む匿名なクラスを生成(ここではラムダ式で代用)
         public static async Task<IEnumerable<string>> GetContents()
         {
-            var indexes = await GetIndex();
+            void a()
+            {
+                var indexes = await GetIndex();

-            var selectedIndexes = await SelectIndex(indexes);
+                var selectedIndexes = await SelectIndex(indexes);

-            var contents = new List<string>();
-            var e = selectedIndexes.GetEnumerator();
+                var contents = new List<string>();
+                var e = selectedIndexes.GetEnumerator();

-            goto EndLoop;
-            BeginLoop:
-            var content = await GetContent(e.Current);
-            contents.Add(content);
-            EndLoop:
-            if (e.MoveNext()) goto BeginLoop;
+                goto EndLoop;
+                BeginLoop:
+                var content = await GetContent(e.Current);
+                contents.Add(content);
+                EndLoop:
+                if (e.MoveNext()) goto BeginLoop;

-            e.Dispose();
+                e.Dispose();

-            return contents;
+                return contents;
+            }
+
+            a();
         }

         static async Task<IEnumerable<string>> GetIndex()


Removed duplicate route definition.

Removed duplicate route definition.

--- DorTaxRateWeb/Controllers/TaxRateController.cs
+++ DorTaxRateWeb/Controllers/TaxRateController.cs
@@ -33,7 +33,6 @@
 		/// <param name="year">A year. Minimum allowed value is 2008.</param>
 		/// <param name="quarter">An integer representing a quarterYear: a value of 1 through 4. For 2008, only quarters 3 and 4 are available.</param>
 		/// <returns>Returns a list of <see cref="TaxRateItem"/> objects.</returns>
-		[Route("rates/{year:min(2008)}/{quarter:range(1,4)}")]
 		[Route("rates/{year:min(2008)}/{quarter:range(1,4)}")]
 		[CacheOutput(ServerTimeSpan=_defaultCache, ClientTimeSpan=_defaultCache)]
 		public IEnumerable<TaxRateItem> GetTaxRates(int year, int quarter)


Revert Mistake

Revert Mistake

--- EmotionCore/src/Game/UI/ScrollInputSelector.cs
+++ EmotionCore/src/Game/UI/ScrollInputSelector.cs
@@ -32,12 +32,9 @@
         /// </summary>
         private ScrollInput _parent;

-        private SoundFile _scrollSound;
-
         public ScrollInputSelector(ScrollInput parent, Controller controller, Rectangle bounds, int priority) : base(controller, bounds, priority)
         {
             _parent = parent;
-            _scrollSound = _controller.Context.AssetLoader.Get<SoundFile>("Music/UI/slider_short.wav");
         }

         public override void Draw(Renderer renderer)
@@ -58,22 +55,6 @@
             float posWithinParent = newPosition.X - _parent.Bounds.X;
             float increment = _parent.Bounds.Width / 100;
             _parent.Value = (int) (posWithinParent / increment);
-
-            if (_controller.Context.SoundManager.GetLayer("UI").Source.Paused)
-            {
-                _controller.Context.SoundManager.GetLayer("UI").Source.Play();
-            }
-        }
-
-        public override void MouseDown(MouseKeys key)
-        {
-            _controller.Context.SoundManager.PlayOnLayer("UI", _scrollSound);
-            _controller.Context.SoundManager.GetLayer("UI").Source.Looping = true;
-        }
-
-        public override void MouseUp(MouseKeys key)
-        {
-            _controller.Context.SoundManager.GetLayer("UI").Source.Destroy();
         }
     }
 }


no more spaces

no more spaces

--- EngineLayer/PsmWithMultiplePossiblePeptides.cs
+++ EngineLayer/PsmWithMultiplePossiblePeptides.cs
@@ -140,7 +140,7 @@
                 sb.Append("MissedCleavages" + '\t');
                 sb.Append("PeptideMonoisotopicMass" + '\t');
                 sb.Append("MassDiff (Da)" + '\t');
-                sb.Append("Decoy/Contaminant");
+                sb.Append("Decoy/Contaminant/Target");
                 return sb.ToString();
             }
         }
@@ -165,7 +165,12 @@
             sb.Append(MissedCleavages.ToString(CultureInfo.InvariantCulture) + '\t');
             sb.Append(PeptideMonoisotopicMass.ToString("F5", CultureInfo.InvariantCulture) + '\t');
             sb.Append((ScanPrecursorMass - PeptideMonoisotopicMass).ToString("F5", CultureInfo.InvariantCulture) + '\t');
-            sb.Append("" + (IsDecoy ? "D" : " ") + (IsContaminant ? "C" : " "));
+            if (IsDecoy)
+                sb.Append("D");
+            else if (IsContaminant)
+                sb.Append("C");
+            else
+                sb.Append("T");

             return sb.ToString();
         }


Refactored into smaller methods

Refactored into smaller methods

--- Espera/Espera.View/ViewModels/MainViewModel.cs
+++ Espera/Espera.View/ViewModels/MainViewModel.cs
@@ -445,7 +445,7 @@
             this.StatusViewModel = new StatusViewModel();

             this.updateTimer = new Timer(333);
-            this.updateTimer.Elapsed += (sender, e) => this.UpdateTime();
+            this.updateTimer.Elapsed += (sender, e) => this.UpdateCurrentTime();

             this.searchText = String.Empty;
         }
@@ -502,28 +502,38 @@
             this.updateTimer.Dispose();
         }

-        private void UpdateTime()
+        private void UpdateCurrentTime()
         {
             this.OnPropertyChanged(vm => vm.CurrentSeconds);
             this.OnPropertyChanged(vm => vm.CurrentTime);
         }

-        private void LibraryRaisedSongFinished(object sender, EventArgs e)
+        private void UpdateTotalTime()
+        {
+            this.OnPropertyChanged(vm => vm.TotalSeconds);
+            this.OnPropertyChanged(vm => vm.TotalTime);
+        }
+
+        private void UpdatePlaylist()
         {
             this.OnPropertyChanged(vm => vm.IsPlaying);
             this.OnPropertyChanged(vm => vm.Playlist);
+        }
+
+        private void LibraryRaisedSongFinished(object sender, EventArgs e)
+        {
+            this.UpdatePlaylist();

             this.updateTimer.Stop();
         }

         private void LibraryRaisedSongStarted(object sender, EventArgs e)
         {
-            this.OnPropertyChanged(vm => vm.TotalSeconds);
-            this.OnPropertyChanged(vm => vm.TotalTime);
-            this.OnPropertyChanged(vm => vm.Playlist);
+            this.UpdateTotalTime();
+            this.UpdatePlaylist();
+
             this.OnPropertyChanged(vm => vm.SongsRemaining);
             this.OnPropertyChanged(vm => vm.TimeRemaining);
-            this.OnPropertyChanged(vm => vm.IsPlaying);

             this.updateTimer.Start();
         }


Make sure the view is still in the hierarchy (#1143)

In the case of virtualized list views, the control may no longer be in screen, so we have to ignore touch events.
Fixes #978

--- source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.WPF/SKTouchHandlerElement.cs
+++ source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.WPF/SKTouchHandlerElement.cs
@@ -102,6 +102,10 @@
 				return false;

 			var view = sender as FrameworkElement;
+
+			// bail out if this view is not part the view hierarchy anymore
+			if (PresentationSource.FromVisual(view) == null)
+				return false;

 			var id = GetId(evt);
 			var action = GetTouchAction(touchActionType, view, evt);


Add VB's concatenation operator overloading to enable VB2015 regular expression concatenation expression

--- src/Compilers/Compilers.Scanners/RegularExpression.cs
+++ src/Compilers/Compilers.Scanners/RegularExpression.cs
@@ -157,5 +157,11 @@
         {
             return new ConcatenationExpression(left, right);
         }
+
+        [SpecialName]
+        public static RegularExpression op_Concatenate(RegularExpression left, RegularExpression right)
+        {
+            return new ConcatenationExpression(left, right);
+        }
     }
 }


Adjusted Commit indexer xml doc see and fixes #966

--- LibGit2Sharp/Commit.cs
+++ LibGit2Sharp/Commit.cs
@@ -54,7 +54,7 @@
         /// <summary>
         /// Gets the <see cref="TreeEntry"/> pointed at by the <paramref name="relativePath"/> in the <see cref="Tree"/>.
         /// </summary>
-        /// <param name="relativePath">The relative path to the <see cref="TreeEntry"/> from the <see cref="Commit"/> working directory.</param>
+        /// <param name="relativePath">Path to the <see cref="TreeEntry"/> from the tree in this <see cref="Commit"/></param>
         /// <returns><c>null</c> if nothing has been found, the <see cref="TreeEntry"/> otherwise.</returns>
         public virtual TreeEntry this[string relativePath]
         {


Four4Sample - too many operands (R)

Four4Sample - too many operands (R)

--- projects/Four4Sample/Four4.Test/CalculatorTest.cs
+++ projects/Four4Sample/Four4.Test/CalculatorTest.cs
@@ -139,6 +139,7 @@
         [InlineData("4 4 - 4 - R", "NaN")]
         [InlineData("4 4 - .4_ - R", "NaN")]
         [InlineData("R", "NaN")]
+        [InlineData("4 4 R", "NaN")]
         public void SquareRoot(string input, string result)
         {
             TestEval(input, result);
@@ -152,6 +153,7 @@
         [InlineData(0, 0, "!", "NaN")]
         [InlineData(0, 1, "+", "NaN")]
         [InlineData(0, 1, "4", "NaN")]
+        [InlineData(0, 1, "4 R", "NaN")]
         public void EvalNumberAndString(int num, int denom, string input, string result)
         {
             TestEval(num, denom, input, result);


Fix #565

Fix #565

--- letsencrypt-win-simple/Options.cs
+++ letsencrypt-win-simple/Options.cs
@@ -54,7 +54,7 @@

         #region Manual

-        [Option(HelpText = "A host name to manually get a certificate for. This may be a comma separated list if the --san option is also specified.")]
+        [Option(HelpText = "A host name to manually get a certificate for. This may be a comma separated list.")]
         public string ManualHost { get; set; }

         [Option(Default = WebRootDefault, HelpText = "A web root for the manual host name for authentication.")]


Bug listing validation errors

Bug listing validation errors

--- letsencrypt-win-simple/Program.cs
+++ letsencrypt-win-simple/Program.cs
@@ -347,7 +347,7 @@
             var errors = auth.Challenges?.
                 Select(c => c.ChallengePart).
                 Where(cp => cp.Status == _authorizationInvalid).
-                SelectMany(cp => cp.Error);
+                SelectMany(cp => cp.Error ?? new Dictionary<string, string>());

             if (errors?.Count() > 0)
             {


Creating chain *.pem file

Creating chain *.pem file

A chain file is created which includes the requested certificate and the
LE intermediate.

--- letsencrypt-win-simple/Program.cs
+++ letsencrypt-win-simple/Program.cs
@@ -665,6 +665,7 @@
                 var csrPemFile = Path.Combine(_certificatePath, $"{dnsIdentifier}-csr.pem");
                 var crtDerFile = Path.Combine(_certificatePath, $"{dnsIdentifier}-crt.der");
                 var crtPemFile = Path.Combine(_certificatePath, $"{dnsIdentifier}-crt.pem");
+                var chainPemFile = Path.Combine(_certificatePath, $"{dnsIdentifier}-chain.pem");
                 string crtPfxFile = null;
                 if (!CentralSsl)
                 {
@@ -699,6 +700,14 @@

                 // To generate a PKCS#12 (.PFX) file, we need the issuer's public certificate
                 var isuPemFile = GetIssuerCertificate(certRequ, cp);
+
+                using (FileStream intermediate = new FileStream(isuPemFile, FileMode.Open),
+                    certificate = new FileStream(crtPemFile, FileMode.Open),
+                    chain = new FileStream(chainPemFile, FileMode.Create))
+                {
+                    certificate.CopyTo(chain);
+                    intermediate.CopyTo(chain);
+                }

                 Log.Debug("CentralSsl {CentralSsl} San {San}", CentralSsl.ToString(), Options.San.ToString());


Fix case sensitive domain in request

Fix case sensitive domain in request

--- src/Certify.Core/Management/CertifyManager/CertifyManager.CertificateRequest.cs
+++ src/Certify.Core/Management/CertifyManager/CertifyManager.CertificateRequest.cs
@@ -519,7 +519,7 @@
                     // resume process, ask CA to check our challenge responses
                     foreach (var domain in distinctDomains)
                     {
-                        var asciiDomain = _idnMapping.GetAscii(domain);
+                        var asciiDomain = _idnMapping.GetAscii(domain).ToLower();

                         // TODO: get fresh copy of authz info before proceeding
                         var authorization = authorizations.FirstOrDefault(a => a.Identifier?.Dns == asciiDomain);
@@ -797,7 +797,7 @@

             foreach (var domain in distinctDomains)
             {
-                var asciiDomain = _idnMapping.GetAscii(domain);
+                var asciiDomain = _idnMapping.GetAscii(domain).ToLower();

                 var authorization = authorizations.FirstOrDefault(a => a.Identifier?.Dns == asciiDomain);


Create a graphic with an empty attributes collection when template prototype attributes is null.

--- src/Common/Esri.ArcGISRuntime.Toolkit/Controls/TemplatePicker/TemplatePicker.cs
+++ src/Common/Esri.ArcGISRuntime.Toolkit/Controls/TemplatePicker/TemplatePicker.cs
@@ -147,7 +147,7 @@
                         templates.Add(item);
                         if (renderer != null)
                         {
-                            var g = new Graphic(template.Prototype.Attributes ?? Enumerable.Empty<System.Collections.Generic.KeyValuePair<string, object>>()); // Need to desambiguate from winstore toolkit KeyValuePair
+                            var g = new Graphic(template.Prototype.Attributes ?? Enumerable.Empty<System.Collections.Generic.KeyValuePair<string, object>>()); // Need to disambiguate from winstore toolkit KeyValuePair
                             item.SetSwatch(renderer.GetSymbol(g));
                         }
                     }
@@ -168,7 +168,7 @@
                             templates.Add(item);
                             if (renderer != null)
                             {
-                                var g = new Graphic(template.Prototype.Attributes);
+                                var g = new Graphic(template.Prototype.Attributes ?? Enumerable.Empty<System.Collections.Generic.KeyValuePair<string, object>>());
                                 item.SetSwatch(renderer.GetSymbol(g));
                             }
                         }


Add tests

Add tests

--- src/EditorFeatures/CSharpTest/UseSystemHashCode/UseSimpleUsingStatementTests.cs
+++ src/EditorFeatures/CSharpTest/UseSystemHashCode/UseSimpleUsingStatementTests.cs
@@ -135,5 +135,290 @@
     }
 }");
         }
-    }
-}
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseSimpleUsingStatement)]
+        public async Task TestFieldAndProp()
+        {
+            await TestInRegularAndScriptAsync(
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode()
+    {
+        var hashCode = -538000506;
+        hashCode = hashCode * -1521134295 + i.GetHashCode();
+        hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(S);
+        return hashCode;
+    }
+}",
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode()
+    {
+        return System.HashCode.Combine(i, S);
+    }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseSimpleUsingStatement)]
+        public async Task TestUnchecked()
+        {
+            await TestInRegularAndScriptAsync(
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode()
+    {
+        unchecked
+        {
+            var hashCode = -538000506;
+            hashCode = hashCode * -1521134295 + i.GetHashCode();
+            hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(S);
+            return hashCode;
+        }
+    }
+}",
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode()
+    {
+        return System.HashCode.Combine(i, S);
+    }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseSimpleUsingStatement)]
+        public async Task TestNotOnNonGetHashCode()
+        {
+            await TestMissingAsync(
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode1()
+    {
+        var hashCode = -538000506;
+        hashCode = hashCode * -1521134295 + i.GetHashCode();
+        hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(S);
+        return hashCode;
+    }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseSimpleUsingStatement)]
+        public async Task TestNotWithoutReturn()
+        {
+            await TestMissingAsync(
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode()
+    {
+        var hashCode = -538000506;
+        hashCode = hashCode * -1521134295 + i.GetHashCode();
+        hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(S);
+    }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseSimpleUsingStatement)]
+        public async Task TestNotWithoutLocal()
+        {
+            await TestMissingAsync(
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode()
+    {
+        hashCode = hashCode * -1521134295 + i.GetHashCode();
+        hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(S);
+        return hashCode;
+    }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseSimpleUsingStatement)]
+        public async Task TestNotWithMultipleLocals()
+        {
+            await TestMissingAsync(
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode()
+    {
+        var hashCode = -538000506, x;
+        hashCode = hashCode * -1521134295 + i.GetHashCode();
+        hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(S);
+        return hashCode;
+    }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseSimpleUsingStatement)]
+        public async Task TestNotWithoutInitializer()
+        {
+            await TestMissingAsync(
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode()
+    {
+        var hashCode;
+        hashCode = hashCode * -1521134295 + i.GetHashCode();
+        hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(S);
+        return hashCode;
+    }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseSimpleUsingStatement)]
+        public async Task TestNotReturningAccumulator()
+        {
+            await TestMissingAsync(
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode()
+    {
+        var hashCode = -538000506;
+        hashCode = hashCode * -1521134295 + i.GetHashCode();
+        hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(S);
+        return 0;
+    }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseSimpleUsingStatement)]
+        public async Task TestAcumulatorInitializedToField()
+        {
+            await TestInRegularAndScriptAsync(
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode()
+    {
+        var hashCode = i;
+        hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(S);
+        return hashCode;
+    }
+}",
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int GetHashCode()
+    {
+        return System.HashCode.Combine(i, S);
+    }
+}");
+        }
+
+        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseSimpleUsingStatement)]
+        public async Task TestAcumulatorInitializedToHashedField()
+        {
+            await TestInRegularAndScriptAsync(
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int $$GetHashCode()
+    {
+        var hashCode = i.GetHashCode();
+        hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(S);
+        return hashCode;
+    }
+}",
+@"using System.Collections.Generic;
+namespace System { public struct HashCode { } }
+
+class C
+{
+    int i;
+
+    string S { get; }
+
+    public override int GetHashCode()
+    {
+        return System.HashCode.Combine(i, S);
+    }
+}");
+        }
+    }
+}


Slightly more precise error message (#1206)

--- src/IdentityServer4/Configuration/IdentityServerApplicationBuilderExtensions.cs
+++ src/IdentityServer4/Configuration/IdentityServerApplicationBuilderExtensions.cs
@@ -49,7 +49,7 @@

                 TestService(serviceProvider, typeof(IPersistedGrantStore), logger, "No storage mechanism for grants specified. Use the 'AddInMemoryPersistedGrants' extension method to register a development version.");
                 TestService(serviceProvider, typeof(IClientStore), logger, "No storage mechanism for clients specified. Use the 'AddInMemoryClients' extension method to register a development version.");
-                TestService(serviceProvider, typeof(IResourceStore), logger, "No storage mechanism for resources specified. Use the 'AddInMemoryResources' extension method to register a development version.");
+                TestService(serviceProvider, typeof(IResourceStore), logger, "No storage mechanism for resources specified. Use the 'AddInMemoryIdentityResources' or 'AddInMemoryApiResources' extension method to register a development version.");

                 var persistedGrants = serviceProvider.GetService(typeof(IPersistedGrantStore));
                 if (persistedGrants.GetType().FullName == typeof(InMemoryPersistedGrantStore).FullName)
@@ -78,4 +78,4 @@
             return appService;
         }
     }
-}+}


Fix ambiguity caused by accessing a method that was expected to be a property.

--- src/NUnitEngine/Portable/nunit.portable.agent.tests/NUnitPortableDriverTests.cs
+++ src/NUnitEngine/Portable/nunit.portable.agent.tests/NUnitPortableDriverTests.cs
@@ -74,7 +74,7 @@
             Assert.That(result.GetAttribute("type"), Is.EqualTo("Assembly"));
             Assert.That(result.GetAttribute("runstate"), Is.EqualTo("Runnable"));
             Assert.That(result.GetAttribute("testcasecount"), Is.EqualTo(MockAssembly.Tests.ToString()));
-            Assert.That(result.Elements("test-suite").Count, Is.EqualTo(0), "Load result should not have child tests");
+            Assert.That(result.Elements("test-suite").Count(), Is.EqualTo(0), "Load result should not have child tests");
         }
         #endregion

@@ -89,7 +89,7 @@
             Assert.That(result.GetAttribute("type"), Is.EqualTo("Assembly"));
             Assert.That(result.GetAttribute("runstate"), Is.EqualTo("Runnable"));
             Assert.That(result.GetAttribute("testcasecount"), Is.EqualTo(MockAssembly.Tests.ToString()));
-            Assert.That(result.Elements("test-suite").Count, Is.GreaterThan(0), "Explore result should have child tests");
+            Assert.That(result.Elements("test-suite").Count(), Is.GreaterThan(0), "Explore result should have child tests");
         }

         [Test]
@@ -138,7 +138,7 @@
             Assert.That(result.GetAttribute("failed"), Is.EqualTo(MockAssembly.ErrorsAndFailures.ToString()));
             Assert.That(result.GetAttribute("skipped"), Is.EqualTo(MockAssembly.Skipped.ToString()));
             Assert.That(result.GetAttribute("inconclusive"), Is.EqualTo(MockAssembly.Inconclusive.ToString()));
-            Assert.That(result.Elements("test-suite").Count, Is.GreaterThan(0), "Explore result should have child tests");
+            Assert.That(result.Elements("test-suite").Count(), Is.GreaterThan(0), "Explore result should have child tests");
         }

         [Test]


2419.1: DrawSubImages

2419.1: DrawSubImages

--- src/PixelFarm/PixelFarm.DrawingGL/DrawingGL/GLShader/SimpleRectTextureShader.cs
+++ src/PixelFarm/PixelFarm.DrawingGL/DrawingGL/GLShader/SimpleRectTextureShader.cs
@@ -1490,7 +1490,7 @@
             _b = color.B / 255f;
             _a = color.A / 255f;
         }
-        public void NewDrawSubImage4FromVBO(GLBitmap glBmp, VertexBufferObject vbo, int elemCount, float x, float y)
+        public void DrawSubImages(GLBitmap glBmp, VertexBufferObject vbo, int elemCount, float x, float y)
         {
             SetCurrent();
             CheckViewMatrix();


remove todo only

remove todo only

--- src/SFA.DAS.EmployerAccounts/Queries/GetStatistics/GetStatisticsQueryHandler.cs
+++ src/SFA.DAS.EmployerAccounts/Queries/GetStatistics/GetStatisticsQueryHandler.cs
@@ -21,7 +21,6 @@

         public async Task<GetStatisticsResponse> Handle(GetStatisticsQuery message)
         {
-            //todo: make note in pr: adds reference to infrastructure
             var accountsQuery = _accountDb.Value.Accounts.FutureCount();
             var legalEntitiesQuery = _accountDb.Value.LegalEntities.FutureCount();
             var payeSchemesQuery = _accountDb.Value.Payees.FutureCount();


modify'

modify'

--- src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/OAuthAccessTokenContainer.cs
+++ src/Senparc.Weixin.MP/Senparc.Weixin.MP/Containers/OAuthAccessTokenContainer.cs
@@ -65,7 +65,7 @@
     }

     /// <summary>
-    /// 用户OAuth容器，用于自动管理OAuth的AccessToken，如果过期会重新获取
+    /// 用户OAuth容器，用于自动管理OAuth的AccessToken，如果过期会重新获取（测试中，暂时别用）
     /// </summary>
     public class OAuthAccessTokenContainer : BaseContainer<OAuthAccessTokenBag>
     {


Indentation corrected

Indentation corrected

--- GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs
+++ GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs
@@ -57,14 +57,14 @@
             if (firstChangesetInBranchToCreate == null)
             {
                 throw new GitTfsException("An unexpected error occured when trying to find the root changeset.\nFailed to find first changeset for " + tfsPathBranchToCreate);
-            }
-
-	        var mergedItemsToFirstChangesetInBranchToCreate = VersionControl
-		        .TrackMerges(new int[] {firstChangesetInBranchToCreate.ChangesetId},
-		                     new ItemIdentifier(tfsPathBranchToCreate),
-		                     new ItemIdentifier[] {new ItemIdentifier(tfsPathParentBranch),},
-		                     null)
-		        .OrderBy(x => x.SourceChangeset.ChangesetId);
+            }
+
+            var mergedItemsToFirstChangesetInBranchToCreate = VersionControl
+                .TrackMerges(new int[] {firstChangesetInBranchToCreate.ChangesetId},
+                             new ItemIdentifier(tfsPathBranchToCreate),
+                             new ItemIdentifier[] {new ItemIdentifier(tfsPathParentBranch),},
+                             null)
+                .OrderBy(x => x.SourceChangeset.ChangesetId);

             var lastChangesetsMergeFromParentBranch = mergedItemsToFirstChangesetInBranchToCreate.LastOrDefault();


Incorporate BridgeClient improvements

Incorporate BridgeClient improvements

--- src/System.Private.ServiceModel/tests/Common/Infrastructure/src/BridgeClient.cs
+++ src/System.Private.ServiceModel/tests/Common/Infrastructure/src/BridgeClient.cs
@@ -13,6 +13,7 @@
 {
     public static class BridgeClient
     {
+        private static object s_thisLock = new object();
         private static Dictionary<string, string> _Resources = new Dictionary<string, string>();
         private static BridgeState _BridgeStatus = BridgeState.NotStarted;
         private static readonly Regex regexResource = new Regex(@"details\s*:\s*""([^""]+)""", RegexOptions.IgnoreCase);
@@ -22,20 +23,26 @@
             get { return TestProperties.GetProperty(TestProperties.BridgeUrl_PropertyName); }
         }

-        static BridgeClient()
+        private static void EnsureBridgeIsRunning()
         {
-            if (_BridgeStatus == BridgeState.NotStarted)
+            // Tests run concurrently, so we need the initial configuration
+            // request to finish and set state before the rest continue.
+            lock (s_thisLock)
             {
-                MakeConfigRequest();
-            }
-            else if (_BridgeStatus == BridgeState.Faulted)
-            {
-                throw new Exception("Bridge is not running");
+                if (_BridgeStatus == BridgeState.NotStarted)
+                {
+                    MakeConfigRequest();
+                }
+                else if (_BridgeStatus == BridgeState.Faulted)
+                {
+                    throw new Exception("Bridge is not running");
+                }
             }
         }
-
         public static string GetResourceAddress(string resourceName)
         {
+            EnsureBridgeIsRunning();
+
             string resourceAddress = null;
             if (_BridgeStatus == BridgeState.Started && !_Resources.TryGetValue(resourceName, out resourceAddress))
             {
@@ -59,7 +66,18 @@
                 {
                     var response = httpClient.PostAsync("/config/", content).Result;
                     if (!response.IsSuccessStatusCode)
-                        throw new Exception("Unexpected status code: " + response.StatusCode);
+                    {
+                        string reason = String.Empty;
+                        if (response.Content != null)
+                        {
+                            string contentAsString = response.Content.ReadAsStringAsync().Result;
+                            reason = String.Format("{0}Bridge returned content:{0}{1}",
+                                                    Environment.NewLine, contentAsString);
+                        }
+                        throw new Exception(
+                            String.Format("Bridge returned unexpected status code {0}{1}",
+                                            response.StatusCode, reason));
+                    }
                     _BridgeStatus = BridgeState.Started;
                 }
                 catch (Exception exc)
@@ -72,6 +90,8 @@

         private static string CreateConfigRequestContentAsJson()
         {
+            ValidateConfigRequestProperties();
+
             // Create a Json dictionary of name/value pairs from TestProperties
             StringBuilder sb = new StringBuilder("{ ");
             string[] propertyNames = TestProperties.PropertyNames.ToArray();
@@ -88,8 +108,21 @@
             return sb.ToString();
         }

+        // Validates some of the name/value pairs that will be sent to the Bridge
+        // via the /config POST request.
+        private static void ValidateConfigRequestProperties()
+        {
+            string bridgeResourceFolder = TestProperties.GetProperty(TestProperties.BridgeResourceFolder_PropertyName);
+            if (String.IsNullOrEmpty(bridgeResourceFolder) || !Directory.Exists(bridgeResourceFolder))
+            {
+                throw new Exception(String.Format("BridgeResourceFolder '{0}' does not exist", bridgeResourceFolder));
+            }
+        }
+
         private static string MakeResourcePutRequest(string resourceName)
         {
+            EnsureBridgeIsRunning();
+
             using (HttpClient httpClient = new HttpClient())
             {
                 httpClient.BaseAddress = new Uri(BridgeBaseAddress);
@@ -119,6 +152,8 @@

         private static string MakeResourceGetRequest(string resourceName)
         {
+            EnsureBridgeIsRunning();
+
             using (HttpClient httpClient = new HttpClient())
             {
                 httpClient.BaseAddress = new Uri(BridgeBaseAddress);


Add non-generic IAwaiter

Add non-generic IAwaiter

--- src/System.Threading.Tasks.Channels/System/Runtime/CompilerServices/IAwaiter.cs
+++ src/System.Threading.Tasks.Channels/System/Runtime/CompilerServices/IAwaiter.cs
@@ -4,6 +4,16 @@

 namespace System.Runtime.CompilerServices
 {
+    /// Provides an interface that may be implemented by an awaiter.
+    /// <typeparam name="T">Specifies the result type of the await operation using this awaiter.</typeparam>
+    public interface IAwaiter : ICriticalNotifyCompletion
+    {
+        /// Gets whether the awaiter is completed.
+        bool IsCompleted { get; }
+        /// Gets the result of the completed, awaited operation.
+        void GetResult();
+    }
+
     /// Provides an interface that may be implemented by an awaiter.
     /// <typeparam name="T">Specifies the result type of the await operation using this awaiter.</typeparam>
     public interface IAwaiter<T> : ICriticalNotifyCompletion


Remove wait for out of process start from OnLoadedAsync as it has not cancellation token.  The wait will instead occur in ActivateAsync with cancellation

--- src/VisualStudio/Core/Def/Implementation/LanguageClient/LanguageServerClient.cs
+++ src/VisualStudio/Core/Def/Implementation/LanguageClient/LanguageServerClient.cs
@@ -111,19 +111,6 @@
             // initialize things on UI thread
             await InitializeOnUIAsync().ConfigureAwait(false);

-            // wait until remote host is available before let platform know that they can activate our LSP
-            var client = await RemoteHostClient.TryGetClientAsync(_services, CancellationToken.None).ConfigureAwait(false);
-            if (client == null)
-            {
-                // There is no OOP. either user turned it off, or process got killed.
-                // We should have already gotten a gold bar + nfw already if the OOP is missing.
-                // so just log telemetry here so we can connect the two with session explorer.
-                Logger.Log(FunctionId.LanguageServer_OnLoadedFailed, KeyValueLogMessage.NoProperty);
-                // don't ask platform to start LSP.
-                // we shouldn't throw as the LSP client does not expect exceptions here.
-                return;
-            }
-
             // let platform know that they can start us
             await StartAsync.InvokeAsync(this, EventArgs.Empty).ConfigureAwait(false);


Add CT

Add CT

--- src/VisualStudio/Core/Def/Implementation/Progression/GraphNavigatorExtension.cs
+++ src/VisualStudio/Core/Def/Implementation/Progression/GraphNavigatorExtension.cs
@@ -100,7 +100,7 @@
             if (symbolId != null)
             {
                 var symbolNavigationService = _workspace.Services.GetService<ISymbolNavigationService>();
-                var symbol = symbolId.Value.Resolve(project.GetCompilationAsync(cancellationToken).WaitAndGetResult(cancellationToken)).Symbol;
+                var symbol = symbolId.Value.Resolve(project.GetCompilationAsync(cancellationToken).WaitAndGetResult(cancellationToken), cancellationToken: cancellationToken).Symbol;

                 // Do not allow third party navigation to types or constructors
                 if (symbol != null &&
@@ -136,7 +136,6 @@

         public int GetRank(GraphObject graphObject)
         {
-
             if (graphObject is GraphNode graphNode)
             {
                 var sourceLocation = graphNode.GetValue<SourceLocation>(CodeNodeProperties.SourceLocation);


Assembly version 49747

Assembly version 49747

--- Heroes.ReplayParser/Properties/AssemblyInfo.cs
+++ Heroes.ReplayParser/Properties/AssemblyInfo.cs
@@ -7,5 +7,5 @@
 [assembly: AssemblyProduct("Heroes.ReplayParser")]
 [assembly: ComVisible(false)]
 [assembly: Guid("ab85402d-b34a-42ed-b74e-02c2656896d8")]
-[assembly: AssemblyVersion("1.0.0.48760")]
-[assembly: AssemblyFileVersion("1.0.0.48760")]+[assembly: AssemblyVersion("1.0.0.49747")]
+[assembly: AssemblyFileVersion("1.0.0.49747")]


log file extension not supported

log file extension not supported

--- src/FilterLists.Agent/Features/Lists/DownloadLists.cs
+++ src/FilterLists.Agent/Features/Lists/DownloadLists.cs
@@ -90,6 +90,10 @@
                                 var command = CommandsByExtension[extension].Invoke(l);
                                 await _mediator.Send(command, cancellationToken);
                             }
+                            else
+                            {
+                                _logger.LogError($"The file extension of list {l.Id} from {l.ViewUrl} is not supported.");
+                            }
                         }
                         catch (HttpRequestException ex)
                         {


allow parsing of only the command options

--- IPTables.Net/Iptables/Modules/CommandParser.cs
+++ IPTables.Net/Iptables/Modules/CommandParser.cs
@@ -18,13 +18,15 @@
         public IpTablesCommand Command;
         private ModuleEntry? _polyfill = null;
         private IpTablesCommand _ipCommand;
+        private bool _onlyCommand;

-        public CommandParser(string[] arguments, IpTablesCommand ipCommand, IpTablesChainSet chains)
+        public CommandParser(string[] arguments, IpTablesCommand ipCommand, IpTablesChainSet chains, bool onlyCommand = false)
         {
             _arguments = arguments;
             _ipCommand = ipCommand;
             _parsers = ModuleRegistry.PreloadDuplicateModules.ToList();
             _chains = chains;
+            _onlyCommand = onlyCommand;
         }

         public String ChainName
@@ -76,11 +78,6 @@
             Position = position;
             String option = GetCurrentArg();

-            if (option == "-m")
-            {
-                LoadParserModule(GetNextArg(), version);
-                return 1;
-            }
             if (option == "-A" || option == "-D" || option == "-R" || option == "-I")
             {
                 _ipCommand.ChainName = GetNextArg();
@@ -108,6 +105,14 @@
             if (option == "-t")
             {
                 _ipCommand.Table = GetNextArg();
+                return 1;
+            }
+
+            if (_onlyCommand) return 0;
+
+            if (option == "-m")
+            {
+                LoadParserModule(GetNextArg(), version);
                 return 1;
             }
             if (option == "-j")


Add window name header

Add window name header

--- src/GRA.Controllers/MissionControl/FilesController.cs
+++ src/GRA.Controllers/MissionControl/FilesController.cs
@@ -35,6 +35,9 @@
             var typeProvider = new FileExtensionContentTypeProvider();
             typeProvider.TryGetContentType(file, out string contentType);

+            HttpContext.Response.Headers
+                .Add("content-disposition", $"inline; filename=\"{filename}\"");
+
             return PhysicalFile(file, contentType);
         }


refactor(WatsonService): Replaced try catch with null check since error is not thrown if there is no

--- src/IBM.WatsonDeveloperCloud/Service/WatsonService.cs
+++ src/IBM.WatsonDeveloperCloud/Service/WatsonService.cs
@@ -104,22 +104,16 @@
                     }
                 }

-                try
-                {
-                    ApiKey = Environment.GetEnvironmentVariable(ServiceName.ToUpper() + "_APIKEY");
+                ApiKey = Environment.GetEnvironmentVariable(ServiceName.ToUpper() + "_APIKEY");
+                if (string.IsNullOrEmpty(ApiKey))
+                {
+                    throw new NullReferenceException(string.Format("{0}_APIKEY did not exist. Please add credentials with this key in ibm-credentials.env.", ServiceName.ToUpper()));
                 }
-                catch(Exception e)
-                {
-                    throw new NullReferenceException(string.Format("{0}_APIKEY did not exist. Please add credentials with this key in ibm-credentials.env. Error: {1}", ServiceName.ToUpper(), e.Message));
-                }
-
-                try
-                {
-                    Endpoint = Environment.GetEnvironmentVariable(ServiceName.ToUpper() + "_URL");
-                }
-                catch(Exception e)
-                {
-                    throw new NullReferenceException(string.Format("{0}_URL did not exist. Please add url with this key in ibm-credentials.env. Error: {1}", ServiceName.ToUpper(), e.Message));
+
+                Endpoint = Environment.GetEnvironmentVariable(ServiceName.ToUpper() + "_URL");
+                if (string.IsNullOrEmpty(Endpoint))
+                {
+                    throw new NullReferenceException(string.Format("{0}_URL did not exist. Please add url with this key in ibm-credentials.env.", ServiceName.ToUpper()));
                 }

                 TokenOptions tokenOptions = new TokenOptions()


Update Program.cs

Update Program.cs


FireAndForget scripted rez - port from Avination

--- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2771,64 +2771,69 @@
         {
             m_host.AddScriptLPS(1);

-            if (Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s))
-                return;
-            float dist = (float)llVecDist(llGetPos(), pos);
-
-            if (dist > m_ScriptDistanceFactor * 10.0f)
-                return;
-
-            TaskInventoryDictionary partInventory = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
-
-            foreach (KeyValuePair<UUID, TaskInventoryItem> inv in partInventory)
-            {
-                if (inv.Value.Name == inventory)
-                {
-                    // make sure we're an object.
-                    if (inv.Value.InvType != (int)InventoryType.Object)
+            Util.FireAndForget(delegate (object x)
+            {
+                if (Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s))
+                    return;
+                float dist = (float)llVecDist(llGetPos(), pos);
+
+                if (dist > m_ScriptDistanceFactor * 10.0f)
+                    return;
+
+                //Clone is thread-safe
+                TaskInventoryDictionary partInventory = (TaskInventoryDictionary)m_host.TaskInventory.Clone();
+
+                foreach (KeyValuePair<UUID, TaskInventoryItem> inv in partInventory)
+                {
+                    if (inv.Value.Name == inventory)
                     {
-                        llSay(0, "Unable to create requested object. Object is missing from database.");
+                        // make sure we're an object.
+                        if (inv.Value.InvType != (int)InventoryType.Object)
+                        {
+                            llSay(0, "Unable to create requested object. Object is missing from database.");
+                            return;
+                        }
+
+                        Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z);
+                        Vector3 llvel = new Vector3((float)vel.x, (float)vel.y, (float)vel.z);
+
+                        // need the magnitude later
+                        // float velmag = (float)Util.GetMagnitude(llvel);
+
+                        SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, Rot2Quaternion(rot), llvel, param);
+
+                        // If either of these are null, then there was an unknown error.
+                        if (new_group == null)
+                            continue;
+
+                        // objects rezzed with this method are die_at_edge by default.
+                        new_group.RootPart.SetDieAtEdge(true);
+
+                        new_group.ResumeScripts();
+
+                        m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams(
+                                "object_rez", new Object[] {
+                                new LSL_String(
+                                new_group.RootPart.UUID.ToString()) },
+                                new DetectParams[0]));
+
+                        float groupmass = new_group.GetMass();
+
+                        if (new_group.RootPart.PhysActor != null && new_group.RootPart.PhysActor.IsPhysical && llvel != Vector3.Zero)
+                        {
+                            //Recoil.
+                            llApplyImpulse(new LSL_Vector(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0);
+                        }
+                        // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
                         return;
                     }
-
-                    Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z);
-                    Vector3 llvel = new Vector3((float)vel.x, (float)vel.y, (float)vel.z);
-
-                    // need the magnitude later
-                    float velmag = (float)Util.GetMagnitude(llvel);
-
-                    SceneObjectGroup new_group = World.RezObject(m_host, inv.Value, llpos, Rot2Quaternion(rot), llvel, param);
-
-                    // If either of these are null, then there was an unknown error.
-                    if (new_group == null)
-                        continue;
-
-                    // objects rezzed with this method are die_at_edge by default.
-                    new_group.RootPart.SetDieAtEdge(true);
-
-                    new_group.ResumeScripts();
-
-                    m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams(
-                            "object_rez", new Object[] {
-                            new LSL_String(
-                            new_group.RootPart.UUID.ToString()) },
-                            new DetectParams[0]));
-
-                    float groupmass = new_group.GetMass();
-
-                    if (new_group.RootPart.PhysActor != null && new_group.RootPart.PhysActor.IsPhysical && llvel != Vector3.Zero)
-                    {
-                        //Recoil.
-                        llApplyImpulse(new LSL_Vector(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0);
-                    }
-                    // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
-                    ScriptSleep((int)((groupmass * velmag) / 10));
-                    ScriptSleep(100);
-                    return;
-                }
-            }
-
-            llSay(0, "Could not find object " + inventory);
+                }
+
+                llSay(0, "Could not find object " + inventory);
+            });
+
+            //ScriptSleep((int)((groupmass * velmag) / 10));
+            ScriptSleep(100);
         }

         public void llRezObject(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param)


More changes to DateTimeOffset

More changes to DateTimeOffset

--- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs
+++ src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs
@@ -129,9 +129,9 @@
             {
                 _length = _fileInfo.Length;

-                DateTime last = _fileInfo.LastModified;
+                DateTimeOffset last = _fileInfo.LastModified;
                 // Truncate to the second.
-                _lastModified = new DateTime(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Kind);
+                _lastModified = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Offset);
                 _lastModifiedString = _lastModified.ToString(Constants.HttpDateFormat, CultureInfo.InvariantCulture);

                 long etagHash = _lastModified.ToFileTime() ^ _length;


Refactored: 存在確認のコードを簡略化。

Refactored: 存在確認のコードを簡略化。

--- Implem.Libraries/DataSources/SqlServer/Sqls.cs
+++ Implem.Libraries/DataSources/SqlServer/Sqls.cs
@@ -63,7 +63,7 @@
                 value: searchTextCollection,
                 raw: "(@SearchText#ParamCount#_#CommandCount# = '' or (" +
                     clauseCollection.Join(" or ") + "))",
-                _using: searchTextCollection.Count() > 0);
+                _using: searchTextCollection.Any());
         }

         public static SqlWhereCollection SqlWhereExists(


Do not start restore if project.lock.json file changes.

The current restore logic is taken from OmniSharp. The latest
OmniSharp code no longer triggers a restore when the project.lock.json
file is changed.

This may or may not reduce the number of times a restore is called
which was reported in issue #23

Occasionally multiple restore processes are started for a single
project when the project.json file is changed. This seems to be
caused by the lock file being changed since there are many (40+)
file watcher events triggered when a restore is run. Now that the
lock file being changed no longer triggers a restore then hopefully
multiple restores for the same underlying project.json file change
should not occur.

--- src/MonoDevelop.Dnx/Omnisharp/Dnx/DnxProjectSystem.cs
+++ src/MonoDevelop.Dnx/Omnisharp/Dnx/DnxProjectSystem.cs
@@ -422,11 +422,11 @@
             _designTimeHostManager.Stop();
         }

-        private void TriggerDependeees(string path, string messageType)
+        private void TriggerDependeees(string path, string messageType, bool restore = true)
         {
             // temp: run [dnu|kpm] restore when project.json changed
             var project = _context.GetProject(path);
-            if (project != null)
+            if (project != null && restore)
             {
                 _packagesRestoreTool.Run(project);
             }
@@ -485,7 +485,7 @@
             // When the project.lock.json file changes, refresh dependencies
             var lockFile = Path.ChangeExtension(projectFile, "lock.json");

-            _watcher.Watch(lockFile, _ => TriggerDependeees(projectFile, "RefreshDependencies"));
+            _watcher.Watch(lockFile, _ => TriggerDependeees(projectFile, "RefreshDependencies", false));
         }

         private void Initialize()


Remove mapping-by-code support for non-generic ISet. NH-3165.

--- src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs
+++ src/NHibernate/Mapping/ByCode/SimpleModelInspector.cs
@@ -1,8 +1,9 @@
 using System;
 using System.Collections.Generic;
+using Iesi.Collections.Generic;
 using System.Linq;
 using System.Reflection;
-using Iesi.Collections;
+

 namespace NHibernate.Mapping.ByCode
 {
@@ -294,13 +295,10 @@
 		protected bool MatchSetMember(MemberInfo subject)
 		{
 			var memberType = subject.GetPropertyOrFieldType();
-			if (typeof(ISet).IsAssignableFrom(memberType))
-			{
-				return true;
-			}
+
 			if (memberType.IsGenericType)
 			{
-				return memberType.GetGenericInterfaceTypeDefinitions().Contains(typeof(Iesi.Collections.Generic.ISet<>));
+				return memberType.GetGenericInterfaceTypeDefinitions().Contains(typeof(ISet<>));
 			}
 			return false;
 		}


Start of abstraction from Container

Start of abstraction from Container

--- src/NRoles.Engine/ConflictDetection/RoleViewMember.cs
+++ src/NRoles.Engine/ConflictDetection/RoleViewMember.cs
@@ -12,24 +12,24 @@
       base(role, member) { }

     public override void Process() {
-      var implementingMemberDefinition = ResolveImplementingMemberDefinition();
+      var implementingMember = ResolveImplementingMember();
       if (this.HasError()) return;

       string aliasing;
-      if (Definition.IsAliasing(out aliasing, Container.Module)) {
+      if (Definition.IsAliasing(out aliasing, Type.Module)) {
         // inform the immediate implementing member that it's been aliased
-        if (Container[implementingMemberDefinition].IsAliased) {
-          AddMessage(Error.RoleMemberAliasedAgain(Role, Container[implementingMemberDefinition].Role, Container[implementingMemberDefinition]));
+        if (implementingMember.IsAliased) {
+          AddMessage(Error.RoleMemberAliasedAgain(Role, implementingMember.Role, implementingMember));
         }
-        Container[implementingMemberDefinition].MarkAsAliased();
+        implementingMember.MarkAsAliased();
       }

-      if (Definition.IsExcluded(Container.Module)) {
+      if (Definition.IsExcluded(Type.Module)) {
         // inform the implementing member that it's been excluded
-        if (Container[implementingMemberDefinition].IsExcluded) {
-          AddMessage(Warning.RoleMemberExcludedAgain(Role, Container[implementingMemberDefinition].Role, Container[implementingMemberDefinition]));
+        if (implementingMember.IsExcluded) {
+          AddMessage(Warning.RoleMemberExcludedAgain(Role, implementingMember.Role, implementingMember));
         }
-        Container[implementingMemberDefinition].MarkAsExcluded();
+        implementingMember.MarkAsExcluded();
         // the role view member is also excluded
         MarkAsExcluded();
       }
@@ -38,9 +38,9 @@

     public override IEnumerable<RoleCompositionMember> ResolveOverridingMembers() {
       // the overriding members are this role view member and the role member it refers to
-      var implementingMemberDefinition = ResolveImplementingMemberDefinition();
-      if (implementingMemberDefinition == null) throw new InvalidOperationException();
-      return new RoleCompositionMember[] { this, Container[implementingMemberDefinition] };
+      var implementingMember = ResolveImplementingMember();
+      if (implementingMember == null) throw new InvalidOperationException();
+      return new RoleCompositionMember[] { this, implementingMember };
     }

     public override RoleCompositionMember ResolveImplementingMember() {
@@ -80,7 +80,7 @@
       var roleForView = allRolesForView.Single();

       _implementingMemberDefinition =
-        Definition.ResolveDefinitionInRole(roleForView, Container.Module);
+        Definition.ResolveDefinitionInRole(roleForView, Type.Module);

       if (_implementingMemberDefinition == null) {
         // TODO: if it's being aliased, use the Aliasing name instead of the Definition name
@@ -98,7 +98,7 @@
     }

     private List<TypeReference> RetrieveAllRolesForView(TypeDefinition roleView) {
-      var roleViewTypeDefinition = Container.Module.Import(typeof(RoleView<>)).Resolve();
+      var roleViewTypeDefinition = Type.Module.Import(typeof(RoleView<>)).Resolve();
       var allRolesForView = roleView.Interfaces
         .Where(interfaceTypeReference => interfaceTypeReference.Resolve() == roleViewTypeDefinition)
         .Select(roleViewTypeReference => ((GenericInstanceType)roleViewTypeReference).GenericArguments[0])


update

update

--- CSharpGL/Scene/Scene.Engine.cs
+++ CSharpGL/Scene/Scene.Engine.cs
@@ -95,5 +95,13 @@
                 UpdateObjects(obj.Children, interval);
             }
         }
+
+        /// <summary>
+        /// update once.
+        /// </summary>
+        public void Update()
+        {
+            this.UpdateObjects(this.objectList, 0);
+        }
     }
 }


Added --tp alias

Added --tp alias

--- src/NUnitConsole/nunit3-console/CommandLineOptions.cs
+++ src/NUnitConsole/nunit3-console/CommandLineOptions.cs
@@ -301,7 +301,7 @@
                     }
                 });

-            this.Add("testparam=", "Followed by a key-value pair separated by an equals sign. Test code can access the value by name.",
+            this.Add("testparam|tp=", "Followed by a key-value pair separated by an equals sign. Test code can access the value by name.",
                 v => ApplyTestParameter(RequiredValue(v, "--testparam")));

             this.Add("timeout=", "Set timeout for each test case in {MILLISECONDS}.",


Updated Codecov tool version

Updated Codecov tool version

--- Cake.Recipe/Content/tools.cake
+++ Cake.Recipe/Content/tools.cake
@@ -2,7 +2,7 @@
 // TOOLS
 ///////////////////////////////////////////////////////////////////////////////

-private const string CodecovTool = "#tool nuget:?package=codecov&version=1.0.0";
+private const string CodecovTool = "#tool nuget:?package=codecov&version=1.0.1";
 private const string CoverallsTool = "#tool nuget:?package=coveralls.io&version=1.3.4";
 private const string GitReleaseManagerTool = "#tool nuget:?package=gitreleasemanager&version=0.5.0";
 private const string GitVersionTool = "#tool nuget:?package=GitVersion.CommandLine&version=3.6.2";


Now maps the type--should make it actually work

--- src/NanoBuilder/NanoBuilder/Flow/ParameterComposer.cs
+++ src/NanoBuilder/NanoBuilder/Flow/ParameterComposer.cs
@@ -66,6 +66,8 @@

       public IFullParameterComposer<T> With<TParameterType>( Func<ParameterName, TParameterType> instanceProvider )
       {
+         _typeMap.Add( instanceProvider( new ParameterName() ) );
+
          return this;
       }


Tweak to EnumParser to make code clearer and better utilise the cached dict.

--- src/Narochno.Primitives.Parsing/Parsers/EnumParser.cs
+++ src/Narochno.Primitives.Parsing/Parsers/EnumParser.cs
@@ -9,7 +9,7 @@
     {
         public Type Type { get; }
         public IList<Enum> Values { get; } = new List<Enum>();
-        public IDictionary<Enum, string> EnumStrings { get; } = new Dictionary<Enum, string>();
+        public IDictionary<string, Enum> EnumStrings { get; } = new Dictionary<string, Enum>();

         public EnumParser(Type type)
         {
@@ -25,7 +25,7 @@
                 foreach (var attribute in Type.GetField(Enum.GetName(Type, value))
                     .GetCustomAttributes<EnumMemberAttribute>())
                 {
-                    EnumStrings.Add(value, attribute.Value);
+                    EnumStrings.Add(attribute.Value, value);
                 }
             }
         }
@@ -33,13 +33,9 @@
         public override Enum Parse(string input)
         {
             // First try to get the fields with EnumMemberAttribute
-            foreach (var value in Values)
+            if (input != null && EnumStrings.ContainsKey(input))
             {
-                if (EnumStrings.ContainsKey(value)
-                    && EnumStrings[value].Equals(input))
-                {
-                    return value;
-                }
+                return EnumStrings[input];
             }

             // Fallback to the real Enum.Parse
@@ -49,13 +45,9 @@
         public override Optional<Enum> TryParse(string input)
         {
             // First try to get the fields with EnumMemberAttribute
-            foreach (var value in Values)
+            if (input != null && EnumStrings.ContainsKey(input))
             {
-                if (EnumStrings.ContainsKey(value)
-                    && EnumStrings[value].Equals(input))
-                {
-                    return value;
-                }
+                return EnumStrings[input];
             }

             // Fallback to a try parse (we can't use the


fix line ending comparison

fix line ending comparison

--- src/NetBox.Tests/Extensions/AssemblyExtensionsTest.cs
+++ src/NetBox.Tests/Extensions/AssemblyExtensionsTest.cs
@@ -34,7 +34,7 @@
       {
          string content = _asm.GetSameFolderEmbeddedResourceFileAsText<AssemblyExtensionsTest>("EmbeddedResource.txt");

-         Assert.Equal("text file content\r\nwith two lines", content);
+         Assert.Equal("text file content\r\nwith two lines", content, false, true);
       }

       [Fact]


removed redundant set of processStarted also ensure initialization to false, add processCompleted to only get the exit code when the process ended correctly

--- RelhaxModpack/RelhaxModpack/Automation/Tasks/ShellExecuteTask.cs
+++ RelhaxModpack/RelhaxModpack/Automation/Tasks/ShellExecuteTask.cs
@@ -30,7 +30,9 @@

         protected ProcessStartInfo startInfo = null;

-        protected bool processStarted;
+        protected bool processStarted = false;
+
+        protected bool processCompleted = false;

         protected int exitCode;

@@ -95,12 +97,12 @@
                     process.OutputDataReceived += Process_OutputDataReceived;
                     process.ErrorDataReceived += Process_ErrorDataReceived;
                     processStarted = process.Start();
-                    processStarted = true;

                     process.BeginOutputReadLine();
                     process.BeginErrorReadLine();

                     process.WaitForExit();
+                    processCompleted = true;
                 }
                 catch (OperationCanceledException) { }
                 catch (Exception ex)
@@ -114,7 +116,12 @@

                 process.OutputDataReceived -= Process_OutputDataReceived;
                 process.ErrorDataReceived -= Process_ErrorDataReceived;
-                exitCode = process.ExitCode;
+
+                if (processCompleted)
+                    exitCode = process.ExitCode;
+                else
+                    exitCode = -1;
+
                 process.Dispose();
             });
             Logging.Info("Shell execution finishes");


Updating Layouts migrations - attaching LayoutPart to Page type.

--- src/Orchard.Web/Modules/Orchard.Layouts/Migrations.cs
+++ src/Orchard.Web/Modules/Orchard.Layouts/Migrations.cs
@@ -56,6 +56,10 @@
             DefineElementWidget("MediaWidget", "Media Widget", "Orchard.Layouts.Elements.MediaItem");
             DefineElementWidget("ContentWidget", "Content Widget", "Orchard.Layouts.Elements.ContentItem");

+            ContentDefinitionManager.AlterTypeDefinition("Page", type => type
+                .WithPart("LayoutPart", p => p
+                    .WithSetting("LayoutTypePartSettings.IsTemplate", "False")));
+
             return 1;
         }


Orchard.Recipes: Fixing that RecipeExecutionLogger should be able to handle messages without arguments

--- src/Orchard/Recipes/Services/RecipeExecutionLogger.cs
+++ src/Orchard/Recipes/Services/RecipeExecutionLogger.cs
@@ -15,7 +15,7 @@
         }

         public void Log(LogLevel level, Exception exception, string format, params object[] args) {
-            var message = String.Format(format, args);
+            var message = args == null ? format : string.Format(format, args);
             Logger.Log(level, exception, "{0}: {1}", ComponentType.Name, message);
         }
     }


mionor fixes accoring to java driver

mionor fixes accoring to java driver

--- Cassandra/ControlConnection.cs
+++ Cassandra/ControlConnection.cs
@@ -265,7 +265,7 @@
         }

         // schema
-        private const string SelectPeers = "SELECT peer, data_center, rack, tokens FROM system.peers";
+        private const string SelectPeers = "SELECT peer, data_center, rack, tokens, rpc_address FROM system.peers";

         private const string SelectLocal =
             "SELECT cluster_name, data_center, rack, tokens, partitioner FROM system.local WHERE key='local'";
@@ -383,7 +383,7 @@

         private const long MaxSchemaAgreementWaitMs = 10000;

-        private const string SelectSchemaPeers = "SELECT peer, schema_version FROM system.peers";
+        private const string SelectSchemaPeers = "SELECT peer, rpc_address, schema_version FROM system.peers";
         private const string SelectSchemaLocal = "SELECT schema_version FROM system.local WHERE key='local'";

         internal bool WaitForSchemaAgreement(IPAddress forHost = null)


Added a unit test to verify that arguments can be set when creating a queue

--- Source/EasyNetQ.Management.Client.Tests/ManagementClientTests.cs
+++ Source/EasyNetQ.Management.Client.Tests/ManagementClientTests.cs
@@ -247,6 +247,19 @@
         }

         [Test]
+        public void Should_be_able_to_create_a_queue_with_arguments()
+        {
+            var exchangeName = "test-dead-letter-exchange";
+            var argumentKey = "x-dead-letter-exchange";
+            var vhost = managementClient.GetVhost("/");
+            var queueInfo = new QueueInfo(testQueue);
+            queueInfo.Arguments.Add(argumentKey, exchangeName);
+            var queue = managementClient.CreateQueue(queueInfo, vhost);
+            queue.Arguments[argumentKey].ShouldNotBeNull();
+            queue.Arguments[argumentKey].ShouldEqual(exchangeName);
+        }
+
+        [Test]
         public void Should_be_able_to_delete_a_queue()
         {
             var queue = managementClient.GetQueues().SingleOrDefault(x => x.Name == testQueue);