Make size_t.Zero a property

Make size_t.Zero a property

--- stdlib-primitives/size_t.cs
+++ stdlib-primitives/size_t.cs
@@ -45,7 +45,7 @@
         /// been initialized to zero.
         /// </summary>
         /// <returns>Zero as a pointer-sized integer.</returns>
-        public static readonly size_t Zero = new size_t((void*)null);
+        public static size_t Zero => new size_t((void*)null);

         /// <summary>
         /// Converts this value to a 32-bit unsigned integer.


fixed sprite tests

fixed sprite tests

--- tests/tests/classes/tests/SpriteTest/SpriteTestDemo.cs
+++ tests/tests/classes/tests/SpriteTest/SpriteTestDemo.cs
@@ -56,22 +56,19 @@
             AddChild(menu, 1);
         }

-        public override void OnExit()
-        {
-            base.OnExit();
-            CCSpriteFrameCache.PurgeSharedSpriteFrameCache();
-        }
-
         public void restartCallback(object pSender)
         {
+            ClearCaches();
+
             CCScene s = new SpriteTestScene();
             s.AddChild(SpriteTestScene.restartSpriteTestAction());
-
             CCDirector.SharedDirector.ReplaceScene(s);
         }

         public void nextCallback(object pSender)
         {
+            ClearCaches();
+
             CCScene s = new SpriteTestScene();
             s.AddChild(SpriteTestScene.nextSpriteTestAction());
             CCDirector.SharedDirector.ReplaceScene(s);
@@ -79,9 +76,17 @@

         public void backCallback(object pSender)
         {
+            ClearCaches();
+
             CCScene s = new SpriteTestScene();
             s.AddChild(SpriteTestScene.backSpriteTestAction());
             CCDirector.SharedDirector.ReplaceScene(s);
         }
+
+        private void ClearCaches()
+        {
+            CCSpriteFrameCache.PurgeSharedSpriteFrameCache();
+            CCTextureCache.PurgeSharedTextureCache();
+        }
     }
 }


Calculate CRC during encoding

Calculate CRC during encoding

--- master/7zip/ArchiveWriter.cs
+++ master/7zip/ArchiveWriter.cs
@@ -471,7 +471,7 @@
                 if(disposing && mEncoder != null)
                 {
                     mEncoder = null;
-                    mCRC = ~mCRC;
+                    mCRC = CRC.Finish(mCRC);
                 }

                 base.Dispose(disposing);
@@ -531,6 +531,7 @@
                 if(count < 0 || count > buffer.Length - offset)
                     throw new ArgumentOutOfRangeException("count");

+                mCRC = CRC.Update(mCRC, buffer, offset, count);
                 mStreamSize += count;

                 mEncoder.WriteInput(buffer, offset, count);
@@ -539,6 +540,8 @@
             internal void Close(FileEntry file)
             {
                 Close();
+
+                Debug.Assert(mEncoder == null); // otherwise the CRC hasn't been finished

                 file.Hash = mCRC;
                 file.Size = mStreamSize;


Easier way to check if the metric is Empty

--- Metric.cs
+++ Metric.cs
@@ -71,7 +71,7 @@

         public float cost { get; set; }

-        public bool Empty => bounds_volume.Equals(0) && bounds_area.Equals(0);
+        public bool Empty => bounds.size.IsZero();

         static Vector3[] local2local(Transform _from, Transform _to, Vector3[] points)
         {


修改HttpDecode的时机引起的解析错误

修改HttpDecode的时机引起的解析错误

--- IngService/Services/IngServices.cs
+++ IngService/Services/IngServices.cs
@@ -77,7 +77,7 @@
                     strHtml = sr.ReadToEnd();
                 }
             }
-            return HttpUtility.HtmlDecode(strHtml);
+            return strHtml;
         }

         public static void CheckLogin(string html)
@@ -214,9 +214,9 @@
                     string strIngId = replyNode.Attributes["href"].Value.Remove(0, "/ing/".Length);
                     strIngId = strIngId.Substring(0, strIngId.Length - 1);
                     //ReplyComment
-                    string strReplyContent = replyNode.InnerHtml;
+                    string strReplyContent = HttpUtility.HtmlDecode(replyNode.InnerHtml);
                     //ReplyMsg
-                    string strReplyMsg = childNode.SelectSingleNode("//span[@class='ing_body']").InnerHtml;
+                    string strReplyMsg = HttpUtility.HtmlDecode(childNode.SelectSingleNode("//span[@class='ing_body']").InnerHtml);
                     //ReplyTime
                     string strReplyTime = childNode.SelectSingleNode("//a[@class='ing_time']").Attributes["title"].Value;

@@ -291,7 +291,7 @@
                     {
                         Segment segment = new Segment();
                         segment.Type = SegmentType.Text;
-                        segment.Text = currNode.InnerHtml.Trim();
+                        segment.Text = HttpUtility.HtmlDecode(currNode.InnerHtml.Trim());
                         if (!string.IsNullOrEmpty(segment.Text))
                             listReplyContent.Add(segment);
                     }
@@ -299,7 +299,7 @@
                     {
                         SegmentUrl segmentUrl = new SegmentUrl();
                         segmentUrl.Type = SegmentType.Link;
-                        segmentUrl.Text = currNode.InnerHtml.Trim();
+                        segmentUrl.Text = HttpUtility.HtmlDecode(currNode.InnerHtml.Trim());
                         segmentUrl.Url = currNode.Attributes["href"].Value;
                         listReplyContent.Add(segmentUrl);
                     }
@@ -318,7 +318,7 @@
                 }

                 //replyTime
-                string strReplyTime = childNode.SelectSingleNode("//a[@class='ing_comment_time']").InnerHtml;
+                string strReplyTime = HttpUtility.HtmlDecode(childNode.SelectSingleNode("//a[@class='ing_comment_time']").InnerHtml);

                 IngComment comment = new IngComment()
                 {
@@ -449,14 +449,14 @@
                 {
                     Segment segment = new Segment();
                     segment.Type = SegmentType.Text;
-                    segment.Text = currNode.InnerHtml.Trim();
+                    segment.Text = HttpUtility.HtmlDecode(currNode.InnerHtml.Trim());
                     if (!string.IsNullOrEmpty(segment.Text))
                         list.Add(segment);
                 }
                 if (currNode.NodeType == HtmlNodeType.Element && currNode.Name == "a")
                 {
                     string strHref = currNode.Attributes["href"].Value;
-                    string strText = currNode.InnerHtml.Trim();
+                    string strText = HttpUtility.HtmlDecode(currNode.InnerHtml.Trim());
                     if (strHref.StartsWith("/ing/tag/"))
                     {
                         //标签


Removed unneccessary link in view all page

Removed the link allowing users to create a review from the view all page.

--- Inspicio/Views/Images/Index.cshtml
+++ Inspicio/Views/Images/Index.cshtml
@@ -4,9 +4,6 @@

View All Reviews

-

-    Create Review
-

     <input type="text" id="myInput" placeholder="Search for reviews..">


LUCENENET-122: Bug in function "SupportClass.Number.ToString(long number)"

git-svn-id: 6c68d65edd5507bf6b37474e0d155329cbeeff2a@677443 13f79535-47bb-0310-9956-ffa450edef68

--- C#/src/Lucene.Net/SupportClass.cs
+++ C#/src/Lucene.Net/SupportClass.cs
@@ -362,7 +362,7 @@
                 while (number > 0)
                 {
                     char c = digits[(int)number % 36];
-                    s.Append(c);
+                    s.Insert(0, c);
                     number = number / 36;
                 }
             }


Fixed the Euclidean GCD program

Fixed the Euclidean GCD program

--- C#1/Loops/EuclideanGCD/Program.cs
+++ C#1/Loops/EuclideanGCD/Program.cs
@@ -10,6 +10,35 @@

 class EuclideanGCD
 {
+    static int GCD (int first, int second)
+    {
+        int biggerNumber;
+        int nextNumber;
+        int remainder;
+        int temp;
+
+        if(first > second)
+        {
+            biggerNumber = first;
+            nextNumber = second;
+        }
+        else
+        {
+            biggerNumber = second;
+            nextNumber = first;
+        }
+
+        remainder = biggerNumber % nextNumber;
+        while(remainder != 0)
+        {
+            temp = nextNumber;
+            nextNumber = biggerNumber % nextNumber;
+            biggerNumber = temp;
+            remainder = biggerNumber % nextNumber;
+        }
+
+        return nextNumber;
+    }
     static void Main()
     {
         Console.Write ("Enter the first integer: ");
@@ -18,54 +47,6 @@
         Console.Write("Enter the second integer: ");
         int secondNumber = int.Parse(Console.ReadLine());

-        int firstRemainder = 0;
-        int remainder = 0;
-
-        if (firstNumber > secondNumber)
-        {
-            firstRemainder = firstNumber % secondNumber;
-
-            if (firstRemainder == 0)
-            {
-                Console.WriteLine("Numbers are equal so the GCD is: {0}", firstNumber);
-                return;
-            }
-
-            remainder = secondNumber % firstRemainder;
-            while (true)
-            {
-
-                if (remainder == 0)
-                {
-                    break;
-                }
-                firstRemainder = remainder;
-                remainder = firstRemainder % remainder;
-            }
-        }
-        else
-        {
-            firstRemainder = secondNumber % firstNumber;
-
-            if (firstRemainder == 0)
-            {
-                Console.WriteLine("Numbers are equal so the GCD is: {0}", firstNumber);
-                return;
-            }
-
-            remainder = firstNumber % firstRemainder;
-            while (true)
-            {
-
-                if (remainder == 0)
-                {
-                    break;
-                }
-                firstRemainder = remainder;
-                remainder = firstRemainder % remainder;
-            }
-        }
-
-        Console.WriteLine("The GCD is: {0}", firstRemainder);
+        Console.WriteLine("The GCD is: {0}", GCD (firstNumber, secondNumber));
     }
 }


Add missing test for CSharp

Add missing test for CSharp

--- CSharp/Parrot.Tests/ParrotTest.cs
+++ CSharp/Parrot.Tests/ParrotTest.cs
@@ -22,6 +22,7 @@
         public void GetSpeedNorwegianBlueParrot_not_nailed_high_voltage()
         {
             var parrot = new Parrot(ParrotTypeEnum.NORWEGIAN_BLUE, 0, 4, false);
+            Assert.Equal(24.0, parrot.GetSpeed());
         }

         [Fact]


Added public constructor to Image class

Added public constructor to Image class

--- CSharpGameLibrary/Vulkan/Image.cs
+++ CSharpGameLibrary/Vulkan/Image.cs
@@ -3,7 +3,18 @@

 namespace CSGL.Vulkan {
     public class ImageCreateInfo {
-
+        public VkImageCreateFlags flags;
+        public VkImageType imageType;
+        public VkFormat format;
+        public VkExtent3D extent;
+        public uint mipLevels;
+        public uint arrayLayers;
+        public VkSampleCountFlags samples;
+        public VkImageTiling tiling;
+        public VkImageUsageFlags usage;
+        public VkSharingMode sharingMode;
+        public uint[] queueFamilyIndices;
+        public VkImageLayout initialLayout;
     }

     public class Image : IDisposable, INative<VkImage> {
@@ -23,9 +34,38 @@
             this.image = image;
         }

-        //public Image(Device device, ImageCreateInfo info) {
-        //    Device = device;
-        //}
+        public Image(Device device, ImageCreateInfo info) {
+            if (device == null) throw new ArgumentNullException(nameof(device));
+            Device = device;
+        }
+
+        void CreateImage(ImageCreateInfo mInfo) {
+            var info = new VkImageCreateInfo();
+            info.sType = VkStructureType.StructureTypeImageCreateInfo;
+            info.flags = mInfo.flags;
+            info.imageType = mInfo.imageType;
+            info.format = mInfo.format;
+            info.extent = mInfo.extent;
+            info.mipLevels = mInfo.mipLevels;
+            info.arrayLayers = mInfo.arrayLayers;
+            info.samples = mInfo.samples;
+            info.tiling = mInfo.tiling;
+            info.usage = mInfo.usage;
+            info.sharingMode = mInfo.sharingMode;
+
+            var indicesMarshalled = new PinnedArray<uint>(mInfo.queueFamilyIndices);
+            info.queueFamilyIndexCount = (uint)indicesMarshalled.Length;
+            info.pQueueFamilyIndices = indicesMarshalled.Address;
+            info.initialLayout = mInfo.initialLayout;
+
+            try {
+                var result = Device.Commands.createImage(Device.Native, ref info, Device.Instance.AllocationCallbacks, out image);
+                if (result != VkResult.Success) throw new ImageException(string.Format("Error creating image: {0}", result));
+            }
+            finally {
+                indicesMarshalled.Dispose();
+            }
+        }

         public void Dispose() {
             if (disposed) return;
@@ -33,4 +73,8 @@
             disposed = true;
         }
     }
+
+    public class ImageException : Exception {
+        public ImageException(string message) : base(message) { }
+    }
 }


uncomment MemoryLeakingHashMapTest

uncomment MemoryLeakingHashMapTest

--- CoAP.Test/MemoryLeakingMapTest.cs
+++ CoAP.Test/MemoryLeakingMapTest.cs
@@ -96,13 +96,13 @@
         [TestMethod]
         public void TestServer()
         {
-            //TestSimpleNONGet(UriFor(PIGGY));
-
-            //TestSimpleGet(UriFor(PIGGY));
-            //TestSimpleGet(UriFor(SEPARATE));
-
-            //TestBlockwise(UriFor(PIGGY));
-            //TestBlockwise(UriFor(SEPARATE));
+            TestSimpleNONGet(UriFor(PIGGY));
+
+            TestSimpleGet(UriFor(PIGGY));
+            TestSimpleGet(UriFor(SEPARATE));
+
+            TestBlockwise(UriFor(PIGGY));
+            TestBlockwise(UriFor(SEPARATE));

             TestObserve(UriFor(PIGGY));
         }
@@ -188,7 +188,7 @@
             }, reason => Assert.Fail(reason.ToString()));

             // Wait until we have received all the notifications and canceled the relation
-            Thread.Sleep(HOW_MANY_NOTIFICATION_WE_WAIT_FOR * OBS_NOTIFICATION_INTERVALL + 100000);
+            Thread.Sleep(HOW_MANY_NOTIFICATION_WE_WAIT_FOR * OBS_NOTIFICATION_INTERVALL + 3000);

             Boolean success = mre.WaitOne(100);
             Assert.IsTrue(success, "Client has not received all expected responses");


Add handling for DataCode

Add handling for DataCode

--- Database/Editor/EditorDataCode.cs
+++ Database/Editor/EditorDataCode.cs
@@ -28,8 +28,10 @@
                 }
             } else {
                 DataHelper helper;
-                EditorLSDatabaseWindow.Window.DatabaseEditor.DataHelpers.TryGetValue (dca.TargetDataName, out helper);
-                if (helper != null) {
+                if (!EditorLSDatabaseWindow.Window.DatabaseEditor.DataHelpers.TryGetValue (dca.TargetDataName, out helper)) {
+                    Debug.LogError("Data code '" + dca.TargetDataName + "' was not found in the current database");
+                }
+                else {
                     DataItem[] data = helper.Data;
                     GUIContent[] dataContents = new GUIContent[data.Length];
                     if (property.isArray && property.type != "string") {


too short password flag add

too short password flag add

--- Dub/Dub.Web.Core/ApiStatusCode.cs
+++ Dub/Dub.Web.Core/ApiStatusCode.cs
@@ -119,5 +119,10 @@
         /// Idicating an email is already used from another user.
         /// </summary>
         EmailAlreadyUsed = RangeAccount + 16,
+
+        /// <summary>
+        /// Idicating a password  is too short.
+        /// </summary>
+        PasswordTooShort = RangeAccount + 17,
     }
 }


Restore now treats filenames as "search in any folder", just as list does

--- Duplicati/CommandLine/Commands.cs
+++ Duplicati/CommandLine/Commands.cs
@@ -297,6 +297,11 @@

             bool controlFiles = Library.Utility.Utility.ParseBoolOption(options, "control-files");
             options.Remove("control-files");
+
+            // Prefix all filenames with "*/" so we search all folders
+            for (var ix = 0; ix < args.Count; ix++)
+                if (args[ix].IndexOfAny(new char[] { '*', '?', System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar }) < 0 && !args[ix].StartsWith("["))
+                    args[ix] = "*" + System.IO.Path.DirectorySeparatorChar.ToString() + args[ix];

             var output = new ConsoleOutput(options);
             output.MessageEvent(string.Format("Restore started at {0}", DateTime.Now));


Use GetRequestContext to get the context and only add routedata not available

--- EPi.Libraries.Forms/MvcUtility.cs
+++ EPi.Libraries.Forms/MvcUtility.cs
@@ -28,6 +28,7 @@

     using EPiServer.Forms.Controllers;
     using EPiServer.Logging;
+    using EPiServer.Web.Routing;

     /// <summary>
     ///     Class MvcUtility.
@@ -52,18 +53,24 @@
                 IControllerFactory factory = DependencyResolver.Current.GetService<IControllerFactory>()
                                              ?? new DefaultControllerFactory();

-                HttpContextBase httpContextBase = new HttpContextWrapper(HttpContext.Current);
+                RequestContext requestContext = HttpContext.Current.GetRequestContext();

-                RouteData routeData = new RouteData();
-                routeData.Values.Add("controller", "FormContainerBlock");
-                routeData.Values.Add("action", "Index");
+                RouteData routeData = requestContext.RouteData ?? new RouteData();

-                RequestContext requestContext = new RequestContext(httpContextBase, routeData);
+                if (!routeData.Values.ContainsKey("controller"))
+                {
+                    routeData.Values.Add("controller", "FormContainerBlock");
+                }
+
+                if (!routeData.Values.ContainsKey("action"))
+                {
+                    routeData.Values.Add("action", "Index");
+                }

                 FormContainerBlockController controller =
                     factory.CreateController(requestContext, "FormContainerBlock") as FormContainerBlockController;

-                ControllerContext newContext = new ControllerContext(httpContextBase, routeData, controller);
+                ControllerContext newContext = new ControllerContext(requestContext.HttpContext, routeData, controller);
                 if (controller != null)
                 {
                     controller.ControllerContext = newContext;


Update wallet balance endpoint.

Update wallet balance endpoint.

--- ESISharp/Path/Character/Wallet.cs
+++ ESISharp/Path/Character/Wallet.cs
@@ -12,13 +12,13 @@
             EasyObject = EasyEve;
         }

-        /// Get Character's wallets and balances
+        /// Get Character's wallet balance
         /// <remarks>Requires SSO Authentication, using "read_character_wallet" scope</remarks>
         /// <param name="CharacterID">(Int32) Character ID</param>
         /// <returns>EsiRequest</returns>
-        public EsiRequest GetWallets(int CharacterID)
+        public EsiRequest GetWalletBalance(int CharacterID)
         {
-            var Path = $"/characters/{CharacterID.ToString()}/wallets/";
+            var Path = $"/characters/{CharacterID.ToString()}/wallet/";
             return new EsiRequest(EasyObject, Path, EsiWebMethod.AuthGet);
         }
     }


Crashing will now exit with code 0.

Crashing will now exit with code 0.

--- EmotionCore/src/Engine/Context.cs
+++ EmotionCore/src/Engine/Context.cs
@@ -314,7 +314,7 @@
         public static void Crash()
         {
             Log?.Dispose();
-            Environment.Exit(1);
+            Environment.Exit(0);
         }

         #endregion


Updated namespace to match project name

Updated namespace to match project name

--- EmptyWebApiProject/Global.asax.cs
+++ EmptyWebApiProject/Global.asax.cs
@@ -2,7 +2,7 @@
 using System.Web.Http;
 using System.Web.Mvc;

-namespace EmptyWebApiTemplateProject
+namespace EmptyWebApiProject
 {
     // Note: For instructions on enabling IIS6 or IIS7 classic mode,
     // visit http://go.microsoft.com/?LinkId=9394801


Address feedback

Address feedback

--- src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs
+++ src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs
@@ -139,7 +139,7 @@

 #if FEATURE_COMINTEROP_APARTMENT_SUPPORT
         [SecurityCritical]  // auto-generated
-        protected bool SetApartmentStateHelper(ApartmentState state, bool fireMDAOnMismatch)
+        internal bool SetApartmentStateHelper(ApartmentState state, bool fireMDAOnMismatch)
         {
             ApartmentState retState = (ApartmentState)SetApartmentStateNative((int)state, fireMDAOnMismatch);

@@ -158,11 +158,11 @@

         [SecurityCritical]  // auto-generated
         [MethodImplAttribute(MethodImplOptions.InternalCall)]
-        protected extern int GetApartmentStateNative();
-
-        [SecurityCritical]  // auto-generated
-        [MethodImplAttribute(MethodImplOptions.InternalCall)]
-        protected extern int SetApartmentStateNative(int state, bool fireMDAOnMismatch);
+        internal extern int GetApartmentStateNative();
+
+        [SecurityCritical]  // auto-generated
+        [MethodImplAttribute(MethodImplOptions.InternalCall)]
+        internal extern int SetApartmentStateNative(int state, bool fireMDAOnMismatch);
 #endif // FEATURE_COMINTEROP_APARTMENT_SUPPORT

         /*=========================================================================


Update summaries in AutoSaveTextFile{TUpdate}.

--- Eutherion/Win/AutoSaveTextFile.cs
+++ Eutherion/Win/AutoSaveTextFile.cs
@@ -153,12 +153,12 @@
         private readonly Task autoSaveBackgroundTask;

         /// <summary>
-        /// Flag to make sure autoSaveBackgroundTask is cancelled at most once.
+        /// Gets if this <see cref="AutoSaveTextFile{TUpdate}"/> is disposed.
         /// </summary>
         private bool isDisposed;

         /// <summary>
-        /// Initializes a new instance of <see cref="AutoSaveTextFile"/>.
+        /// Initializes a new instance of <see cref="AutoSaveTextFile{TUpdate}"/>.
         /// </summary>
         /// <param name="remoteState">
         /// Object responsible for converting updates to text.
@@ -166,7 +166,7 @@
         /// <param name="autoSaveFiles">
         /// The <see cref="FileStreamPair"/> containing <see cref="FileStream"/>s to write to.
         /// Any existing contents in the files will be overwritten.
-        /// <see cref="AutoSaveTextFile"/> assumes ownership of the <see cref="FileStream"/>s
+        /// <see cref="AutoSaveTextFile{TUpdate}"/> assumes ownership of the <see cref="FileStream"/>s
         /// so it takes care of disposing it after use.
         /// To be used as an auto-save <see cref="FileStream"/>,
         /// it must support seeking, reading and writing, and not be able to time out.


Re-order things.

Re-order things.

--- osu.Framework/Graphics/Drawable.cs
+++ osu.Framework/Graphics/Drawable.cs
@@ -1779,7 +1779,11 @@
             FadeIn();
         }

-
+        /// <summary>
+        /// The time to use for starting transforms which support <see cref="Delay(double, bool)"/>
+        /// </summary>
+        protected double TransformStartTime => Clock != null ? Time.Current + transformDelay : 0;
+
         protected void TransformTo<T>(T startValue, T newValue, double duration, EasingTypes easing, Transform<T> transform) where T : IEquatable<T>
         {
             Type type = transform.GetType();
@@ -1817,6 +1821,32 @@
             addTransform(transform);
         }

+        private void addTransform(ITransform transform)
+        {
+            if (Clock == null)
+            {
+                transform.UpdateTime(new FrameTimeInfo { Current = transform.EndTime });
+                transform.Apply(this);
+                return;
+            }
+
+            //we have no duration and do not need to be delayed, so we can just apply ourselves and be gone.
+            bool canApplyInstant = transform.Duration == 0 && transformDelay == 0;
+
+            //we should also immediately apply any transforms that have already started to avoid potentially applying them one frame too late.
+            if (canApplyInstant || transform.StartTime < Time.Current)
+            {
+                transform.UpdateTime(Time);
+                transform.Apply(this);
+                if (canApplyInstant)
+                    return;
+            }
+
+            Transforms.Add(transform);
+        }
+
+        #region Helpers
+
         public void FadeIn(double duration = 0, EasingTypes easing = EasingTypes.None)
         {
             FadeTo(1, duration, easing);
@@ -1838,8 +1868,6 @@
             FadeTo(1);
             FadeOut(duration, easing);
         }
-
-        #region Float-based helpers

         public void FadeTo(float newAlpha, double duration = 0, EasingTypes easing = EasingTypes.None)
         {
@@ -1874,10 +1902,6 @@
             TransformTo(Position.Y, destination, duration, easing, new TransformPositionY());
         }

-        #endregion
-
-        #region Vector2-based helpers
-
         public void ScaleTo(float newScale, double duration = 0, EasingTypes easing = EasingTypes.None)
         {
             TransformTo(Scale, new Vector2(newScale), duration, easing, new TransformScale());
@@ -1907,15 +1931,6 @@
         {
             MoveTo((Transforms.FindLast(t => t is TransformPosition) as TransformPosition)?.EndValue ?? Position + offset, duration, easing);
         }
-
-        #endregion
-
-        /// <summary>
-        /// The time to use for starting transforms which support <see cref="Delay(double, bool)"/>
-        /// </summary>
-        protected double TransformStartTime => Clock != null ? Time.Current + transformDelay : 0;
-
-        #region Color4-based helpers

         public void FadeColour(SRGBColour newColour, double duration = 0, EasingTypes easing = EasingTypes.None)
         {
@@ -1930,30 +1945,6 @@

             FadeColour(flashColour);
             FadeColour(endValue, duration, easing);
-        }
-
-        private void addTransform(ITransform transform)
-        {
-            if (Clock == null)
-            {
-                transform.UpdateTime(new FrameTimeInfo { Current = transform.EndTime });
-                transform.Apply(this);
-                return;
-            }
-
-            //we have no duration and do not need to be delayed, so we can just apply ourselves and be gone.
-            bool canApplyInstant = transform.Duration == 0 && transformDelay == 0;
-
-            //we should also immediately apply any transforms that have already started to avoid potentially applying them one frame too late.
-            if (canApplyInstant || transform.StartTime < Time.Current)
-            {
-                transform.UpdateTime(Time);
-                transform.Apply(this);
-                if (canApplyInstant)
-                    return;
-            }
-
-            Transforms.Add(transform);
         }

         #endregion


Create disposal actions ahead of time in async load portion

--- osu.Framework/Graphics/Drawable.cs
+++ osu.Framework/Graphics/Drawable.cs
@@ -116,25 +116,25 @@

         internal virtual void UnbindAllBindables() => unbindAllBindables();

-        /// <summary>
-        /// Unbinds all <see cref="Bindable{T}"/>s stored as fields or properties in this <see cref="Drawable"/>.
-        /// </summary>
-        private void unbindAllBindables()
-        {
+        private List<Action<object>> unbindActions;
+
+        private void prepareUnbindActions()
+        {
+            Trace.Assert(unbindActions == null);
+
+            unbindActions = new List<Action<object>>();
             Type type = GetType();
+
             do
             {
-                unbind(type);
+                unbindActions.Add(createUnbindAction(type));
                 type = type.BaseType;
             } while (type != null && type != typeof(object));

-            void unbind(Type targetType)
+            Action<object> createUnbindAction(Type targetType)
             {
                 if (unbind_action_cache.TryGetValue(targetType, out var existing))
-                {
-                    existing(this);
-                    return;
-                }
+                    return existing;

                 // List containing all the delegates to perform the unbinds
                 var actions = new List<Action<object>>();
@@ -149,8 +149,7 @@
                                            .Where(p => typeof(IUnbindable).IsAssignableFrom(p.PropertyType))
                                            .Select(p => new Action<object>(target => ((IUnbindable)p.GetValue(target))?.UnbindAll())));

-                unbind_action_cache[targetType] = performUnbind;
-                performUnbind(this);
+                return unbind_action_cache[targetType] = performUnbind;

                 void performUnbind(object target)
                 {
@@ -169,6 +168,18 @@
             }
         }

+        /// <summary>
+        /// Unbinds all <see cref="Bindable{T}"/>s stored as fields or properties in this <see cref="Drawable"/>.
+        /// </summary>
+        private void unbindAllBindables()
+        {
+            if (unbindActions == null)
+           return;
+
+            foreach (var a in unbindActions)
+                a.Invoke(this);
+        }
+
         #endregion

         #region Loading
@@ -242,6 +253,8 @@
             RequestsPositionalInputSubTree = RequestsPositionalInput;

             InjectDependencies(dependencies);
+
+            prepareUnbindActions();

             LoadAsyncComplete();


Modified   KodiLuncher/Sources/ContextMenu.cs

--- KodiLuncher/Sources/ContextMenu.cs
+++ KodiLuncher/Sources/ContextMenu.cs
@@ -48,18 +48,18 @@
             item.Image = KodiLuncher.Properties.Resources.Settings.ToBitmap();
             menu.Items.Add(item);

-            // About.
+            // About
             item = new ToolStripMenuItem();
             item.Text = "About";
             item.Image = KodiLuncher.Properties.Resources.StatusHelp.ToBitmap();
             item.Click += new EventHandler(About_Click);
             menu.Items.Add(item);

-            // Separator.
+            // Separator
             sep = new ToolStripSeparator();
             menu.Items.Add(sep);

-            // Exit.
+            // Exit
             item = new ToolStripMenuItem();
             item.Text = "Exit";
             item.Click += new System.EventHandler(Exit_Click);


better arming/disarming

better arming/disarming

--- LaunchPad2/ViewModels/ViewModel.cs
+++ LaunchPad2/ViewModels/ViewModel.cs
@@ -524,8 +524,13 @@

             try
             {
-                var nodes = EnabledNodes.Where(node => node.DiscoveryState == NodeDiscoveryState.Discovered);
-                await Task.WhenAll(nodes.Select(Arm));
+                var broadcast = new NodeAddress(LongAddress.Broadcast);
+                await NetworkController.Arm(broadcast);
+
+                foreach (var nodeViewModel in Nodes)
+                {
+                    nodeViewModel.IsArmed = true;
+                }
             }
             catch (Exception e)
             {
@@ -536,30 +541,20 @@
                 IsNetworkArming = false;
             }
         }
-
-        private static async Task Arm(NodeViewModel node)
-        {
+
+        public async Task Disarm()
+        {
+            IsNetworkArming = true;
+
             try
             {
-                await NetworkController.Arm(new NodeAddress(node.Address));
-                node.IsArmed = true;
-            }
-            catch (InvalidOperationException)
-            {
-            }
-            catch (TimeoutException)
-            {
-            }
-        }
-
-        public async Task Disarm()
-        {
-            IsNetworkArming = true;
-
-            try
-            {
-                var nodes = EnabledNodes.Where(node => node.DiscoveryState == NodeDiscoveryState.Discovered);
-                await Task.WhenAll(nodes.Select(Disarm));
+                var broadcast = new NodeAddress(LongAddress.Broadcast);
+                await NetworkController.Disarm(broadcast);
+
+                foreach (var nodeViewModel in Nodes)
+                {
+                    nodeViewModel.IsArmed = false;
+                }
             }
             catch (Exception e)
             {
@@ -568,21 +563,6 @@
             finally
             {
                 IsNetworkArming = false;
-            }
-        }
-
-        private static async Task Disarm(NodeViewModel node)
-        {
-            try
-            {
-                await NetworkController.Disarm(new NodeAddress(node.Address));
-                node.IsArmed = false;
-            }
-            catch (InvalidOperationException)
-            {
-            }
-            catch (TimeoutException)
-            {
             }
         }

@@ -1291,6 +1271,8 @@

             try
             {
+                await Disarm();
+
                 await NetworkController.DiscoverNetworkAsync();
                 NetworkDiscoveryState = NetworkDiscoveryState.Discovered;
             }


* adapted AssemblyInfo of unit test project

--- code/UI/UWP/test_RYB/Properties/AssemblyInfo.cs
+++ code/UI/UWP/test_RYB/Properties/AssemblyInfo.cs
@@ -1,19 +1,18 @@
 using System.Reflection;
-using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;

 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("test_RYB")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("test_RYB")]
-[assembly: AssemblyCopyright("Copyright ©  2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: AssemblyMetadata("TargetPlatform","UAP")]
+[assembly: AssemblyTitle( "test_RYB" )]
+[assembly: AssemblyDescription( "" )]
+[assembly: AssemblyConfiguration( "" )]
+[assembly: AssemblyCompany( "" )]
+[assembly: AssemblyProduct( "RYB" )]
+[assembly: AssemblyCopyright( "Copyright © XElement 2017" )]
+[assembly: AssemblyTrademark( "" )]
+[assembly: AssemblyCulture( "" )]
+[assembly: AssemblyMetadata( "TargetPlatform", "UAP" )]

 // Version information for an assembly consists of the following four values:
 //
@@ -25,6 +24,6 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: ComVisible(false)]+[assembly: AssemblyVersion( "0.0.0.0" )]
+[assembly: AssemblyFileVersion( "0.0.0.0" )]
+[assembly: ComVisible( false )]


Fix bson reader wrong cache CString buffer

--- LiteDB/Document/Bson/BsonReader.cs
+++ LiteDB/Document/Bson/BsonReader.cs
@@ -155,21 +155,19 @@
             return Encoding.UTF8.GetString(bytes, 0, length - 1);
         }

-        // use byte array buffer for CString (key-only)
-        private byte[] _strBuffer = new byte[1000];
-
         private string ReadCString(ByteReader reader)
         {
             var pos = 0;
+            var buffer = new byte[200];

             while (true)
             {
-                byte buf = reader.ReadByte();
-                if (buf == 0x00) break;
-                _strBuffer[pos++] = buf;
+                var data = reader.ReadByte();
+                if (data == 0x00 || pos == 200) break;
+                buffer[pos++] = data;
             }

-            return Encoding.UTF8.GetString(_strBuffer, 0, pos);
+            return Encoding.UTF8.GetString(buffer, 0, pos);
         }
     }
 }


Update ParamGenerator.cs

Update ParamGenerator.cs

--- LogicAppTemplate/ParamGenerator.cs
+++ LogicAppTemplate/ParamGenerator.cs
@@ -26,6 +26,9 @@
             HelpMessage = "How to handle KeyVault integration, default is None, available options None or Static, Static will generate parameters for static reference to KeyVault"
             )]
         public KeyVaultUsage KeyVault = KeyVaultUsage.None;
+
+        [Parameter(Mandatory = false, HelpMessage = "If true, the default value for the parameters will be cleared")]
+        public SwitchParameter ClearParameterValues;

         public enum KeyVaultUsage
         {
@@ -75,6 +78,10 @@
                     k.secretName = param.Name;
                     obj["reference"] = JObject.FromObject(k);
                 }
+                else if (ClearParameterValues)
+                {
+                    obj["value"] = string.Empty;
+                }
                 else {
                     obj["value"] = logicAppTemplate["parameters"][param.Name]["defaultValue"];
                 }


Simplified the SmtpDataFilter logic

Simplified the SmtpDataFilter logic

--- MailKit/Net/Smtp/SmtpDataFilter.cs
+++ MailKit/Net/Smtp/SmtpDataFilter.cs
@@ -23,8 +23,6 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 //
-
-using System;

 using MimeKit.IO.Filters;

@@ -59,10 +57,8 @@
 				if (c == (byte) '.' && escape) {
 					escape = false;
 					ndots++;
-				} else if (c == (byte) '\n') {
-					escape = true;
 				} else {
-					escape = false;
+					escape = c == (byte) '\n';
 				}
 			}

@@ -74,15 +70,12 @@

 				if (c == (byte) '.' && bol) {
 					OutputBuffer[index++] = (byte) '.';
-					OutputBuffer[index++] = (byte) '.';
 					bol = false;
-				} else if (c == (byte) '\n') {
-					OutputBuffer[index++] = (byte) '\n';
-					bol = true;
 				} else {
-					OutputBuffer[index++] = c;
-					bol = false;
+					bol = c == (byte) '\n';
 				}
+
+				OutputBuffer[index++] = c;
 			}

 			outputLength = index;


Bumped Assembly version to 2.1.5 (oops)

Bumped Assembly version to 2.1.5 (oops)

--- MimeKit/Properties/AssemblyInfo.cs
+++ MimeKit/Properties/AssemblyInfo.cs
@@ -80,6 +80,6 @@
 //
 // If there have only been bug fixes, bump the Micro Version and/or the Build Number
 //    in the AssemblyFileVersion attribute.
-[assembly: AssemblyInformationalVersion ("2.1.4.0")]
-[assembly: AssemblyFileVersion ("2.1.4.0")]
+[assembly: AssemblyInformationalVersion ("2.1.5.0")]
+[assembly: AssemblyFileVersion ("2.1.5.0")]
 [assembly: AssemblyVersion ("2.1.0.0")]


Display error text

Display error text

--- Minimart/Views/Shared/Error.cshtml
+++ Minimart/Views/Shared/Error.cshtml
@@ -7,4 +7,5 @@
 <hgroup class="title">

Error.

An error occurred while processing your request.

+
@Model.ToString()

 </hgroup>


some logging for node invoke

some logging for node invoke

--- Node/Node/Workers/InvokeHandler.cs
+++ Node/Node/Workers/InvokeHandler.cs
@@ -1,7 +1,9 @@
 using System;
 using System.Threading;
+using System.Web.Http.Results;
 using Autofac;
 using log4net;
+using Stardust.Node.Helpers;
 using Stardust.Node.Interfaces;

 namespace Stardust.Node.Workers
@@ -26,12 +28,30 @@
 		                   CancellationTokenSource cancellationTokenSource,
 		                   Action<string> progressCallback)
 		{
+
 			var handler =
 				ComponentContext.Resolve(typeof (IHandle<>).MakeGenericType(query.GetType()));
+
+			if (handler == null)
+			{
+				LogHelper.LogErrorWithLineNumber(Logger,
+												   string.Format("The job type [{0}] could not be resolved. The job cannot be started.",
+													   query.GetType()));
+
+				throw new Exception("The handler " + query.GetType() + " could not be resolved");
+			}

 			var method = handler.GetType()
 				.GetMethod("Handle");

+			if (method == null)
+			{
+				LogHelper.LogErrorWithLineNumber(Logger,
+												   string.Format("The method for handler [{0}] could not be found. ",
+													   handler.GetType()));
+
+				throw new Exception("The method 'Handle' for handler " + handler.GetType() + " could not be found");
+			}

 			try //this is to throw right exception and not cause faulted on cancellation
 			{


Removed Test method from ConfigManager

Removed Test method from ConfigManager

--- FameBot/Services/ConfigManager.cs
+++ FameBot/Services/ConfigManager.cs
@@ -12,12 +12,6 @@
 {
     public static class ConfigManager
     {
-        public static void Test()
-        {
-            var cwd = Directory.GetCurrentDirectory();
-            Console.WriteLine(cwd);
-        }
-
         public static Configuration GetConfiguration()
         {
             string path = Directory.GetCurrentDirectory() + "\\Plugins\\famebot_config.xml";


Radial Blur

Radial Blur

--- FusionSamples/DeferredDemo/Sky.cs
+++ FusionSamples/DeferredDemo/Sky.cs
@@ -516,10 +516,28 @@
 			}

 			//Blur
-
 			var filter = Game.GetService<Filter>();

-			filter.RadialBlur(smallerCloudTarget.Surface, cloudTarget, new Vector2(0.5f, 0.5f), 1.0f, -0.05f);
+			filter.RadialBlur(smallerCloudTarget.Surface, cloudTarget, new Vector2(0.5f, 0.5f), 1.0f, -0.2f);
+			//filter.RadialBlur(smallerCloudTarget.Surface, cloudTarget, new Vector2(1, 0), 1.0f, -0.2f);
+
+			//if(Game.InputDevice.IsKeyDown(Keys.LeftButton))
+			//{
+				//Log.Message("" + Game.InputDevice.MousePosition);
+				Vector4 sunProj = Vector4.Transform(new Vector4(sunPos, 0), viewMatrix);
+				sunProj = 	Vector4.Transform(sunProj, projMatrix);
+				sunProj = new Vector4(sunProj.X / sunProj.W, sunProj.Y / sunProj.W, sunProj.Z / sunProj.W, 1);
+				//Log.Message("" + sunProj);
+				Vector2 relSunPosition = new Vector2(0.5f, 0.5f);
+
+				//if ( Math.Abs(sunProj.X ) < 1 && Math.Abs (sunProj.Y) < 1){
+					relSunPosition = new Vector2( (sunProj.X + 1) / 2, - (sunProj.Y - 1) / 2);
+				//}
+
+				//Log.Message(relSunPosition + "");
+				filter.RadialBlur(smallerCloudTarget.Surface, cloudTarget, relSunPosition, 1.0f, -0.2f);
+			//}
+
 			//filter.StretchRect( smallerCloudTarget.Surface, cloudTarget, SamplerState.LinearClamp );

 			#if false


Allow service to start with missing config + new path for config file

--- tcpTrigger/Configuration.cs
+++ tcpTrigger/Configuration.cs
@@ -1,5 +1,4 @@
-using Microsoft.Win32;
-using System;
+using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
@@ -41,50 +40,44 @@
         public string MessageBodyNamePoison { get; private set; }
         public string MessageBodyRogueDhcp { get; private set; }

-        private const string RegistryKey = @"System\CurrentControlSet\services\tcpTrigger";
-        private const string RegistryValue = "ImagePath";
-
         private string GetConfigurationPath()
         {
-            string installPath = string.Empty;
-
-            // Get the install path for the tcpTrigger service from the Window registry.
-            try
-            {
-                using (RegistryKey key = Registry.LocalMachine.OpenSubKey(RegistryKey))
-                {
-                    if (key != null)
-                    {
-                        object value = key.GetValue(RegistryValue);
-                        if (value != null)
-                        {
-                            installPath = Path.GetDirectoryName((value as string).Trim('"'));
-                        }
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                EventLog.WriteEntry(
-                    "tcpTrigger",
-                    $"Failed to start the tcpTrigger service. Error retrieving tcpTrigger installation path from the Windows registry.{Environment.NewLine}{ex.Message}",
-                    EventLogEntryType.Error,
-                    400);
-            }
-
-            return (installPath.Length > 0) ? installPath + @"\tcpTrigger.xml" : string.Empty;
+            // Locate the tcpTrigger.xml configuration file.
+            // First check the current directory. If not found, check ProgramData.
+            // A typical installation will have the configuration stored in ProgramData.
+            const string fileName = "tcpTrigger.xml";
+            if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + fileName))
+                return AppDomain.CurrentDomain.BaseDirectory + fileName;
+            else if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\tcpTrigger\" + fileName))
+                return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\tcpTrigger\" + fileName;
+            else
+                return string.Empty;
         }

         public bool Load()
         {
             string configuratonPath = GetConfigurationPath();
-            string currentNode = string.Empty;
-
+
             if (string.IsNullOrEmpty(configuratonPath))
             {
-                return false;
+                // No configuration was found. Log a warning in the Windows event log and
+                // return true (successful load) to allow the tcpTrigger service to start.
+                // In this state, the tcpTrigger service will start and run with everything disabled.
+                EventLog.WriteEntry(
+                    "tcpTrigger",
+                    "Could not locate a configuration file for the tcpTrigger service."
+                    + $" The service will start and run with everything disabled.{Environment.NewLine}{Environment.NewLine}"
+                    + $" First path checked: {AppDomain.CurrentDomain.BaseDirectory + "tcpTrigger.xml"}{Environment.NewLine}"
+                    + $" Second path checked: {Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\tcpTrigger\tcpTrigger.xml"}",
+                    EventLogEntryType.Warning,
+                    400);
+                return true;
             }

+            // currentNode is updated with the XML node path for every element that is read
+            // from the configuration file. This aids in debugging and provides more useful
+            // error messages when something goes wrong.
+            string currentNode = string.Empty;
             try
             {
                 var xd = new XmlDocument();
@@ -285,6 +278,7 @@

     internal class ConfigurationNode
     {
+        // XML node paths for the tcpTrigger configuration file.
         public const string enabledComponents_tcp = "/tcpTrigger/enabledComponents/tcp";
         public const string enabledComponents_icmp = "/tcpTrigger/enabledComponents/icmp";
         public const string enabledComponents_namePoison = "/tcpTrigger/enabledComponents/namePoison";


typoを修正

typoを修正

--- Dumper.cs
+++ Dumper.cs
@@ -309,14 +309,15 @@
         {
             if (value == null) return "(null)";

+            // 値
             var type = value.GetType();
-            string escapedValue = EspaceString(value.ToString());
-
+            string escapedValue = EscapeString(value.ToString());
             string str =
                 (type == typeof(string)) ? "\"" + escapedValue + "\"" :
                 (type == typeof(char)) ? "'" + escapedValue + "'" :
                 escapedValue;

+            // 型
             if (ShowPropertyType)
             {
                 string typeText;
@@ -351,7 +352,7 @@
             return method.DeclaringType != typeof(object);
         }

-        private static string EspaceString(string str)
+        private static string EscapeString(string str)
         {
             var sb = new StringBuilder(str);
             foreach (var converter in EscapedChars)


Added possibility to scale spheres

Added possibility to scale spheres

--- Movement_Related_Functions.cs
+++ Movement_Related_Functions.cs
@@ -23,7 +23,6 @@
 	private float startTime;
 	private bool setTime = false;

-    // this function instantiates the different global variables.
 	public Movement_Related_Functions(int numberOfPedestrians, int numberOfSteps, double[,] positions,
 		GameObject prefabBlue, GameObject prefabRed, float rotationSpeed, bool pedestrians)
 	{
@@ -41,30 +40,31 @@
 	public List<Transform> instantiateGameObjects()
 	{
 		int counter = 0;
-		while (counter < numberOfPedestrians) { // For all pedestrians
-			if(pedestrians == false) // If pedestrian mode is off
+		while (counter < numberOfPedestrians) {
+			if(pedestrians == false)
 			{
-				GameObject sphere = GameObject.CreatePrimitive (PrimitiveType.Sphere); // The program creates spheres to represent the pedestrians
-
-				if (counter < numberOfPedestrians /2){ // Half of them will be blue
+				GameObject sphere = GameObject.CreatePrimitive (PrimitiveType.Sphere);
+				sphere.transform.localScale = new Vector3 ((float) 1.5, (float) 1.5, (float) 1.5);
+
+				if (counter < numberOfPedestrians /2){
 					sphere.renderer.material.color = Color.blue;
 				}
 				else{
-					sphere.renderer.material.color = Color.red; // Half of them will be red
-				}
-				// Furthermore a rigidbody is added, the spere is placed on its position and added to the list spheres containing the GameObjects
+					sphere.renderer.material.color = Color.red;
+				}
+
 				sphere.AddComponent<Rigidbody> ();
 				sphere.transform.position = new Vector3 (Convert.ToInt32 (positions [counter, 0]), Convert.ToInt32 (1.0), Convert.ToInt32 (positions [counter + numberOfPedestrians, 0]));
 				spheres.Add (sphere.transform);
 				}

-			else { // If pedestrian mode is selected
-				if (counter < numberOfPedestrians / 2) { // Half of the GameObjects is instantiated to be prefabBlue
+			else {
+				if (counter < numberOfPedestrians / 2) {
 					GameObject sphere =(GameObject)Instantiate (prefabBlue);
 					sphere.transform.position = new Vector3 (Convert.ToInt32 (positions [counter, 0]), Convert.ToInt32 (0.0), Convert.ToInt32 (positions [counter + numberOfPedestrians, 0]));
 					spheres.Add (sphere.transform);
 				}
-				else { // The other half of the GameObjects is instatiated as prefabRed
+				else {
 					GameObject sphere = (GameObject)Instantiate (prefabRed);
 					sphere.transform.position = new Vector3 (Convert.ToInt32 (positions [counter, 0]), Convert.ToInt32 (0.0), Convert.ToInt32 (positions [counter + numberOfPedestrians, 0]));
 					spheres.Add (sphere.transform);
@@ -75,7 +75,6 @@
 		return spheres;
 	}

-    // This function goes through the entire list of gameobjects and moves them to their next position as well as adjusting their respective rotation.
 	public int moveGameObjects(float threshold, float threshold2, float time, int CamNum, bool resetCounter, List<Transform> spheres,
 	                           int numberOfPedestrians, int numberOfSteps, double[,] positions, bool pedestrians)
 	{
@@ -85,16 +84,17 @@
 			setTime = true;
 		}

-		// This if statement is used to reset the animation when this is needed.
+		// For the resetting of the animation
 		if(resetCounter == true)
 		{
 			index = 1;
 			resetCounter = false;
 		}

+		// For movement
 		int counter = 0;
 		float startertime = Time.time;
-		while (counter < numberOfPedestrians) { // For all pedestrians
+		while (counter < numberOfPedestrians) {
 			if(spheres[counter]){

 				float realTime = Time.time;
@@ -103,18 +103,21 @@
 				Vector3 tempStart = sphere.transform.position;
 				Vector3 tempNext = sphere.transform.position;

+				//For Rotation
 				Vector3 nextlook = sphere.transform.position; // vector variable used to store next position to look at

+				//For Rotation
 				Quaternion currotation = sphere.transform.localRotation; // saves the current rotation position

-                if (index <= numberOfSteps - 4) // Added -3 such that the rotation part of the function can be used.
+				// Added -3 for the rotation (Means we wont need a separate function for movement and rotation)
+				if (index <= numberOfSteps-4)
 				{
 					tempStart.x = (float)positions[counter, index - 1];
 					tempStart.z = (float)positions[(counter + numberOfPedestrians), index - 1];
 					tempNext.x = (float)positions [counter, index];
 					tempNext.z = (float)positions [(counter + numberOfPedestrians), index];

-					if(Math.Abs(tempNext.x-tempStart.x) > 2.0f) // When the pedestrian objects move from one side to the other the object will be destroyed (and later be remade)
+					if(Math.Abs(tempNext.x-tempStart.x) > 2.0f)
 					{
 						Destroy(spheres[counter].gameObject);

@@ -123,7 +126,7 @@
 						}
 					}

-					// In order to smoothen the rotation process a rolling average is used.
+					//For Rotation
 					float averagex = ((float)positions [counter , index+1]+
 						(float)positions [counter, index+2]+
 						(float)positions [counter, index+3])/3.0f; // the average value for x is calculated from the next 3 values
@@ -131,14 +134,17 @@
 						(float)positions [counter + numberOfPedestrians, index+2]+
 						(float)positions [counter + numberOfPedestrians, index+3])/3.0f; // the average value for y is calculated from the next 3 values

-					//Determines the difference in both x and y direction between now and 3 steps in the future.
+					//Determine difference in both x and y direction between now and in 3 steps in the future.
 					double xdifference = (Math.Abs(positions[counter, index] - positions[ counter, index + 3]));
 					double ydifference = (Math.Abs(positions[counter + numberOfPedestrians, index] - positions[counter, index + 3]));

 					// If difference between boundaries then the next rotation position is determined.
-					if (xdifference < 10 || ydifference < 5 ){
+					if (xdifference < 10 || ydifference < 5 )
+					{
+
 					nextlook.x = averagex; // x coordinate of the next position to look at is the average of x
 					nextlook.z = averagey; // y coordinate of the next position to look at is the average of y
+
 					}
 					else {nextlook = tempNext;}

@@ -147,7 +153,8 @@

 					// The rotation is adjusted.
 					sphere.transform.localRotation = nextrotation;
-
+
+
 					//Back to movement of shperes
 					if (spheres[counter]){
 						sphere.transform.position = Vector3.Lerp (tempStart, tempNext, 6*(time - startTime));
@@ -166,33 +173,35 @@
 			index++;

 			// If a game object has been destroyed then it should be remade at its next position which falls in the range of the playing field.
-			for(int i = 0; i < numberOfPedestrians; i++) // This for loop loops through the list of GameObjects.
+			for(int i = 0; i < numberOfPedestrians; i++)
 			{
-				if (spheres[i] == null) // When the loop encounters an GameObject with value null (a destroyed game object) ...
+				if (spheres[i] == null)
 				{
-					if(positions[i, index] > 0.0f && positions[i,index] < 120.0f && Math.Abs(positions[i, index] - positions[i, index-1]) < 2.0f) // ... and is within the playing field ...
+					if(positions[i, index] > 0.0f && positions[i,index] < 120.0f && Math.Abs(positions[i, index] - positions[i, index-1]) < 2.0f)
 					{
-						if(pedestrians == false){ // ... a sphere is created when pedestrians mode was turned off.
+						if(pedestrians == false){
 							GameObject sphere = GameObject.CreatePrimitive (PrimitiveType.Sphere);
-							if (i < numberOfPedestrians /2){ // This if function checks for the color of the object.
+							sphere.transform.localScale = new Vector3 ((float) 1.5, (float) 1.5, (float) 1.5);
+
+							if (i < numberOfPedestrians /2){
 								sphere.renderer.material.color = Color.blue;
 							}
-							else{
+							else{
 								sphere.renderer.material.color = Color.red;
 							}
-							// The object is initialized on the right position.
-							sphere.AddComponent<Rigidbody> ();
+
+							sphere.AddComponent<Rigidbody> ();
 							sphere.transform.position = new Vector3 (Convert.ToInt32 (positions [i, index]), Convert.ToInt32 (1.0), Convert.ToInt32 (positions [i + numberOfPedestrians, index]));
-							spheres[i] = sphere.transform; // The object is placed in the list with GameObjects
-						}
-						else{ // ... a pedestrian is created when pedestrian mode was on.
-							if (i < numberOfPedestrians / 2) { // The color of the pedestrian model is determined and placed on the playing field.
-								GameObject sphere =(GameObject)Instantiate (prefabBlue); // The blue variant
+							spheres[i] = sphere.transform;
+						}
+						else{
+							if (i < numberOfPedestrians / 2) {
+								GameObject sphere =(GameObject)Instantiate (prefabBlue);
 								sphere.transform.position = new Vector3 (Convert.ToInt32 (positions [i, index]), Convert.ToInt32 (0.0), Convert.ToInt32 (positions [i + numberOfPedestrians, index]));
 								spheres[i] = sphere.transform;
 							}
-								else{
-								GameObject sphere = (GameObject)Instantiate (prefabRed); // The red variant
+								else{
+								GameObject sphere = (GameObject)Instantiate (prefabRed);
 								sphere.transform.position = new Vector3 (Convert.ToInt32 (positions [i, index]), Convert.ToInt32 (0.0), Convert.ToInt32 (positions [i + numberOfPedestrians, index]));
 								spheres[i] = sphere.transform;
 							}


(#78) Remove hardcoded `test` string from ShowMpMessageLarge and add overload with subtitle parameter

Fixes #78.


fix hexToByte function

fix hexToByte function

--- SteamToolkit/Web/RsaHelper.cs
+++ SteamToolkit/Web/RsaHelper.cs
@@ -50,21 +50,19 @@
             return true;
         }

-
         private static byte[] HexToByte(string hex)
         {
-            if (hex.Length%2 == 1)
+            int hexLen = hex.Length;
+            if (hexLen % 2 == 1)
                 throw new Exception("The binary key cannot have an odd number of digits");

-            byte[] arr = new byte[hex.Length >> 1];
-            int l = hex.Length;
-
-            for (int i = 0; i < (l >> 1); ++i)
+
+            byte[] ret = new byte[hexLen / 2];
+            for (int i = 0; i < hexLen; i += 2)
             {
-                arr[i] = (byte) ((GetHexVal(hex[i << 1]) << 4) + (GetHexVal(hex[(i << 1) + 1])));
+                ret[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
             }
-
-            return arr;
+            return ret;
         }

         private static int GetHexVal(char hex)


finishing framework for GenerateHandler

finishing framework for GenerateHandler

--- service/src/Logic/GenerateHandler.cs
+++ service/src/Logic/GenerateHandler.cs
@@ -31,6 +31,8 @@
                 throw new InvalidOperationException("Invalid generation request");
             try
             {
+                await HandleAsync(idver, target).ConfigureAwait(false);
+                await _logStorage.WriteAsync(idver, target, message.Timestamp, Status.Succeeded, string.Join("\n", AmbientContext.InMemoryLogger?.Messages ?? new List<string>())).ConfigureAwait(false);
             }
             catch (Exception ex)
             {
@@ -38,5 +40,10 @@
                 await _logStorage.WriteAsync(idver, target, message.Timestamp, Status.Failed, string.Join("\n", AmbientContext.InMemoryLogger?.Messages ?? new List<string>())).ConfigureAwait(false);
             }
         }
+
+        private Task HandleAsync(NugetPackageIdVersion idver, PlatformTarget target)
+        {
+            return Task.CompletedTask;
+        }
     }
 }


Optimize dummy

Optimize dummy

--- OfflineServer/PersonaManagement.cs
+++ OfflineServer/PersonaManagement.cs
@@ -8,6 +8,7 @@
     public static class PersonaManagement
     {
         private static ISession session;
+        private static PersonaEntity dummyEntity = new PersonaEntity();
         static PersonaManagement()
         {
             session = SessionManager.getSessionFactory().OpenSession();
@@ -19,7 +20,7 @@
             {
                 if (Access.CurrentSession.ActivePersona != null)
                     return session.Load<PersonaEntity>(Access.CurrentSession.ActivePersona.Id);
-                return new PersonaEntity(); // to ensure no NullReferenceExceptions, it's just a dummy
+                return dummyEntity; // to ensure no NullReferenceExceptions, it's just a dummy
             }
             set
             {


勘違いを修正

勘違いを修正

--- OnedrawHelper/Models/ThemeModel.cs
+++ OnedrawHelper/Models/ThemeModel.cs
@@ -36,7 +36,7 @@
         public async Task UpdateNextChallengeAsync(Tokens tokens)
         {
             var c = await GetNextChallengeAsync(tokens);
-            if (c != null && NextChallenge == null || c.StartTime < NextChallenge.StartTime)
+            if (c != null && (NextChallenge == null || c.StartTime < NextChallenge.StartTime))
                 NextChallenge = c;
         }

@@ -60,7 +60,6 @@
                         p.MatchDate.Groups["day"].Value != "" ? int.Parse(p.MatchDate.Groups["day"].Value) : p.CreatedAt.Day,
                         int.Parse(p.MatchDate.Groups["hour"].Value),
                         int.Parse(p.MatchDate.Groups["min"].Value), 0);
-                    if (start < DateTime.Now) start += TimeSpan.FromDays(1);

                     var subjects = Regex.Split(p.MatchSubjects.Groups["subjects"].Value, Source.Extractor.SubjectsSplitPattern).Where(q => !string.IsNullOrWhiteSpace(q)).ToList();
                     var rules = Regex.Split(p.MatchRules.Groups["rules"].Value, Source.Extractor.RulesSplitPattern).Where(q => !string.IsNullOrWhiteSpace(q)).ToList();


[OpusOptionCodeGenerator] Better function name, and remove log output for the end of scope of a delegate implementation

--- OpusOptionCodeGenerator/Program.cs
+++ OpusOptionCodeGenerator/Program.cs
@@ -686,7 +686,7 @@
         }

         private static DelegateFileLayout
-        ReadAndParseDelegatesFile(
+        ReadAndParseDelegatesImplementation(
             Parameters parameters)
         {
             if (!System.IO.File.Exists(parameters.outputDelegatesPathName))
@@ -763,12 +763,13 @@
                 // find functions
                 for (;;)
                 {
-                    Log("\tDelegate source line: '{0}'", line);
                     // done reading - it's the end of the class
                     if (line.StartsWith("}"))
                     {
                         break;
                     }
+
+                    Log("\tDelegate source line: '{0}'", line);

                     // look for function signatures
                     if (line.EndsWith(")"))
@@ -830,7 +831,7 @@
                 Log("Would have written file '{0}'", parameters.outputDelegatesPathName);
             }

-            var layout = ReadAndParseDelegatesFile(parameters);
+            var layout = ReadAndParseDelegatesImplementation(parameters);

             var memStream = new System.IO.MemoryStream();
             using (var writer = !parameters.toStdOut ? new System.IO.StreamWriter(memStream) : System.Console.Out)


[trunk] OpusOptionCodeGenerator no longer crashes when no delegate files are provided as input

--- OpusOptionCodeGenerator/Program.cs
+++ OpusOptionCodeGenerator/Program.cs
@@ -456,9 +456,12 @@
             }

             System.Collections.Generic.List<DelegateSignature> delegateSignatures = new System.Collections.Generic.List<DelegateSignature>();
-            foreach (string path in parameters.inputDelegates)
-            {
-                delegateSignatures.Add(ReadDelegate(path));
+            if (null != parameters.inputDelegates)
+            {
+                foreach (string path in parameters.inputDelegates)
+                {
+                    delegateSignatures.Add(ReadDelegate(path));
+                }
             }

             if (Parameters.Mode.GenerateProperties == (parameters.mode & Parameters.Mode.GenerateProperties))


[GLib] Avoid locking in fastactivator by using threadstatic dictionaries.

--- glib/FastActivator.cs
+++ glib/FastActivator.cs
@@ -13,16 +13,14 @@
 		static FastCreateObjectPtr FastCtorPtr (Type t, Dictionary<Type, FastCreateObjectPtr> cache)
 		{
 			FastCreateObjectPtr method;
-			lock (cache) {
-				if (!cache.TryGetValue (t, out method)) {
-					var param = Expression.Parameter (typeof (IntPtr));
-					var ctor = t.GetConstructor (flags, null, new [] { typeof (IntPtr) }, new ParameterModifier [0]);
-					if (ctor == null)
-						throw new MissingMethodException ();
+			if (!cache.TryGetValue (t, out method)) {
+				var param = Expression.Parameter (typeof (IntPtr));
+				var ctor = t.GetConstructor (flags, null, new [] { typeof (IntPtr) }, new ParameterModifier [0]);
+				if (ctor == null)
+					throw new MissingMethodException ();

-					var newExpr = Expression.New (ctor, param);
-					cache [t] = method = Expression.Lambda<FastCreateObjectPtr> (newExpr, param).Compile ();
-				}
+				var newExpr = Expression.New (ctor, param);
+				cache [t] = method = Expression.Lambda<FastCreateObjectPtr> (newExpr, param).Compile ();
 			}
 			return method;
 		}
@@ -31,11 +29,9 @@
 		static FastCreateObject FastCtor (Type t, Dictionary<Type, FastCreateObject> cache)
 		{
 			FastCreateObject method;
-			lock (cache) {
-				if (!cache.TryGetValue (t, out method)) {
-					var newExpr = Expression.New (t);
-					cache [t] = method = Expression.Lambda<FastCreateObject> (newExpr).Compile ();
-				}
+			if (!cache.TryGetValue (t, out method)) {
+				var newExpr = Expression.New (t);
+				cache [t] = method = Expression.Lambda<FastCreateObject> (newExpr).Compile ();
 			}
 			return method;
 		}
@@ -44,40 +40,42 @@
 		static FastCreateBoxed FastBoxed (Type t, Dictionary<Type, FastCreateBoxed> cache)
 		{
 			FastCreateBoxed method;
-			lock (cache) {
-				if (!cache.TryGetValue (t, out method)) {
-					var newMethod = t.GetMethod ("New", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
-					if (newMethod != null) {
-						var param = Expression.Parameter (typeof (IntPtr));
-						var call = Expression.Call (newMethod, param);
-						var callWithConvert = Expression.Convert (call, typeof (object));
-						cache [t] = method = Expression.Lambda<FastCreateBoxed> (callWithConvert, param).Compile ();
-					} else {
-						cache [t] = method = ptr => System.Runtime.InteropServices.Marshal.PtrToStructure (ptr, t);
-					}
+			if (!cache.TryGetValue (t, out method)) {
+				var newMethod = t.GetMethod ("New", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
+				if (newMethod != null) {
+					var param = Expression.Parameter (typeof (IntPtr));
+					var call = Expression.Call (newMethod, param);
+					var callWithConvert = Expression.Convert (call, typeof (object));
+					cache [t] = method = Expression.Lambda<FastCreateBoxed> (callWithConvert, param).Compile ();
+				} else {
+					cache [t] = method = ptr => System.Runtime.InteropServices.Marshal.PtrToStructure (ptr, t);
 				}
 			}
 			return method;
 		}

+		[ThreadStatic]
 		static readonly Dictionary<Type, FastCreateObjectPtr> cacheOpaque = new Dictionary<Type, FastCreateObjectPtr> (new TypeEqualityComparer ());
 		public static Opaque CreateOpaque (IntPtr o, Type type)
 		{
 			return (Opaque)FastCtorPtr (type, cacheOpaque)(o);
 		}

+		[ThreadStatic]
 		static readonly Dictionary<Type, FastCreateObjectPtr> cacheObject = new Dictionary<Type, FastCreateObjectPtr> (new TypeEqualityComparer ());
 		public static Object CreateObject (IntPtr o, Type type)
 		{
 			return (Object)FastCtorPtr (type, cacheObject)(o);
 		}

+		[ThreadStatic]
 		static readonly Dictionary<Type, FastCreateObject> cacheSignalArgs = new Dictionary<Type, FastCreateObject> (new TypeEqualityComparer ());
 		public static SignalArgs CreateSignalArgs (Type type)
 		{
 			return (SignalArgs)FastCtor (type, cacheSignalArgs)();
 		}

+		[ThreadStatic]
 		static readonly Dictionary<Type, FastCreateBoxed> cacheBoxed = new Dictionary<Type, FastCreateBoxed> (new TypeEqualityComparer ());
 		public static object CreateBoxed (IntPtr o, Type type)
 		{


change redirct to 302

change redirct to 302

301 is cached by Chrome and will not be resolved on second visit

--- IGS/WebServer/SimpleHttpServer.cs
+++ IGS/WebServer/SimpleHttpServer.cs
@@ -388,7 +388,7 @@
         /// </summary>
         public void WriteRedirect(String new_location)
         {
-            OutputStream.WriteLine("HTTP/1.1 301 Moved Permanently");
+            OutputStream.WriteLine("HTTP/1.1 302 Found");
             OutputStream.WriteLine("Location: " + new_location);
             OutputStream.WriteLine("");
         }


Implemented Summary MeterValue Device Element Reference

--- ISOv4Plugin/Mappers/TaskMapper.cs
+++ ISOv4Plugin/Mappers/TaskMapper.cs
@@ -1,4 +1,4 @@
-/*
+/*
  * ISO standards can be purchased through the ANSI webstore at https://webstore.ansi.org
 */

@@ -297,6 +297,14 @@
                                 dlv.ProcessDataValue = (int)numericValue.Value.Value;
                             }
                         }
+                        if (value.DeviceConfigurationId.HasValue)
+                        {
+                            DeviceElementConfiguration config = DataModel.Catalog.DeviceElementConfigurations.FirstOrDefault(c => c.Id.ReferenceId == value.DeviceConfigurationId.Value);
+                            if (config != null)
+                            {
+                                dlv.DeviceElementIdRef = TaskDataMapper.InstanceIDMap.GetISOID(config.DeviceElementId);
+                            }
+                        }
                         time.DataLogValues.Add(dlv);
                     }
                 }
@@ -850,10 +858,23 @@

             DdiDefinition ddiDefintion = DDIs[ddi];

+            int? deviceConfigurationID = null;
+            int? deviceElementID = TaskDataMapper.InstanceIDMap.GetADAPTID(dlv.DeviceElementIdRef);
+            if (deviceElementID.HasValue)
+            {
+                DeviceElementConfiguration config = DataModel.Catalog.DeviceElementConfigurations.FirstOrDefault(c => c.DeviceElementId == deviceElementID.Value);
+                if (config != null)
+                {
+                    deviceConfigurationID = config.Id.ReferenceId;
+                }
+            }
+
             return new MeteredValue
             {
                 Value = new NumericRepresentationValue(RepresentationMapper.Map(ddi) as NumericRepresentation,
-                    unitOfMeasure, new NumericValue(unitOfMeasure, dataValue * ddiDefintion.Resolution))
+                                                       unitOfMeasure,
+                                                       new NumericValue(unitOfMeasure, dataValue * ddiDefintion.Resolution)),
+                DeviceConfigurationId = deviceConfigurationID
             };
         }
         #endregion Import Summary Data


- removing buffering from ScanIdentifier - purging buffered ScanString

--- JsonFx.Json/Json/JsonTokenizer.cs
+++ JsonFx.Json/Json/JsonTokenizer.cs
@@ -434,165 +434,6 @@
 					// native EcmaScript number (IEEE-754)
 					return new Token<JsonTokenType>(JsonTokenType.Number, number);
 				}
-			}
-
-			private Token<JsonTokenType> ScanStringBuffered()
-			{
-				// TODO: simplify this so that it just leverages the BufferedTextReader's buffer
-				// then do a performance comparison with original
-
-				// store for unterminated case
-				long stringStart = this.Reader.Position;
-				char stringDelim = (char)this.Reader.Read();
-
-				StringBuilder builder = new StringBuilder(this.BufferSize);
-
-				// fill initial buffer
-				int count = this.Reader.Peek(this.PeekBuffer);
-				while (count > 0)
-				{
-					int start = 0;
-					for (int i=start; i<count; i++)
-					{
-						char ch = this.PeekBuffer[i];
-
-						// check each character for ending delim
-						if (ch == stringDelim)
-						{
-							// append final segment
-							builder.Append(this.PeekBuffer, start, i-start);
-
-							// flush string and closing delim
-							this.Reader.Flush(i+1);
-
-							// output string
-							return new Token<JsonTokenType>(JsonTokenType.String, builder.ToString());
-						}
-
-						if (Char.IsControl(ch) && ch != '\t')
-						{
-							throw new DeserializationException(JsonTokenizer.ErrorUnterminatedString, stringStart);
-						}
-
-						if (ch != JsonGrammar.OperatorCharEscape)
-						{
-							// accumulate
-							continue;
-						}
-
-						if (i > start)
-						{
-							// append segment before escape
-							builder.Append(this.PeekBuffer, start, i-start);
-						}
-
-						// flush prefix and escape char
-						this.Reader.Flush(i+1);
-
-						// ensure full buffer
-						count = this.Reader.Peek(this.PeekBuffer);
-						start = i = 0;
-
-						if (count < 1)
-						{
-							// unexpected end of input
-							throw new DeserializationException(JsonTokenizer.ErrorUnterminatedString, stringStart);
-						}
-
-						// decode
-						ch = this.PeekBuffer[i];
-						switch (ch)
-						{
-							case '0':
-							{
-								// don't allow NULL char '\0'
-								// causes CStrings to terminate
-								break;
-							}
-							case 'b':
-							{
-								// backspace
-								builder.Append('\b');
-								break;
-							}
-							case 'f':
-							{
-								// formfeed
-								builder.Append('\f');
-								break;
-							}
-							case 'n':
-							{
-								// newline
-								builder.Append('\n');
-								break;
-							}
-							case 'r':
-							{
-								// carriage return
-								builder.Append('\r');
-								break;
-							}
-							case 't':
-							{
-								// tab
-								builder.Append('\t');
-								break;
-							}
-							case 'u':
-							{
-								// Unicode escape sequence
-								// e.g. Copyright: "\u00A9"
-
-								const int UnicodeEscapeLength = 4;
-
-								// unicode ordinal
-								int utf16;
-								if (start+UnicodeEscapeLength < count &&
-						        Int32.TryParse(
-									new String(this.PeekBuffer, i+1, UnicodeEscapeLength),
-									NumberStyles.AllowHexSpecifier,
-									NumberFormatInfo.InvariantInfo,
-									out utf16))
-								{
-									builder.Append(Char.ConvertFromUtf32(utf16));
-									i += UnicodeEscapeLength;
-									start += UnicodeEscapeLength;
-								}
-								else
-								{
-									// using FireFox style recovery, if not a valid hex
-									// escape sequence then treat as single escaped 'u'
-									// followed by rest of string
-									goto default;
-								}
-								break;
-							}
-							default:
-							{
-								if (Char.IsControl(ch) && ch != '\t')
-								{
-									throw new DeserializationException(JsonTokenizer.ErrorUnterminatedString, stringStart);
-								}
-
-								builder.Append(ch);
-								break;
-							}
-						}
-
-						start++;
-					}
-
-					// append remaining buffered segment and flush
-					builder.Append(this.PeekBuffer, start, count-start);
-					this.Reader.Flush(count);
-
-					// refill buffer
-					count = this.Reader.Peek(this.PeekBuffer);
-				}
-
-				// reached END before string delim
-				throw new DeserializationException(JsonTokenizer.ErrorUnterminatedString, stringStart);
 			}

 			private Token<JsonTokenType> ScanString()
@@ -834,46 +675,34 @@
 			/// </remarks>
 			private string ScanIdentifier()
 			{
-				StringBuilder ident = new StringBuilder(JsonTokenizer.MinBufferLength);
-
-				int bufferSize = this.Reader.Peek(this.PeekBuffer);
-
 				bool identPart = false;
-				while (bufferSize > 0)
-				{
-					int i;
-					for (i=0; i<bufferSize; i++)
-					{
-						char ch = this.PeekBuffer[i];
-
-						// digits are only allowed after first char
-						// rest can be in head or tail
-						if ((identPart && Char.IsDigit(ch)) ||
+
+				int i = 0;
+				while (true)
+				{
+					char ch = (char)this.Reader.Peek(i);
+
+					// digits are only allowed after first char
+					// rest can be in head or tail
+					if ((ch > 0) &&
+						(identPart && Char.IsDigit(ch)) ||
 						Char.IsLetter(ch) || ch == '_' || ch == '$')
-						{
-							identPart = true;
-							continue;
-						}
-
-						// append partial
-						ident.Append(this.PeekBuffer, 0, i);
-						if (i > 0)
-						{
-							this.Reader.Flush(i);
-						}
-						return ident.ToString();
-					}
-
-					// append entire buffer
-					ident.Append(this.PeekBuffer, 0, bufferSize);
-					if (bufferSize > 0)
-					{
-						this.Reader.Flush(bufferSize);
-					}
-					bufferSize = this.Reader.Peek(this.PeekBuffer);
-				}
-
-				return ident.ToString();
+					{
+						identPart = true;
+						i++;
+						continue;
+					}
+
+					// append partial
+					if (i < 0)
+					{
+						return String.Empty;
+					}
+
+					StringBuilder ident = new StringBuilder(i, i);
+					this.Reader.Flush(i, ident);
+					return ident.ToString();
+				}
 			}

 			#endregion Scanning Methods


updated create field hints (for date formats)

in order to prevent exceptions from happening when creating a new
application... updated the hints for date fields

--- KaskKiosk/Views/App/Create.cshtml
+++ KaskKiosk/Views/App/Create.cshtml
@@ -382,11 +382,11 @@

         @Html.Label("Years Attended From:")
-        <input type="text" class="form-control" name="YearsAttendedFrom_1" id="YearsAttendedFrom_1" placeholder="2000" />
+        <input type="text" class="form-control" name="YearsAttendedFrom_1" id="YearsAttendedFrom_1" placeholder="9/2000" />

         @Html.Label("Years Attended To:")
-        <input type="text" class="form-control" name="YearsAttendedTo_1" id="YearsAttendedTo_1" placeholder="2000" />
+        <input type="text" class="form-control" name="YearsAttendedTo_1" id="YearsAttendedTo_1" placeholder="9/2000" />

         @Html.Label("Graduated:")
@@ -411,11 +411,11 @@

         @Html.Label("Years Attended From:")
-        <input type="text" class="form-control" name="YearsAttendedFrom_2" id="YearsAttendedFrom_2" placeholder="2000" />
+        <input type="text" class="form-control" name="YearsAttendedFrom_2" id="YearsAttendedFrom_2" placeholder="9/2000" />

         @Html.Label("Years Attended To:")
-        <input type="text" class="form-control" name="YearsAttendedTo_2" id="YearsAttendedTo_2" placeholder="2000" />
+        <input type="text" class="form-control" name="YearsAttendedTo_2" id="YearsAttendedTo_2" placeholder="9/2000" />

         @Html.Label("Graduated:")
@@ -440,11 +440,11 @@

         @Html.Label("Years Attended From:")
-        <input type="text" class="form-control" name="YearsAttendedFrom_3" id="YearsAttendedFrom_3" placeholder="2000" />
+        <input type="text" class="form-control" name="YearsAttendedFrom_3" id="YearsAttendedFrom_3" placeholder="9/2000" />

         @Html.Label("Years Attended To:")
-        <input type="text" class="form-control" name="YearsAttendedTo_3" id="YearsAttendedTo_3" placeholder="2000" />
+        <input type="text" class="form-control" name="YearsAttendedTo_3" id="YearsAttendedTo_3" placeholder="9/2000" />

         @Html.Label("Graduated:")


Add getter to status code.

Add getter to status code.

--- PerformanceCounters/PCException.cs
+++ PerformanceCounters/PCException.cs
@@ -8,7 +8,7 @@
     [Serializable]
     public class PCException : Exception, ISerializable
     {
-        uint statusCode;
+        uint StatusCode { get; }

         public PCException()
         {
@@ -16,12 +16,12 @@

         public PCException(uint statusCode) : base(FormatMessage(statusCode))
         {
-            this.statusCode = statusCode;
+            StatusCode = statusCode;
         }

         public PCException(uint statusCode, Exception innerException) : base(FormatMessage(statusCode), innerException)
         {
-            this.statusCode = statusCode;
+            StatusCode = statusCode;
         }

         public PCException(string message) : base(message)


Removed empty methods.

Removed empty methods.

--- tests/Magick.NET.Tests/Shared/MagickImageCollectionTests.cs
+++ tests/Magick.NET.Tests/Shared/MagickImageCollectionTests.cs
@@ -479,28 +479,5 @@
                 Cleanup.DeleteFile(tempFile);
             }
         }
-
-        private static void Test_Ping(IMagickImageCollection<QuantumType> collection)
-        {
-            Assert.AreEqual(1, collection.Count);
-
-            ExceptionAssert.Throws<InvalidOperationException>(() =>
-            {
-                collection[0].GetPixels();
-            });
-
-            var profile = collection[0].Get8BimProfile();
-            Assert.IsNotNull(profile);
-        }
-
-        private static void Test_Read(IMagickImageCollection<QuantumType> collection)
-        {
-            Assert.AreEqual(3, collection.Count);
-            foreach (var image in collection)
-            {
-                Assert.AreEqual(70, image.Width);
-                Assert.AreEqual(46, image.Height);
-            }
-        }
     }
 }


Fix comment wrong Type parameter

Fix comment wrong Type parameter

--- QueryBuilder/Compilers/Compiler.cs
+++ QueryBuilder/Compilers/Compiler.cs
@@ -894,7 +894,6 @@
         /// </summary>
         /// <param name="ctx"></param>
         /// <param name="parameter"></param>
-        /// <typeparam name="T"></typeparam>
         /// <returns></returns>
         public virtual object Resolve(SqlResult ctx, object parameter)
         {
@@ -920,7 +919,6 @@
         /// </summary>
         /// <param name="ctx"></param>
         /// <param name="parameter"></param>
-        /// <typeparam name="T"></typeparam>
         /// <returns></returns>
         public virtual string Parameter(SqlResult ctx, object parameter)
         {


File handle leak when creating new files

--- source/Playnite/Common/FileSystem.cs
+++ source/Playnite/Common/FileSystem.cs
@@ -86,7 +86,7 @@
         public static void CreateFile(string path)
         {
             path = FixPathLength(path);
-            File.Create(path);
+            File.Create(path).Dispose();
         }

         public static void CopyFile(string sourcePath, string targetPath, bool overwrite = true)


PR feedback

PR feedback

--- csharp/src/Google.Protobuf/ParsingPrimitives.cs
+++ csharp/src/Google.Protobuf/ParsingPrimitives.cs
@@ -438,8 +438,6 @@
                 throw InvalidProtocolBufferException.NegativeSize();
             }

-            ValidateCurrentLimit(ref buffer, ref state, size);
-
             if (size <= state.bufferSize - state.bufferPos)
             {
                 // We have all the bytes we need already.
@@ -448,7 +446,16 @@
                 state.bufferPos += size;
                 return bytes;
             }
-            else if (IsDataAvailableInSource(ref state, size))
+
+            return ReadRawBytesSlow(ref buffer, ref state, size);
+        }
+
+        private static byte[] ReadRawBytesSlow(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state, int size)
+        {
+            ValidateCurrentLimit(ref buffer, ref state, size);
+
+            if ((!state.segmentedBufferHelper.TotalLength.HasValue && size < buffer.Length) ||
+                IsDataAvailableInSource(ref state, size))
             {
                 // Reading more bytes than are in the buffer, but not an excessive number
                 // of bytes.  We can safely allocate the resulting array ahead of time.
@@ -490,7 +497,7 @@
                 }

                 // OK, got everything.  Now concatenate it all into one buffer.
-                byte[] bytes = new byte[size];
+                byte[] bytes = new byte[size];
                 int newPos = 0;
                 foreach (byte[] chunk in chunks)
                 {


Add Score to VotableThing

Add Score to VotableThing

--- RedditSharp/Things/VotableThing.cs
+++ RedditSharp/Things/VotableThing.cs
@@ -71,6 +71,8 @@
         public int Downvotes { get; set; }
         [JsonProperty("ups")]
         public int Upvotes { get; set; }
+        [JsonProperty("score")]
+        public int Score { get; set; }
         [JsonProperty("saved")]
         public bool Saved { get; set; }
         [JsonProperty("distinguished")]


Add DoShortcutKeys method

Add DoShortcutKeys method

--- Libraries/Views/Forms/FormBase.cs
+++ Libraries/Views/Forms/FormBase.cs
@@ -318,6 +318,22 @@
             );
         }

+        /* ----------------------------------------------------------------- */
+        ///
+        /// DoShortcutKeys
+        ///
+        /// <summary>
+        /// ショートカットキーを実行します。
+        /// </summary>
+        ///
+        /* ----------------------------------------------------------------- */
+        protected bool DoShortcutKeys(System.Windows.Forms.Keys keys)
+        {
+            if (!ShortcutKeys.ContainsKey(keys)) return false;
+            ShortcutKeys[keys]();
+            return true;
+        }
+
         #endregion

         #region Implementations


Version update to 2.0.0

Version update to 2.0.0

--- Library/Properties/VersionInfo.cs
+++ Library/Properties/VersionInfo.cs
@@ -1,4 +1,4 @@
 using System.Reflection;

-[assembly: AssemblyVersion("1.0.3.0")]
-[assembly: AssemblyFileVersion("1.0.3.0")]
+[assembly: AssemblyVersion("2.0.0.0")]
+[assembly: AssemblyFileVersion("2.0.0.0")]


add a NaN test

add a NaN test

--- LinqStatisticsTests/RangeTests.cs
+++ LinqStatisticsTests/RangeTests.cs
@@ -3,6 +3,8 @@
 using System.Collections.Generic;
 using System.Linq;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+using LinqStatistics.NaN;

 namespace LinqStatistics.UnitTests
 {
@@ -48,7 +50,26 @@

             int result = source.Range();

-            Assert.AreEqual(4,result);
+            Assert.AreEqual(4, result);
+        }
+
+        [TestMethod]
+        [ExpectedException(typeof(InvalidOperationException))]
+        public void RangeEmptyExcepts()
+        {
+            var source = new List<double>();
+
+            var result = source.Range();
+        }
+
+        [TestMethod]
+        public void RangeNaN()
+        {
+            var source = new List<double>();
+
+            var result = source.RangeNaN();
+
+            Assert.IsTrue(double.IsNaN(result));
         }

         [TestMethod]
@@ -70,5 +91,16 @@

             var result = source.MinMax();
         }
+
+        [TestMethod]
+        public void MinMaxNoElementsNaN()
+        {
+            IEnumerable<double> source = new List<double>();
+
+            var result = source.MinMaxNaN();
+
+            Assert.IsTrue(double.IsNaN(result.Max));
+            Assert.IsTrue(double.IsNaN(result.Min));
+        }
     }
 }


Fix #74

Fix #74

--- MaterialDesignThemes.Wpf/Clock.cs
+++ MaterialDesignThemes.Wpf/Clock.cs
@@ -269,7 +269,7 @@
             if (angle < 0) angle += 2 * Math.PI;

             var time = DisplayMode == ClockDisplayMode.Hours
-                ? new DateTime(Time.Year, Time.Month, Time.Day, (int)Math.Round(6 * angle / Math.PI, MidpointRounding.AwayFromZero) % 12, Time.Minute, Time.Second)
+                ? new DateTime(Time.Year, Time.Month, Time.Day, (int)Math.Round(6 * angle / Math.PI, MidpointRounding.AwayFromZero) % 12 + (IsPostMeridiem? 12 : 0), Time.Minute, Time.Second)
                 : new DateTime(Time.Year, Time.Month, Time.Day, Time.Hour, (int)Math.Round(30 * angle / Math.PI, MidpointRounding.AwayFromZero) % 60, Time.Second);

             SetCurrentValue(TimeProperty, time);


setting nam 0.4

setting nam 0.4

--- MazeProject/Assets/human/Human.cs
+++ MazeProject/Assets/human/Human.cs
@@ -219,13 +219,13 @@
 	void OnSerializeNetworkView(BitStream stream,NetworkMessageInfo info){
 		if(changeName){
 			if(stream.isWriting){
-				char t;
+				char t='\n';
 				//foreach(char c in humanName){
 				//	t = c;
 					stream.Serialize(ref t);
 				//}
-				t = '\n';
-				stream.Serialize(ref t);
+				//t = '\n';
+				//stream.Serialize(ref t);
 			}else{
 				char c ='\0';
 				stream.Serialize(ref c);


Remove datatype sort order from sync file (not used)

--- uSync8.Core/Serialization/Serializers/DataTypeSerializer.cs
+++ uSync8.Core/Serialization/Serializers/DataTypeSerializer.cs
@@ -1,22 +1,21 @@
 using Newtonsoft.Json;
+
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Web;
 using System.Xml.Linq;
+
 using Umbraco.Core;
+using Umbraco.Core.Composing;
 using Umbraco.Core.Logging;
-using Umbraco.Core.Composing;
 using Umbraco.Core.Models;
 using Umbraco.Core.Models.Entities;
+using Umbraco.Core.PropertyEditors;
 using Umbraco.Core.Services;
+
+using uSync8.Core.DataTypes;
 using uSync8.Core.Extensions;
 using uSync8.Core.Models;
-using Umbraco.Core.Configuration.UmbracoSettings;
-using Umbraco.Core.PropertyEditors;
-using uSync8.Core.DataTypes;

 namespace uSync8.Core.Serialization.Serializers
 {
@@ -60,7 +59,10 @@
                 }
             }

-            item.SortOrder = info.Element("SortOrder").ValueOrDefault(0);
+            // removing sort order - as its not used on datatypes,
+            // and can change based on minor things (so gives false out of sync results)
+
+            // item.SortOrder = info.Element("SortOrder").ValueOrDefault(0);
             item.DatabaseType = info.Element("DatabaseType").ValueOrDefault(ValueStorageType.Nvarchar);

             // config
@@ -68,6 +70,7 @@

             SetFolderFromElement(item, info.Element("Folder"));

+            // save is responsiblity of caller
             // dataTypeService.Save(item);

             return SyncAttempt<IDataType>.Succeed(item.Name, item, ChangeType.Import);
@@ -117,8 +120,8 @@
             var info = new XElement("Info",
                 new XElement("Name", item.Name),
                 new XElement("EditorAlias", item.EditorAlias),
-                new XElement("DatabaseType", item.DatabaseType),
-                new XElement("SortOrder", item.SortOrder));
+                new XElement("DatabaseType", item.DatabaseType));
+                // new XElement("SortOrder", item.SortOrder));

             if (item.Level != 1)
             {


Closes #1171

Closes #1171

--- ArchiSteamFarm/Trading.cs
+++ ArchiSteamFarm/Trading.cs
@@ -353,8 +353,14 @@
 					ParsingScheduled = false;
 				}

+				bool lootableTypesReceived;
+
 				using (await Bot.Actions.GetTradingLock().ConfigureAwait(false)) {
-					await ParseActiveTrades().ConfigureAwait(false);
+					lootableTypesReceived = await ParseActiveTrades().ConfigureAwait(false);
+				}
+
+				if (lootableTypesReceived && Bot.BotConfig.SendOnFarmingFinished) {
+					await Bot.Actions.SendTradeOffer(wantedTypes: Bot.BotConfig.LootableTypes).ConfigureAwait(false);
 				}
 			} finally {
 				TradesSemaphore.Release();
@@ -373,11 +379,11 @@
 			return sets.ToDictionary(set => set.Key, set => set.Value.Values.OrderBy(amount => amount).ToList());
 		}

-		private async Task ParseActiveTrades() {
+		private async Task<bool> ParseActiveTrades() {
 			HashSet<Steam.TradeOffer> tradeOffers = await Bot.ArchiWebHandler.GetActiveTradeOffers().ConfigureAwait(false);

 			if ((tradeOffers == null) || (tradeOffers.Count == 0)) {
-				return;
+				return false;
 			}

 			if (HandledTradeOfferIDs.Count > 0) {
@@ -396,17 +402,14 @@
 					if (!twoFactorSuccess) {
 						HandledTradeOfferIDs.ExceptWith(mobileTradeOfferIDs);

-						return;
-					}
-				}
-			}
-
-			if (results.Any(result => (result.TradeResult != null) && (result.TradeResult.Result == ParseTradeResult.EResult.Accepted) && (!result.RequiresMobileConfirmation || Bot.HasMobileAuthenticator) && (result.TradeResult.ReceivingItemTypes?.Any(receivedItemType => Bot.BotConfig.LootableTypes.Contains(receivedItemType)) == true)) && Bot.BotConfig.SendOnFarmingFinished) {
-				// If we finished a trade, perform a loot if user wants to do so
-				await Bot.Actions.SendTradeOffer(wantedTypes: Bot.BotConfig.LootableTypes).ConfigureAwait(false);
+						return false;
+					}
+				}
 			}

 			await Core.OnBotTradeOfferResults(Bot, results.Select(result => result.TradeResult).ToHashSet()).ConfigureAwait(false);
+
+			return results.Any(result => (result.TradeResult != null) && (result.TradeResult.Result == ParseTradeResult.EResult.Accepted) && (!result.RequiresMobileConfirmation || Bot.HasMobileAuthenticator) && (result.TradeResult.ReceivingItemTypes?.Any(receivedItemType => Bot.BotConfig.LootableTypes.Contains(receivedItemType)) == true));
 		}

 		private async Task<(ParseTradeResult TradeResult, bool RequiresMobileConfirmation)> ParseTrade(Steam.TradeOffer tradeOffer) {


Fix 1+1 -> 0+2, #84

Fix 1+1 -> 0+2, #84

--- ArchiSteamFarm/Trading.cs
+++ ArchiSteamFarm/Trading.cs
@@ -219,8 +219,8 @@
 			}

 			// Trade is worth for us if we're in total trading more of our dupes for less of our dupes (or at least same amount)
-			// Which means that itemsToGiveDupesValue should be at least itemsToReceiveDupesValue
-			return itemsToGiveDupesValue >= itemsToReceiveDupesValue;
+			// Which means that itemsToGiveDupesValue should be greater than itemsToReceiveDupesValue
+			return itemsToGiveDupesValue > itemsToReceiveDupesValue;
 		}
 	}
 }


Shapefile demo now zooms to full envelope

--- Samples/Mapsui.Wpf/Window1.xaml.cs
+++ Samples/Mapsui.Wpf/Window1.xaml.cs
@@ -64,8 +64,8 @@
             var provider = CreateRandomPointsProvider();
             mapControl.Map.Layers.Add(PointLayerSample.CreateRandomPointLayerWithLabel(provider));
             mapControl.Map.Layers.Add(PointLayerSample.CreateStackedLabelLayer(provider));
-
             layerList.Initialize(mapControl.Map.Layers);
+            mapControl.ZoomToFullEnvelope();
             mapControl.Refresh();
         }

@@ -88,6 +88,7 @@
             mapControl.Map.Layers.Clear();
             mapControl.Map.Layers.Add(new TileLayer(new GeodanWorldWmsTileSource()));
             layerList.Initialize(mapControl.Map.Layers);
+            mapControl.ZoomToFullEnvelope();
             mapControl.Refresh();
         }

@@ -105,6 +106,7 @@
             mapControl.Map.Layers.Clear();
             mapControl.Map.Layers.Add(new TileLayer(new BingTileSource(BingRequest.UrlBingStaging, String.Empty, BingMapType.Aerial)));
             layerList.Initialize(mapControl.Map.Layers);
+            mapControl.ZoomToFullEnvelope();
             mapControl.Refresh();
         }

@@ -121,12 +123,14 @@
             mapControl.Map.Layers.Clear();
             mapControl.Map.Layers.Add(CreateGroupLayer());
             layerList.Initialize(mapControl.Map.Layers);
+            mapControl.ZoomToFullEnvelope();
             mapControl.Refresh();
         }

         private void ShapefileClick(object sender, RoutedEventArgs e)
         {
             mapControl.Map = ShapefileSample.CreateMap();
+            mapControl.ZoomToFullEnvelope();
             layerList.Initialize(mapControl.Map.Layers);
             mapControl.Refresh();
         }
@@ -136,6 +140,7 @@
             mapControl.Map.Layers.Clear();
             mapControl.Map.Layers.Add(new TileLayer(new MapTilerTileSource()));
             layerList.Initialize(mapControl.Map.Layers);
+            mapControl.ZoomToFullEnvelope();
             mapControl.Refresh();
         }

@@ -162,6 +167,7 @@
             mapControl.Map.Layers.Clear();
             mapControl.Map.Layers.Add(WmsSample.Create());
             layerList.Initialize(mapControl.Map.Layers);
+            mapControl.ZoomToFullEnvelope();
             mapControl.Refresh();
         }

@@ -170,6 +176,7 @@
             mapControl.Map.Layers.Clear();
             mapControl.Map.Layers.Add(ArcGISImageServiceSample.Create());
             layerList.Initialize(mapControl.Map.Layers);
+            mapControl.ZoomToFullEnvelope();
             mapControl.Refresh();
         }
     }


Fix rare IndexOutOfRangeException closing the app

--- MultiMiner.Win/Forms/MinerForm.cs
+++ MultiMiner.Win/Forms/MinerForm.cs
@@ -550,7 +550,8 @@
                 }

                 foreach (int selectedIndex in selectedIndexes)
-                    if (selectedIndex < deviceListView.Items.Count)
+                    //selectedIndex may be -1, check for that
+                    if ((selectedIndex >= 0) && (selectedIndex < deviceListView.Items.Count))
                         deviceListView.Items[selectedIndex].Selected = true;
             }
             finally


Mark the dictionary used to store _PlatformFolders readonly

--- Sharpmake/MSBuildGlobalSettings.cs
+++ Sharpmake/MSBuildGlobalSettings.cs
@@ -22,7 +22,7 @@
     /// </summary>
     public class MSBuildGlobalSettings
     {
-        private static ConcurrentDictionary<Tuple<DevEnv, Platform>, string> s_cppPlatformFolders = new ConcurrentDictionary<Tuple<DevEnv, Platform>, string>();
+        private static readonly ConcurrentDictionary<Tuple<DevEnv, Platform>, string> s_cppPlatformFolders = new ConcurrentDictionary<Tuple<DevEnv, Platform>, string>();

         /// <summary>
         /// Allows overwriting the MSBuild platform folder used for a given platform and Visual Studio version.