fixed unit tests for PackedSize, which now returns the maximum integer that could be represented by the packed form

git-svn-id: 7f26e25b9b3e4c343427ebc7c3d22488fae9659d@75 ef9fb88f-4736-4558-9cff-406f806169d0

--- source/SvnQueryTests/PackedSizeConverterTest.cs
+++ source/SvnQueryTests/PackedSizeConverterTest.cs
@@ -23,41 +23,42 @@
     [TestFixture]
     public class PackedSizeConverterTest
     {
+        const int kb = 1024;
+        const int mb = 1024*kb;
+        const int gb = 1024*mb;
+
         [Test]
         public void ToSortableString_Bytes()
         {
             Assert.AreEqual("b000", PackedSizeConverter.ToSortableString(0));
             Assert.AreEqual("b3E7", PackedSizeConverter.ToSortableString(999));
-            Assert.AreEqual("b3FF", PackedSizeConverter.ToSortableString(1023));
-            Assert.AreEqual("k001", PackedSizeConverter.ToSortableString(1024));
+            Assert.AreEqual("b3FF", PackedSizeConverter.ToSortableString(kb - 1));
+            Assert.AreEqual("k001", PackedSizeConverter.ToSortableString(kb));
         }

         [Test]
         public void ToSortableString_KBytes()
         {
-            Assert.AreEqual("k001", PackedSizeConverter.ToSortableString(1024));
-            Assert.AreEqual("k3FF", PackedSizeConverter.ToSortableString(1024*1024 - 1));
-            Assert.AreEqual("m001", PackedSizeConverter.ToSortableString(1024*1024));
+            Assert.AreEqual("k001", PackedSizeConverter.ToSortableString(kb));
+            Assert.AreEqual("k3FF", PackedSizeConverter.ToSortableString(mb - 1));
+            Assert.AreEqual("m001", PackedSizeConverter.ToSortableString(mb));
         }

         [Test]
         public void ToSortableString_MBytes()
         {
-            Assert.AreEqual("m001", PackedSizeConverter.ToSortableString(1024*1024));
-            Assert.AreEqual("m3FF", PackedSizeConverter.ToSortableString(1024*1024*1024 - 1));
-            Assert.AreEqual("z001", PackedSizeConverter.ToSortableString(1024*1024*1024));
+            Assert.AreEqual("m001", PackedSizeConverter.ToSortableString(mb));
+            Assert.AreEqual("m3FF", PackedSizeConverter.ToSortableString(gb - 1));
+            Assert.AreEqual("z001", PackedSizeConverter.ToSortableString(gb));
         }

         [Test]
         public void FromSortableString()
         {
             Assert.AreEqual(999, PackedSizeConverter.FromSortableString(PackedSizeConverter.ToSortableString(999)));
-            Assert.AreEqual(999*1024,
-                            PackedSizeConverter.FromSortableString(PackedSizeConverter.ToSortableString(999*1024)));
-            Assert.AreEqual(999*1024*1024,
-                            PackedSizeConverter.FromSortableString(PackedSizeConverter.ToSortableString(999*1024*1024)));
-            Assert.AreEqual(1*1024*1024*1024,
-                            PackedSizeConverter.FromSortableString(PackedSizeConverter.ToSortableString(1*1024*1024*1024)));
+            Assert.AreEqual(999, PackedSizeConverter.FromSortableString(PackedSizeConverter.ToSortableString(999*kb)) / kb);
+            Assert.AreEqual(999, PackedSizeConverter.FromSortableString(PackedSizeConverter.ToSortableString(999*mb)) / mb);
+            Assert.AreEqual(1, PackedSizeConverter.FromSortableString(PackedSizeConverter.ToSortableString(1*gb)) / gb);
         }
     }
 }


Current Split Index is now checked properly

The Condition was wrong. It only checked whether it was below 0 or not.
It never checked whether it was above the run count at all. Closes #87

--- LiveSplit/LiveSplit.Core/Model/LiveSplitState.cs
+++ LiveSplit/LiveSplit.Core/Model/LiveSplitState.cs
@@ -83,7 +83,7 @@
         }

         public int CurrentSplitIndex { get; set; }
-        public ISegment CurrentSplit { get { return (CurrentSplitIndex < 0 && CurrentSplitIndex < Run.Count) ? null : Run[CurrentSplitIndex]; } }
+        public ISegment CurrentSplit { get { return (CurrentSplitIndex >= 0 && CurrentSplitIndex < Run.Count) ? Run[CurrentSplitIndex] : null; } }

         private LiveSplitState() { }


PutStructure needs to generate the arguments properly when creating a new structure

--- LogicalShift.Reason/Unification/SimpleUnifier.cs
+++ LogicalShift.Reason/Unification/SimpleUnifier.cs
@@ -136,9 +136,17 @@
             if (heapValue.IsVariable())
             {
                 // Variable is an unbound ref cell: bind it to a new value that we create
-                var firstArgument = new ArgumentReference(null);
+                ArgumentReference firstArgument = null;
+
+                for (int argNum = 0; argNum < termLength; ++argNum)
+                {
+                    var newArgument = new ArgumentReference(firstArgument);
+                    firstArgument = newArgument;
+                }
+
                 var newStructure = new SimpleReference(termName, firstArgument);
                 _lastArgument = firstArgument;
+                _structurePtr = firstArgument;

                 Bind(heapValue, newStructure);
                 _writeMode = true;


Changed: Text mail to Outlook only

Changed: Text mail to Outlook only

--- MarkdownViewerPlusPlus/Forms/AbstractRenderer.cs
+++ MarkdownViewerPlusPlus/Forms/AbstractRenderer.cs
@@ -17,6 +17,7 @@
 using System.Xml.Linq;
 using PdfSharp.Pdf;
 using System.IO;
+using System.Net;

 /// <summary>
 ///
@@ -103,7 +104,8 @@
             Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_DMMREGASDCKDLG, 0, _ptrNppTbData);
             Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_DMMHIDE, 0, this.Handle);

-            //Hide the HTML E-mail item if Outlook is not installed
+            //Hide the E-mail items if Outlook is not installed
+            this.sendAsTextMail.Visible = IsOutlookInstalled();
             this.sendAsHTMLMail.Visible = IsOutlookInstalled();
         }

@@ -195,9 +197,17 @@
         /// <param name="e"></param>
         protected virtual void sendAsTextMail_Click(object sender, EventArgs e)
         {
-            //Build a mailto: command
-            string command = $"mailto:?subject={FileName}&body={RawText}";
-            Process.Start(command);
+            //Double-check
+            if (IsOutlookInstalled())
+            {
+                Outlook.Application outlook = new Outlook.Application();
+                Outlook.MailItem message = (Outlook.MailItem)outlook.CreateItem(Outlook.OlItemType.olMailItem);
+                //
+                message.Subject = FileName;
+                message.BodyFormat = Outlook.OlBodyFormat.olFormatPlain;
+                message.Body = RawText;
+                message.Display(true);
+            }
         }

         /// <summary>


no cache

no cache

--- MeetupManager.Portable/Services/MeetupService.cs
+++ MeetupManager.Portable/Services/MeetupService.cs
@@ -19,6 +19,7 @@
  */
 using System;
 using System.Collections.Generic;
+using System.Net.Http.Headers;
 using Cirrious.CrossCore;
 using MeetupManager.Portable.Interfaces;
 using System.Threading.Tasks;
@@ -49,9 +50,16 @@
                 return new EventsRootObject() { Events = new List<Event>() };
             }

-			var httpClient = new HttpClient ();
+            var client = new HttpClient();
+            if (client.DefaultRequestHeaders.CacheControl == null)
+                client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue();
+
+            client.DefaultRequestHeaders.CacheControl.NoCache = true;
+            client.DefaultRequestHeaders.IfModifiedSince = DateTime.UtcNow;
+            client.DefaultRequestHeaders.CacheControl.NoStore = true;
+            client.Timeout = new TimeSpan(0, 0, 30);
             var request = string.Format(GetEventsUrl, offset, groupId, Settings.AccessToken);
-			var response = await httpClient.GetStringAsync (request);
+            var response = await client.GetStringAsync(request);
 			return await JsonConvert.DeserializeObjectAsync<EventsRootObject> (response);
 		}

@@ -65,9 +73,16 @@
             }

-			var httpClient = new HttpClient ();
+			var client = new HttpClient ();
+            if (client.DefaultRequestHeaders.CacheControl == null)
+                client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue();
+
+            client.DefaultRequestHeaders.CacheControl.NoCache = true;
+            client.DefaultRequestHeaders.IfModifiedSince = DateTime.UtcNow;
+            client.DefaultRequestHeaders.CacheControl.NoStore = true;
+            client.Timeout = new TimeSpan(0, 0, 30);
 			var request = string.Format (GetRSVPsUrl, offset, eventId, Settings.AccessToken);
-			var response = await httpClient.GetStringAsync (request);
+            var response = await client.GetStringAsync(request);
 			return await JsonConvert.DeserializeObjectAsync<RSVPsRootObject> (response);

 		}
@@ -87,6 +102,13 @@
             {
                 try
                 {
+                    if (client.DefaultRequestHeaders.CacheControl == null)
+                        client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue();
+
+                    client.DefaultRequestHeaders.CacheControl.NoCache = true;
+                    client.DefaultRequestHeaders.IfModifiedSince = DateTime.UtcNow;
+                    client.DefaultRequestHeaders.CacheControl.NoStore = true;
+                    client.Timeout = new TimeSpan(0, 0, 30);

                     var content = new FormUrlEncodedContent(new[]
                     {
@@ -117,9 +139,16 @@
 		public async Task<LoggedInUser> GetCurrentMember ()
 		{
 			await RenewAccessToken();
-			var httpClient = new HttpClient ();
+            var client = new HttpClient();
+            if (client.DefaultRequestHeaders.CacheControl == null)
+                client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue();
+
+            client.DefaultRequestHeaders.CacheControl.NoCache = true;
+            client.DefaultRequestHeaders.IfModifiedSince = DateTime.UtcNow;
+            client.DefaultRequestHeaders.CacheControl.NoStore = true;
+            client.Timeout = new TimeSpan(0, 0, 30);
 			var request = string.Format (GetUserUrl, Settings.AccessToken);
-			var response = await httpClient.GetStringAsync (request);
+			var response = await client.GetStringAsync (request);

             //should use async, but has issue for some reason and throws exception
 		    return JsonConvert.DeserializeObject<LoggedInUser>(response);
@@ -139,10 +168,17 @@
                 return new GroupsRootObject{Groups = new List<Group>()};
             }

-            var httpClient = new HttpClient();
+            var client = new HttpClient();
+            if (client.DefaultRequestHeaders.CacheControl == null)
+                client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue();
+
+            client.DefaultRequestHeaders.CacheControl.NoCache = true;
+            client.DefaultRequestHeaders.IfModifiedSince = DateTime.UtcNow;
+            client.DefaultRequestHeaders.CacheControl.NoStore = true;
+            client.Timeout = new TimeSpan(0, 0, 30);
             var request = string.Format(GetGroupsUrl, offset, memberId, Settings.AccessToken);

-            var response = await httpClient.GetStringAsync(request);
+            var response = await client.GetStringAsync(request);
             return await JsonConvert.DeserializeObjectAsync<GroupsRootObject>(response);
         }
     }


code cleanup

code cleanup

--- MimeKit/Cryptography/WindowsSecureMimeContext.cs
+++ MimeKit/Cryptography/WindowsSecureMimeContext.cs
@@ -532,13 +532,9 @@
 				throw new ArgumentNullException ("encryptedData");

 			var enveloped = new EnvelopedCms ();
+
 			enveloped.Decode (ReadAllBytes (encryptedData));
-
-			var store = new X509Store (StoreName.My, StoreLocation);
-			store.Open (OpenFlags.ReadOnly);
-
 			enveloped.Decrypt ();
-			store.Close ();

 			var decryptedData = enveloped.Encode ();

@@ -623,6 +619,7 @@
 					rawData = memory.ToArray ();
 				}
 			}
+
 			var store = new X509Store (StoreName.My, StoreLocation);
 			var certs = new X509Certificate2Collection ();


add IsClean output to Svn Version task #10110     Implement Subversion tasks

--- Releases/4.0.5.0/Main/Framework/Subversion/Svn.cs
+++ Releases/4.0.5.0/Main/Framework/Subversion/Svn.cs
@@ -55,7 +55,7 @@
     ///         <MSBuild.ExtensionPack.Subversion.Svn TaskAction="Version" Item="c:\path\to\working\copy">
     ///             <Output TaskParameter="Info" ItemName="Info"/>
     ///         </MSBuild.ExtensionPack.Subversion.Svn>
-    ///         <Message Text="MinRevision: %(Info.MinRevision), MaxRevision: %(Info.MaxRevision), IsMixed: %(Info.IsMixed), IsModified: %(Info.IsModified), IsSwitched: %(Info.IsSwitched), IsPartial: %(Info.IsPartial)"/>
+    ///         <Message Text="MinRevision: %(Info.MinRevision), MaxRevision: %(Info.MaxRevision), IsMixed: %(Info.IsMixed), IsModified: %(Info.IsModified), IsSwitched: %(Info.IsSwitched), IsPartial: %(Info.IsPartial), IsClean: %(Info.IsClean)"/>
     ///     </Target>
     /// </Project>
     /// ]]></code>
@@ -394,15 +394,18 @@
                     return;
                 }

+                var mixed = !string.IsNullOrEmpty(m.Groups["max"].Value);
+                var sw = m.Groups["sw"].Value;
+
                 // fill up the output
                 this.Info = new TaskItem(this.Item);
                 this.Info.SetMetadata("MinRevision", m.Groups["min"].Value);
-                var mixed = !string.IsNullOrEmpty(m.Groups["max"].Value);
                 this.Info.SetMetadata("MaxRevision", m.Groups[mixed ? "max" : "min"].Value);
                 this.Info.SetMetadata("IsMixed", mixed.ToString());
-                this.Info.SetMetadata("IsModified", m.Groups["sw"].Value.Contains("M").ToString());
-                this.Info.SetMetadata("IsSwitched", m.Groups["sw"].Value.Contains("S").ToString());
-                this.Info.SetMetadata("IsPartial", m.Groups["sw"].Value.Contains("P").ToString());
+                this.Info.SetMetadata("IsModified", sw.Contains("M").ToString());
+                this.Info.SetMetadata("IsSwitched", sw.Contains("S").ToString());
+                this.Info.SetMetadata("IsPartial", sw.Contains("P").ToString());
+                this.Info.SetMetadata("IsClean", (!mixed && sw.Length == 0).ToString());
             }
         }
         #endregion


fix(AsyncStorageModule): capitalize internal function names

AsyncStorageModule provides permanent storage for React Native JavaScript applications.
- implement PR #3 comments

Fixes #136

--- ReactNative/Modules/Storage/AsyncStorageModule.cs
+++ ReactNative/Modules/Storage/AsyncStorageModule.cs
@@ -82,7 +82,7 @@
                 result.Add(new JArray
                 {
                     key,
-                    getTokenFromContainer(key),
+                    GetTokenFromContainer(key),
                 });
             }

@@ -121,7 +121,7 @@
                     var pair = keyValue.Value<JArray>();
                     if (pair.First.Type == JTokenType.String)
                     {
-                        addTokenToContainer(pair.First.Value<string>(), pair.Last);
+                        AddTokenToContainer(pair.First.Value<string>(), pair.Last);
                     }
                     else
                     {
@@ -210,27 +210,27 @@
                     if (pair.First.Type == JTokenType.String)
                     {
                         var key = pair.First.Value<string>();
-                        var tokenOld = getTokenFromContainer(key);
+                        var tokenOld = GetTokenFromContainer(key);
                         var tokenNew = pair.Last;

                         if (tokenOld.Type == JTokenType.Object && tokenNew.Type == JTokenType.Object)
                         {
-                            deepMergeInto((JObject)tokenOld, (JObject)tokenNew);
-                            addTokenToContainer(key, tokenOld);
+                            DeepMergeInto((JObject)tokenOld, (JObject)tokenNew);
+                            AddTokenToContainer(key, tokenOld);
                         }
                         else if (tokenOld.Type == JTokenType.Array)
                         {
                             (tokenOld as JArray).Merge(tokenNew);
-                            addTokenToContainer(key, tokenOld);
+                            AddTokenToContainer(key, tokenOld);
                         }
                         else if (tokenNew.Type == JTokenType.Array)
                         {
                             (tokenNew as JArray).Merge(tokenOld);
-                            addTokenToContainer(key, tokenNew);
+                            AddTokenToContainer(key, tokenNew);
                         }
                         else if (tokenOld.Type == JTokenType.Null)
                         {
-                            addTokenToContainer(key, tokenNew);
+                            AddTokenToContainer(key, tokenNew);
                         }
                     }
                     else
@@ -289,13 +289,13 @@
         /// </summary>
         /// <param name="key">The key.</param>
         /// <param name="token">The token.</param>
-        private void addTokenToContainer(string key, JToken token)
+        private void AddTokenToContainer(string key, JToken token)
         {
             switch (token.Type)
             {
                 case JTokenType.Null:
                     _dataContainer.Values[key] = "";
-                    addTokenTypeToContainer(key, _DataType.Null);
+                    AddTokenTypeToContainer(key, _DataType.Null);
                     break;
                 case JTokenType.Boolean:
                     _dataContainer.Values[key] = token.Value<bool>();
@@ -314,31 +314,31 @@
                     break;
                 case JTokenType.Date:
                     _dataContainer.Values[key] = token.ToString();
-                    addTokenTypeToContainer(key, _DataType.Date);
+                    AddTokenTypeToContainer(key, _DataType.Date);
                     break;
                 case JTokenType.Uri:
                     _dataContainer.Values[key] = token.ToString();
-                    addTokenTypeToContainer(key, _DataType.Uri);
+                    AddTokenTypeToContainer(key, _DataType.Uri);
                     break;
                 case JTokenType.String:
                     _dataContainer.Values[key] = token.Value<string>();
-                    addTokenTypeToContainer(key, _DataType.String);
+                    AddTokenTypeToContainer(key, _DataType.String);
                     break;
                 case JTokenType.Array:
                     _dataContainer.Values[key] = token.ToString();
-                    addTokenTypeToContainer(key, _DataType.Array);
+                    AddTokenTypeToContainer(key, _DataType.Array);
                     break;
                 case JTokenType.Constructor:
                     _dataContainer.Values[key] = token.ToString();
-                    addTokenTypeToContainer(key, _DataType.Constructor);
+                    AddTokenTypeToContainer(key, _DataType.Constructor);
                     break;
                 case JTokenType.Object:
                     _dataContainer.Values[key] = token.ToString();
-                    addTokenTypeToContainer(key, _DataType.Object);
+                    AddTokenTypeToContainer(key, _DataType.Object);
                     break;
                 case JTokenType.Raw:
                     _dataContainer.Values[key] = token.ToString();
-                    addTokenTypeToContainer(key, _DataType.Raw);
+                    AddTokenTypeToContainer(key, _DataType.Raw);
                     break;
                 default:
                     Debug.Assert(false); // Not supported JToken type
@@ -350,7 +350,7 @@
         /// Gets related value for a specific key from <see cref="ApplicationDataContainer"/> as <see cref="JToken"/>.
         /// </summary>
         /// <param name="key">The key.</param>
-        private JToken getTokenFromContainer(string key)
+        private JToken GetTokenFromContainer(string key)
         {
             object value;
             if (_dataContainer.Values.TryGetValue(key, out value))
@@ -361,7 +361,7 @@
                 }
                 else if (value is string)
                 {
-                    var type = getTokenTypeFromContainer(key);
+                    var type = GetTokenTypeFromContainer(key);
                     switch (type)
                     {
                         case _DataType.Array:
@@ -392,7 +392,7 @@
         /// </summary>
         /// <param name="key">The key.</param>
         /// <param name="type">The type.</param>
-        private void addTokenTypeToContainer(string key, _DataType type)
+        private void AddTokenTypeToContainer(string key, _DataType type)
         {
             _typeContainer.Values[key] = (int)type;
         }
@@ -401,7 +401,7 @@
         /// Gets token's type for a specific key from <see cref="ApplicationDataContainer"/>.
         /// </summary>
         /// <param name="key">The key.</param>
-        private _DataType getTokenTypeFromContainer(string key)
+        private _DataType GetTokenTypeFromContainer(string key)
         {
             object value;
             if (_typeContainer.Values.TryGetValue(key, out value))
@@ -419,7 +419,7 @@
         /// </summary>
         /// <param name="oldObj">The old value.</param>
         /// <param name="newObj">The old value.</param>
-        private static void deepMergeInto(JObject oldObj, JObject newObj)
+        private static void DeepMergeInto(JObject oldObj, JObject newObj)
         {
             IDictionary<string, JToken> dictionary = newObj;
             var keys = dictionary.Keys;
@@ -431,15 +431,15 @@
                 oldObj.TryGetValue(key, out tokenOld);
                 if (tokenNew?.Type == JTokenType.Object && tokenOld?.Type == JTokenType.Object)
                 {
-                    deepMergeInto(tokenOld as JObject, tokenNew as JObject);
-                    putToJObject(key, tokenOld, oldObj);
+                    DeepMergeInto(tokenOld as JObject, tokenNew as JObject);
+                    PutToJObject(key, tokenOld, oldObj);
                 }
                 else
                 {
                     var property = newObj.Property(key);
                     foreach (var token in property)
                     {
-                        putToJObject(key, token, oldObj);
+                        PutToJObject(key, token, oldObj);
                     }
                 }
             }
@@ -452,7 +452,7 @@
         /// <param name="key">The key.</param>
         /// <param name="token">The token.</param>
         /// <param name="obj">The object.</param>
-        private static void putToJObject(string key, JToken token, JObject obj)
+        private static void PutToJObject(string key, JToken token, JObject obj)
         {
             obj.Remove(key);
             obj.Add(key, token);


Increases the timeout and adds more logging so we can see what we seem to be missing. We might be able to then make the tests wait for something more specific than all of Django being ready.

--- Release/Tests/DjangoUITests/DjangoEditingTests.cs
+++ Release/Tests/DjangoUITests/DjangoEditingTests.cs
@@ -1748,7 +1748,7 @@
                 // wait until Django is loaded, and then wait until the
                 // analysis is complete.
                 bool isLoaded = false;
-                for (int i = 0; i < 24; i++) {
+                for (int i = 0; i < 36; i++) {

                     if (django._filters.Count > 0 &&
                         django._tags.Count > 0 &&
@@ -1756,6 +1756,8 @@
                         foreach (var templateFile in django._templateFiles) {
                             if (templateFile.Value.Count > 0) {
                                 isLoaded = true;
+                            } else {
+                                Console.WriteLine("No template information: {0}", templateFile.Key);
                             }
                         }
                     }
@@ -1763,7 +1765,10 @@
                         break;
                     }

-                    Console.WriteLine("{0} Django still not loaded, sleeping...", DateTime.Now);
+                    Console.WriteLine("{0} Django still not loaded, sleeping... {1} {2}",
+                        DateTime.Now,
+                        django._filters.Count,
+                        django._tags.Count);
                     System.Threading.Thread.Sleep(5000);
                 }
                 Assert.IsTrue(isLoaded, "failed to wait for complete analysis");


Add a overload method for the constructor of Interpolation class

--- Scallion/DomainModels/Components/Interpolation.cs
+++ Scallion/DomainModels/Components/Interpolation.cs
@@ -27,9 +27,19 @@
         /// Initializes a new instance of the <see cref="Interpolation"/> class that defined as linear interpolation.
         /// </summary>
         public Interpolation()
+            : this(new InterpolationParameter(20, 20), new InterpolationParameter(107, 107))
         {
-            First = new InterpolationParameter(20, 20);
-            Second = new InterpolationParameter(107, 107);
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="Interpolation"/> class with the specified <see cref="InterpolationParameter"/> objects.
+        /// </summary>
+        /// <param name="first">The instance of the <see cref="InterpolationParameter"/> class for <see cref="First"/> property of this interpolation.</param>
+        /// <param name="second">The instance of the <see cref="InterpolationParameter"/> class for <see cref="Second"/> property of this interpolation.</param>
+        public Interpolation(InterpolationParameter first, InterpolationParameter second)
+        {
+            First = first;
+            Second = second;
         }
     }


bugfix: sample read methods ignored the datachunklength and read over the end of the datachunk until the EOF

--- NAudio/NAudio/Wave/WaveStreams/WaveFileReader.cs
+++ NAudio/NAudio/Wave/WaveStreams/WaveFileReader.cs
@@ -265,7 +265,7 @@
             {
                 for (int channel = 0; channel < waveFormat.Channels; channel++)
                 {
-                    if (waveStream.Position < waveStream.Length)
+                    if (Position < Length)
                         buffer[channel][sample] = (float)br.ReadInt16() / 32768.0f;
                     else
                         return sample;
@@ -290,7 +290,7 @@
             {
                 for (int channel = 0; channel < waveFormat.Channels; channel++)
                 {
-                    if (waveStream.Position < waveStream.Length)
+                    if (Position < Length)
                         buffer[channel][sample] = br.ReadInt16() / 32768.0;
                     else
                         return sample;


Make longs nullable

Make longs nullable

--- ShopifySharp/Entities/FulfillmentOrderLineItem.cs
+++ ShopifySharp/Entities/FulfillmentOrderLineItem.cs
@@ -17,42 +17,42 @@
         /// The ID of the shop associated with the fulfillment order line item.
         /// </summary>
         [JsonProperty("shop_id")]
-        public long ShopId { get; set; }
+        public long? ShopId { get; set; }

         /// <summary>
         /// The ID of the fulfillment order associated with this line item.
         /// </summary>
         [JsonProperty("fulfillment_order_id")]
-        public long FulfillmentOrderId { get; set; }
+        public long? FulfillmentOrderId { get; set; }

         /// <summary>
         /// The ID of the line item associated with this fulfillment order line item.
         /// </summary>
         [JsonProperty("line_item_id")]
-        public long LineItemId { get; set; }
+        public long? LineItemId { get; set; }

         /// <summary>
         /// The ID of the inventory item associated with this fulfillment order line item.
         /// </summary>
         [JsonProperty("inventory_item_id")]
-        public long InventoryItemId { get; set; }
+        public long? InventoryItemId { get; set; }

         /// <summary>
         /// The total number of units to be fulfilled.
         /// </summary>
         [JsonProperty("quantity")]
-        public long Quantity { get; set; }
+        public long? Quantity { get; set; }

         /// <summary>
         /// The number of units remaining to be fulfilled.
         /// </summary>
         [JsonProperty("fulfillable_quantity")]
-        public long FulfillableQuantity { get; set; }
+        public long? FulfillableQuantity { get; set; }

         /// <summary>
         /// The ID of the variant associated with this fulfillment order line item.
         /// </summary>
         [JsonProperty("variant_id")]
-        public long VariantId { get; set; }
+        public long? VariantId { get; set; }
     }
 }


add QueryToken ContainsKey

add QueryToken ContainsKey

--- Signum.Entities/DynamicQuery/Tokens/QueryToken.cs
+++ Signum.Entities/DynamicQuery/Tokens/QueryToken.cs
@@ -403,6 +403,10 @@
             }
         }

+        public bool ContainsKey(string key)
+        {
+            return this.Key == key || this.Parent != null && this.Parent.ContainsKey(key);
+        }
     }

     public class BuildExpressionContext


fix QueryToken.AddPropertyRoute for ModelEntity

--- Signum.Entities/DynamicQuery/Tokens/QueryToken.cs
+++ Signum.Entities/DynamicQuery/Tokens/QueryToken.cs
@@ -50,6 +50,9 @@

         internal PropertyRoute AddPropertyRoute(PropertyInfo pi)
         {
+            if(typeof(ModelEntity).IsAssignableFrom(Type))
+                return PropertyRoute.Root(Type).Add(pi);
+
             Type type = Lite.Extract(Type); //Because Add doesn't work with lites
             if (type != null)
                 return PropertyRoute.Root(type).Add(pi);


Adapt to rename of FindOptions Limit to MaxItems

--- Signum.Windows/DynamicQuery/SearchControl.xaml.cs
+++ Signum.Windows/DynamicQuery/SearchControl.xaml.cs
@@ -485,7 +485,7 @@
                 Filters = FilterOptions.Select(f => f.ToFilter()).ToList(),
                 Orders = OrderOptions.Select(o => o.ToOrder()).ToList(),
                 Columns = CurrentColumns.ToList(),
-                Limit = MaxItemsCount
+                MaxItems = MaxItemsCount
             };

             return request;


Same issue as previous commit.

Same issue as previous commit.

--- OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2694,15 +2694,16 @@
                 // we created a new ScenePresence (a new child agent) in a fresh region.
                 // Request info about all the (root) agents in this region
                 // Note: This won't send data *to* other clients in that region (children don't send)
+                EntityBase[] entities = Scene.Entities.GetEntities();
+                foreach(EntityBase e in entities)
+                {
+                    if (e != null && e is SceneObjectGroup)
+                        ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient);
+                }
+
                 SendOtherAgentsAvatarDataToMe();
                 SendOtherAgentsAppearanceToMe();

-                EntityBase[] entities = Scene.Entities.GetEntities();
-                foreach(EntityBase e in entities)
-                {
-                    if (e != null && e is SceneObjectGroup)
-                        ((SceneObjectGroup)e).SendFullUpdateToClient(ControllingClient);
-                }
             });
         }


Fixed inversing expectations not working

--- src/MonoUnit/Expectation.cs
+++ src/MonoUnit/Expectation.cs
@@ -13,11 +13,14 @@
             this.inverse = false;
         }

-        public Expectation not()
+        public Expectation not
         {
-            inverse = true;
+            get
+            {
+                inverse = !inverse;

-            return this;
+                return this;
+            }
         }

         public Expectation toEqual(object expected)
@@ -57,6 +60,8 @@
         {
             bool match = matcher.Match(actual);

+            if (inverse) match = !match;
+
             if (!match)
             {
                 string failureMessage = matcher.GetFailureMessage(inverse);


Fixed two regressions in avatar position

- avatars not sent on login until avatar movement or camera changes
(InitialDataSent needed to be set before sent, so now it's
InitialDataReady)
- child agent update NO_POSITION test got inverted in the "nothing"
change. Brain fart, got the == and != backwards in the conversion to
CompareTo. Scrap that, it's harder to read anyway.

--- OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -83,11 +83,11 @@
         None = 0,
         CompleteMovementReceived = 1,
         FetchedProfile = 2,
-        InitialDataSent = 4,
+        InitialDataReady = 4,
         ParcelInfoSent = 8,
         CanExitRegion = CompleteMovementReceived,   // don't care much about this region if leaving
         // FullyInRegion doesn't need parcel info to start sending updates, especially with 250ms delay
-        FullyInRegion = CompleteMovementReceived|FetchedProfile|InitialDataSent
+        FullyInRegion = CompleteMovementReceived|FetchedProfile|InitialDataReady
     }

     public class ScenePresence : EntityBase
@@ -1617,8 +1617,8 @@

             if (!IsBot)
                 SendAvatarData(ControllingClient, true);
+            this.AgentInRegion |= AgentInRegionFlags.InitialDataReady;
             SceneView.SendInitialFullUpdateToAllClients();
-            this.AgentInRegion |= AgentInRegionFlags.InitialDataSent;

             SendAnimPack();
         }
@@ -4077,12 +4077,12 @@
                 m_log.Info("[SCENE PRESENCE]: ChildAgentPositionUpdate while in transit - ignored.");
                 return;
             }
-            if (cAgentData.Position.CompareTo(NO_POSITION) == 0) // UGH!!
+            if (cAgentData.Position != NO_POSITION) // if valid, use it.
             {
                 lock (m_posInfo)
                 {
-                    // if (cAgentData.Position.CompareTo(m_posInfo.m_pos) != 0)
-                    //    m_log.Warn("[SCENE PRESENCE]: >>> ChildAgentPositionUpdate (" + rRegionX + "," + rRegionY + ") at " + cAgentData.Position.ToString());
+                    if (cAgentData.Position.CompareTo(m_posInfo.m_pos) != 0)
+                        m_log.Warn("[SCENE PRESENCE]: >>> ChildAgentPositionUpdate (" + rRegionX + "," + rRegionY + ") at " + cAgentData.Position.ToString());
                     if (m_posInfo.Parent != null)
                     {
                         m_log.InfoFormat("[SCENE PRESENCE]: ChildAgentPositionUpdate move to {0} refused for agent already sitting at {1}.",


调整了一下代码的写法。 :wolf:

调整了一下代码的写法。 :wolf:

--- src/Common/DataProvider.cs
+++ src/Common/DataProvider.cs
@@ -156,17 +156,19 @@

 			var error = this.Error;

-			if(error == null)
-				return exception;
-
-			//构建错误事件参数对象
-			var args = new DataAccessErrorEventArgs(context, exception);
-
-			//激发“Error”事件
-			error(this, args);
-
-			//如果异常处理已经完成则返回空，否则返回处理后的异常
-			return args.ExceptionHandled ? null : args.Exception;
+			if(error != null)
+			{
+				//构建错误事件参数对象
+				var args = new DataAccessErrorEventArgs(context, exception);
+
+				//激发“Error”事件
+				error(this, args);
+
+				//如果异常处理已经完成则返回空，否则返回处理后的异常
+				return args.ExceptionHandled ? null : args.Exception;
+			}
+
+			return exception;
 		}

 		protected virtual void OnExecuting(IDataAccessContext context)


Comment

Comment

--- Slipstream.CommonDotNet.Commands/IAsyncCommand.cs
+++ Slipstream.CommonDotNet.Commands/IAsyncCommand.cs
@@ -6,7 +6,7 @@

 namespace Slipstream.CommonDotNet.Commands
 {
-    // TODO: can I do a distinct command, using the bytes of the data or something for a hash
+    // TODO: can I do a distinct command, using the bytes of the data or something for a hash, then could stop duplicate commands in for one processor
     public interface IAsyncCommand
     {
     }


Refs #95 - beetje cleanup in GroepenService:

* GetGroepEnCheckGav(string) werd maar op 1 plaats gebruikt. En wel in
  InfoOphalen, die de functie aanriep, en het resultaat returnde. Dat leek
  me wat overkill.
* String.Compare vervangen door een eigen functie 'Equal' is volgens mij
  geen goed idee, want ik denk dat Linq to Entities daar niet mee overweg
  kan. Op die manier worden alle gegevens uit de database gehaald, en
  gebeurt de selectie in-memory. Terwijl dat nu door de database wordt
  afgehandeld.

--- Solution/Chiro.Gap.Services/GroepenService.svc.cs
+++ Solution/Chiro.Gap.Services/GroepenService.svc.cs
@@ -181,7 +181,12 @@
         /// <returns>Groepsinformatie voor groep met code <paramref name="code"/></returns>
         public GroepInfo InfoOphalenCode(string code)
         {
-            var groep = GetGroepEnCheckGav(code);
+            var groep = (from g in _groepenRepo.Select()
+                         where String.Compare(g.Code, code, StringComparison.OrdinalIgnoreCase) == 0
+                         select g).FirstOrDefault();
+
+            Gav.Check(groep);
+
             return Mapper.Map<Groep, GroepInfo>(groep);
         }

@@ -242,15 +247,6 @@
             return Mapper.Map<IEnumerable<GroepsWerkJaar>, IEnumerable<WerkJaarInfo>>(groepsWerkJaren);
         }

-        static bool Equal(string links, string rechts)
-        {
-            if (links == null || rechts == null)
-            {
-                return links == null && rechts == null;
-            }
-            return String.Compare(links, rechts, StringComparison.OrdinalIgnoreCase) == 0;
-        }
-
         /// <summary>
         /// Persisteert een groep in de database
         /// Momenteel ondersteunen we enkel het wijzigen van groepsnaam
@@ -262,7 +258,7 @@
         {
             var groep = GetGroepEnCheckGav(groepInfo.ID);

-            if (!Equal(groepInfo.StamNummer, groep.Code) && !_autorisatieMgr.IsSuperGav())
+            if (String.Compare(groepInfo.StamNummer, groep.Code, StringComparison.OrdinalIgnoreCase) != 0 && !_autorisatieMgr.IsSuperGav())
             {
                 throw FaultExceptionHelper.GeenGav();
             }
@@ -362,14 +358,8 @@
             var ai = _afdelingenRepo.ByID(info.ID);
             Gav.Check(ai);
             Debug.Assert(ai != null, "ai != null");
-            if (!Equal(info.Naam, ai.Naam))
-            {
-                ai.Naam = info.Naam;
-            }
-            if (!Equal(info.Afkorting, ai.Afkorting))
-            {
-                ai.Afkorting = info.Afkorting;
-            }
+            ai.Naam = info.Naam;
+            ai.Afkorting = info.Afkorting;
             _afdelingenRepo.SaveChanges();
         }

@@ -719,15 +709,6 @@
             return groep;
         }

-        Groep GetGroepEnCheckGav(string groepCode)
-        {
-            var groep = (from g in _groepenRepo.Select()
-                         where Equal(g.Code, groepCode)
-                         select g).FirstOrDefault();
-            Gav.Check(groep);
-            return groep;
-        }
-
         /// <summary>
         /// Voegt een functie toe aan de groep
         /// </summary>
@@ -874,7 +855,7 @@
                 throw FaultExceptionHelper.FoutNummer(FoutNummer.ValidatieFout, Properties.Resources.OngeldigeCategorieNaam);
             }
             bool bestaatal = (from g in _categorieenRepo.Select()
-                              where Equal(g.Naam, nieuwenaam)
+                              where String.Compare(g.Naam, nieuwenaam, StringComparison.OrdinalIgnoreCase) == 0
                               select g).Any();
             if (bestaatal)
             {
@@ -896,7 +877,7 @@
         public CategorieInfo CategorieOpzoeken(int groepId, string code)
         {
             var groep = GetGroepEnCheckGav(groepId);
-            var categorie = groep.Categorie.FirstOrDefault(e => Equal(e.Code, code));
+            var categorie = groep.Categorie.FirstOrDefault(e => String.Compare(e.Code, code, StringComparison.InvariantCultureIgnoreCase) == 0);
             if (categorie == null)
             {
                 throw FaultExceptionHelper.GeenGav();


Add MapAll method to scan types from an assembly or a given list of types

--- src/ContainerExtensions.cs
+++ src/ContainerExtensions.cs
@@ -1,7 +1,9 @@
 namespace Nine.Injection
 {
+    using System;
     using System.Collections.Generic;
     using System.ComponentModel;
+    using System.Reflection;

     [EditorBrowsable(EditorBrowsableState.Never)]
     public static class ContainerExtensions
@@ -27,6 +29,56 @@
         {
             container.Map(typeof(TFrom), typeof(TTo));
             return container;
+        }
+
+        /// <summary>
+        ///  Map all exported types in the assemblies that implements T or derives from T.
+        /// </summary>
+        /// <returns>The container, complete with new registration</returns>
+        public static IContainer MapAll<T>(this IContainer container, params Assembly[] assemblies)
+        {
+            IEnumerable<Type> exportedTypes = null;
+
+            foreach (var assembly in assemblies)
+            {
+                try
+                {
+                    exportedTypes = assembly.ExportedTypes;
+                }
+                catch (ReflectionTypeLoadException)
+                {
+                    continue;
+                }
+
+                MapAll<T>(container, exportedTypes);
+            }
+
+            return container;
+        }
+
+        /// <summary>
+        ///  Map all types that implements T or derives from T.
+        /// </summary>
+        /// <returns>The container, complete with new registration</returns>
+        public static IContainer MapAll<T>(this IContainer container, IEnumerable<Type> types)
+        {
+            var ti = typeof(T).GetTypeInfo();
+
+            foreach (var type in types)
+            {
+                var info = type.GetTypeInfo();
+                if (IsTypeInjectible(info) && ti.IsAssignableFrom(info))
+                {
+                    container.Map(typeof(T), type);
+                }
+            }
+
+            return container;
+        }
+
+        private static bool IsTypeInjectible(TypeInfo type)
+        {
+            return type.IsClass && type.IsVisible && !type.IsAbstract && !type.IsGenericType && !type.IsGenericTypeDefinition;
         }

         /// <summary>


Better to be explicit about defaults that could be changed.

--- Source/Anaximander/TileMapping/TileImageWriter.cs
+++ Source/Anaximander/TileMapping/TileImageWriter.cs
@@ -87,9 +87,13 @@
 		/// <param name="filename">Filename.</param>
 		/// <param name="bitmap">Bitmap.</param>
 		private void WriteTile(string filename, DirectBitmap bitmap) {
-			var format = ImageFormat.Jpeg;
-			var extension = ".jpg";
+			ImageFormat format = ImageFormat.Jpeg;
+			string extension = string.Empty;
 			switch (_imageFormat) {
+				case ImageFormats.JPEG:
+					format = ImageFormat.Jpeg;
+					extension = ".jpg";
+				break;
 				case ImageFormats.PNG:
 					format = ImageFormat.Png;
 					extension = ".png";


Finished test for getting/setting working folder

--- Source/CmisCmdlets.Test/CmisWorkingFolderTests.cs
+++ Source/CmisCmdlets.Test/CmisWorkingFolderTests.cs
@@ -56,16 +56,28 @@
             });
         }

-        [Test, Ignore]
-        public void SetWFToRootWorks()
+        [Test]
+        public void SetWFWorks()
         {
+            CmisHelper.CreateTempFolder("/__subdir1/foo", true);
+            CmisHelper.CreateTempFolder("/__subdir2", false);
             var res = Shell.Execute(
                 GetConnectToTestRepoCmd(),
-                CmdletName(typeof(SetCmisWorkingFolderCommand)) + " /__subdir",
+                CmdletName(typeof(SetCmisWorkingFolderCommand)) + " /__subdir1",
+                CmdletName(typeof(GetCmisWorkingFolderCommand)),
+                CmdletName(typeof(SetCmisWorkingFolderCommand)) + " foo",
+                CmdletName(typeof(GetCmisWorkingFolderCommand)),
+                CmdletName(typeof(SetCmisWorkingFolderCommand)) + " ../../__subdir2",
+                CmdletName(typeof(GetCmisWorkingFolderCommand)),
                 CmdletName(typeof(SetCmisWorkingFolderCommand)) + " /",
                 CmdletName(typeof(GetCmisWorkingFolderCommand))
             );
-            Assert.That(res, Is.EquivalentTo(new [] { "/", "/"}));
+            Assert.That(res, Is.EquivalentTo(new [] {
+                "/__subdir1", "/__subdir1",
+                "/__subdir1/foo", "/__subdir1/foo",
+                "/__subdir2", "/__subdir2",
+                "/", "/"
+            }));
         }
     }
 }


[Util] Added file copy readonly policy

[Util] Added file copy readonly policy

Users now have some control over the readonly state of the destination
file when doing a file copy via `Util.ForceCopy`. Options are:
  - Preserve (default)
  - SetReadOnly
  - UnsetReadOnly

--- Sharpmake/Util.cs
+++ Sharpmake/Util.cs
@@ -1975,7 +1975,19 @@
             }
         }

+        public enum FileCopyDestReadOnlyPolicy : byte
+        {
+            Preserve,
+            SetReadOnly,
+            UnsetReadOnly
+        }
+
         public static void ForceCopy(string source, string destination)
+        {
+            ForceCopy(source, destination, FileCopyDestReadOnlyPolicy.Preserve);
+        }
+
+        public static void ForceCopy(string source, string destination, FileCopyDestReadOnlyPolicy destinationReadOnlyPolicy)
         {
             if (File.Exists(destination))
             {
@@ -1985,6 +1997,20 @@
             }

             File.Copy(source, destination, true);
+
+            if (destinationReadOnlyPolicy != FileCopyDestReadOnlyPolicy.Preserve)
+            {
+                FileAttributes attributes = File.GetAttributes(destination);
+                if (destinationReadOnlyPolicy == FileCopyDestReadOnlyPolicy.SetReadOnly)
+                {
+                    attributes |= FileAttributes.ReadOnly;
+                }
+                else
+                {
+                    attributes &= ~FileAttributes.ReadOnly;
+                }
+                File.SetAttributes(destination, attributes);
+            }
         }

         public static bool IsDotNet(Project.Configuration conf)


Mac: Fix updating layout properly when setting ImageView.Image after it has been loaded. Fixes #362

--- Source/Eto.Mac/Forms/Controls/ImageViewHandler.cs
+++ Source/Eto.Mac/Forms/Controls/ImageViewHandler.cs
@@ -39,7 +39,7 @@
 	public class ImageViewHandler : MacControl<NSImageView, ImageView, ImageView.ICallback>, ImageView.IHandler
 	{
 		Image image;
-
+
 		public class EtoImageView : NSImageView, IMacControl
 		{
 			public WeakReference WeakHandler { get; set; }
@@ -50,24 +50,29 @@
 				set { WeakHandler = new WeakReference(value); }
 			}
 		}
-
-		public ImageViewHandler ()
+
+		public ImageViewHandler()
 		{
 			Control = new EtoImageView { Handler = this, ImageScaling = NSImageScale.ProportionallyUpOrDown };
 		}

-		protected override SizeF GetNaturalSize (SizeF availableSize)
+		protected override SizeF GetNaturalSize(SizeF availableSize)
 		{
 			return image == null ? Size.Empty : image.Size;
 		}
-
-		public Image Image {
-			get {
-				return image;
-			}
-			set {
-				image = value;
-				Control.Image = image == null ? null : ((IImageSource)value.Handler).GetImage();
+
+		public Image Image
+		{
+			get { return image; }
+			set
+			{
+				if (image != value)
+				{
+					var oldSize = GetPreferredSize(Size.MaxValue);
+					image = value;
+					Control.Image = image.ToNS();
+					LayoutIfNeeded(oldSize);
+				}
 			}
 		}
 	}


update Facebook api to v2.10

update Facebook api to v2.10

--- SimpleWAWS/Authentication/FacebookAuthProvider.cs
+++ SimpleWAWS/Authentication/FacebookAuthProvider.cs
@@ -85,7 +85,7 @@
         private string GetGraphUrl(string userId, string accessToken)
         {
             var builder = new StringBuilder();
-            builder.Append("https://graph.facebook.com/v2.2");
+            builder.Append("https://graph.facebook.com/v2.10");
             builder.AppendFormat("/{0}", userId);
             builder.AppendFormat("?access_token={0}", accessToken);
             builder.Append("&format=json");


Add OpenWindowTest#OpenWithSafeParameter.

--- Source/Kamishibai.Test/Scenario/OpenWindowTest.cs
+++ Source/Kamishibai.Test/Scenario/OpenWindowTest.cs
@@ -105,4 +105,28 @@
         childWindow.CloseCommand.EmulateClick();
         childWindow.IsLoaded.Should().BeFalse();
     }
+
+    [Test]
+    public void OpenWithSafeParameter()
+    {
+        var mainWindow = app.AttachMainWindow();
+        var openWindowPage = app.AttachOpenWindowPage();
+        // Navigate OpenWindowPage
+        mainWindow.SelectedMenuItem.EmulateChangeSelectedIndex(1);
+
+        // Open window
+        const string windowName = "Hello, Navigate!";
+        openWindowPage.WindowName3.EmulateChangeText(windowName);
+
+        openWindowPage.OpenWithSafeParameterCommand.EmulateClick();
+        var childWindow = app.AttachChildWindow();
+        childWindow.IsLoaded.Should().BeTrue();
+        childWindow.WindowName.Text.Should().Be(windowName);
+
+
+        // close window
+        childWindow.Core.Activate();
+        childWindow.CloseCommand.EmulateClick();
+        childWindow.IsLoaded.Should().BeFalse();
+    }
 }


Fixed SQL Error in Delete endpoint

Fixed SQL Error in Delete endpoint

--- Source/Libraries/GSF.Web/Model/ModelController.cs
+++ Source/Libraries/GSF.Web/Model/ModelController.cs
@@ -420,21 +420,21 @@
                         if (idProp.PropertyType == typeof(int))
                         {
                             int id = (int)idProp.GetValue(record);
-                            int result = connection.ExecuteNonQuery($"EXEC UniversalCascadeDelete '{tableName}', '{PrimaryKeyField} = {id}'");
+                            int result = connection.ExecuteNonQuery($"EXEC UniversalCascadeDelete {tableName}, '{PrimaryKeyField} = {id}'");
                             return Ok(result);

                         }
                         else if (idProp.PropertyType == typeof(Guid))
                         {
                             Guid id = (Guid)idProp.GetValue(record);
-                            int result = connection.ExecuteNonQuery($"EXEC UniversalCascadeDelete '{tableName}', '{PrimaryKeyField} = ''{id}'''");
+                            int result = connection.ExecuteNonQuery($"EXEC UniversalCascadeDelete {tableName}, '{PrimaryKeyField} = ''{id}'''");
                             return Ok(result);

                         }
                         else if (idProp.PropertyType == typeof(string))
                         {
                             string id = (string)idProp.GetValue(record);
-                            int result = connection.ExecuteNonQuery($"EXEC UniversalCascadeDelete '{tableName}', '{PrimaryKeyField} = ''{id}'''");
+                            int result = connection.ExecuteNonQuery($"EXEC UniversalCascadeDelete {tableName}, '{PrimaryKeyField} = ''{id}'''");
                             return Ok(result);

                         }


Add token expiration

Add token expiration

--- SnapMD.VirtualCare.ApiModels/SerializableToken.cs
+++ SnapMD.VirtualCare.ApiModels/SerializableToken.cs
@@ -12,9 +12,14 @@
 #endregion

 using System;
+// ReSharper disable InconsistentNaming
+#pragma warning disable 1591

 namespace SnapMD.VirtualCare.ApiModels
 {
+    /// <summary>
+    ///
+    /// </summary>
     public class SerializableToken
     {
         public string access_token { get; set; }


Add RSS MIME Type

Add RSS MIME Type

--- Source/MVC6/Boilerplate.AspNetCore/ContentType.cs
+++ Source/MVC6/Boilerplate.AspNetCore/ContentType.cs
@@ -1,4 +1,4 @@
-namespace Boilerplate.AspNetCore
+namespace Boilerplate.AspNetCore
 {
     ///
     /// A list of internet media types, which are a standard identifier used on the Internet to indicate the type of
@@ -22,9 +22,6 @@
         /// JPEG JFIF image; Defined in RFC 2045 and RFC 2046.
         public const string Jpg = "image/jpeg";

-        /// Binary JavaScript Object Notation BSON.
-        public const string Bson = "application/bson";
-
         /// JavaScript Object Notation JSON; Defined in RFC 4627.
         public const string Json = "application/json";

@@ -33,6 +30,9 @@

         /// Portable Network Graphics; Registered,[8] Defined in RFC 2083.
         public const string Png = "image/png";
+
+        /// Rich Site Summary; Defined by Harvard Law.
+        public const string Rss = "application/rss+xml";

         /// Textual data; Defined in RFC 2046 and RFC 3676.
         public const string Text = "text/plain";


Update Creature_Vitals.cs (#3641)

Update Creature_Vitals.cs (#3641)

* Update Creature_Vitals.cs

* Update Creature_Vitals.cs

--- Source/ACE.Server/WorldObjects/Creature_Vitals.cs
+++ Source/ACE.Server/WorldObjects/Creature_Vitals.cs
@@ -105,7 +105,7 @@
             var vitalCurrent = vital.Current;
             var vitalMax = vital.MaxValue;

-            if (vitalCurrent == vitalMax)
+            if (vitalCurrent >= vitalMax && vital.RegenRate > 0)
                 return false;

             if (vitalCurrent > vitalMax)
@@ -140,16 +140,29 @@
             var intTick = (int)totalTick;
             vital.PartialRegen = totalTick - intTick;

-            if (intTick > 0)
+            if (intTick != 0)
             {
                 //if (this is Player)
                     //Console.WriteLine($"VitalTick({vital.Vital.ToSentence()}): attributeMod={attributeMod}, stanceMod={stanceMod}, enchantmentMod={enchantmentMod}, regenRate={vital.RegenRate}, currentTick={currentTick}, totalTick={totalTick}, accumulated={vital.PartialRegen}");

                 UpdateVitalDelta(vital, intTick);
                 if (vital.Vital == PropertyAttribute2nd.MaxHealth)
-                    DamageHistory.OnHeal((uint)intTick);
-
-                return true;
+                {
+                    if (intTick > 0)
+                        DamageHistory.OnHeal((uint)intTick);
+                    else
+                    {
+                        DamageHistory.Add(this, DamageType.Health, (uint)intTick);
+
+                        if (Health.Current <= 0)
+                        {
+                            OnDeath(DamageHistory.LastDamager, DamageType.Health);
+                            Die();
+                        }
+                    }
+
+                    return true;
+                }
             }
             return false;
         }


made  downloader not update statuslog if there was an external action

--- Source/Applications/openMIC/openMIC/Downloader.cs
+++ Source/Applications/openMIC/openMIC/Downloader.cs
@@ -998,9 +998,12 @@

                             // Handle local file age limit processing, if enabled
                             if (settings.DeleteOldLocalFiles)
-                                HandleLocalFileAgeLimitProcessing(settings);
-
-                            //OnProgressUpdated(this, new ProgressUpdate(ProgressState.Processing, true, null, ++m_overallTasksCompleted, m_overallTasksCount));
+                                HandleLocalFileAgeLimitProcessing(settings);
+
+                            //OnProgressUpdated(this, new ProgressUpdate(ProgressState.Processing, true, null, ++m_overallTasksCompleted, m_overallTasksCount));
+                            if (string.IsNullOrWhiteSpace(settings.ExternalOperation))
+                                UpdateStatusLogDatabase("", "", true);
+
                         }

                         OnProgressUpdated(this, new ProgressUpdate(ProgressState.Succeeded, true, $"Completed \"{connectionProfileName}\" connection profile processing.", m_overallTasksCount, m_overallTasksCount));
@@ -1009,8 +1012,6 @@
                     {
                         OnProgressUpdated(this, new ProgressUpdate(ProgressState.Skipped, true, $"Skipped \"{connectionProfileName}\" connection profile processing: No tasks defined.", 0, 1));
                     }
-
-                    UpdateStatusLogDatabase("", "", true);
                     Ticks connectedTime = DateTime.UtcNow.Ticks - connectionStartTime;
                     OnStatusMessage("FTP session connected for {0}", connectedTime.ToElapsedTimeString(2));
                     TotalConnectedTime += connectedTime;


GSF.TimeSeries: Added comments to MeasurementKey describing the reasoning behind SyncEdits.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/gsf/Main;C94375

--- Source/Libraries/GSF.TimeSeries/MeasurementKey.cs
+++ Source/Libraries/GSF.TimeSeries/MeasurementKey.cs
@@ -33,6 +33,10 @@
     /// <summary>
     /// Represents a primary key for a measurement.
     /// </summary>
+    /// <remarks>
+    /// In the Static section of this class, all edits to <see cref="IDCache"/> as well as the
+    /// ConcurrentDictionaries in <see cref="KeyCache"/> should occur within a lock on SyncEdits.
+    /// </remarks>
     [Serializable]
     public class MeasurementKey
     {
@@ -197,6 +201,14 @@
                 return key;
             };

+            // https://msdn.microsoft.com/en-us/library/ee378675(v=vs.110).aspx
+            //
+            //     If you call AddOrUpdate simultaneously on different threads,
+            //     addValueFactory may be called multiple times, but its key/value
+            //     pair might not be added to the dictionary for every call.
+            //
+            // This lock prevents race conditions that might occur in the addValueFactory that
+            // could cause different MeasurementKey objects to be written to the KeyCache and IDCache
             lock (SyncEdits)
             {
                 return IDCache.AddOrUpdate(signalID, addValueFactory, updateValueFactory);


Use forwarded headers (for when we're behind nginx)

--- src/NodaTime.Web/Startup.cs
+++ src/NodaTime.Web/Startup.cs
@@ -6,6 +6,7 @@
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http.Headers;
+using Microsoft.AspNetCore.HttpOverrides;
 using Microsoft.AspNetCore.Rewrite;
 using Microsoft.AspNetCore.StaticFiles;
 using Microsoft.CodeAnalysis.CSharp;
@@ -46,6 +47,9 @@
             // Add framework services.
             services.AddMvc();

+            services.Configure<ForwardedHeadersOptions>(
+                options => options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto);
+
             if (UseGoogleCloudStorage)
             {
                 // Eagerly fetch the GoogleCredential so that we're not using Task.Result in
@@ -70,6 +74,7 @@
             loggerFactory.AddConsole(Configuration.GetSection("Logging"));
             loggerFactory.AddDebug();

+            app.UseForwardedHeaders();
             if (env.IsDevelopment())
             {
                 app.UseDeveloperExceptionPage();


Use default parameter instead of overload

--- Source/MQTTnet/Client/MqttClientOptionsBuilder.cs
+++ Source/MQTTnet/Client/MqttClientOptionsBuilder.cs
@@ -92,28 +92,13 @@
             return this;
         }

-        public MqttClientOptionsBuilder WithWebSocketServer(string uri)
+        public MqttClientOptionsBuilder WithWebSocketServer(string uri, MqttClientOptionsBuilderWebSocketParameters parameters = null)
         {
             _webSocketOptions = new MqttClientWebSocketOptions
             {
-                Uri = uri
-            };
-
-            return this;
-        }
-
-        public MqttClientOptionsBuilder WithWebSocketServer(string uri, MqttClientOptionsBuilderWebSocketParameters parameters)
-        {
-            if(parameters == null)
-            {
-                throw new ArgumentNullException(nameof(parameters));
-            }
-
-            _webSocketOptions = new MqttClientWebSocketOptions
-            {
                 Uri = uri,
-                RequestHeaders = parameters.RequestHeaders,
-                CookieContainer = parameters.CookieContainer
+                RequestHeaders = parameters?.RequestHeaders,
+                CookieContainer = parameters?.CookieContainer
             };

             return this;


version bump again

version bump again

--- Source/Version.cs
+++ Source/Version.cs
@@ -8,6 +8,7 @@
 // Note: until version 1.0 expect breaking changes on 0.X versions.

 // 0.45.0.0 IBus Subscription methods now return an ISubscriptionResult and IAdvancedBus exposes IConventions.
+// 0.44.3.0 RabbitHutch.CreateBus overload
 // 0.44.2.0 Bug fix, when a subscriptionId is null the queue name end with '_'
 // 0.44.1.0 SSL enabled cluster support - Added SSL options per host configuration
 // 0.44.0.0 Added Action<IConsumerConfiguration> overloads to Receive() on IBus, ISendReceive, and their implementations


Added micro IoC container to RabbitHutch. Allows complete user control over component injection. See docs for details.

--- Source/Version.cs
+++ Source/Version.cs
@@ -1,8 +1,9 @@
 using System.Reflection;

 // EasyNetQ version number: <major>.<minor>.0.<build>
-[assembly: AssemblyVersion("0.6.3.0")]
+[assembly: AssemblyVersion("0.6.4.0")]

+// 0.7.0.0  Added IServiceProvider to make it easy to plug in your own dependencies. Some breaking changes to RabbitHutch
 // 0.6.3.0  Consumer Queue now uses BCL BlockingCollection.
 // 0.6.2.0  New model cleanup strategy based on consumer tracking
 // 0.6.1.0  Removed InMemoryBus, Removed concrete class dependencies from FuturePublish.


Bump Version.cs

Bump Version.cs

--- Source/Version.cs
+++ Source/Version.cs
@@ -2,11 +2,12 @@
 using System.Reflection;

 // EasyNetQ version number: <major>.<minor>.<non-breaking-feature>.<build>
-[assembly: AssemblyVersion("0.50.12.0")]
+[assembly: AssemblyVersion("0.51.0.0")]
 [assembly: CLSCompliant(true)]

 // Note: until version 1.0 expect breaking changes on 0.X versions.

+// 0.51.0.0 A lot of changes in publish mechanisms. Should be used with care
 // 0.50.12.0 Added Serilog nuget package
 // 0.50.11.0 Updated Scheduler for MSSQL to support all properties of the ScheduleMe message
 // 0.50.10.0 Updated RabbitMQ client to 3.5.6


- Fixed build.

- Fixed build.

--- Source/Mosa.Platform.Internal.x86/StringBuffer.cs
+++ Source/Mosa.Platform.Internal.x86/StringBuffer.cs
@@ -280,7 +280,9 @@
 		/// <summary>
 		/// The length of the string
 		/// </summary>
-		/// <param name="length"></param>
+		/// <value>
+		/// The length.
+		/// </value>
 		public int Length
 		{
 			get { return length; }
@@ -329,4 +331,4 @@
 			return -1;
 		}
 	}
-}+}


Make it easy to figure who was finalized

--- src/Core/FSpot.Core/Tag.cs
+++ src/Core/FSpot.Core/Tag.cs
@@ -182,7 +182,7 @@
 			}
 			else
 			{
-				Console.WriteLine ("Finalizer called on {0}. Should be Disposed", GetType ());
+				Console.WriteLine ("[FSpot.Core.Tag] Finalizer called on {0}. Should be Disposed", GetType ());
 				if (icon != null)
 					icon.Dispose ();
 				if (cached_icon != null)


add util

add util

--- TCC.Core/Utils.cs
+++ TCC.Core/Utils.cs
@@ -303,6 +303,25 @@
             return StringUtils.ByteArrayToString(SHA256.Create().ComputeHash(fileBuffer));

         }
+
+        public static bool IsFileLocked(string filename, FileAccess file_access)
+        {
+            // Try to open the file with the indicated access.
+            try
+            {
+                var fs = new FileStream(filename, FileMode.Open, file_access);
+                fs.Close();
+                return false;
+            }
+            catch (IOException)
+            {
+                return true;
+            }
+            catch (Exception)
+            {
+                throw;
+            }
+        }
     }

     public static class ListExtensions


Test getting all resources, and print results on right

--- osu.Framework.Tests/Visual/Platform/TestSceneResourceStores.cs
+++ osu.Framework.Tests/Visual/Platform/TestSceneResourceStores.cs
@@ -20,8 +20,9 @@
 {
     public class TestSceneResourceStores : FrameworkTestScene
     {
+        private FillFlowContainer textContainer;
+
         private FontStore fontStore;
-        private FillFlowContainer textContainer;
         private TextureStore textureStore;
         private StorageBackedResourceStore storageStore;
         private TrackStore trackStore;
@@ -49,92 +50,122 @@
         [Test]
         public void TestGetFontStoreResources()
         {
-            AddStep("Print resources in font store", () => populateText(fontStore.GetAvailableResources()));
+            var glyphNames = fontStore.GetAvailableResources().ToList();
+            var glyphTextures = new List<Texture>();
+            var boxes = new List<Drawable>();
+
+            AddStep("Get all available resources", () =>
+            {
+                glyphTextures = new List<Texture>();
+                boxes = new List<Drawable>();
+                glyphTextures.AddRange(glyphNames.Select(glyph =>
+                {
+                    var tex = fontStore.Get(glyph);
+                    boxes.Add(new Box
+                    {
+                        Texture = tex,
+                        Size = new Vector2(20)
+                    });
+                    return tex;
+                }));
+            });
+            AddStep("Print resources in font store", () => populateText(glyphNames, boxes));
+            AddAssert("No glyphs were null", () => glyphTextures.All(tex => tex != null));
         }

         [Test]
         public void TestGetStorageBackedResources()
         {
-            AddStep("Print storage backed resources", () => populateText(storageStore.GetAvailableResources()));
+            var fileNames = storageStore.GetAvailableResources().ToList();
+            var fileList = new List<byte[]>();
+            var texts = new List<Drawable>();
+
+            AddStep("Get all available resources", () =>
+            {
+                texts = new List<Drawable>();
+                fileList = new List<byte[]>();
+                fileList.AddRange(fileNames.Select(file =>
+                {
+                    var tex = storageStore.Get(file);
+                    texts.Add(new SpriteText { Text = tex.ToString() });
+                    return tex;
+                }));
+            });
+            AddStep("Print storage backed resources", () => populateText(fileNames, texts));
+            AddAssert("No files were null", () => fileList.All(file => file != null));
         }

         [Test]
         public void TestGetTextureStore()
         {
-            AddStep("Print texture store", () => populateText(textureStore.GetAvailableResources()));
+            var texNames = textureStore.GetAvailableResources().ToList();
+            var textures = new List<Texture>();
+            var drawables = new List<Drawable>();
+
+            AddStep("Get all available resources", () =>
+            {
+                textures = new List<Texture>();
+                drawables = new List<Drawable>();
+                textures.AddRange(texNames.Select(name =>
+                {
+                    var tex = textureStore.Get(name);
+                    drawables.Add(new Box
+                    {
+                        Texture = tex,
+                        Size = new Vector2(20)
+                    });
+                    return tex;
+                }));
+            });
+            AddStep("Print resources in texture store", () => populateText(texNames, drawables));
+            AddAssert("No textures were null", () => textures.All(tex => tex != null));
         }

         [Test]
         public void TestGetTrackManager()
         {
-            AddStep("Print track manager", () => populateText(trackStore.GetAvailableResources()));
+            var trackNames = trackStore.GetAvailableResources().ToList();
+            var fileList = new List<Track>();
+            var texts = new List<Drawable>();
+
+            AddStep("Get all available resources", () =>
+            {
+                texts = new List<Drawable>();
+                fileList = new List<Track>();
+                fileList.AddRange(trackNames.Select(name =>
+                {
+                    var track = trackStore.Get(name);
+                    texts.Add(new SpriteText { Text = track.ToString() });
+                    return track;
+                }));
+            });
+            AddStep("Print resources in track store", () => populateText(trackNames, texts));
+            AddAssert("No tracks were null", () => fileList.All(file => file != null));
         }

-        [Test]
-        public void TestGetFromResources()
-        {
-            Texture glyph = null;
-            byte[] file = null;
-            Texture texture = null;
-            Track track = null;
-
-            AddStep("Get all resources", () =>
-            {
-                glyph = null;
-                file = null;
-                texture = null;
-                track = null;
-
-                var glyphs = fontStore.GetAvailableResources();
-                var storage = storageStore.GetAvailableResources();
-                var textures = textureStore.GetAvailableResources();
-                var tracks = trackStore.GetAvailableResources();
-
-                glyph = fontStore.Get(glyphs.First());
-                file = storageStore.Get(storage.First());
-                texture = textureStore.Get(textures.First());
-                track = trackStore.Get(tracks.First());
-
-                textContainer.Clear();
-                textContainer.Add(new Box
-                {
-                    Texture = glyph,
-                    Size = new Vector2(20)
-                });
-
-                textContainer.Add(new SpriteText
-                {
-                    Text = file.ToString()
-                });
-
-                textContainer.Add(new Box
-                {
-                    Texture = texture,
-                    Size = new Vector2(20)
-                });
-
-                textContainer.Add(new SpriteText
-                {
-                    Text = track.ToString()
-                });
-            });
-
-            AddAssert("glyph was not null", () => glyph != null);
-            AddAssert("file was not null", () => file != null);
-            AddAssert("texture was not null", () => texture != null);
-            AddAssert("track was not null", () => track != null);
-        }
-
-        private void populateText(IEnumerable<string> lines)
+        private void populateText(List<string> lines, List<Drawable> results)
         {
             textContainer.Clear();
-            foreach (var text in lines)
+
+            for (int i = 0; i < lines.Count; i++)
             {
-                textContainer.Add(new SpriteText
+                var result = results[i];
+                result.Origin = Anchor.TopRight;
+                result.Anchor = Anchor.TopRight;
+                textContainer.Add(new Container
                 {
-                    Anchor = Anchor.TopLeft,
-                    Origin = Anchor.TopLeft,
-                    Text = text,
+                    RelativeSizeAxes = Axes.X,
+                    AutoSizeAxes = Axes.Y,
+                    Children = new[]
+                    {
+                        new SpriteText
+                        {
+                            Anchor = Anchor.TopLeft,
+                            Origin = Anchor.TopLeft,
+                            Text = lines[i],
+                        },
+                        result
+                    }
                 });
             }
         }


Read appSettings on construction to throw early.

--- librato4net/AppSettingsLibratoSettings.cs
+++ librato4net/AppSettingsLibratoSettings.cs
@@ -5,14 +5,12 @@
 {
     public class AppSettingsLibratoSettings : ILibratoSettings
     {
-        // ReSharper disable once InconsistentNaming
-        private static readonly AppSettingsLibratoSettings settings = new AppSettingsLibratoSettings();
-
         private const string DefaultApiEndPoint = "https://metrics-api.librato.com/v1/";

-        public static AppSettingsLibratoSettings Settings
+        public AppSettingsLibratoSettings()
         {
-            get { return settings; }
+            var _ = Username;
+            _ = ApiKey;
         }

         public string Username


Use IndexOf() and fix GetLength()

Use IndexOf() and fix GetLength()

--- src/DotNet/Writer/Heaps.cs
+++ src/DotNet/Writer/Heaps.cs
@@ -194,10 +194,12 @@
 			if (guid == null)
 				return 0;

-			for (int i = 0; i < guids.Count; i++) {
-				if (guids[i] == guid.Value)
-					return (uint)i + 1;
-			}
+			// The number of GUIDs will almost always be 1 so there's no need for a dictionary.
+			// The only table that contains GUIDs is the Module table, and it has three GUID
+			// columns. Only one of them (Mvid) is normally set and the others are null.
+			int index = guids.IndexOf(guid.Value);
+			if (index >= 0)
+				return (uint)index + 1;

 			guids.Add(guid.Value);
 			return (uint)guids.Count;
@@ -205,7 +207,7 @@

 		/// <inheritdoc/>
 		public override uint GetLength() {
-			return (uint)guids.Count * 16 + 1;
+			return (uint)guids.Count * 16;
 		}

 		/// <inheritdoc/>


Do not lookup default kiai explosion if skin has own

--- osu.Game.Rulesets.Taiko/Skinning/TaikoLegacySkinTransformer.cs
+++ osu.Game.Rulesets.Taiko/Skinning/TaikoLegacySkinTransformer.cs
@@ -114,6 +114,13 @@

                     return null;

+                case TaikoSkinComponents.TaikoExplosionKiai:
+                    // suppress the default kiai explosion if the skin brings its own sprites.
+                    if (hasExplosion.Value)
+                        return Drawable.Empty();
+
+                    return null;
+
                 case TaikoSkinComponents.Scroller:
                     if (GetTexture("taiko-slider") != null)
                         return new LegacyTaikoScroller();


Fix incorrectly changed difficulty count in recently updated test

--- osu.Game.Tests/Visual/Online/TestSceneBeatmapListingOverlay.cs
+++ osu.Game.Tests/Visual/Online/TestSceneBeatmapListingOverlay.cs
@@ -90,7 +90,7 @@
         {
             AddAssert("is visible", () => overlay.State.Value == Visibility.Visible);

-            AddStep("show many results", () => fetchFor(Enumerable.Repeat(CreateAPIBeatmapSet(Ruleset.Value), 10).ToArray()));
+            AddStep("show many results", () => fetchFor(Enumerable.Repeat(CreateAPIBeatmapSet(Ruleset.Value), 100).ToArray()));

             AddUntilStep("placeholder hidden", () => !overlay.ChildrenOfType<BeatmapListingOverlay.NotFoundDrawable>().Any(d => d.IsPresent));


Make TLB test scene test TLB and not back button

--- osu.Game.Tests/Visual/UserInterface/TestSceneTwoLayerButton.cs
+++ osu.Game.Tests/Visual/UserInterface/TestSceneTwoLayerButton.cs
@@ -1,17 +1,26 @@
 // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

-using System.ComponentModel;
+using osu.Framework.Extensions.Color4Extensions;
+using osu.Framework.Graphics.Sprites;
 using osu.Game.Graphics.UserInterface;
+using osuTK;
+using osuTK.Graphics;

 namespace osu.Game.Tests.Visual.UserInterface
 {
-    [Description("mostly back button")]
     public class TestSceneTwoLayerButton : OsuTestScene
     {
         public TestSceneTwoLayerButton()
         {
-            Add(new BackButton());
+            Add(new TwoLayerButton
+            {
+                Position = new Vector2(100),
+                Text = "button",
+                Icon = FontAwesome.Solid.Check,
+                BackgroundColour = Color4.SlateGray,
+                HoverColour = Color4.SlateGray.Darken(0.2f)
+            });
         }
     }
 }


Fix arguments in call to ILBuilderVisualizer.BasicBlockToString (changeset 1332978)

--- Src/Compilers/Core/Portable/CodeGen/BasicBlock.cs
+++ Src/Compilers/Core/Portable/CodeGen/BasicBlock.cs
@@ -672,7 +672,7 @@
                 if (visType != null)
                 {
                     var method = visType.GetTypeInfo().GetDeclaredMethod("BasicBlockToString");
-                    return (string)method.Invoke(this, SpecializedCollections.EmptyArray<object>());
+                    return (string)method.Invoke(null, new object[] { this });
                 }
 #endif


Remove unneeded Literal fields (#18)

Remove unneeded Literal fields (#18)

--- src/Esprima/Ast/Literal.cs
+++ src/Esprima/Ast/Literal.cs
@@ -8,9 +8,9 @@
         Expression,
         PropertyKey
     {
-        [JsonIgnore] public readonly string StringValue;
+        [JsonIgnore] public string StringValue => TokenType == TokenType.StringLiteral ? Value as string : null;
         [JsonIgnore] public readonly double NumericValue;
-        [JsonIgnore] public readonly bool BooleanValue;
+        [JsonIgnore] public bool BooleanValue => TokenType == TokenType.BooleanLiteral && NumericValue != 0;
         [JsonIgnore] public readonly Regex RegexValue;

         [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
@@ -23,17 +23,10 @@

         [JsonIgnore] public readonly TokenType TokenType;

-        [JsonIgnore] public readonly bool Integral;
-
-        [JsonIgnore] public readonly bool Cached;
-
-        //[JsonIgnore]
-        //public JsValue CachedValue;
-
         public Literal(string value, string raw)
         {
             Type = Nodes.Literal;
-            Value = StringValue = value;
+            Value = value;
             TokenType = TokenType.StringLiteral;
             Raw = raw;
         }
@@ -41,7 +34,8 @@
         public Literal(bool value, string raw)
         {
             Type = Nodes.Literal;
-            Value = BooleanValue = value;
+            Value = value;
+            NumericValue = value ? 1 : 0;
             TokenType = TokenType.BooleanLiteral;
             Raw = raw;
         }


Fix job success log level check

Fix job success log level check

--- src/Foundatio/Jobs/IJob.cs
+++ src/Foundatio/Jobs/IJob.cs
@@ -81,11 +81,11 @@
                     logger.LogError(result.Error, "Job run {JobName} failed: {Message}", jobName, result.Message);
                 else if (!String.IsNullOrEmpty(result.Message))
                     logger.LogInformation("Job run {JobName} succeeded: {Message}", jobName, result.Message);
-                else if (logger.IsEnabled(LogLevel.Trace))
+                else if (logger.IsEnabled(LogLevel.Debug))
                     logger.LogDebug("Job run {JobName} succeeded.", jobName);
             } else if (logger.IsEnabled(LogLevel.Error)) {
                 logger.LogError("Null job run result for {JobName}.", jobName);
             }
         }
     }
-}+}


Fix #5318: don't crash when disposing the MonoMac_Disposer.

--- src/Foundation/NSObject.cs
+++ src/Foundation/NSObject.cs
@@ -126,7 +126,7 @@
 						Messaging.void_objc_msgSend (handle, selRelease);

 					Marshal.FreeHGlobal (SuperHandle);
-				} else {
+				} else if (disposer != null) {
 					bool calldrain = false;

 					if (Class.IsCustomType (this.GetType ()))
@@ -361,6 +361,12 @@
 					direct_handles.Clear ();
 				}
 			}
+
+			protected override void Dispose (bool disposing)
+			{
+				NSObject.disposer = null;
+				base.Dispose (disposing);
+			}
 		}
 	}
 }


Fixed storage chunk size

Fixed storage chunk size

--- VM12/VM12/VM12.cs
+++ VM12/VM12/VM12.cs
@@ -70,7 +70,7 @@
         }

         private const int STORAGE_CHUNK_SIZE = 128;
-        private const int STORAGE_CHUNK_GROUPING = 4069;
+        private const int STORAGE_CHUNK_GROUPING = 4096;

         public static readonly byte[][,] S = AllocateStorageMemory(MEM_SIZE, STORAGE_CHUNK_GROUPING, STORAGE_CHUNK_SIZE);
         public static readonly bool[] S_HIT = new bool[MEM_SIZE];


Make lists use hex to display ids

Make lists use hex to display ids

--- Views/MainView.cs
+++ Views/MainView.cs
@@ -165,19 +165,19 @@

             try
             {
-                lstSpawnMonsterSearchList.Clear();
-
-                foreach (KeyValuePair<string, Int32> monster in PluginCore.monsters)
+                lstSpawnModelSearchList.Clear();
+
+                foreach (KeyValuePair<int, string> model in PluginCore.models)
                 {
-                    if (!(monster.Key.ToLowerInvariant().Contains(searchText.ToLowerInvariant())))
+                    if (!(model.Value.ToLowerInvariant().Contains(searchText.ToLowerInvariant())))
                     {
                         continue;
                     }

-                    IListRow row = lstSpawnMonsterSearchList.Add();
-
-                    row[0][0] = monster.Key;
-                    row[1][0] = monster.Value.ToString("X");
+                    IListRow row = lstSpawnModelSearchList.Add();
+
+                    row[0][0] = model.Key.ToString("X4");
+                    row[1][0] = model.Value.ToString();
                 }
             }
             catch (Exception ex)
@@ -231,9 +231,10 @@
         {
             try
             {
-                Int32 value = Int32.Parse(txtSpawnToolValue.Text);
-                value += 1;
-                txtSpawnToolValue.Text = value.ToString();
+                int value = int.Parse(txtSpawnToolValue.Text, System.Globalization.NumberStyles.HexNumber);
+
+                 value += 1;
+                txtSpawnToolValue.Text = value.ToString("X4");
             }
             catch (Exception ex)
             {
@@ -245,9 +246,9 @@
         {
             try
             {
-                Int32 value = Int32.Parse(txtSpawnToolValue.Text);
+                int value = int.Parse(txtSpawnToolValue.Text, System.Globalization.NumberStyles.HexNumber);
                 value -= 1;
-                txtSpawnToolValue.Text = value.ToString();
+                txtSpawnToolValue.Text = value.ToString("X4");
             }
             catch (Exception ex)
             {
@@ -271,14 +272,14 @@
         {
             try
             {
-                lstSpawnMonsterSearchList.Clear();
-
-                foreach (KeyValuePair<string, Int32> monster in PluginCore.monsters)
+                lstSpawnModelSearchList.Clear();
+
+                foreach (KeyValuePair<int, string> model in PluginCore.models)
                 {
-                    IListRow row = lstSpawnMonsterSearchList.Add();
-
-                    row[0][0] = monster.Key;
-                    row[1][0] = monster.Value.ToString();
+                    IListRow row = lstSpawnModelSearchList.Add();
+
+                    row[0][0] = model.Key.ToString("X4");
+                    row[1][0] = model.Value.ToString();
                 }
             }
             catch (Exception ex)


Small fixes.

Small fixes.

--- src/Hashids.net/Hashids.cs
+++ src/Hashids.net/Hashids.cs
@@ -78,12 +78,10 @@
         private long[] PrecalculateNumberPowers(int number)
         {
             var powers = new long[NumberPowersCount];
-
-            long n = 1;
-            for (var i = 0; i < NumberPowersCount; i++)
-            {
-                powers[i] = n;
-                n *= number;
+            powers[0] = 1;
+            for (var i = 1; i < NumberPowersCount; i++)
+            {
+                powers[i] = powers[i - 1] * number;
             }

             return powers;


extended MathEx: EvaluateEllipse/Circle, EvaluateQuadraticBezier and Deg2Rad/Rad2Deg

--- src/ImGui/Common/MathEx.cs
+++ src/ImGui/Common/MathEx.cs
@@ -292,5 +292,38 @@
             var z = 1.0 / (3.0 * sum);
             return new Point(vsum.X * z, vsum.Y * z);
         }
+
+        public static Point EvaluateCircle(Point center, double radius, double rad)
+        {
+            return EvaluateEllipse(center, radius, radius, rad);
+        }
+
+        public static Point EvaluateEllipse(Point center, double xHalfAxis, double yHalfAxis, double rad)
+        {
+            double x = xHalfAxis * Math.Cos(rad);
+            double y = yHalfAxis * Math.Sin(rad);
+            return new Point(x, y) + new Vector(center.X, center.Y);
+        }
+
+        public static Point EvaluateQuadraticBezier(Point startPoint, Point controlPoint, Point endPoint, double t)
+        {
+            var P0 = startPoint;
+            var P1 = controlPoint;
+            var P2 = endPoint;
+
+            double x = (1 - t) * (1 - t) * P0.X + 2 * (1 - t) * t * P1.X + t * t * P2.X;
+            double y = (1 - t) * (1 - t) * P0.Y + 2 * (1 - t) * t * P1.Y + t * t * P2.Y;
+            return new Point(x, y);
+        }
+
+        public static double Deg2Rad(double degree)
+        {
+            return degree * Math.PI / 180;
+        }
+
+        public static double Rad2Deg(double radian)
+        {
+            return radian * 180 / Math.PI;
+        }
     }
 }


don't automatically rejoin channels in Reconnect(bool) if AutoRejoin is set to false

--- src/IrcClient/IrcClient.cs
+++ src/IrcClient/IrcClient.cs
@@ -501,7 +501,7 @@
         /// <param name="login">If the login data should be sent, after successful connect.</param>
         public void Reconnect(bool login)
         {
-            Reconnect(login, true);
+            Reconnect(login, AutoRejoin);
         }

         /// <summary>


catching exception raised by hanging clients

--- webchat/Communication/Publisher.cs
+++ webchat/Communication/Publisher.cs
@@ -3,6 +3,7 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
+using System.Runtime.Remoting;
 using System.Web;

 namespace webchat.Communication {
@@ -30,7 +31,12 @@
             //no need of locking because I use a ConcurrentQueue that I don't modify
             foreach(var subscriber in clients) {
                 subscriber.Write(eventPattern, channel, message);
-                subscriber.Flush();
+                try {
+                    subscriber.Flush();
+                }
+                catch(RemotingException e) {
+                    MvcApplication.Logger.Log(e.ToString(), "EXCEPTION");
+                }
             }
         }


[Modify] Move it

[Modify] Move it

--- websocket-sharp/Net/ChunkStream.cs
+++ websocket-sharp/Net/ChunkStream.cs
@@ -184,10 +184,10 @@

         if (!_gotIt)
           _saved.Append ((char) b);
-
-        if (_saved.Length > 20)
-          throwProtocolViolation ("The chunk size is too long.");
-      }
+      }
+
+      if (_saved.Length > 20)
+        throwProtocolViolation ("The chunk size is too long.");

       if (!_sawCr || b != 10)
         return InputChunkState.None;


[Modify] Remove it

[Modify] Remove it

--- websocket-sharp/Net/HttpUtility.cs
+++ websocket-sharp/Net/HttpUtility.cs
@@ -1019,14 +1019,6 @@
       output.Write (HtmlEncode (s));
     }

-    public static NameValueCollection ParseQueryString (string query, Encoding encoding)
-    {
-      if (query == null)
-        throw new ArgumentNullException ("query");
-
-      return InternalParseQueryString (query, encoding ?? Encoding.UTF8);
-    }
-
     public static string UrlDecode (string s)
     {
       return UrlDecode (s, Encoding.UTF8);


Updated version to 1.3.2.* for release

Updated version to 1.3.2.* for release

--- starboard-sc2/Properties/AssemblyInfo.cs
+++ starboard-sc2/Properties/AssemblyInfo.cs
@@ -26,5 +26,5 @@

 [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]

-[assembly: AssemblyVersion("1.3.1.*")]
-[assembly: AssemblyFileVersion("1.3.1.0")]+[assembly: AssemblyVersion("1.3.2.*")]
+[assembly: AssemblyFileVersion("1.3.2.0")]


add network switch to query command

add network switch to query command

--- src/Resin.Cli/Program.cs
+++ src/Resin.Cli/Program.cs
@@ -190,8 +190,10 @@
             string dir = null;
             bool log = false;
             bool logAnalyzed = false;
+            bool net = false;

             if (Array.IndexOf(args, "--log") > 0) log = true;
+            if (Array.IndexOf(args, "--net") > 0) net = true;
             if (Array.IndexOf(args, "--analyze") > 0) logAnalyzed = true;
             if (Array.IndexOf(args, "--dir") > 0) dir = args[Array.IndexOf(args, "--dir") + 1];

@@ -207,7 +209,19 @@
             var timer = new Stopwatch();
             timer.Start();

-            using (var s = new Searcher(dir))
+            Searcher s;
+
+            if (net)
+            {
+                s = new Searcher(dir, sessionFactory: new NetworkFullTextReadSessionFactory(
+                "localhost", 11111, dir));
+            }
+            else
+            {
+                s = new Searcher(dir);
+            }
+
+            using (s)
             {
                 result = s.Search(q, page, size);


new constellations handling for disabling between levels and sending complete messages


Removed PS3 exclusive Callbacks

Removed PS3 exclusive Callbacks

--- Plugins/Steamworks.NET/autogen/SteamCallbacks.cs
+++ Plugins/Steamworks.NET/autogen/SteamCallbacks.cs
@@ -667,24 +667,6 @@
 								// k_EResultLimitExceeded - your game client has created too many lobbies

 		public ulong m_ulSteamIDLobby;		// chat room, zero if failed
-	}
-
-	// used by now obsolete RequestFriendsLobbiesResponse_t
-	// enum { k_iCallback = k_iSteamMatchmakingCallbacks + 14 };
-	//-----------------------------------------------------------------------------
-	// Purpose: Result of CheckForPSNGameBootInvite
-	//			m_eResult == k_EResultOK on success
-	//			at this point, the local user may not have finishing joining this lobby;
-	//			game code should wait until the subsequent LobbyEnter_t callback is received
-	//-----------------------------------------------------------------------------
-	[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
-	[CallbackIdentity(Constants.k_iSteamMatchmakingCallbacks + 15)]
-	public struct PSNGameBootInviteResult_t {
-		public const int k_iCallback = Constants.k_iSteamMatchmakingCallbacks + 15;
-
-		[MarshalAs(UnmanagedType.I1)]
-		public bool m_bGameBootInviteExists;
-		public CSteamID m_steamIDLobby;		// Should be valid if m_bGameBootInviteExists == true
 	}

 	// callbacks
@@ -1423,19 +1405,6 @@
 	}

 	//-----------------------------------------------------------------------------
-	// Purpose: callback indicating that PS3 trophies have been installed
-	//-----------------------------------------------------------------------------
-	[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
-	[CallbackIdentity(Constants.k_iSteamUserStatsCallbacks + 12)]
-	public struct PS3TrophiesInstalled_t {
-		public const int k_iCallback = Constants.k_iSteamUserStatsCallbacks + 12;
-		public ulong m_nGameID;				// Game these stats are for
-		public EResult m_eResult;				// The result of the operation
-		public ulong m_ulRequiredDiskSpace;	// If m_eResult is k_EResultDiskFull, will contain the amount of space needed to install trophies
-
-	}
-
-	//-----------------------------------------------------------------------------
 	// Purpose: callback indicating global stats have been received.
 	//	Returned as a result of RequestGlobalStats()
 	//-----------------------------------------------------------------------------
@@ -1496,64 +1465,6 @@
 		public ECheckFileSignature m_eCheckFileSignature;
 	}

-	//-----------------------------------------------------------------------------
-	// callback for NetCtlNetStartDialog finishing on PS3
-	//-----------------------------------------------------------------------------
-	[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
-	[CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 6)]
-	public struct NetStartDialogFinished_t {
-		public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 6;
-	}
-
-	//-----------------------------------------------------------------------------
-	// callback for NetCtlNetStartDialog unloaded on PS3
-	//-----------------------------------------------------------------------------
-	[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
-	[CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 7)]
-	public struct NetStartDialogUnloaded_t {
-		public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 7;
-	}
-
-	//-----------------------------------------------------------------------------
-	// callback for system menu closing on PS3 - should trigger resyncronizing friends list, etc.
-	//-----------------------------------------------------------------------------
-	[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
-	[CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 8)]
-	public struct PS3SystemMenuClosed_t {
-		public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 8;
-	}
-
-	//-----------------------------------------------------------------------------
-	// callback for NP message being selected by user on PS3 - should trigger handling of message if it's a lobby invite, etc.
-	//-----------------------------------------------------------------------------
-	[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
-	[CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 9)]
-	public struct PS3NPMessageSelected_t {
-		public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 9;
-		public uint dataid;
-	}
-
-	//-----------------------------------------------------------------------------
-	// callback for when the PS3 keyboard dialog closes
-	//-----------------------------------------------------------------------------
-	[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
-	[CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 10)]
-	public struct PS3KeyboardDialogFinished_t {
-		public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 10;
-	}
-
-	// k_iSteamUtilsCallbacks + 11 is taken
-	//-----------------------------------------------------------------------------
-	// callback for PSN status changing on PS3
-	//-----------------------------------------------------------------------------
-	[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
-	[CallbackIdentity(Constants.k_iSteamUtilsCallbacks + 12)]
-	public struct PS3PSNStatusChange_t {
-		public const int k_iCallback = Constants.k_iSteamUtilsCallbacks + 12;
-		[MarshalAs(UnmanagedType.I1)]
-		public bool m_bPSNOnline;
-	}
-
 	// k_iSteamUtilsCallbacks + 13 is taken
 	//-----------------------------------------------------------------------------
 	// Big Picture gamepad text input has been closed