Fixed the using, for reals this time.

Fixed the using, for reals this time.

--- src/OmniSharp/Middleware/Endpoint/EndpointHandler.cs
+++ src/OmniSharp/Middleware/Endpoint/EndpointHandler.cs
@@ -230,7 +230,13 @@
         {
             try
             {
-                return JToken.Load(new JsonTextReader(new StreamReader(readStream)));
+                using (var streamReader = new StreamReader(readStream))
+                {
+                    using (var textReader = new JsonTextReader(streamReader))
+                    {
+                        return JToken.Load(textReader);
+                    }
+                }
             }
             catch
             {


Added RootObject<T>.Meta() method for mapping _meta

Signed-off-by: Yegoroff <bf061889850bcfd68dbdc929b8ebe70666e9fd1f@gmail.com>

--- src/PlainElastic.Net/Builders/Mappings/RootObject.cs
+++ src/PlainElastic.Net/Builders/Mappings/RootObject.cs
@@ -97,6 +97,16 @@
         }

+        /// <summary>
+        /// Simple storage for custom metadata associated with type mapping.
+        /// see http://www.elasticsearch.org/guide/reference/mapping/meta.html
+        /// </summary>
+        public RootObject<T> Meta(string metaJson)
+        {
+            RegisterCustomJsonMap("'_meta': {0}", metaJson);
+            return this;
+        }
+

         /// <summary>
         /// Allows to map _all field


ReflectionExtensions simplified. Code duplication was required for .NET 4.0, but old version is not supported any longer.

--- src/SimpleInjector/Internals/ReflectionExtensions.cs
+++ src/SimpleInjector/Internals/ReflectionExtensions.cs
@@ -4,40 +4,11 @@
 namespace SimpleInjector
 {
     using System;
-    using System.Collections.Generic;
     using System.Linq;
     using System.Reflection;

     internal static class ReflectionExtensions
     {
-#if NET45
-        public static bool IsGenericType(this Type type) => type.IsGenericType;
-        public static bool IsValueType(this Type type) => type.IsValueType;
-        public static bool IsAbstract(this Type type) => type.IsAbstract;
-        public static bool ContainsGenericParameters(this Type type) => type.ContainsGenericParameters;
-        public static Type BaseType(this Type type) => type.BaseType;
-        public static bool IsPrimitive(this Type type) => type.IsPrimitive;
-        public static bool IsGenericTypeDefinition(this Type type) => type.IsGenericTypeDefinition;
-        public static bool IsNestedPublic(this Type type) => type.IsNestedPublic;
-        public static bool IsPublic(this Type type) => type.IsPublic;
-        public static bool IsClass(this Type type) => type.IsClass;
-        public static bool IsInterface(this Type type) => type.IsInterface;
-        public static bool IsGenericParameter(this Type type) => type.IsGenericParameter;
-        public static GenericParameterAttributes GetGenericParameterAttributes(this Type type) => type.GenericParameterAttributes;
-        public static IEnumerable<PropertyInfo> GetRuntimeProperties(this Type type) =>
-            type.GetProperties(BindingFlags.FlattenHierarchy |
-                BindingFlags.Instance | BindingFlags.Static |
-                BindingFlags.NonPublic | BindingFlags.Public);
-        public static Assembly GetAssembly(this Type type) => type.Assembly;
-        public static Guid GetGuid(this Type type) => type.GUID;
-
-        public static ConstructorInfo[] GetConstructors(this Type type, bool nonPublic) =>
-            type.GetConstructors(
-                BindingFlags.Public
-                | BindingFlags.Instance
-                | (nonPublic ? BindingFlags.NonPublic : BindingFlags.Default));
-#endif
-#if NETSTANDARD1_0 || NETSTANDARD1_3 || NETSTANDARD2_0
         public static MethodInfo? GetSetMethod(this PropertyInfo property, bool nonPublic = true) =>
             nonPublic || property.SetMethod?.IsPublic == true ? property.SetMethod : null;

@@ -83,6 +54,5 @@
             where types.SequenceEqual(constructor.GetParameters().Select(p => p.ParameterType))
             select constructor)
             .FirstOrDefault();
-#endif
     }
 }


Trying Directory.GetCurrentDirectory

Trying Directory.GetCurrentDirectory

--- src/SimpleMvcSitemap.Tests/XmlAssertionExtensions.cs
+++ src/SimpleMvcSitemap.Tests/XmlAssertionExtensions.cs
@@ -9,7 +9,8 @@
     {
         public static void BeXmlEquivalent(this StringAssertions assertions, string filename)
         {
-            XDocument doc1 = XDocument.Parse(File.ReadAllText($"Samples{Path.DirectorySeparatorChar}{filename}"));
+            var fullPath = Path.Combine(Directory.GetCurrentDirectory(),"Samples", filename);
+            XDocument doc1 = XDocument.Parse(File.ReadAllText(fullPath));
             XDocument doc2 = XDocument.Parse(assertions.Subject);

             XNode.DeepEquals(doc1, doc2).Should().BeTrue();


Add Preamble overrides in System.Private.Xml

--- src/System.Private.Xml/src/System/Xml/XmlEncoding.cs
+++ src/System.Private.Xml/src/System/Xml/XmlEncoding.cs
@@ -303,6 +303,7 @@
                 return new Ucs4Encoding2143();
             }
         }
+
         internal static Encoding UCS4_3412
         {
             get
@@ -312,8 +313,10 @@
         }
     }

-    internal class Ucs4Encoding1234 : Ucs4Encoding
-    {
+    internal sealed class Ucs4Encoding1234 : Ucs4Encoding
+    {
+        private static readonly byte[] s_preamble = new byte[4] { 0x00, 0x00, 0xfe, 0xff };
+
         public Ucs4Encoding1234()
         {
             ucs4Decoder = new Ucs4Decoder1234();
@@ -331,10 +334,14 @@
         {
             return new byte[4] { 0x00, 0x00, 0xfe, 0xff };
         }
-    }
-
-    internal class Ucs4Encoding4321 : Ucs4Encoding
-    {
+
+        public override ReadOnlySpan<byte> Preamble => s_preamble;
+    }
+
+    internal sealed class Ucs4Encoding4321 : Ucs4Encoding
+    {
+        private static readonly byte[] s_preamble = new byte[4] { 0xff, 0xfe, 0x00, 0x00 };
+
         public Ucs4Encoding4321()
         {
             ucs4Decoder = new Ucs4Decoder4321();
@@ -352,10 +359,14 @@
         {
             return new byte[4] { 0xff, 0xfe, 0x00, 0x00 };
         }
-    }
-
-    internal class Ucs4Encoding2143 : Ucs4Encoding
-    {
+
+        public override ReadOnlySpan<byte> Preamble => s_preamble;
+    }
+
+    internal sealed class Ucs4Encoding2143 : Ucs4Encoding
+    {
+        private static readonly byte[] s_preamble = new byte[4] { 0x00, 0x00, 0xff, 0xfe };
+
         public Ucs4Encoding2143()
         {
             ucs4Decoder = new Ucs4Decoder2143();
@@ -372,10 +383,14 @@
         {
             return new byte[4] { 0x00, 0x00, 0xff, 0xfe };
         }
-    }
-
-    internal class Ucs4Encoding3412 : Ucs4Encoding
-    {
+
+        public override ReadOnlySpan<byte> Preamble => s_preamble;
+    }
+
+    internal sealed class Ucs4Encoding3412 : Ucs4Encoding
+    {
+        private static readonly byte[] s_preamble = new byte[4] { 0xfe, 0xff, 0x00, 0x00 };
+
         public Ucs4Encoding3412()
         {
             ucs4Decoder = new Ucs4Decoder3412();
@@ -393,6 +408,8 @@
         {
             return new byte[4] { 0xfe, 0xff, 0x00, 0x00 };
         }
+
+        public override ReadOnlySpan<byte> Preamble => s_preamble;
     }

     internal abstract class Ucs4Decoder : Decoder


Update formWrangler.cshtml

Update formWrangler.cshtml

Added URL friendly id for url targeting of folders

--- formWrangler.cshtml
+++ formWrangler.cshtml
@@ -23,7 +23,7 @@

 @helper structure( dynamic node ){
 	if ( node.NodeTypeAlias == "Folder" ) {
-		@node.Name
+		@node.Name
 	} else {
 		@node.Name
 	}


adding openfile dialog

adding openfile dialog

--- source/DotNetBay.WPF/NewAuctionView.xaml.cs
+++ source/DotNetBay.WPF/NewAuctionView.xaml.cs
@@ -1,4 +1,5 @@
-using System;
+using Microsoft.Win32;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -23,5 +24,14 @@
         {
             InitializeComponent();
         }
+
+        private void ShowFileDialog(object sender, RoutedEventArgs e)
+        {
+            var dialog = new OpenFileDialog();
+            if(dialog.ShowDialog() == true)
+            {
+                txtImagePath.Text = dialog.FileName;
+            }
+        }
     }
 }


First Controller with route and status call

--- source/DotNetBay.WebApi/StatusController.cs
+++ source/DotNetBay.WebApi/StatusController.cs
@@ -3,10 +3,19 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Web.Http;

 namespace DotNetBay.WebApi
 {
-    class StatusController : ApiController
+    [Route("api")]
+    public class StatusController : ApiController
     {
+        [HttpGet]
+        [Route("status")]
+        public IHttpActionResult AreYouFine()
+        {
+            return this.Ok("I am fine");
+        }
+
     }
 }


application retermination logic changed from any key to ctrl+c

--- src/csharp/TrafficIntersection.ConsoleApp/Program.cs
+++ src/csharp/TrafficIntersection.ConsoleApp/Program.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Reactive.Concurrency;
+using System.Threading;
 using Serilog;

 namespace TrafficIntersection.ConsoleApp
@@ -21,7 +22,10 @@
             intersection.WestLight.Subscribe(x => Log.Information("West is now {x}", x));
             intersection.EastLight.Subscribe(x => Log.Information("East is now {x}", x));

-            Console.ReadLine();
+            while (true)
+            {
+                Thread.Sleep(TimeSpan.FromSeconds(1));
+            }
         }
     }
 }


add wpf pop client to config

add wpf pop client to config

--- source/Host.Configuration/Config/Clients.cs
+++ source/Host.Configuration/Config/Clients.cs
@@ -471,7 +471,36 @@

                     AccessTokenType = AccessTokenType.Reference
                 },
-
+
+                /////////////////////////////////////////////////////////////
+                // WPF Client with Hybrid Flow and PKCE and PoP
+                /////////////////////////////////////////////////////////////
+                new Client
+                {
+                    ClientName = "WPF Client with Hybrid Flow and PKCE and PoP",
+                    ClientId = "wpf.hybrid.pop",
+                    Flow = Flows.HybridWithProofKey,
+
+                    ClientSecrets = new List<Secret>
+                    {
+                        new Secret("secret".Sha256())
+                    },
+
+                    RedirectUris = new List<string>
+                    {
+                        "http://localhost/wpf.hybrid.pop"
+                    },
+
+                    AllowedScopes = new List<string>
+                    {
+                        StandardScopes.OpenId.Name,
+                        StandardScopes.Profile.Name,
+                        StandardScopes.OfflineAccess.Name,
+                        "read", "write"
+                    },
+
+                    AccessTokenType = AccessTokenType.Reference
+                },

                 /////////////////////////////////////////////////////////////
                 // UWP OIDC Client


prev commit fix.

prev commit fix.


Same refactoring of names

Same refactoring of names

--- AngleSharp/Parser/Html/HtmlParser.cs
+++ AngleSharp/Parser/Html/HtmlParser.cs
@@ -31,16 +31,16 @@
         readonly Stack<HtmlTreeMode> _templateModes;
         readonly Object _syncGuard;

+        HtmlFormElement _currentFormElement;
+        HtmlScriptElement _currentScriptElement;
         HtmlTreeMode _currentMode;
         HtmlTreeMode _previousMode;
-        HtmlFormElement _currentFormElement;
         Element _fragmentContext;
         Boolean _foster;
         Boolean _embedded;
         Boolean _frameset;
-        Int32 _nestingLevel;
+        Int32 _nested;
         Boolean _started;
-        HtmlScriptElement _pendingScript;
         Task<IDocument> _parsing;

         #endregion
@@ -3640,24 +3640,24 @@
             _document.ProvideStableState();
             CloseCurrentNode();
             _currentMode = _previousMode;
-            _nestingLevel++;
+            _nested++;
             script.Prepare();
-            _nestingLevel--;
-
-            if (_pendingScript == null || _nestingLevel != 0)
+            _nested--;
+
+            if (_currentScriptElement == null || _nested != 0)
                 return;

             do
             {
-                script = _pendingScript;
-                _pendingScript = null;
+                script = _currentScriptElement;
+                _currentScriptElement = null;
                 _document.WaitForReady();
-                _nestingLevel++;
+                _nested++;
                 script.Run();
-                _nestingLevel--;
+                _nested--;
                 _tokenizer.ResetInsertionPoint();
             }
-            while (_pendingScript != null);
+            while (_currentScriptElement != null);
         }

         /// <summary>


Add method comments

Add method comments

--- source/XeroApi/Linq/LinqQueryDescription.cs
+++ source/XeroApi/Linq/LinqQueryDescription.cs
@@ -20,7 +20,10 @@
     {
         private readonly StringBuilder _orderQuery = new StringBuilder();
         private readonly StringBuilder _whereQuery = new StringBuilder();
-
+
+        private string _lastWhereTerm;
+
+
         public Type ElementType
         {
             get;
@@ -45,7 +48,11 @@
                 return ModelTypeHelper.GetElementCollectionType(ElementType);
             }
         }
-
+
+        /// <summary>
+        /// Gets the element name, used to construct the request url
+        /// </summary>
+        /// <value>The name of the element.</value>
         public string ElementName
         {
             get
@@ -54,6 +61,10 @@
             }
         }

+        /// <summary>
+        /// Gets the property from the <c ref="ElementType"/> which is marked as <c ref="ItemIdAttribute"/>.
+        /// </summary>
+        /// <value>The element id property.</value>
         public PropertyInfo ElementIdProperty
         {
             get
@@ -64,6 +75,10 @@
             }
         }

+        /// <summary>
+        /// Gets the property from the <c ref="ElementType"/> which is marked as <c ref="ItemNumberAttribute"/>.
+        /// </summary>
+        /// <value>The element number property.</value>
         public PropertyInfo ElementNumberProperty
         {
             get
@@ -74,6 +89,10 @@
             }
         }

+        /// <summary>
+        /// Gets the property from the <c ref="ElementType"/> which is marked as <c ref="ItemUpdatedDateAttribute"/>.
+        /// </summary>
+        /// <value>The element updated date property.</value>
         public PropertyInfo ElementUpdatedDateProperty
         {
             get
@@ -84,12 +103,20 @@
             }
         }

+        /// <summary>
+        /// Gets the element id, used to construct the request url
+        /// </summary>
+        /// <value>The element id.</value>
         public string ElementId
         {
             get;
             set;
         }

+        /// <summary>
+        /// Gets the date used to populate the If-Modified-Since http header.
+        /// </summary>
+        /// <value>The updated since date.</value>
         public DateTime? UpdatedSinceDate
         {
             get;
@@ -106,6 +133,10 @@
             get { return _orderQuery.ToString(); }
         }

+        /// <summary>
+        /// Gets the query string parameter collection.
+        /// </summary>
+        /// <value>The query string params.</value>
         public NameValueCollection QueryStringParams
         {
             get
@@ -145,8 +176,13 @@
             return sb.ToString().Trim();
         }

-        private string _lastWhereTerm;
-
+
+
+        /// <summary>
+        /// Appends the <c ref="term"/> to either the <c ref="Where"/> or <c ref="Order"/> clause.
+        /// </summary>
+        /// <param name="term">The term.</param>
+        /// <param name="querystringName">Name of the querystring.</param>
         public void AppendTerm(string term, ApiQuerystringName querystringName)
         {
             switch (querystringName)


Update application version.

Update application version.

--- ApiTester/Properties/AssemblyInfo.cs
+++ ApiTester/Properties/AssemblyInfo.cs
@@ -32,6 +32,6 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.0")]
-[assembly: AssemblyFileVersion("1.0.0.2")]
+[assembly: AssemblyFileVersion("1.0.0.3")]
 [assembly: AssemblyInformationalVersion("1.0 Development")]


Character-based text output

Character-based text output

--- Assets/Harmonic/Gui/RI/AIRenderer.cs
+++ Assets/Harmonic/Gui/RI/AIRenderer.cs
@@ -40,9 +40,10 @@
         StartCoroutine(PollQueues());
     }

-    private string[] sentences;
-    private int sentenceIndex;
-    private Regex splitter = new Regex(@"(\.|\?|\!)");
+    private string[] characters;
+    private int charIndex;
+    private Regex isBreak = new Regex(@"(\.|\?|\!)");
+    private float waitTime = .05f;
     private IEnumerator PollQueues()
     {
         while(this.isActiveAndEnabled)
@@ -64,7 +65,6 @@
             {
                 if (!OuputIsOpen)
                     yield return StartCoroutine(ToggleBackground(true));
-                //if finished with last state

                 //set sprite to state
                 behaviorImage.sprite = GetSprite(CurrentOutput.First);
@@ -74,18 +74,23 @@
                 AnimationAnimator.SetFloat("CurrentSpeed", GetSpeed(CurrentOutput.First));

                 OutputText.text = "";
-                //CurrentOutput.Second.Split('.', '?', '!');
-                sentences = splitter.Split(CurrentOutput.Second);
-                //set text (one sentence at a time?)
-                for (sentenceIndex = 0; sentenceIndex < sentences.Length; sentenceIndex++)
+                //set text (one char at a time)
+                for (charIndex = 0; charIndex < CurrentOutput.Second.Length; charIndex++)
                 {
-                    print("printing:" + sentences[sentenceIndex]);
-                    OutputText.text += sentences[sentenceIndex];
-
-                    //wait based on how many characters are in the output string
-                    yield return new WaitForSeconds(sentences[sentenceIndex].Length * .1f);
+                    OutputText.text += CurrentOutput.Second[charIndex];
+
+                    if (isBreak.IsMatch(CurrentOutput.Second[charIndex].ToString()))
+                    {
+                        waitTime = .5f;
+                    }
+                    else
+                    {
+                        waitTime = .05f;
+                    }
+                    yield return new WaitForSeconds(waitTime);
                 }
-                yield return new WaitForSeconds(.5f);
+                //give the user a bit to process this
+                yield return new WaitForSeconds(1f);
             }
             else
             {
@@ -97,10 +102,6 @@
                 else
                     yield return new WaitForSeconds(.5f);
             }
-            //repeat
-
-            //maybe include debug input (1-6) to set states
-
         }
     }


Battery now drops on timer vs frames

Battery now drops on timer vs frames

--- Assets/PlayerAssets/PlayerManager.cs
+++ Assets/PlayerAssets/PlayerManager.cs
@@ -106,7 +106,7 @@
 			}

 			if (battery > 0) {
-				battery -= .01f;
+				battery -= 1 * Time.deltaTime / 2;
 			}
 			else{
 				Flashlight.active = false;


add spinner judgement and score

add spinner judgement and score

--- Assets/Scenes/InGame/Scripts/Spin.cs
+++ Assets/Scenes/InGame/Scripts/Spin.cs
@@ -2,6 +2,13 @@
 using System.Collections;
 using Leap;
 public class Spin : MonoBehaviour {
+
+	public GameObject judgement;
+	public float TotalTime = 3.0f;
+
+	Color c300, c100, c50, c0;
+
+	GamePlayer status;

 	float rotate = 0.0f;
 	float rotatespeed = 20.0f;
@@ -24,6 +31,12 @@

 		}
 		fingeroldposition = FingerPos;
+
+		status = GameObject.Find ("GamePlayer").GetComponent ("GamePlayer") as GamePlayer;
+		c300 = new Color (58 / 255f, 183 / 255f, 239 / 255f, 0);
+		c100 = new Color(191 / 255f, 255 / 255f, 160 / 255f, 0);
+		c50 = new Color(251 / 255f, 208 / 255f, 114 / 255f, 0);
+		c0 = new Color(249 / 255f, 90 / 255f, 101 / 255f, 0);
 	}

 	// Update is called once per frame
@@ -44,8 +57,49 @@
 			// add score
 			// this.rotate is a float that remark the total angle that the spinner has been rotated before it ends;

+			Debug.Log(rotate);
+
+			TextMesh tmp = ((GameObject)Instantiate (judgement, transform.position, Quaternion.identity)).GetComponent<TextMesh> ();
+			int ScoreGet;
+			if (rotate >= TotalTime / 2f * 360) {
+				tmp.text = "Perfect";
+				tmp.color = c300;
+				ScoreGet = 300 + 300 / 25 * status.ComboCounter;
+				status.ComboCounter++;
+				status.PerfectCount++;
+			}
+			else if (rotate >= TotalTime / 4f * 360) {
+				tmp.text = "Good";
+				tmp.color = c100;
+				ScoreGet = 100 + 100 / 25 * status.ComboCounter;
+				status.ComboCounter++;
+				status.GoodCount++;
+			}
+			else if (rotate >= TotalTime / 8f * 360) {
+				tmp.text = "Bad";
+				tmp.color = c50;
+				ScoreGet = 50 + 50 / 25 * status.ComboCounter;
+				status.ComboCounter = 0;
+				status.BadCount++;
+			}
+			else {
+				tmp.text = "Miss";
+				tmp.color = c0;
+				status.MissCount++;
+				ScoreGet = 0;
+			}
+
+			status.ScoreCounter += ScoreGet;
+			if (status.ComboCounter > status.MaxCombo)
+				status.MaxCombo = status.ComboCounter;
+			//status.ScoreText.text = "Score: " + status.ScoreNow.ToString ();
+			status.ComboText.text = "Combo: " + status.ComboCounter.ToString ();
+
+
+
 			// distory this spinner
-			GetComponent<Renderer>().enabled = false;
+			Destroy(gameObject);
+			//GetComponent<Renderer>().enabled = false;
 		}
 	}
 	void rot(){


リファクタリング

リファクタリング

--- Assets/Scripts/Editor/PopupWindow.cs
+++ Assets/Scripts/Editor/PopupWindow.cs
@@ -13,7 +13,7 @@
     /**
     * @brief YES用の処理を使うためのデリゲート宣言
     */
-    public delegate void Callback(bool t_init);
+    public delegate void Callback(bool t_check);
     /**
     * @brief YES用の処理を使うためのデリゲート変数
     */


Add outline support to limit size

Add outline support to limit size

--- Assets/Scripts/UI/TextLimitSizeV2.cs
+++ Assets/Scripts/UI/TextLimitSizeV2.cs
@@ -20,6 +20,7 @@
     private bool resetSizeFields;

     ContentSizeFitter fitter;
+    private CanvasTextOutline outline;  //Force update when size is changed

     private string lastText;

@@ -31,6 +32,8 @@
             textComponent = GetComponent<Text>();
         if (rectTransform == null)
             rectTransform = (RectTransform)transform;
+        if (outline == null)
+            outline = GetComponent<CanvasTextOutline>();
         if (fitter == null)
             fitter = GetComponent<ContentSizeFitter>();
     }
@@ -48,7 +51,20 @@
             resetSizeFields = false;
         }
         if (!onlyUpdateOnTextChange || getText() != lastText)
+        {
             updateScale();
+
+            if (outline != null)
+            {
+                var children = outline.getChildTexts();
+                if (children != null)
+                {
+                    outline.updateAttributes = true;
+                    outline.LateUpdate();
+                }
+            }
+        }
+
     }

     public void updateScale()


fix command parse bug.

fix command parse bug.

--- Assets/uREPL/Scripts/Core/Command.cs
+++ Assets/uREPL/Scripts/Core/Command.cs
@@ -145,10 +145,23 @@
 		// To consider commands with spaces, check if the head of the given code is consistent
 		// with any command name. command list is ranked in descending order of the command string length.
 		var commandInfo = Commands.GetAll().FirstOrDefault(
-			x => (code.Length >= x.command.Length) &&
+			x => (code.Length >= x.command.Length) &&
 			     (code.Substring(0, x.command.Length) == x.command));
+
+		// There is no command:
 		if (commandInfo == null) {
 			return code;
+		}
+
+		// Check command format
+		if (commandInfo.parameters.Length == 0) {
+			if (code.Trim() != commandInfo.command) {
+				return code;
+			}
+		} else {
+			if (code[commandInfo.command.Length] != ' ') {
+				return code;
+			}
 		}

 		// Remove last semicolon.


User feedback. Amazon links should be specific to "Books".

--- Bieb.Web/Views/Books/MoreInfo.cshtml
+++ Bieb.Web/Views/Books/MoreInfo.cshtml
@@ -4,7 +4,7 @@

Google

Wikipedia

-
Amazon

+
Amazon

Goodreads


showOff adapter throws now the correct general button vcode when releasing a button.
Interaction manager now fires again released events when no keys are pressed when releasing

git-svn-id: 01af18a6463d82f2dfa8239e3c2aedb49696f51b@265 6efbd2d2-d52f-40b0-b04a-ac586c898535

--- BrailleIO_ShowOff/ShowOff_Buttons.cs
+++ BrailleIO_ShowOff/ShowOff_Buttons.cs
@@ -25,25 +25,25 @@
         private void button_KEY_LEFT_CURSORS_UP_Click(object sender, EventArgs e)
         {
             if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.UpDown, new List<string>() { "clu" }, null, (int)DateTime.UtcNow.Ticks); }
-            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.UpDown, null, new List<string>() { "clu" }, (int)DateTime.UtcNow.Ticks); }
+            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.UpUp, null, new List<string>() { "clu" }, (int)DateTime.UtcNow.Ticks); }
         }

         private void button_KEY_LEFT_CURSORS_LEFT_Click(object sender, EventArgs e)
         {
             if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.LeftDown, new List<string>() { "cll" }, null, (int)DateTime.UtcNow.Ticks); }
-            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.LeftDown, null, new List<string>() { "cll" }, (int)DateTime.UtcNow.Ticks); }
+            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.LeftUp, null, new List<string>() { "cll" }, (int)DateTime.UtcNow.Ticks); }
         }

         private void button_KEY_LEFT_CURSORS_RIGHT_Click(object sender, EventArgs e)
         {
             if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.RightDown, new List<string>() { "clr" }, null, (int)DateTime.UtcNow.Ticks); }
-            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.RightDown, null, new List<string>() { "clr" }, (int)DateTime.UtcNow.Ticks); }
+            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.RightUp, null, new List<string>() { "clr" }, (int)DateTime.UtcNow.Ticks); }
         }

         private void button_KEY_LEFT_CURSORS_DOWN_Click(object sender, EventArgs e)
         {
             if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.DownDown, new List<string>() { "cld" }, null, (int)DateTime.UtcNow.Ticks); }
-            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.DownDown, null, new List<string>() { "cld" }, (int)DateTime.UtcNow.Ticks); }
+            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.DownUp, null, new List<string>() { "cld" }, (int)DateTime.UtcNow.Ticks); }
         }

         private void button_KEY_RIGHT_CURSORS_UP_Click(object sender, EventArgs e)
@@ -73,25 +73,25 @@
         private void button_KEY_LEFT_ROCKER_SWITCH_UP_Click(object sender, EventArgs e)
         {
             if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.ZoomInDown, new List<string>() { "nsdd" }, null, (int)DateTime.UtcNow.Ticks); }
-            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.ZoomInDown, null, new List<string>() { "nsdd" }, (int)DateTime.UtcNow.Ticks); }
+            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.ZoomInUp, null, new List<string>() { "nsdd" }, (int)DateTime.UtcNow.Ticks); }
         }

         private void button_KEY_LEFT_ROCKER_SWITCH_DOWN_Click(object sender, EventArgs e)
         {
             if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.ZoomOutDown, new List<string>() { "rsld" }, null, (int)DateTime.UtcNow.Ticks); }
-            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.ZoomOutDown, null, new List<string>() { "rsld" }, (int)DateTime.UtcNow.Ticks); }
+            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.ZoomOutUp, null, new List<string>() { "rsld" }, (int)DateTime.UtcNow.Ticks); }
         }

         private void button_KEY_LEFT_CURSORS_CENTER_Click(object sender, EventArgs e)
         {
             if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.EnterDown, new List<string>() { "clc" }, null, (int)DateTime.UtcNow.Ticks); }
-            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.EnterDown, null, new List<string>() { "clc" }, (int)DateTime.UtcNow.Ticks); }
+            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.EnterUp, null, new List<string>() { "clc" }, (int)DateTime.UtcNow.Ticks); }
         }

         private void button_KEY_HYPERBRAILLE_KEY_RIGHT_Click(object sender, EventArgs e)
         {
             if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.AbortDown, new List<string>() { "hbr" }, null, (int)DateTime.UtcNow.Ticks); }
-            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.AbortDown, null, new List<string>() { "hbr" }, (int)DateTime.UtcNow.Ticks); }
+            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.AbortUp, null, new List<string>() { "hbr" }, (int)DateTime.UtcNow.Ticks); }
         }

         private void button_KEY_DOT7_Click(object sender, EventArgs e)
@@ -223,7 +223,7 @@
         private void button_KEY_HYPERBRAILLE_KEY_LEFT_Click_1(object sender, EventArgs e)
         {
             if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.GestureDown, new List<string>() { "hbl" }, null, (int)DateTime.UtcNow.Ticks); }
-            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.GestureDown, null, new List<string>() { "hbl" }, (int)DateTime.UtcNow.Ticks); }
+            if (showOffAdapter != null) { showOffAdapter.firekeyStateChangedEvent(Interface.BrailleIO_DeviceButtonStates.GestureUp, null, new List<string>() { "hbl" }, (int)DateTime.UtcNow.Ticks); }
         }

         #endregion


Renaming update

Renaming update

--- BullsAndCows/BullsAndCows/Project.cs
+++ BullsAndCows/BullsAndCows/Project.cs
@@ -24,7 +24,7 @@
                               "to cheat and 'exit' to quit the game.");
         }

-        static bool checkIfNumConsistsOnlyOfDigits(string num)
+        static bool CheckIfNumConsistsOnlyOfDigits(string num)
         {
             int count = 0;
             for (int i = 0; i < 4; i++)
@@ -201,7 +201,7 @@
                     Console.WriteLine("Good bye!");
                     break;
                 }
-                else if (playerInput.Length != 4 || checkIfNumConsistsOnlyOfDigits(playerInput) == false)
+                else if (playerInput.Length != 4 || CheckIfNumConsistsOnlyOfDigits(playerInput) == false)
                 {
                     Console.WriteLine("Incorrect guess or command!");
                     continue;


json utility can inherit

json utility can inherit

--- CatLib.VS/CatLib/Json/JsonUtility.cs
+++ CatLib.VS/CatLib/Json/JsonUtility.cs
@@ -18,7 +18,7 @@
     /// <summary>
     /// Json处理器
     /// </summary>
-    internal sealed class JsonUtility : IJson, IJsonAware
+    public class JsonUtility : IJson, IJsonAware
     {
         /// <summary>
         /// 处理器


Fix a bug in the i64 comparison operators

--- libwasm-interpret/OperatorImpls.cs
+++ libwasm-interpret/OperatorImpls.cs
@@ -1303,7 +1303,7 @@
         {
             var rhs = Context.Pop<long>();
             var lhs = Context.Pop<long>();
-            Context.Push<long>(lhs == rhs ? 1 : 0);
+            Context.Push<int>(lhs == rhs ? 1 : 0);
         }

         /// <summary>
@@ -1315,7 +1315,7 @@
         {
             var rhs = Context.Pop<long>();
             var lhs = Context.Pop<long>();
-            Context.Push<long>(lhs != rhs ? 1 : 0);
+            Context.Push<int>(lhs != rhs ? 1 : 0);
         }

         /// <summary>
@@ -1327,7 +1327,7 @@
         {
             var rhs = Context.Pop<long>();
             var lhs = Context.Pop<long>();
-            Context.Push<long>(lhs < rhs ? 1 : 0);
+            Context.Push<int>(lhs < rhs ? 1 : 0);
         }

         /// <summary>
@@ -1339,7 +1339,7 @@
         {
             var rhs = (ulong)Context.Pop<long>();
             var lhs = (ulong)Context.Pop<long>();
-            Context.Push<long>(lhs < rhs ? 1 : 0);
+            Context.Push<int>(lhs < rhs ? 1 : 0);
         }

         /// <summary>
@@ -1351,7 +1351,7 @@
         {
             var rhs = Context.Pop<long>();
             var lhs = Context.Pop<long>();
-            Context.Push<long>(lhs <= rhs ? 1 : 0);
+            Context.Push<int>(lhs <= rhs ? 1 : 0);
         }

         /// <summary>
@@ -1363,7 +1363,7 @@
         {
             var rhs = (ulong)Context.Pop<long>();
             var lhs = (ulong)Context.Pop<long>();
-            Context.Push<long>(lhs <= rhs ? 1 : 0);
+            Context.Push<int>(lhs <= rhs ? 1 : 0);
         }

         /// <summary>
@@ -1375,7 +1375,7 @@
         {
             var rhs = Context.Pop<long>();
             var lhs = Context.Pop<long>();
-            Context.Push<long>(lhs > rhs ? 1 : 0);
+            Context.Push<int>(lhs > rhs ? 1 : 0);
         }

         /// <summary>
@@ -1387,7 +1387,7 @@
         {
             var rhs = (ulong)Context.Pop<long>();
             var lhs = (ulong)Context.Pop<long>();
-            Context.Push<long>(lhs > rhs ? 1 : 0);
+            Context.Push<int>(lhs > rhs ? 1 : 0);
         }

         /// <summary>
@@ -1399,7 +1399,7 @@
         {
             var rhs = Context.Pop<long>();
             var lhs = Context.Pop<long>();
-            Context.Push<long>(lhs >= rhs ? 1 : 0);
+            Context.Push<int>(lhs >= rhs ? 1 : 0);
         }

         /// <summary>
@@ -1411,7 +1411,7 @@
         {
             var rhs = (ulong)Context.Pop<long>();
             var lhs = (ulong)Context.Pop<long>();
-            Context.Push<long>(lhs >= rhs ? 1 : 0);
+            Context.Push<int>(lhs >= rhs ? 1 : 0);
         }

         /// <summary>
@@ -1421,7 +1421,7 @@
         /// <param name="Context">The interpreter's context.</param>
         public static void Int64Eqz(Instruction Value, InterpreterContext Context)
         {
-            Context.Push<long>(Context.Pop<long>() == 0 ? 1 : 0);
+            Context.Push<int>(Context.Pop<long>() == 0 ? 1 : 0);
         }

         /// <summary>


made class public

made class public

--- Code/TrackingApp.Droid/TextParser.cs
+++ Code/TrackingApp.Droid/TextParser.cs
@@ -12,7 +12,8 @@

 namespace TrackingApp.Droid
 {
-    class TextParser
+    public class TextParser
     {
+
     }
 }


made "CeremonyName" return the specified name if it exists.

closes #44

--- Commencement.Core/Domain/Ceremony.cs
+++ Commencement.Core/Domain/Ceremony.cs
@@ -125,6 +125,11 @@
         public virtual string CeremonyName {
             get
             {
+                if (!string.IsNullOrEmpty(Name))
+                {
+                    return Name;
+                }
+
                 var sb = new StringBuilder();

                 if (this.TermCode.Id.EndsWith("03")) sb.Append("Spring");


CustomBlocks: TimestampHelper class updated

--- CustomBlocks/UUID/TimestampHelper.cs
+++ CustomBlocks/UUID/TimestampHelper.cs
@@ -37,7 +37,7 @@
 		private static readonly double swTicksToDateTicksMult = (double)10000000 / (double)Stopwatch.Frequency;
 		private static long lastTimestamp;

-		private const int minTimerResolutionMS = 1000;
+		private const int timerResolution = (int)(0xFFFFF / TimeSpan.TicksPerMillisecond) + 1;
 		//stuff for powering LCG algorithm that is used to fill lower 32 bits of timestamp
 		//with unique 32-bit values (until LGC overflows, of course)
 		private static ulong curLCGValue;
@@ -89,7 +89,7 @@
 						if(curLCGValue==lastLCGValue)
 						{
 							//wait for a while, so next timestamp will change
-							Thread.Sleep(minTimerResolutionMS);
+							Thread.Sleep(timerResolution);
 							continue;
 						}
 						curLCGValue = (curLCGValue * a) % m; //generate next 32-bit pseudo-random value for timestamp scrambling


OnGetObject event added on object type read

--- DbLinq/Util/RowEnumeratorCompiler.cs
+++ DbLinq/Util/RowEnumeratorCompiler.cs
@@ -55,6 +55,23 @@
                 return src.ToString();
             return GetString(src, t, dr, index);
         }
+
+        /// <summary>
+        /// Occurs when object type of property is read.
+        /// Sample:
+        /// DbLinq.Util.RowEnumeratorCompiler.GetObject +=
+        /// (value, type, datarecord, index)=> {
+        /// (value is string) ?
+        ///     value.ToString().TrimEnd() : value;
+        /// </summary>
+        public static event Func<object, Type, IDataRecord, int, object> GetObject;
+
+        internal static object OnGetObject(object src, Type t, IDataRecord dr, int index) {
+          if (GetObject == null)
+            return src;
+          return GetObject(src, t, dr, index);
+        }
+
     }

     public class RowEnumeratorCompiler<T> : RowEnumeratorCompiler
@@ -704,7 +721,8 @@
           if (dataRecord.IsDBNull(index))
             return null;
           object obj = dataRecord.GetValue(index);
-          return obj;
+          return OnGetObject(obj, typeof(T), dataRecord, index);
+          // return obj;
         }

         #endregion


check bitpay invoice status of complete (#892)

--- src/Billing/Controllers/BitPayController.cs
+++ src/Billing/Controllers/BitPayController.cs
@@ -66,10 +66,16 @@
             }

             var invoice = await _bitPayClient.GetInvoiceAsync(model.Data.Id);
-            if (invoice == null || invoice.Status != "confirmed")
+            if (invoice == null)
             {
                 // Request forged...?
-                _logger.LogWarning("Forged invoice detected. #" + model.Data.Id);
+                _logger.LogWarning("Invoice not found. #" + model.Data.Id);
+                return new BadRequestResult();
+            }
+
+            if (invoice.Status != "confirmed" && invoice.Status != "completed")
+            {
+                _logger.LogWarning("Invoice status of '" + invoice.Status + "' is not acceptable. #" + invoice.Id);
                 return new BadRequestResult();
             }

@@ -97,7 +103,7 @@
             var transaction = await _transactionRepository.GetByGatewayIdAsync(GatewayType.BitPay, invoice.Id);
             if (transaction != null)
             {
-                _logger.LogWarning("Already processed this confirmed invoice. #" + invoice.Id);
+                _logger.LogWarning("Already processed this invoice. #" + invoice.Id);
                 return new OkResult();
             }

@@ -152,7 +158,7 @@
                 }
             }
             // Catch foreign key violations because user/org could have been deleted.
-            catch (SqlException e) when(e.Number == 547) { }
+            catch (SqlException e) when (e.Number == 547) { }

             return new OkResult();
         }


If can't start the image server, pass along the inner exception in the error report.

--- src/BloomExe/ImageProcessing/ImageServer.cs
+++ src/BloomExe/ImageProcessing/ImageServer.cs
@@ -44,13 +44,16 @@

 		public void StartWithSetupIfNeeded()
 		{
+			Exception error=null;
+
 			bool didStart = false;
 			try
 			{
 				didStart = TryStart();
 			}
-			catch (Exception)
-			{
+			catch (Exception e)
+			{
+				error = e;
 			}
 			if (didStart)
 				return;
@@ -60,13 +63,14 @@
 			{
 				didStart = TryStart();
 			}
-			catch (Exception)
-			{
+			catch (Exception e)
+			{
+				error = e;
 			}

 			if(!didStart)
 			{
-				var e = new ApplicationException("Could not start ImageServer");//passing this in will enable the details button
+				var e = new ApplicationException("Could not start ImageServer", error);//passing this in will enable the details button
 				ErrorReport.NotifyUserOfProblem(e, "What Happened\r\nBloom could not start its image server, which keeps hi-res images from chewing up memory. You will still be able to work, but Bloom will take more memory, and hi-res images may not always show.\r\n\r\nWhat caused this?\r\nProbably Bloom does not know how to get your specific Windows operating system to allow its image server to run. \r\n\r\n What can you do?\r\nClick 'Details' and report the problem to the developers.");
 			}
 		}


BOO-793 (Cedric Vivier)

BOO-793 (Cedric Vivier)

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

--- src/Boo.Lang.Compiler/Steps/EmitAssembly.cs
+++ src/Boo.Lang.Compiler/Steps/EmitAssembly.cs
@@ -2400,17 +2400,44 @@
 		override public void OnExpressionInterpolationExpression(ExpressionInterpolationExpression node)
 		{
 			Type stringBuilderType = typeof(StringBuilder);
-			ConstructorInfo constructor =  stringBuilderType.GetConstructor(new Type[0]);
+			ConstructorInfo constructor = stringBuilderType.GetConstructor(new Type[0]);
+			ConstructorInfo constructorString = stringBuilderType.GetConstructor(new Type[] { typeof(string) });
 			MethodInfo appendObject = stringBuilderType.GetMethod("Append", new Type[] { typeof(object) });
 			MethodInfo appendString = stringBuilderType.GetMethod("Append", new Type[] { typeof(string) });
-
-			_il.Emit(OpCodes.Newobj, constructor);
+			Expression arg0 = node.Expressions[0];
+			IType argType = arg0.ExpressionType;
+
+			/* if arg0 is a string, let's call StringBuilder constructor
+			 * directly with the string */
+			if ( ( typeof(StringLiteralExpression) == arg0.GetType()
+				   && ((StringLiteralExpression) arg0).Value.Length > 0 )
+				|| ( typeof(StringLiteralExpression) != arg0.GetType()
+					 && TypeSystemServices.StringType == argType ) )
+			{
+				Visit(arg0);
+				PopType();
+				_il.Emit(OpCodes.Newobj, constructorString);
+			}
+			else
+			{
+				_il.Emit(OpCodes.Newobj, constructor);
+				arg0 = null; /* arg0 is not a string so we want it to be appended below */
+			}

 			foreach (Expression arg in node.Expressions)
 			{
+				/* we do not need to append literal string.Empty
+				 * or arg0 if it has been handled by ctor */
+				if ( ( typeof(StringLiteralExpression) == arg.GetType()
+					   && ((StringLiteralExpression) arg).Value.Length == 0 )
+					|| arg == arg0 )
+				{
+					continue;
+				}
+
 				Visit(arg);

-				IType argType = PopType();
+				argType = PopType();
 				if (TypeSystemServices.StringType == argType)
 				{
 					_il.EmitCall(OpCodes.Call, appendString, null);
@@ -3729,7 +3756,6 @@
 				Type definition = field.DeclaringType.GetGenericTypeDefinition();
 				field = definition.GetField(field.Name);
 			}
-
 			return TypeBuilder.GetField(GetSystemType(targetType), field);
 		}


test array

test array

--- Director/UnitTestParser/UnitTest1.cs
+++ Director/UnitTestParser/UnitTest1.cs
@@ -521,7 +521,7 @@

         [TestMethod]
         public void IpNotEqualInteger()
-        {
+        {
             Dictionary<string, string> customVar = new Dictionary<string, string>
             {
                 {"a", "-10"},
@@ -543,15 +543,60 @@
         [TestMethod]
         public void IpGreaterThanFloat()
         {
+            String result;
             Dictionary<string, string> customVar = new Dictionary<string, string>
             {
                 {"var", "-10.2"},
             };

-            ParserResult pr = parser.parseResponse("{ a : \"#float#ip_gt#var##\", b: \"#float#ip_gt#0##\"  }", "{ b: 1 }", customVar);
+            ParserResult pr = parser.parseResponse("{ a : \"#float#ip_gt#var#res#\", b: \"#float#ip_gt#0##\"  }", "{ b: 1 }", customVar);
             Assert.IsNotNull(pr);
             Assert.IsTrue(pr.isSuccess());

+            Assert.IsTrue(customVar.TryGetValue("res", out result));
+            Assert.AreEqual(result, "-10.2");
+
+        }
+
+
+        //#######################################
+        //          arrays
+        //#######################################
+
+        [TestMethod]
+        public void ArrayInteger()
+        {
+            String result;
+            Dictionary<string, string> customVar = new Dictionary<string, string>
+            {
+                {"a", "3"},
+                {"b", "10"}
+            };
+            String template = "\"foo\": [\"#array#uv_ge#a#res#\", \"#integer#uv_ge#b##\"] ";
+            String response = "foo: [10,20,30]";
+            ParserResult pr = parser.parseResponse(template, response, customVar);
+
+            Assert.IsNotNull(pr);
+            Assert.IsTrue(pr.isSuccess());
+
+            Assert.IsTrue( customVar.TryGetValue("res", out result) );
+            Assert.AreEqual(result, "3");
+        }
+
+
+        [TestMethod]
+        public void ArrayString()
+        {
+            Dictionary<string, string> customVar = new Dictionary<string, string>
+            {
+                {"a", "abc"}
+            };
+            String template = "\"foo\": [\"#string#uv_ne#a##\"";
+            String response = "foo: [\"ab\", \"abcd\"]";
+            ParserResult pr = parser.parseResponse(template, response, customVar);
+
+            Assert.IsNotNull(pr);
+            Assert.IsTrue(pr.isSuccess());
         }
     }
 }


Avoid brancing in ToLower/UpperAsciiInvariant(char)

Rather than comparing the input char against 'A'/'a' and 'Z'/'z', we simply trim off all but the lower 7 bits and do a lookup into a precomputed table.  This is ~3-4x faster than the branching version.


Possible fix for a crash

Possible fix for a crash

--- Duplicati/Library/Utility/Utility.cs
+++ Duplicati/Library/Utility/Utility.cs
@@ -1019,8 +1019,8 @@
         public static byte[] RepeatedHashWithSalt(string data, string salt, int repeats = 1200)
         {
             return RepeatedHashWithSalt(
-                System.Text.Encoding.UTF8.GetBytes(data),
-                System.Text.Encoding.UTF8.GetBytes(salt),
+                System.Text.Encoding.UTF8.GetBytes(data ?? ""),
+                System.Text.Encoding.UTF8.GetBytes(salt ?? ""),
                 repeats);
         }


Fix for issue #491 (2 commits squashed)

Fix for issue #491 (2 commits squashed)

--- src/Couchbase.Lite.Shared/View/UpdateJob.cs
+++ src/Couchbase.Lite.Shared/View/UpdateJob.cs
@@ -48,12 +48,13 @@
             _logic = logic;
             _args = args;
             LastSequences = lastSequences.ToArray();
+            _task = new Task<Status>(() => _logic(_args.ToList()));
         }

         public void Run()
         {
-            if (_task == null) {
-                _task = Task.Factory.StartNew<Status>(() => _logic(_args.ToList()));
+            if (_task.Status <= TaskStatus.Running) {
+                _task.Start(TaskScheduler.Default);
                 _task.ContinueWith(t =>
                 {
                     if(Finished != null) {


Add Write<T>(void*, ref T) to ref source

--- src/DotNetCross.Memory.Unsafe.Ref/Unsafe.cs
+++ src/DotNetCross.Memory.Unsafe.Ref/Unsafe.cs
@@ -77,6 +77,8 @@
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static ref T Unbox<T>(object box) where T : struct { throw null; }
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
+        public unsafe static void Write<T>(void* destination, ref T value) { }
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public unsafe static void Write<T>(void* destination, T value) { }
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public unsafe static void WriteUnaligned<T>(void* destination, T value) { }


Fixed incorrect control size.

Fixed incorrect control size.

--- EliteTradingGUI/MainForm.Designer.cs
+++ EliteTradingGUI/MainForm.Designer.cs
@@ -141,7 +141,7 @@
             this.RouteDisplay.FullRowSelect = true;
             this.RouteDisplay.Location = new System.Drawing.Point(3, 232);
             this.RouteDisplay.Name = "RouteDisplay";
-            this.RouteDisplay.Size = new System.Drawing.Size(764, 294);
+            this.RouteDisplay.Size = new System.Drawing.Size(764, 272);
             this.RouteDisplay.TabIndex = 1;
             this.RouteDisplay.UseCompatibleStateImageBehavior = false;
             this.RouteDisplay.View = System.Windows.Forms.View.Details;


refactor: fixes the typo of the parameter name.

--- src/Experiment.Idioms/DisplayNameVisitor.cs
+++ src/Experiment.Idioms/DisplayNameVisitor.cs
@@ -159,19 +159,19 @@
         /// <summary>
         /// Visits a method element to collect a dispaly name of it.
         /// </summary>
-        /// <param name="metodInfoElement">
+        /// <param name="methodInfoElement">
         /// The method element whose display name is collected.
         /// </param>
         /// <returns>
         /// The visitor which collected a display name.
         /// </returns>
         public override IReflectionVisitor<IEnumerable<string>> Visit(
-            MethodInfoElement metodInfoElement)
-        {
-            if (metodInfoElement == null)
-                throw new ArgumentNullException("metodInfoElement");
-
-            var methodInfo = metodInfoElement.MethodInfo;
+            MethodInfoElement methodInfoElement)
+        {
+            if (methodInfoElement == null)
+                throw new ArgumentNullException("methodInfoElement");
+
+            var methodInfo = methodInfoElement.MethodInfo;

             var displayName = string.Format(
                 CultureInfo.CurrentCulture,


Add missing XML docs.

Add missing XML docs.

--- src/Facility.Definition/Fsd/FsdGenerator.cs
+++ src/Facility.Definition/Fsd/FsdGenerator.cs
@@ -6,10 +6,19 @@

 namespace Facility.Definition.Fsd
 {
+	/// <summary>
+	/// Generates an FSD file for a service definition.
+	/// </summary>
 	public sealed class FsdGenerator
 	{
+		/// <summary>
+		/// The name of the generator (for comments).
+		/// </summary>
 		public string GeneratorName { get; set; }

+		/// <summary>
+		/// Generates an FSD file for a service definition.
+		/// </summary>
 		public ServiceTextSource GenerateOutput(ServiceDefinitionInfo definition)
 		{
 			var service = definition.Service;


Minor fix for google integration test

Minor fix for google integration test

--- src/Firebase.Auth.Tests/IntegrationTests.cs
+++ src/Firebase.Auth.Tests/IntegrationTests.cs
@@ -9,10 +9,12 @@
     public class IntegrationTests
     {
         private const string ApiKey = "<YOUR API KEY>";
+
         private const string FacebookAccessToken = "<FACEBOOK USER ACCESS TOKEN>";
         private const string FacebookTestUserFirstName = "Mark";

         private const string GoogleAccessToken = "<GOOGLE USER ACCESS TOKEN>";
+        private const string GoogleTestUserFirstName = "Mark";

         [TestMethod]
         public void FacebookTest()
@@ -32,7 +34,7 @@

             var auth = authProvider.SignInWithOAuth(FirebaseAuthType.Google, GoogleAccessToken).Result;

-            auth.User.FirstName.ShouldBeEquivalentTo(FacebookTestUserFirstName);
+            auth.User.FirstName.ShouldBeEquivalentTo(GoogleTestUserFirstName);
             auth.FirebaseToken.Should().NotBeNullOrWhiteSpace();
         }
     }


DecimalUtility.ToStringFixedLength: Fixed a bug when the number was zero.

--- src/GM.Utility/GM.Utility/DecimalUtility.cs
+++ src/GM.Utility/GM.Utility/DecimalUtility.cs
@@ -77,7 +77,7 @@
 		/// </summary>
 		/// <param name="value">The decimal value.</param>
 		/// <param name="decimalCount">Number of decimals to get.</param>
-		[Obsolete("This method is obsolete and will be removed in next releases, please use GetDecimalPart(decimal value, int decimalCount, bool round).", false)]
+		[Obsolete("This method is obsolete and will be removed in the next release, please use GetDecimalPart(decimal value, int decimalCount, bool round).", false)]
 		public static int GetDecimalPart(this decimal value, int decimalCount)
 		{
 			// FIXME obsolete 2019-06-15
@@ -234,11 +234,15 @@
 					sb.Append(cultureInfo.NumberFormat.NumberDecimalSeparator);
 					charsLeft -= cultureInfo.NumberFormat.NumberDecimalSeparator.Length;
 					decimal decimalPart = Math.Abs(value.GetDecimals(charsLeft));
-					string decimalPartString = decimalPart.ToString(cultureInfo).Substring(1 + cultureInfo.NumberFormat.NumberDecimalSeparator.Length);
-					if(decimalPartString.Length > charsLeft) {
-						decimalPartString = decimalPartString.Substring(0, charsLeft);
+					if(decimalPart == 0) {
+						sb.Append('0', charsLeft);
+					} else {
+						string decimalPartString = decimalPart.ToString(cultureInfo).Substring(1 + cultureInfo.NumberFormat.NumberDecimalSeparator.Length);
+						if(decimalPartString.Length > charsLeft) {
+							decimalPartString = decimalPartString.Substring(0, charsLeft);
+						}
+						sb.Append(decimalPartString);
 					}
-					sb.Append(decimalPartString);
 				}
 			}


Minor change to bool converter

Minor change to bool converter

--- src/Gfycat.Net/NumericalBooleanConverter.cs
+++ src/Gfycat.Net/NumericalBooleanConverter.cs
@@ -7,12 +7,12 @@
     {
         public override bool CanConvert(Type objectType)
         {
-            return objectType == typeof(bool) || objectType == typeof(bool?);
+            return objectType == typeof(string);
         }

         public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
         {
-            return ((int)existingValue != 1 ? false : true);
+            return ((string)existingValue != "1" ? false : true);
         }

         public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)


Delete DIPSbotHost.cs

Delete DIPSbotHost.cs

--- src/Hjerpbakk.DIPSbot.Runner/DIPSbotHost.cs
+++ src/Hjerpbakk.DIPSbot.Runner/DIPSbotHost.cs
@@ -1,153 +0,0 @@
-using LightInject;
-using System;
-using System.Threading.Tasks;
-using Hjerpbakk.DIPSbot.Services;
-using SlackConnector;
-using Hjerpbakk.DIPSBot;
-using System.Threading;
-using System.Net.Http;
-using Hjerpbakk.DIPSBot.Clients;
-using Hjerpbakk.DIPSBot.Actions;
-using Hjerpbakk.DIPSBot.MessageHandlers;
-using Hjerpbakk.DIPSBot.Configuration;
-using Hjerpbakk.ServiceDiscovery.Client;
-using Hjerpbakk.DIPSBot.Services;
-using Hjerpbakk.DIPSBot.Telemetry;
-using Microsoft.ApplicationInsights;
-using System.Collections.Generic;
-
-namespace Hjerpbakk.DIPSbot.Runner
-{
-    class DIPSbotHost
-	{
-        static readonly ManualResetEvent manualResetEvent;
-
-        readonly TelemetryServiceClient telemetryServiceClient;
-
-        int restartCount;
-        DIPSbotImplementation DIPSbot;
-
-        static DIPSbotHost() {
-            manualResetEvent = new ManualResetEvent(false);
-        }
-
-        public DIPSbotHost(TelemetryServiceClient telemetryServiceClient)
-        {
-            this.telemetryServiceClient = telemetryServiceClient;
-        }
-
-        public async Task<string> Start(AppConfiguration configuration)
-		{
-            try
-            {
-				configuration.FatalExceptionHandler = RestartBot;
-				while (true)
-				{
-                    Console.WriteLine("Starting DIPSbot...");
-                    IServiceContainer serviceContainer;
-					try
-					{
-						serviceContainer = await CompositionRoot(configuration);
-						DIPSbot = serviceContainer.GetInstance<DIPSbotImplementation>();
-						await DIPSbot.Connect();
-					}
-					catch (Exception e)
-					{
-						Console.WriteLine($"Error connecting to Slack or other services: {e}");
-                        telemetryServiceClient.TrackException(e, $"Error connecting to Slack {restartCount}");
-						return "";
-					}
-
-                    Console.WriteLine("DIPSbot started.");
-					manualResetEvent.WaitOne();
-
-					Console.WriteLine("Stopping before restart...");
-					var res = Stop().GetAwaiter().GetResult();
-					serviceContainer.Dispose();
-
-					manualResetEvent.Reset();
-				}
-			}
-            catch (Exception e)
-            {
-                telemetryServiceClient.TrackException(e, $"Died unexpectedly {restartCount}");
-                return e.ToString();
-            }
-        }
-
-        public async Task<string> Stop()
-		{
-            try {
-				Console.WriteLine("Disconnecting...");
-				await DIPSbot.Close();
-				DIPSbot = null;
-                Console.WriteLine("DIPSbot stopped.");
-            } catch (Exception e) {
-                return e.ToString();
-            }
-
-            return "";
-		}
-
-        void RestartBot(Exception exception) {
-            Interlocked.Increment(ref restartCount);
-            manualResetEvent.Set();
-            Console.WriteLine("Trying to restart. Cause of death:");
-            Console.WriteLine(exception);
-
-            telemetryServiceClient.TrackException(exception, $"Bot died during message handling, trying to restart {restartCount}");
-        }
-
-		async Task<IServiceContainer> CompositionRoot(AppConfiguration configuration)
-		{
-			var serviceContainer = new ServiceContainer();
-			serviceContainer.RegisterInstance<IServiceContainer>(serviceContainer);
-
-            serviceContainer.RegisterInstance(telemetryServiceClient);
-
-            var httpClient = new HttpClient();
-            serviceContainer.RegisterInstance(httpClient);
-            var serviceDiscoveryClient = new ServiceDiscoveryClient(httpClient, configuration.ServiceDiscoveryServerName);
-
-            // TODO: Smoothify
-            var kitchenServiceTask = serviceDiscoveryClient.GetServiceURL(configuration.KitchenResponsibleServiceName);
-            var comicsServiceTask = serviceDiscoveryClient.GetServiceURL(configuration.ComicsServiceName);
-            await Task.WhenAll(kitchenServiceTask, comicsServiceTask);
-            configuration.KitchenServiceURL = kitchenServiceTask.Result;
-            configuration.ComicsServiceURL = comicsServiceTask.Result;
-
-            serviceContainer.RegisterInstance(configuration.Context);
-            serviceContainer.RegisterInstance<IReadOnlyAppConfiguration>(configuration);
-            serviceContainer.RegisterInstance(serviceDiscoveryClient);
-
-			serviceContainer.Register<ISlackConnector, SlackConnector.SlackConnector>(new PerContainerLifetime());
-			serviceContainer.Register<ISlackIntegration, SlackIntegration>(new PerContainerLifetime());
-
-            serviceContainer.Register<ComicsClient>(new PerContainerLifetime());
-            serviceContainer.Register<IKitchenResponsibleClient, KitchenResponsibleClient>(new PerContainerLifetime());
-			serviceContainer.Register<IOrganizationService, FileOrganizationService>(new PerContainerLifetime());
-            serviceContainer.Register<IDebuggingService, DebuggingService>(new PerContainerLifetime());
-
-            serviceContainer.Register<AdminMessageHandler>(new PerContainerLifetime());
-            serviceContainer.Register<ChannelMessageHandler>(new PerContainerLifetime());
-            serviceContainer.Register<NoopMessageHandler>(new PerContainerLifetime());
-            serviceContainer.Register<RegularUserMessageHandler>(new PerContainerLifetime());
-            serviceContainer.Register<TrondheimMessageHandler>(new PerContainerLifetime());
-
-            // TODO: Smoothify
-            serviceContainer.Register<AddDevelopersToUtviklingChannelAction>(new PerContainerLifetime());
-            serviceContainer.Register<KitchenResponsibleAction>(new PerContainerLifetime());
-            serviceContainer.Register<AddEmployeeAction>(new PerContainerLifetime());
-            serviceContainer.Register<ThanksAction>(new PerContainerLifetime());
-            serviceContainer.Register<NegativeAction>(new PerContainerLifetime());
-            serviceContainer.Register<WeekAction>(new PerContainerLifetime());
-            serviceContainer.Register<RemoveEmployeeAction>(new PerContainerLifetime());
-            serviceContainer.Register<ComicsAction>(new PerContainerLifetime());
-            serviceContainer.Register<VersionAction>(new PerContainerLifetime());
-
-			serviceContainer.Register<DIPSbotImplementation>(new PerContainerLifetime());
-
-			return serviceContainer;
-		}
-	}
-}


Removed message usage in RecordOperations

--- FileHelpers/Core/RecordOperations.cs
+++ FileHelpers/Core/RecordOperations.cs
@@ -57,11 +57,7 @@
                             mRecordInfo.Fields[i].FieldInfo.Name,
                             line.mReader.LineNumber,
                             -1,
-                            Messages.Errors.WrongConverter
-                                .FieldName(mRecordInfo.Fields[i].FieldInfo.Name)
-                                .ConverterReturnedType(values[i].GetType().Name)
-                                .FieldType(mRecordInfo.Fields[i].FieldInfo.FieldType.Name)
-                                .Text
+                            $"The converter for the field: {mRecordInfo.Fields[i].FieldInfo.Name} returns an object of Type: {values[i].GetType().Name} and the field is of type: {mRecordInfo.Fields[i].FieldInfo.FieldType.Name}"
                             ,
                             ex);
                     }
@@ -100,11 +96,7 @@
                             mRecordInfo.Fields[i].FieldInfo.Name,
                             line.mReader.LineNumber,
                             -1,
-                            Messages.Errors.WrongConverter
-                                .FieldName(mRecordInfo.Fields[i].FieldInfo.Name)
-                                .ConverterReturnedType(values[i].GetType().Name)
-                                .FieldType(mRecordInfo.Fields[i].FieldInfo.FieldType.Name)
-                                .Text
+                            $"The converter for the field: {mRecordInfo.Fields[i].FieldInfo.Name} returns an object of Type: {values[i].GetType().Name} and the field is of type: {mRecordInfo.Fields[i].FieldInfo.FieldType.Name}"
                             ,
                             ex);
                     }


Throw instead of doing a no-op update

Throw instead of doing a no-op update

Throw instead of doing a no-op update if a user already has a login for
a specific provider.

--- src/LondonTravel.Site/Identity/UserStore.cs
+++ src/LondonTravel.Site/Identity/UserStore.cs
@@ -53,10 +53,12 @@
                 throw new ArgumentNullException(nameof(login));
             }

-            if (!user.Logins.Any((p) => p.LoginProvider == login.LoginProvider))
-            {
-                user.Logins.Add(LondonTravelLoginInfo.FromUserLoginInfo(login));
-            }
+            if (user.Logins.Any((p) => p.LoginProvider == login.LoginProvider))
+            {
+                throw new InvalidOperationException($"Failed to add login for provider '{login.LoginProvider}' for user '{user.Id}' as a login for that provider already exists.");
+            }
+
+            user.Logins.Add(LondonTravelLoginInfo.FromUserLoginInfo(login));

             var result = await UpdateAsync(user, cancellationToken);


Remove some dead code

Remove some dead code

--- src/Microsoft.DotNet.Cli.Utils/Constants.cs
+++ src/Microsoft.DotNet.Cli.Utils/Constants.cs
@@ -28,9 +28,6 @@
         public static readonly string LibCoreClrFileName = (CurrentPlatform == Platform.Windows ? "coreclr" : "libcoreclr");
         public static readonly string LibCoreClrName = LibCoreClrFileName + DynamicLibSuffix;

-        public static readonly string RuntimeIdentifier = CurrentPlatform == Platform.Windows ? "win7-x64" :
-                                                          CurrentPlatform == Platform.Darwin ? "osx.10.10-x64" : "ubuntu.{RuntimeEnvironment.OperatingSystemVersion}-x64";
-
         public static readonly string StaticLibSuffix = CurrentPlatform == Platform.Windows ? ".lib" : ".a";

         public static readonly string ResponseFileSuffix = ".rsp";


Added support to avoid quotation character

When you need to export a csv file, it is possible that it is to add quotation characters only for some field.
In DelimitedRecordReader class it was added the property UseQuoteCharacter to manager these cases.

--- src/NLight/IO/Text/DelimitedRecordWriter.cs
+++ src/NLight/IO/Text/DelimitedRecordWriter.cs
@@ -14,12 +14,14 @@
 		public const char DefaultQuoteEscapeCharacter = '"';
 		public const char DefaultColumnHeaderTypeSeparator = ':';

+		public bool UseQuoteCharacter { get; set; } = true;
+
 		private char _quote;
 		private char _quoteEscape;

 		private string _escapedQuoteString;
 		private string _quoteString;
-
+
 		private bool _isFirstField;

 		public DelimitedRecordWriter(TextWriter writer)
@@ -81,13 +83,19 @@
 				value = value.TrimEnd();
 			else if ((this.FieldTrimmingOptions & TrimmingOptions.Start) == TrimmingOptions.Start)
 				value = value.TrimStart();
+
+			if (UseQuoteCharacter)
+            {
+				value = value.Replace(_quoteString, _escapedQuoteString);
+
+				writer.Write(_quote);
+				writer.Write(value);
+				writer.Write(_quote);
+			}
+			else
+				writer.Write(value);

-			value = value.Replace(_quoteString, _escapedQuoteString);
-
-			writer.Write(_quote);
-			writer.Write(value);
-			writer.Write(_quote);
-
+
 			_isFirstField = false;
 		}


Add reserve header space test for Sequence<T>

--- src/Nerdbank.Streams.Tests/SequenceTests.cs
+++ src/Nerdbank.Streams.Tests/SequenceTests.cs
@@ -70,6 +70,28 @@
         mockPool.AssertContents(mem1);
     }

+    /// <summary>
+    /// Verifies that folks can "reserve" space for a header, write content, then circle back and write
+    /// the header later.
+    /// </summary>
+    /// <seealso href="https://github.com/dotnet/corefx/issues/34259"/>
+    [Fact]
+    public void GetSpan_ReservesHeaderSpaceForWritingLater()
+    {
+        var seq = new Sequence<char>();
+
+        var headerSpan = seq.GetSpan(4);
+        seq.Advance(4);
+
+        var contentSpan = seq.GetSpan(10);
+        "0123456789".AsSpan().CopyTo(contentSpan);
+        seq.Advance(10);
+
+        "abcd".AsSpan().CopyTo(headerSpan);
+
+        Assert.Equal("abcd0123456789", new string(seq.AsReadOnlySequence.ToArray()));
+    }
+
     [Fact]
     public void Advance_OneBlock()
     {


Added MonoMacPlatform.ShowInDock

Added MonoMacPlatform.ShowInDock

--- src/OSX/Avalonia.MonoMac/MonoMacPlatform.cs
+++ src/OSX/Avalonia.MonoMac/MonoMacPlatform.cs
@@ -14,6 +14,9 @@
         internal readonly MouseDevice MouseDevice = new MouseDevice();
         readonly KeyboardDevice _keyboardDevice = new KeyboardDevice();
         internal static NSApplication App;
+        private static bool s_monoMacInitialized;
+        private static bool s_showInDock = true;
+
         void DoInitialize()
         {
             AvaloniaLocator.CurrentMutable
@@ -26,7 +29,7 @@
                 .Bind<ISystemDialogImpl>().ToSingleton<SystemDialogsImpl>()
                 .Bind<IPlatformThreadingInterface>().ToConstant(PlatformThreadingInterface.Instance);

-            InitializeCocoaApp();
+            InitializeMonoMac();
         }

         public static void Initialize()
@@ -36,12 +39,29 @@

         }

-        void InitializeCocoaApp()
+        void InitializeMonoMac()
         {
+            if(s_monoMacInitialized)
+                return;
             NSApplication.Init();
             App = NSApplication.SharedApplication;
-            App.ActivationPolicy = NSApplicationActivationPolicy.Regular;
+            UpdateActivationPolicy();
+            s_monoMacInitialized = true;
+        }

+        static void UpdateActivationPolicy() => App.ActivationPolicy = ShowInDock
+            ? NSApplicationActivationPolicy.Regular
+            : NSApplicationActivationPolicy.Accessory;
+
+        public static bool ShowInDock
+        {
+            get => s_showInDock;
+            set
+            {
+                s_showInDock = value;
+                if (s_monoMacInitialized)
+                    UpdateActivationPolicy();
+            }
         }


Squashed a bug with ResourceManager that sometimes resulted in missing resources.

--HG--
branch : dev

--- src/Orchard/UI/Resources/ResourceManager.cs
+++ src/Orchard/UI/Resources/ResourceManager.cs
@@ -11,7 +11,7 @@
 using Orchard.Environment.Extensions.Models;

 namespace Orchard.UI.Resources {
-    public class ResourceManager : IResourceManager {
+    public class ResourceManager : IResourceManager, IUnitOfWorkDependency {
         private readonly Dictionary<Tuple<String, String>, RequireSettings> _required = new Dictionary<Tuple<String, String>, RequireSettings>();
         private readonly List<LinkEntry> _links = new List<LinkEntry>();
         private readonly Dictionary<string, MetaEntry> _metas = new Dictionary<string, MetaEntry> {
@@ -234,11 +234,14 @@
             if (resource == null) {
                 return;
             }
-            if (allResources.Contains(resource)) {
-                settings = ((RequireSettings) allResources[resource]).Combine(settings);
-            }
-            settings.Type = resource.Type;
-            settings.Name = resource.Name;
+            // Settings is given so they can cascade down into dependencies. For example, if Foo depends on Bar, and Foo's required
+            // location is Head, so too should Bar's location.
+            // forge the effective require settings for this resource
+            // (1) If a require exists for the resource, combine with it. Last settings in gets preference for its specified values.
+            // (2) If no require already exists, form a new settings object based on the given one but with its own type/name.
+            settings = allResources.Contains(resource)
+                ? ((RequireSettings)allResources[resource]).Combine(settings)
+                : new RequireSettings { Type = resource.Type, Name = resource.Name }.Combine(settings);
             if (resource.Dependencies != null) {
                 var dependencies = from d in resource.Dependencies
                                    select FindResource(new RequireSettings { Type = resource.Type, Name = d });


Fix issue with ms asp.net getting httproute paths with a wildcard

--- src/Pablo.Gallery/App_Start/WebApiConfig.cs
+++ src/Pablo.Gallery/App_Start/WebApiConfig.cs
@@ -17,6 +17,14 @@

 			config.Routes.MapHttpRoute(
 				name: "api",
+				routeTemplate: "api/{version}/{controller}/{id}",
+				defaults: new { version = "v0", id = RouteParameter.Optional }
+			);
+
+			// need this separate as Url.RouteUrl does not work with a wildcard in the route
+			// this is used to allow files in subfolders of a pack to be retrieved.
+			config.Routes.MapHttpRoute(
+				name: "apipath",
 				routeTemplate: "api/{version}/{controller}/{id}/{*path}",
 				defaults: new { version = "v0", id = RouteParameter.Optional, path = RouteParameter.Optional }
 			);


Fix typo in BoundIndirectStFieldPlace

Fix typo in BoundIndirectStFieldPlace

--- src/Peachpie.CodeAnalysis/CodeGen/Places.cs
+++ src/Peachpie.CodeAnalysis/CodeGen/Places.cs
@@ -1985,7 +1985,7 @@
             if (_lazyStoreCallSite == null)
                 _lazyStoreCallSite = cg.Factory.StartCallSite("set_" + this.NameValueOpt);

-            _lazyLoadCallSite.Prepare();
+            _lazyStoreCallSite.Prepare();

             // callsite.Target callsite
             _lazyStoreCallSite.EmitLoadTarget();


Check result for null to prevent NRE when getting exception details

--- src/ProblemDetails/ProblemDetailsFactory.cs
+++ src/ProblemDetails/ProblemDetailsFactory.cs
@@ -37,6 +37,12 @@

             var result = MapToProblemDetails(context, error);

+            if (result is null)
+            {
+                // Developer has explicitly ignored the problem.
+                return null;
+            }
+
             if (Options.IncludeExceptionDetails(context, error))
             {
                 try


Don't run any executables when ApplyReleases is invoked with silentInstall = true

--- src/Squirrel/UpdateManager.ApplyReleases.cs
+++ src/Squirrel/UpdateManager.ApplyReleases.cs
@@ -39,7 +39,7 @@
                 if (release == null) {
                     if (attemptingFullInstall) {
                         this.Log().Info("No release to install, running the app");
-                        await invokePostInstall(updateInfo.CurrentlyInstalledVersion.Version, false, true);
+                        await invokePostInstall(updateInfo.CurrentlyInstalledVersion.Version, false, true, silentInstall);
                     }

                     return getDirectoryForRelease(updateInfo.CurrentlyInstalledVersion.Version).FullName;
@@ -56,7 +56,7 @@
                 var newVersion = currentReleases.MaxBy(x => x.Version).First().Version;
                 executeSelfUpdate(newVersion);

-                await this.ErrorIfThrows(() => invokePostInstall(newVersion, attemptingFullInstall, false),
+                await this.ErrorIfThrows(() => invokePostInstall(newVersion, attemptingFullInstall, false, silentInstall),
                     "Failed to invoke post-install");
                 progress(75);

@@ -325,7 +325,7 @@
                     File.Copy(newSquirrel, Path.Combine(targetDir.Parent.FullName, "Update.exe"), true));
             }

-            async Task invokePostInstall(Version currentVersion, bool isInitialInstall, bool firstRunOnly)
+            async Task invokePostInstall(Version currentVersion, bool isInitialInstall, bool firstRunOnly, bool silentInstall)
             {
                 var targetDir = getDirectoryForRelease(currentVersion);
                 var args = isInitialInstall ?
@@ -354,7 +354,7 @@
                     squirrelApps.ForEach(x => CreateShortcutsForExecutable(Path.GetFileName(x), ShortcutLocation.Desktop | ShortcutLocation.StartMenu, isInitialInstall == false));
                 }

-                if (!isInitialInstall) return;
+                if (!isInitialInstall || silentInstall) return;

                 var firstRunParam = isInitialInstall ? "--squirrel-firstrun" : "";
                 squirrelApps.ForEach(exe => Process.Start(exe, firstRunParam));


1299: RunSpecificDemo()

1299: RunSpecificDemo()

--- src/Tests/WinFormTestBed2/TestBedStartup.cs
+++ src/Tests/WinFormTestBed2/TestBedStartup.cs
@@ -14,7 +14,7 @@
             FrameworkInitGLES.SetupDefaultValues();
 #endif
             //you can use your font loader
-
+
             CommonTextServiceSetup.SetupDefaultValues();
             PixelFarm.CpuBlit.Imaging.PngImageWriter.InstallImageSaveToFileService((IntPtr imgBuffer, int stride, int width, int height, string filename) =>
             {
@@ -46,7 +46,8 @@
 #if DEBUG
         public static bool dbugShowLayoutInspectorForm { get; set; }
 #endif
-        public static void RunSpecificDemo(LayoutFarm.App demo)
+
+        public static void RunSpecificDemo(LayoutFarm.App demo, InnerViewportKind innerViewportKind = InnerViewportKind.GdiPlusOnGLES)
         {
             //-------------------------------
             Application.EnableVisualStyles();
@@ -55,7 +56,7 @@
             //1. select view port kind

             //InnerViewportKind innerViewportKind = InnerViewportKind.GdiPlus;
-            InnerViewportKind innerViewportKind = InnerViewportKind.PureAgg;
+            //InnerViewportKind innerViewportKind = InnerViewportKind.GdiPlusOnGLES;
             System.Drawing.Rectangle workingArea = Screen.PrimaryScreen.WorkingArea;

             Form formCanvas = FormCanvasHelper.CreateNewFormCanvas(
@@ -63,7 +64,9 @@
                workingArea.Height,
                innerViewportKind,
                out UISurfaceViewportControl latestviewport);
+#if DEBUG
             formCanvas.Text = innerViewportKind.ToString();
+#endif

             demo.Start(new LayoutFarm.AppHostWinForm(latestviewport));
             latestviewport.TopDownRecalculateContent();


We don't support C# 6 yet

We don't support C# 6 yet

--- src/Umbraco.Tests/Persistence/LocksTests.cs
+++ src/Umbraco.Tests/Persistence/LocksTests.cs
@@ -254,7 +254,9 @@
                     var info = database.Query<dynamic>("SELECT * FROM sys.lock_information;");
                     Console.WriteLine("LOCKS:");
                     foreach (var row in info)
-                        Console.WriteLine($"> {row.request_spid} {row.resource_type} {row.resource_description} {row.request_mode} {row.resource_table} {row.resource_table_id} {row.request_status}");
+                        Console.WriteLine(string.Format("> {0} {1} {2} {3} {4} {5} {6}", row.request_spid,
+                            row.resource_type, row.resource_description, row.request_mode, row.resource_table,
+                            row.resource_table_id, row.request_status));
                     Thread.Sleep(6000);
                 }
                 catch (Exception e)
@@ -277,7 +279,9 @@
                     var info = database.Query<dynamic>("SELECT * FROM sys.lock_information;");
                     Console.WriteLine("LOCKS:");
                     foreach (var row in info)
-                        Console.WriteLine($"> {row.request_spid} {row.resource_type} {row.resource_description} {row.request_mode} {row.resource_table} {row.resource_table_id} {row.request_status}");
+                        Console.WriteLine(string.Format("> {0} {1} {2} {3} {4} {5} {6}", row.request_spid,
+                            row.resource_type, row.resource_description, row.request_mode, row.resource_table,
+                            row.resource_table_id, row.request_status));
                     Thread.Sleep(1000);
                 }
                 catch (Exception e)


Fix member groups and don't add a line at the top

--- src/Umbraco.Web/Editors/MemberController.cs
+++ src/Umbraco.Web/Editors/MemberController.cs
@@ -822,7 +822,6 @@
                 using (var textWriter = new StreamWriter(memoryStream))
                 {
                     var output = JsonConvert.SerializeObject(exportProperties, Formatting.Indented);
-                    textWriter.WriteLine("Member export");
                     textWriter.Write(output);
                     textWriter.Flush();
                 }
@@ -897,6 +896,12 @@
                         CreateDate = null,
                         UpdateDate = null
                     };
+                    if (prop.Name == "Groups")
+                    {
+                        var memberGroups = Roles.GetRolesForUser(owner.Username);
+                        propertyExportModel.Value = memberGroups.ToList();
+                    }
+
                     exportProperties.Add(propertyExportModel);
                 }


Wrap use of httpClient in a usings due to it being IDisposable

--- src/Umbraco.Web/Telemetry/ReportSiteTask.cs
+++ src/Umbraco.Web/Telemetry/ReportSiteTask.cs
@@ -89,19 +89,21 @@
                 _httpClient.BaseAddress = new Uri("https://telemetry.rainbowsrock.net/");
 #endif

-                _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json");
-                var postData = new TelemetryReportData { Id = telemetrySiteIdentifier, Version = UmbracoVersion.SemanticVersion.ToSemanticString() };
-                var request = new HttpRequestMessage(HttpMethod.Post, "installs/");
-                request.Content = new StringContent(JsonConvert.SerializeObject(postData), Encoding.UTF8, "application/json"); //CONTENT-TYPE header
+                using (_httpClient)
+                {
+                    _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json");
+                    var postData = new TelemetryReportData { Id = telemetrySiteIdentifier, Version = UmbracoVersion.SemanticVersion.ToSemanticString() };
+                    var request = new HttpRequestMessage(HttpMethod.Post, "installs/");
+                    request.Content = new StringContent(JsonConvert.SerializeObject(postData), Encoding.UTF8, "application/json"); //CONTENT-TYPE header

-                // Set a low timeout - no need to use a larger default timeout for this POST request
-                _httpClient.Timeout = new TimeSpan(0,0,1);
+                    // Set a low timeout - no need to use a larger default timeout for this POST request
+                    _httpClient.Timeout = new TimeSpan(0, 0, 1);

-                // Make a HTTP Post to telemetry service
-                // https://telemetry.umbraco.com/installs/
-                // Fire & Forget, do not need to know if its a 200, 500 etc
-                var result = await _httpClient.SendAsync(request);
-
+                    // Make a HTTP Post to telemetry service
+                    // https://telemetry.umbraco.com/installs/
+                    // Fire & Forget, do not need to know if its a 200, 500 etc
+                    var result = await _httpClient.SendAsync(request);
+                }
             }
             catch
             {


Using BackupLogger to backup Utils.Log messages in DEBUG mode.


Log exceptions with info logging level

Log exceptions with info logging level

--- src/app/SharpBrake/AirbrakeNoticeBuilder.cs
+++ src/app/SharpBrake/AirbrakeNoticeBuilder.cs
@@ -155,7 +155,7 @@
             if (exception == null)
                 throw new ArgumentNullException("exception");

-            this.log.Debug(f => f("{0}.Notice({1})", GetType(), exception.GetType()), exception);
+            this.log.Info(f => f("{0}.Notice({1})", GetType(), exception.GetType()), exception);

             AirbrakeError error = ErrorFromException(exception);


class CFHeaderRecord is derived from StandardRecord

git-svn-id: c2c5d07e262ed50e40b747c12a6c75ebdd83f29b@247 3d0cb27c-5942-9f1f-b0c8-b51bd5f61ba7

--- main/HSSF/Record/CFHeaderRecord.cs
+++ main/HSSF/Record/CFHeaderRecord.cs
@@ -24,13 +24,14 @@
     using NPOI.HSSF.Record.CF;
     using NPOI.HSSF.Util;
     using NPOI.SS.Util;
+    using NPOI.Util.IO;

     /**
      * Conditional Formatting Header record (CFHEADER)
      *
      * @author Dmitriy Kumshayev
      */
-    public class CFHeaderRecord : Record
+    public class CFHeaderRecord : StandardRecord
     {
         public const short sid = 0x1B0;

@@ -136,7 +137,7 @@
             return buffer.ToString();
         }

-        private int DataSize
+        protected override int DataSize
         {
             get
             {
@@ -146,26 +147,12 @@
             }
         }

-        /**
-         * @return byte array containing instance data
-         */
-
-        public override int Serialize(int offset, byte[] data)
+        public override void Serialize(LittleEndianOutput out1)
         {
-            int dataSize = DataSize;
-
-            LittleEndian.PutUShort(data, 0 + offset, sid);
-            LittleEndian.PutUShort(data, 2 + offset, dataSize);
-            LittleEndian.PutUShort(data, 4 + offset, field_1_numcf);
-            LittleEndian.PutUShort(data, 6 + offset, field_2_need_recalculation);
-            field_3_enclosing_cell_range.Serialize(8 + offset, data);
-            field_4_cell_ranges.Serialize(16 + offset, data);
-            return 4 + dataSize;
-        }
-
-        public override int RecordSize
-        {
-            get { return 4 + DataSize; }
+            out1.WriteShort(field_1_numcf);
+            out1.WriteShort(field_2_need_recalculation);
+            field_3_enclosing_cell_range.Serialize(out1);
+            field_4_cell_ranges.Serialize(out1);
         }


Minor fix with flags

Minor fix with flags

--- source/CoreLib/BoogieVerify.cs
+++ source/CoreLib/BoogieVerify.cs
@@ -142,7 +142,7 @@
                 Debug.Assert(CommandLineOptions.Clo.vcVariety != CommandLineOptions.VCVariety.Doomed);
                 Debug.Assert (CommandLineOptions.Clo.StratifiedInlining > 0);
                 if (options.newStratifiedInlining) {
-                  Microsoft.Boogie.SMTLib.Factory.UseInterpolation = true;
+                  if(options.newStratifiedInliningAlgo.ToLower() == "duality") Microsoft.Boogie.SMTLib.Factory.UseInterpolation = true;
                   vcgen = new CoreLib.StratifiedInlining(program, CommandLineOptions.Clo.SimplifyLogFilePath, CommandLineOptions.Clo.SimplifyLogFileAppend);
                 }
                 else


add startSegment to FtpFolderNameRule

add startSegment to FtpFolderNameRule

--- FluentFTP/Rules/FtpFolderNameRule.cs
+++ FluentFTP/Rules/FtpFolderNameRule.cs
@@ -29,13 +29,20 @@
 		public IList<string> Names;

 		/// <summary>
+		/// Which path segment to start checking from
+		/// </summary>
+		public int StartSegment;
+
+		/// <summary>
 		/// Only accept folders that have the given name, or exclude folders of a given name.
 		/// </summary>
 		/// <param name="whitelist">If true, only folders of the given name are downloaded. If false, folders of the given name are excluded.</param>
 		/// <param name="names">The folder names to match</param>
-		public FtpFolderNameRule(bool whitelist, IList<string> names) {
+		/// <param name="startSegment">Which path segment to start checking from. 0 checks root folder onwards. 1 skips root folder.</param>
+		public FtpFolderNameRule(bool whitelist, IList<string> names, int startSegment = 0) {
 			this.Whitelist = whitelist;
 			this.Names = names;
+			this.StartSegment = startSegment;
 		}

 		/// <summary>
@@ -58,8 +65,11 @@
 			// check against whitelist or blacklist
 			if (Whitelist) {

-				// whitelist
-				foreach (var dirName in dirNameParts) {
+				// loop thru path segments starting at given index
+				for (int d = StartSegment; d < dirNameParts.Length; d++) {
+					var dirName = dirNameParts[d];
+
+					// whitelist
 					if (Names.Contains(dirName.Trim())) {
 						return true;
 					}
@@ -68,8 +78,11 @@
 			}
 			else {

-				// blacklist
-				foreach (var dirName in dirNameParts) {
+				// loop thru path segments starting at given index
+				for (int d = StartSegment; d < dirNameParts.Length; d++) {
+					var dirName = dirNameParts[d];
+
+					// blacklist
 					if (Names.Contains(dirName.Trim())) {
 						return false;
 					}


Deleted some code that wasn't being used and was causing warnings

Part of a feature for hiding the wireframe outlines on tiles which users of the editor (Dylan) didn't like anyway, plus the method it used was deprecated and was throwing warnings in Unity 5.5

--- Assets/Code/HexTiles/Editor/HexTileMapEditor.cs
+++ Assets/Code/HexTiles/Editor/HexTileMapEditor.cs
@@ -658,8 +658,6 @@
             // Init anim bools
             showTileCoordinateFormat = new AnimBool(Repaint);

-            SetWireframeVisible(hexMap.DrawWireframeWhenSelected);
-
             Initialise();

             Undo.undoRedoPerformed += OnUndoPerformed;
@@ -812,16 +810,5 @@

             public Vector2 Position;
         }
-
-        /// <summary>
-        /// Show or hide wireframe outline of all tiles while the tile map is selected.
-        /// </summary>
-        private void SetWireframeVisible(bool visible)
-        {
-            foreach (var renderer in hexMap.GetComponentsInChildren<Renderer>())
-            {
-                EditorUtility.SetSelectedWireframeHidden(renderer, !visible);
-            }
-        }
     }
 }