Add InstructionalButtons.MaxWidth property

--- Source/Elements/InstructionalButtons.cs
+++ Source/Elements/InstructionalButtons.cs
@@ -18,6 +18,7 @@
         public Scaleform Scaleform { get; }
         public InstructionalButtonsCollection Buttons { get; }
         public Color BackgroundColor { get; set; } = DefaultBackgroundColor;
+        public float MaxWidth { get; set; } = 1.0f;

         public InstructionalButtons()
         {
@@ -57,6 +58,7 @@

             Scaleform.CallFunction("CLEAR_ALL");
             Scaleform.CallFunction("TOGGLE_MOUSE_BUTTONS", true);
+            Scaleform.CallFunction("SET_MAX_WIDTH", MaxWidth);

             for (int i = 0, slot = 0; i < Buttons.Count; i++)
             {
@@ -72,7 +74,7 @@
             }

             Scaleform.CallFunction("SET_BACKGROUND_COLOUR", (int)BackgroundColor.R, (int)BackgroundColor.G, (int)BackgroundColor.B, (int)BackgroundColor.A);
-            Scaleform.CallFunction("DRAW_INSTRUCTIONAL_BUTTONS", -1);
+            Scaleform.CallFunction("DRAW_INSTRUCTIONAL_BUTTONS", 0);

             needsUpdate = false;
         }


added public virtual void GetAsync<TResult>(string path)

--- Source/Facebook/FacebookClient.Async.cs
+++ Source/Facebook/FacebookClient.Async.cs
@@ -519,6 +519,20 @@
         }

         /// <summary>
+        /// Makes an asynchronous GET request to the Facebook server.
+        /// </summary>
+        /// <param name="path">The resource path or the resource url.</param>
+        /// <typeparam name="TResult">The result type.</typeparam>
+#if FLUENTHTTP_CORE_TPL
+        [Obsolete("Use GetTaskAsync instead.")]
+        [EditorBrowsable(EditorBrowsableState.Never)]
+#endif
+        public virtual void GetAsync<TResult>(string path)
+        {
+            GetAsync<TResult>(path, null);
+        }
+
+        /// <summary>
         /// Makes an asynchronous POST request to the Facebook server.
         /// </summary>
         /// <param name="parameters">The parameters</param>


Use Registration block to configure services

--- Source/Miruken/Register/Registration.cs
+++ Source/Miruken/Register/Registration.cs
@@ -15,6 +15,7 @@
         private SourceSelector _publicSources;
         private TypeSelector _select;
         private Predicate<Type> _exclude;
+        private readonly IServiceCollection _services;

         public delegate IImplementationTypeSelector SourceSelector(ITypeSourceSelector source);
         public delegate void TypeSelector(IImplementationTypeSelector source, bool publicOnly);
@@ -25,10 +26,16 @@

         public Registration(IServiceCollection services)
         {
-            Services = services ?? new ServiceCollection();
+            _services = services ?? new ServiceCollection();
         }

-        public IServiceCollection Services { get; }
+        public Registration Services(Action<IServiceCollection> services)
+        {
+            if (services == null)
+                throw new ArgumentNullException(nameof(services));
+            services(_services);
+            return this;
+        }

         public Registration Sources(params SourceSelector[] sources)
         {
@@ -62,7 +69,7 @@
         {
             if (_sources != null || _publicSources != null)
             {
-                Services.Scan(scan =>
+                _services.Scan(scan =>
                 {
                     foreach (var source in GetSources())
                     {
@@ -82,7 +89,7 @@
                 });
             }

-            return Services;
+            return _services;
         }

         public Registration AddFilters(params IFilterProvider[] providers)


fixed place where toint was being called on a non numeric string

--- Source/Tools/BenDownloader/BenRunner.cs
+++ Source/Tools/BenDownloader/BenRunner.cs
@@ -138,7 +138,7 @@
             }
             finally
             {
-                lastFileDownloaded = curRecId.ToString();
+                //lastFileDownloaded = curRecId.ToString();

             }
         }
@@ -192,24 +192,21 @@
                     while (!dirReader.EndOfData)
                     {
                         curRow = dirReader.ReadFields();
-                        if (Convert.ToInt32(curRow[0]) > Convert.ToInt32(lastFileDownloaded))
+
+                        if (Convert.ToInt32(curRow[2]) < BENMAXFILESIZE)
                         {
-                            if (Convert.ToInt32(curRow[2]) < BENMAXFILESIZE)
-                            {
-                                BenRecord curRecord = new BenRecord(Convert.ToInt32(curRow[0]), Convert.ToDateTime(curRow[1]), Convert.ToInt32(curRow[2]));
-                                downloadList.Add(curRecord);
-                            }
-                            else
-                            {
-                                SendFileTooLargeEmailNotification("Record id: " + curRow[0]);
-                            }
+                            BenRecord curRecord = new BenRecord(Convert.ToInt32(curRow[0]), Convert.ToDateTime(curRow[1]), Convert.ToInt32(curRow[2]));
+                            downloadList.Add(curRecord);
                         }
                         else
                         {
-                            SendFileNumberLargerEmailNotification("Record id: " + curRow[0], downloadFileNumber);
+                            SendFileTooLargeEmailNotification("Record id: " + curRow[0]);
                         }
+
                     }
                     dirReader.Close();
+                    FileSystem.DeleteFile(dirFile);
+
                 }
                 else
                 {
@@ -437,6 +434,7 @@

             return lastFile;
         }
+

         #endregion


updated to produce binary comtrade

updated to produce binary comtrade

--- Source/Tools/BenDownloader/BenRunner.cs
+++ Source/Tools/BenDownloader/BenRunner.cs
@@ -355,7 +355,7 @@
                             "RecordNum=" + currec.Id + System.Environment.NewLine +
                             "SubBenNum=0" + System.Environment.NewLine +
                             "Origin=1" + System.Environment.NewLine +
-                            "OptionFlags=1" + System.Environment.NewLine +
+                            "OptionFlags=2" + System.Environment.NewLine +
                             "DataPath=" + m_tempDirectoryName + System.Environment.NewLine +
                             "FileName=" + Get232Fn(currec.DateTime, currec.Id.ToString());

@@ -542,7 +542,7 @@
             }
             catch (Exception ex)
             {
-                Program.Log("StatusLog Update (" + m_siteName + "): " + ex.Message, m_tempDirectoryName);
+                Program.Log("StatusLog Update (" + m_siteName + ") failed: " + ex.Message, m_tempDirectoryName);
             }
         }

@@ -680,16 +680,23 @@

         private void SendEmail(string msgTo, string msgFrom, string msgSubject, string msgBody)
         {
-            if (bool.Parse(ConfigurationFile.Current.Settings["systemSettings"]["EmailNotificationsEnabled"].Value))
-            {
-                MailAddress mf = new MailAddress(msgFrom);
-                MailAddress mt = new MailAddress(msgTo);
-                MailMessage msg = new MailMessage(mf, mt);
-                msg.Subject = msgSubject;
-                msg.Body = msgBody;
-
-                SmtpClient mclient = new SmtpClient(ConfigurationFile.Current.Settings["systemSettings"]["Mailserver"].Value);
-                mclient.Send(msg);
+            try
+            {
+                if (bool.Parse(Program.OpenMiConfigurationFile.Settings["systemSettings"]["EmailNotificationsEnabled"]?.Value ?? "false"))
+                {
+                    MailAddress mf = new MailAddress(msgFrom);
+                    MailAddress mt = new MailAddress(msgTo);
+                    MailMessage msg = new MailMessage(mf, mt);
+                    msg.Subject = msgSubject;
+                    msg.Body = msgBody;
+
+                    SmtpClient mclient = new SmtpClient(Program.OpenMiConfigurationFile.Settings["systemSettings"]["Mailserver"].Value);
+                    mclient.Send(msg);
+                }
+            }
+            catch (Exception ex)
+            {
+                Program.Log("Failed Sending Email: " + ex.Message);
             }
         }


Lock now changes to green when unlocked

Lock now changes to green when unlocked

--- Haunt/Assets/Lock.cs
+++ Haunt/Assets/Lock.cs
@@ -7,8 +7,19 @@
 	public bool isLocked;
 	public MultipleLockDoor door;

+	Renderer rend;
+	[SerializeField] Material lockedMat;
+	[SerializeField] Material unlockedMat;
+
+	public void Start () {
+
+		rend = GetComponent<Renderer> ();
+	}
+
 	public void ToggleLock () {
 		isLocked = !isLocked;
 		door.CheckLocks ();
+
+		rend.material = /*rend.material == lockedMat ?*/ unlockedMat/* : lockedMat*/;
 	}
 }


Only consider full width frames when looking for the left and right item border

--- ItemCollage/Form1.cs
+++ ItemCollage/Form1.cs
@@ -108,11 +108,16 @@
                         where Range(-5, 5).All(dx =>
                             Range(-5, 5).All(dy => bmp.IsBlackAt(x + dx, y + dy)))
                         select new Point(x, y);
-            var frames = black.Select(p => FindFrame(bmp, p, false));
+            var frames = black.Select(p => FindFrame(bmp, p, false)).
+                OrderBy(f => f.Width);
+
+            // reject all frames that aren't full width
+            var fullWidth = frames.LastOrDefault().Width;
+            var fullFrames = frames.Where(f => f.Width == fullWidth);

             // then, its left and right border
-            var left = frames.OrderBy(f => f.Left).FirstOrDefault();
-            var right = frames.OrderBy(f => f.Right).LastOrDefault();
+            var left = fullFrames.OrderBy(f => f.Left).FirstOrDefault();
+            var right = fullFrames.OrderBy(f => f.Right).LastOrDefault();
             if (left.Width == 0 && right.Width == 0) return null;

             // and from there find the outer frame


fixed unit tests to pass on the new results of soql2sqltranslator

--- tests/TestCases/Soql/SoqlTranslatorTest.cs
+++ tests/TestCases/Soql/SoqlTranslatorTest.cs
@@ -160,7 +160,7 @@
         public void SelectFromRelationTest1() {
             AssertTranslation(
                 "select c.Contact.Name,c.Role.Name from ContactToRole c where c.Contact.PrimaryGroup.Manager.Name = 'Mary Manager'",
-                "select t0.name as c_Contact_Name, t1.name as c_Role_Name from ContactRole c left outer join Contact t0 on (c.contact_id = t0.id) left outer join _Role t1 on (c.role_id = t1.id) left outer join _Group t2 on (t0.primary_group = t2.id) left outer join Contact t3 on (t2.manager = t3.id) where (t3.name = 'Mary Manager')");
+                "select t0.name as c_Contact_Name, t1.name as c_Role_Name from ContactRole c left outer join Contact t0 on (c.contact_id = t0.id) left outer join _Role t1 on (c.role_id = t1.id) left outer join _Group t2 on (t0.primary_group = t2.id) left outer join Contact t3 on (t2.manager = t3.id) where (t3.name = {L:AnsiString:Mary Manager})");
         }
         [Test]
         public void SelectCountAsteriskTest1() {
@@ -199,7 +199,7 @@
         public void OneToManyContainsTest2() {
             AssertTranslation(
                 "select Name from Group where Members.Contains(select ContactId from Contact where Name='Mary Manager')",
-                "select t0.name as Name from _Group t0 where exists (select * from Contact where primary_group=t0.id and id in (select t1.id as ContactId from Contact t1 where (t1.name = 'Mary Manager')))");
+                "select t0.name as Name from _Group t0 where exists (select * from Contact where primary_group=t0.id and id in (select t1.id as ContactId from Contact t1 where (t1.name = {L:AnsiString:Mary Manager})))");
         }

         [Test]
@@ -212,7 +212,7 @@
 where    exists (select * from Contact where primary_group=t0.id and id in (
     select   t1.id as [ContactId]
     from     Contact t1
-    where    (t1.name = 'Mary Manager')))
+    where    (t1.name = {L:AnsiString:Mary Manager})))
 ");
         }

@@ -227,14 +227,14 @@
         public void ManyToManyContainsTest2() {
             AssertTranslation(
                 "select Name from Contact where Roles.Contains(select Id from Role where Name like 'Man%')",
-                "select t0.name as Name from Contact t0 where exists (select * from ContactRole where contact_id=t0.id and role_id in (select t1.id as Id from _Role t1 where (t1.name like 'Man%')))");
+                "select t0.name as Name from Contact t0 where exists (select * from ContactRole where contact_id=t0.id and role_id in (select t1.id as Id from _Role t1 where (t1.name like {L:String:Man%})))");
         }

         [Test]
         public void ManyToManyContainsTest3() {
             AssertTranslation(
                 "select Name from Contact where Roles.Contains(select Id from Role where Name like 'Man%' and Members.Contains(1))",
-                "select t0.name as Name from Contact t0 where exists (select * from ContactRole where contact_id=t0.id and role_id in (select t1.id as Id from _Role t1 where ((t1.name like 'Man%') and exists (select * from ContactRole where role_id=t1.id and contact_id in (1)))))");
+                "select t0.name as Name from Contact t0 where exists (select * from ContactRole where contact_id=t0.id and role_id in (select t1.id as Id from _Role t1 where ((t1.name like {L:String:Man%}) and exists (select * from ContactRole where role_id=t1.id and contact_id in (1)))))");
         }

         [Test]
@@ -247,7 +247,7 @@
 where    exists (select * from ContactRole where contact_id=t0.id and role_id in (
     select   t1.id as [Id]
     from     _Role t1
-    where    ((t1.name like 'Man%') and exists (select * from ContactRole where role_id=t1.id and contact_id in (
+    where    ((t1.name like {L:String:Man%}) and exists (select * from ContactRole where role_id=t1.id and contact_id in (
 1)))))
 ");
         }
@@ -265,7 +265,7 @@
                 @"
                 select c2.Name
                 from Contact c2
-                where exists (ContactToRole cr where cr.Role = 'Unit Manager' and cr.Contact = c2.PrimaryGroup.Manager)",
+                where exists (ContactToRole cr where cr.Role.Name = 'Unit Manager' and cr.Contact = c2.PrimaryGroup.Manager)",
                 null);
         }

@@ -307,7 +307,7 @@
          left outer join Contact t0 on (cr.contact_id = t0.id)
          left outer join _Group t1 on (t0.primary_group = t1.id)
          left outer join Contact t2 on (t1.manager = t2.id)
-where    ((((t2.name = 'zzz') and exists (
+where    ((((t2.name = {L:AnsiString:zzz}) and exists (
     select   *
     from     Contact t3
     where    (t3.name = t0.name)
@@ -319,15 +319,15 @@
     select   *
     from     _Group t5
              left outer join Contact t6 on (t5.manager = t6.id)
-    where    ((((t6.name = 'Mary Manager') and ((select count(*) from Contact where primary_group=t5.id) > 3)) and exists (select * from Contact where primary_group=t5.id and id in (
+    where    ((((t6.name = {L:AnsiString:Mary Manager}) and ((select count(*) from Contact where primary_group=t5.id) > 3)) and exists (select * from Contact where primary_group=t5.id and id in (
         select   t7.id as [ContactId]
         from     Contact t7
                  left outer join _Group t8 on (t7.primary_group = t8.id)
-        where    ((t7.name = 'ZZZ') and exists (select * from Contact where primary_group=t8.id and id in (
+        where    ((t7.name = {L:AnsiString:ZZZ}) and exists (select * from Contact where primary_group=t8.id and id in (
 3)))))) and exists (select * from ContactRole where contact_id=t6.id and role_id in (
         select   t9.id as [Id]
         from     _Role t9
-        where    (t9.name = 'Customer'))))
+        where    (t9.name = {L:String:Customer}))))
 ))
 ");
         }


Add working retry logic

Add working retry logic

--- osu.Framework.Tests/IO/TestWebRequest.cs
+++ osu.Framework.Tests/IO/TestWebRequest.cs
@@ -20,11 +20,8 @@
         private const string valid_get_url = "httpbin.org/get";
         private const string invalid_get_url = "a.ppy.shhhhh";

-        [TestCase("http", false)]
-        [TestCase("https", false)]
-        [TestCase("http", true)]
-        [TestCase("https", true)]
-        public void TestValidGet(string protocol, bool async)
+        [Test, Retry(5)]
+        public void TestValidGet([Values("http", "https")] string protocol, [Values(true, false)] bool async)
         {
             var url = $"{protocol}://httpbin.org/get";
             var request = new JsonWebRequest<HttpBinGetResponse>(url) { Method = HttpMethod.GET };
@@ -49,11 +46,8 @@
             Assert.IsFalse(hasThrown);
         }

-        [TestCase("http", false)]
-        [TestCase("https", false)]
-        [TestCase("http", true)]
-        [TestCase("https", true)]
-        public void TestInvalidGetExceptions(string protocol, bool async)
+        [Test, Retry(5)]
+        public void TestInvalidGetExceptions([Values("http", "https")] string protocol, [Values(true, false)] bool async)
         {
             var request = new WebRequest($"{protocol}://{invalid_get_url}") { Method = HttpMethod.GET };

@@ -72,9 +66,8 @@
             Assert.IsNotNull(finishedException);
         }

-        [TestCase(false)]
-        [TestCase(true)]
-        public void TestBadStatusCode(bool async)
+        [Test, Retry(5)]
+        public void TestBadStatusCode([Values(true, false)] bool async)
         {
             var request = new WebRequest("https://httpbin.org/hidden-basic-auth/user/passwd");

@@ -98,9 +91,8 @@
         /// Tests aborting the <see cref="WebRequest"/> after response has been received from the server
         /// but before data has been read.
         /// </summary>
-        [TestCase(false)]
-        [TestCase(true)]
-        public void TestAbortReceive(bool async)
+        [Test, Retry(5)]
+        public void TestAbortReceive([Values(true, false)] bool async)
         {
             var request = new JsonWebRequest<HttpBinGetResponse>("https://httpbin.org/get") { Method = HttpMethod.GET };

@@ -124,7 +116,7 @@
         /// <summary>
         /// Tests aborting the <see cref="WebRequest"/> before the request is sent to the server.
         /// </summary>
-        [Test]
+        [Test, Retry(5)]
         public void TestAbortRequest()
         {
             var request = new JsonWebRequest<HttpBinGetResponse>("https://httpbin.org/get") { Method = HttpMethod.GET };
@@ -149,9 +141,8 @@
         /// <summary>
         /// Tests being able to abort + restart a request.
         /// </summary>
-        [TestCase(false)]
-        [TestCase(true)]
-        public void TestRestartAfterAbort(bool async)
+        [Test, Retry(5)]
+        public void TestRestartAfterAbort([Values(true, false)] bool async)
         {
             var request = new JsonWebRequest<HttpBinGetResponse>("https://httpbin.org/get") { Method = HttpMethod.GET };

@@ -181,7 +172,7 @@
         /// <summary>
         /// Tests that specifically-crafted <see cref="WebRequest"/> is completed after one timeout.
         /// </summary>
-        [Test]
+        [Test, Retry(5)]
         public void TestOneTimeout()
         {
             var request = new DelayedWebRequest
@@ -207,7 +198,7 @@
         /// <summary>
         /// Tests that a <see cref="WebRequest"/> will only timeout a maximum of <see cref="WebRequest.MAX_RETRIES"/> times before being aborted.
         /// </summary>
-        [Test]
+        [Test, Retry(5)]
         public void TestFailTimeout()
         {
             var request = new WebRequest("https://httpbin.org/delay/4")
@@ -232,9 +223,8 @@
         /// <summary>
         /// Tests being able to abort + restart a request.
         /// </summary>
-        [TestCase(false)]
-        [TestCase(true)]
-        public void TestEventUnbindOnCompletion(bool async)
+        [Test, Retry(5)]
+        public void TestEventUnbindOnCompletion([Values(true, false)] bool async)
         {
             var request = new JsonWebRequest<HttpBinGetResponse>("https://httpbin.org/get") { Method = HttpMethod.GET };

@@ -256,9 +246,8 @@
         /// <summary>
         /// Tests being able to abort + restart a request.
         /// </summary>
-        [TestCase(false)]
-        [TestCase(true)]
-        public void TestUnbindOnDispose(bool async)
+        [Test, Retry(5)]
+        public void TestUnbindOnDispose([Values(true, false)] bool async)
         {
             WebRequest request;
             using (request = new JsonWebRequest<HttpBinGetResponse>("https://httpbin.org/get") { Method = HttpMethod.GET })
@@ -279,9 +268,8 @@
             }
         }

-        [TestCase(false)]
-        [TestCase(true)]
-        public void TestPostWithJsonResponse(bool async)
+        [Test, Retry(5)]
+        public void TestPostWithJsonResponse([Values(true, false)] bool async)
         {
             var request = new JsonWebRequest<HttpBinPostResponse>("https://httpbin.org/post") { Method = HttpMethod.POST };

@@ -312,9 +300,8 @@
             Assert.IsTrue(responseObject.Headers.ContentType.StartsWith("multipart/form-data; boundary="));
         }

-        [TestCase(false)]
-        [TestCase(true)]
-        public void TestPostWithJsonRequest(bool async)
+        [Test, Retry(5)]
+        public void TestPostWithJsonRequest([Values(true, false)] bool async)
         {
             var request = new JsonWebRequest<HttpBinPostResponse>("https://httpbin.org/post") { Method = HttpMethod.POST };

@@ -338,11 +325,8 @@
             Assert.IsTrue(responseObject.Headers.ContentType == null);
         }

-        [TestCase(false, false)]
-        [TestCase(false, true)]
-        [TestCase(true, false)]
-        [TestCase(true, true)]
-        public void TestGetBinaryData(bool async, bool chunked)
+        [Test, Retry(5)]
+        public void TestGetBinaryData([Values(true, false)] bool async, [Values(true, false)] bool chunked)
         {
             const int bytes_count = 65536;
             const int chunk_size = 1024;
@@ -415,6 +399,7 @@
             public Action CompleteInvoked;

             private int delay;
+
             public int Delay
             {
                 get { return delay; }


Update DrawVisualiser to use new elegant formatting.

--- osu.Framework/Graphics/DrawVisualiser.cs
+++ osu.Framework/Graphics/DrawVisualiser.cs
@@ -21,14 +21,9 @@
             Depth = 0
         };

-        ScrollContainer scroll = new ScrollContainer();
-
-        FlowContainer flow = new FlowContainer()
-        {
-            Direction = FlowDirection.VerticalOnly
-        };
-
+        FlowContainer flow;
         Drawable target;
+
         private ScheduledDelegate scheduledUpdater;
         private SpriteText loadMessage;

@@ -36,18 +31,20 @@
         {
             base.Load();

-            AddProcessing(new MaskingContainer());
-
-            scroll.Add(flow);
-
-            Add(background);
-            Add(scroll);
-
-            Add(loadMessage = new SpriteText()
-            {
-                Text = @"Click to load DrawVisualiser",
-                Anchor = Anchor.Centre,
-                Origin = Anchor.Centre
+            Add(new MaskingContainer
+            {
+                Kids = new Drawable[]
+                {
+                    background,
+                    new ScrollContainer {
+                        Kids = new [] { flow = new FlowContainer { Direction = FlowDirection.VerticalOnly } }
+                    },
+                    loadMessage = new SpriteText {
+                        Text = @"Click to load DrawVisualiser",
+                        Anchor = Anchor.Centre,
+                        Origin = Anchor.Centre
+                    }
+                }
             });
         }


Completely ignore spinners from note lock

--- osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs
+++ osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs
@@ -90,7 +90,14 @@

         private bool checkHittable(DrawableOsuHitObject osuHitObject)
         {
-            var lastObject = HitObjectContainer.AliveObjects.GetPrevious(osuHitObject);
+            DrawableHitObject lastObject = osuHitObject;
+
+            // Get the last hitobject that contributes to note lock
+            while ((lastObject = HitObjectContainer.AliveObjects.GetPrevious(lastObject)) != null)
+            {
+                if (contributesToNoteLock(lastObject.HitObject))
+                    break;
+            }

             // If there is no previous object alive, allow the hit.
             if (lastObject == null)
@@ -166,10 +173,19 @@
         }

         /// <summary>
-        /// Whether a <see cref="HitObject"/> can be missed and causes other hitobjects to be missed during notelock.
+        /// Whether a <see cref="HitObject"/> is contributes to note lock.
+        /// Future contributing <see cref="HitObject"/>s will not be hittable until the start time of the last contributing <see cref="HitObject"/> is reached.
         /// </summary>
         /// <param name="hitObject">The <see cref="HitObject"/> to test.</param>
-        /// <returns>Whether <paramref name="hitObject"/> contributes to notelock misses.</returns>
+        /// <returns>Whether <paramref name="hitObject"/> causes note lock.</returns>
+        private bool contributesToNoteLock(HitObject hitObject)
+            => hitObject is HitCircle || hitObject is Slider;
+
+        /// <summary>
+        /// Whether a <see cref="HitObject"/> can be missed and causes other <see cref="HitObject"/>s to be missed when hit out-of-order during note lock.
+        /// </summary>
+        /// <param name="hitObject">The <see cref="HitObject"/> to test.</param>
+        /// <returns>Whether <paramref name="hitObject"/> contributes to note lock misses.</returns>
         private bool causesNoteLockMisses(HitObject hitObject)
             => hitObject is HitCircle && !(hitObject is SliderTailCircle);


Remove interlocked within a lock

Remove interlocked within a lock

--- osu.Game/Database/ArchiveModelManager.cs
+++ osu.Game/Database/ArchiveModelManager.cs
@@ -161,8 +161,8 @@
                     lock (imported)
                     {
                         imported.Add(model);
-
-                        Interlocked.Increment(ref current);
+                        current++;
+
                         notification.Text = $"Imported {current} of {paths.Length} {humanisedModelName}s";
                         notification.Progress = (float)current / paths.Length;
                     }


Move `previousContext` assign within `lock` to make things look safer

Not an actual requirement, but no harm.

--- osu.Game/Database/RealmContextFactory.cs
+++ osu.Game/Database/RealmContextFactory.cs
@@ -2,6 +2,7 @@
 // See the LICENCE file in the repository root for full licence text.

 using System;
+using System.Diagnostics;
 using System.Threading;
 using osu.Framework.Allocation;
 using osu.Framework.Development;
@@ -166,11 +167,15 @@
         private void flushContexts()
         {
             Logger.Log(@"Flushing realm contexts...", LoggingTarget.Database);
-
-            var previousContext = context;
+            Debug.Assert(blockingLock.CurrentCount == 0);
+
+            Realm previousContext;

             lock (updateContextLock)
+            {
+                previousContext = context;
                 context = null;
+            }

             // wait for all threaded usages to finish
             while (active_usages.Value > 0)


Less intrusive NancyHost-initialization

Less intrusive NancyHost-initialization

--- OmniSharp/Program.cs
+++ OmniSharp/Program.cs
@@ -74,7 +74,7 @@
                             e.Cancel = true;
                         };

-                var nancyHost = new NancyHost(new Bootstrapper(solution, new NativeFileSystem(), verbose), new Uri("http://localhost:" + port));
+                var nancyHost = new NancyHost(new Bootstrapper(solution, new NativeFileSystem(), verbose), new HostConfiguration{RewriteLocalhost=false}, new Uri("http://localhost:" + port));

                 nancyHost.Start();
                 Console.WriteLine("OmniSharp server is listening");


Quit gracefully

Quit gracefully

--- OmniSharp/Program.cs
+++ OmniSharp/Program.cs
@@ -53,9 +53,18 @@
             var solution = new CSharpSolution(solutionPath);

             var nancyHost = new NancyHost(new Bootstrapper(solution), new Uri("http://localhost:" + port));
-
-            nancyHost.Start();
-
+
+            try
+            {
+                nancyHost.Start();
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine("{0} Exception caught.", e);
+                //Quit gracefully
+                return;
+            }
+
             while (Console.ReadLine() != "exit")
             {
                 Thread.Sleep(1000); // To fix CPU spike on linux


Update ents.cs

Update ents.cs

--- Runtime/LibMisc/ents.cs
+++ Runtime/LibMisc/ents.cs
@@ -72,7 +72,15 @@
 				source[length++] = e;
 			}
 		}
-
+
+		[Il2CppSetOption(Option.NullChecks | Option.ArrayBoundsChecks, false)]
+		public void Add(ents entities)
+		{
+			for (int i = 0; i < entities.length; i++)
+			{
+				Add(entities[i]);
+			}
+		}

 		[Il2CppSetOption(Option.NullChecks | Option.ArrayBoundsChecks, false)]
 		public bool Remove(in ent entity)


Revert "Template S Algorithm"

Revert "Template S Algorithm"

This reverts commit d6ab9c6c7707409710eecdc1c4987847c3e9655b.

--- SQLSkyline/TemplateS.cs
+++ SQLSkyline/TemplateS.cs
@@ -1,139 +0,0 @@
-using System;
-using System.Data;
-using System.Data.SqlClient;
-using System.Data.SqlTypes;
-using Microsoft.SqlServer.Server;
-using System.Collections;
-using System.Collections.Generic;
-
-//Caution: Attention small changes in this code can lead to performance issues, i.e. using a startswith instead of an equal can increase by 10 times
-//Important: Only use equal for comparing text (otherwise performance issues)
-namespace prefSQL.SQLSkyline
-{
-    public abstract class TemplateS
-    {
-
-        public DataTable getSkylineTable(String strQuery, String strOperators, int numberOfRecords, String strConnection)
-        {
-            return getSkylineTable(strQuery, strOperators, numberOfRecords, true, strConnection);
-        }
-
-        protected DataTable getSkylineTable(String strQuery, String strOperators, int numberOfRecords, bool isIndependent, string strConnection)
-        {
-            ArrayList resultCollection = new ArrayList();
-            ArrayList resultstringCollection = new ArrayList();
-            string[] operators = strOperators.ToString().Split(';');
-            DataTable dtResult = new DataTable();
-
-            SqlConnection connection = null;
-            if (isIndependent == false)
-                connection = new SqlConnection(Helper.cnnStringSQLCLR);
-            else
-                connection = new SqlConnection(strConnection);
-
-            try
-            {
-                //Some checks
-                if (strQuery.ToString().Length == Helper.MaxSize)
-                {
-                    throw new Exception("Query is too long. Maximum size is " + Helper.MaxSize);
-                }
-                connection.Open();
-
-                SqlDataAdapter dap = new SqlDataAdapter(strQuery.ToString(), connection);
-                DataTable dt = new DataTable();
-                dap.Fill(dt);
-
-
-                // Build our record schema
-                List<SqlMetaData> outputColumns = Helper.buildRecordSchema(dt, operators, ref dtResult);
-                SqlDataRecord record = new SqlDataRecord(outputColumns.ToArray());
-
-
-
-                //Read all records only once. (SqlDataReader works forward only!!)
-                DataTableReader sqlReader = dt.CreateDataReader();
-                while (sqlReader.Read())
-                {
-                    //Check if window list is empty
-                    if (resultCollection.Count == 0)
-                    {
-                        // Build our SqlDataRecord and start the results
-                        addtoWindow(sqlReader, operators, ref resultCollection, ref resultstringCollection, record, true, ref dtResult);
-                    }
-                    else
-                    {
-                        bool isDominated = false;
-
-                        //check if record is dominated (compare against the records in the window)
-                        for (int i = resultCollection.Count - 1; i >= 0; i--)
-                        {
-                            if (tupleDomination(ref resultCollection, ref resultstringCollection, sqlReader, operators, ref dtResult, i) == true)
-                            {
-                                isDominated = true;
-                                break;
-                            }
-                        }
-                        if (isDominated == false)
-                        {
-                            addtoWindow(sqlReader, operators, ref resultCollection, ref resultstringCollection, record, true, ref dtResult);
-                        }
-
-                    }
-                }
-
-                sqlReader.Close();
-
-                //Remove certain amount of rows if query contains TOP Keyword
-                Helper.getAmountOfTuples(dtResult, numberOfRecords);
-
-                if (isIndependent == false)
-                {
-                    //Send results to client
-                    SqlContext.Pipe.SendResultsStart(record);
-
-                    //foreach (SqlDataRecord recSkyline in btg[iItem])
-                    foreach (DataRow recSkyline in dtResult.Rows)
-                    {
-                        for (int i = 0; i < recSkyline.Table.Columns.Count; i++)
-                        {
-                            record.SetValue(i, recSkyline[i]);
-                        }
-                        SqlContext.Pipe.SendResultsRow(record);
-                    }
-                    SqlContext.Pipe.SendResultsEnd();
-                }
-
-
-            }
-            catch (Exception ex)
-            {
-                //Pack Errormessage in a SQL and return the result
-                string strError = "Fehler in SP_SkylineBNL: ";
-                strError += ex.Message;
-
-                if (isIndependent == true)
-                {
-                    System.Diagnostics.Debug.WriteLine(strError);
-
-                }
-                else
-                {
-                    SqlContext.Pipe.Send(strError);
-                }
-
-            }
-            finally
-            {
-                if (connection != null)
-                    connection.Close();
-            }
-            return dtResult;
-        }
-
-        protected abstract bool tupleDomination(ref ArrayList resultCollection, ref ArrayList resultstringCollection, DataTableReader sqlReader, string[] operators, ref DataTable dtResult, int i);
-
-        protected abstract void addtoWindow(DataTableReader sqlReader, string[] operators, ref ArrayList resultCollection, ref ArrayList resultstringCollection, SqlDataRecord record, bool isFrameworkMode, ref DataTable dtResult);
-
-    }
-}


Fix docs

Fix docs

--- Saule/TypeExtensions.cs
+++ Saule/TypeExtensions.cs
@@ -40,10 +40,10 @@
         }

         /// <summary>
-        /// Get the type of the items if the type is an <see cref="IEnumerable"/> (if not it will return the input type).
+        /// Get the type of the items if the type is an <see cref="IEnumerable{T}"/> (if not it will return the input type).
         /// </summary>
         /// <param name="type">The type to apply this extension method to.</param>
-        /// <returns>The type of the items if the type is an <see cref="IEnumerable"/> (if not it will return the input type).</returns>
+        /// <returns>The type of the items if the type is an <see cref="IEnumerable{T}"/> (if not it will return the input type).</returns>
         public static Type TryGetCollectionType(this Type type)
         {
             var collectionType = type.GetInterfaces().FirstOrDefault(i => i.IsEnumerable());


Deleted Stack from the 2.1

Deleted Stack from the 2.1

--- Semester_2/2.1/Stack.cs
+++ Semester_2/2.1/Stack.cs
@@ -1,37 +0,0 @@
-using System.Collections.Generic;
-
-namespace Stack
-{
-    class Stack
-    {
-        private List<int> list = new List<int>();
-
-        ///adds an integer to the stack
-        public void Push(int a)
-        {
-            list.Add(a);
-        }
-
-        ///returns last element of the stack
-        public int Top()
-        {
-            if (list.Count == 0)
-            {
-                return 0;
-            }
-            return list[list.Count - 1];
-        }
-
-        ///removes last element from the stack and returns its value
-        public int Pop()
-        {
-            if (list.Count == 0)
-            {
-                return 0;
-            }
-            int result = list[list.Count - 1];
-            list.RemoveAt(list.Count - 1);
-            return result;
-        }
-    }
-}


Add LLVM fragments

Add LLVM fragments

--- Sharpmake/Options.Vc.cs
+++ Sharpmake/Options.Vc.cs
@@ -44,7 +44,11 @@
                     [DevEnvVersion(minimum = DevEnv.vs2017)]
                     v141_xp, // Visual Studio 2017 - Windows XP
                     [DevEnvVersion(minimum = DevEnv.vs2012)]
-                    LLVM_vs2012 // LLVM from Visual Studio 2012
+                    LLVM_vs2012, // LLVM from Visual Studio 2012
+                    [DevEnvVersion(minimum = DevEnv.vs2015)]
+                    LLVM_vs2014, // LLVM from Visual Studio 2015
+                    [DevEnvVersion(minimum = DevEnv.vs2017)]
+                    LLVM, // LLVM from Visual Studio 2017
                 }

                 public enum WindowsTargetPlatformVersion


(TFS CS 3039)

(TFS CS 3039)

--- Signum.Web/Navigator.cs
+++ Signum.Web/Navigator.cs
@@ -597,6 +597,9 @@
             if (GlobalIsFindable != null && !GlobalIsFindable(queryName))
                 return false;

+            if (QuerySettings == null)
+                return false;
+
             return QuerySettings.ContainsKey(queryName);
         }
     }


Added disabled() method to SimpleCrosslinkRobot

--- SimpleCrosslinkRobot.cs
+++ SimpleCrosslinkRobot.cs
@@ -40,9 +40,14 @@

         private void periodic(object source, ElapsedEventArgs e)
         {
-            if (State == State.Teleop)
+            switch (State)
             {
-                teleop();
+                case crosslink.State.Disabled:
+                    disabled();
+                    break;
+                case crosslink.State.Teleop:
+                    teleop();
+                    break;
             }
         }


Removed debug log

Removed debug log

--- Reader.cs
+++ Reader.cs
@@ -59,11 +59,10 @@

                 var pos = toftitle[0].Descendants("article").ToList();
                 foreach (var item in pos)
-                 {
+                {
                     var link = item.Descendants("a").ToList()[0].GetAttributeValue("href", null);
                     var img = item.Descendants("img").ToList()[0].GetAttributeValue("src", null);
                     var title = item.Descendants("h1").ToList()[0].InnerText;
-

                     Console.WriteLine("\n");
                     Console.WriteLine("Post Title: " + title);


- fake assembly

- fake assembly

--- tweetingest-azurefunction/run.csx
+++ tweetingest-azurefunction/run.csx
@@ -1,5 +1,4 @@
 #r "Newtonsoft.Json"
-# hap
 using System;
 using System.Net.Http;
 using System.Runtime.Serialization.Json;


Improve old log file deleting logic

Improve old log file deleting logic

* Check if an old log file exists before trying
* Make the exception handler more specific
* Write message to the debugger if deleting fails

--- KAGTools/App.xaml.cs
+++ KAGTools/App.xaml.cs
@@ -155,11 +155,17 @@
         {
             string outputTemplate = "{Timestamp:HH:mm:ss} [{Level:u3}] {Message:j}{NewLine}{Exception}";

-            try
-            {
-                File.Delete(logPath);
-            }
-            catch (Exception) { } // It's not a problem if we can't delete the old log
+            if(File.Exists(logPath))
+            {
+                try
+                {
+                    File.Delete(logPath);
+                }
+                catch (Exception ex) when (ex is UnauthorizedAccessException || ex is IOException)
+                {
+                    System.Diagnostics.Debug.WriteLine("Failed to delete previous log file due to {0}", ex);
+                }
+            }

             Log.Logger = new LoggerConfiguration()
                 .WriteTo.File(logPath, Serilog.Events.LogEventLevel.Information, outputTemplate)


Updated OnAvatarSitChanged event to include other avatars

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@1413 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife/ObjectManager.cs
+++ libsecondlife/ObjectManager.cs
@@ -152,7 +152,7 @@
         /// <param name="simulator">Simulator the packet was received from</param>
         /// <param name="sittingOn">The local ID of the object that is being sat
         /// on. If this is zero the avatar is not sitting on an object</param>
-        public delegate void AvatarSitChanged(Simulator simulator, uint sittingOn);
+        public delegate void AvatarSitChanged(Simulator simulator, Avatar avatar, uint sittingOn, uint oldSeat);

         #endregion

@@ -428,9 +428,8 @@
         /// </summary>
         public event ObjectUpdatedCallback OnObjectUpdated;
         /// <summary>
-        /// This event will be raised when the main avatar sits on an
-        /// object or stands up, with a local ID of the current seat or
-        /// zero.
+        /// This event will be raised when an avatar sits on an object
+        /// or stands up, with a local ID of the current seat or zero.
         /// </summary>
         public event AvatarSitChanged OnAvatarSitChanged;
         /// <summary>
@@ -1556,22 +1555,13 @@
                             Client.Self.Rotation = rotation;
                             Client.Self.AngularVelocity = angularVelocity;

-                            // Detect if we are sitting or standing
-                            uint oldSittingOn = Client.Self.SittingOn;
-
-                            // Fire the callback for our sitting orientation changing
-                            if (block.ParentID != oldSittingOn)
-                            {
-                                SetAvatarSelfSittingOn(block.ParentID);
-                                FireOnAvatarSitChanged(simulator, Client.Self.SittingOn);
-                            }
-
                             #endregion
                         }

                         #region Create an Avatar from the decoded data

                         Avatar avatar = GetAvatar(simulator, block.ID, block.FullID);
+                        uint oldSeatID = avatar.sittingOn;

                         avatar.ID = block.FullID;
                         avatar.LocalID = block.ID;
@@ -1584,8 +1574,9 @@
                         avatar.NameValues = nameValues;
                         avatar.Data = data;
                         avatar.GenericData = block.Data;
-
-                        SetAvatarSittingOn(avatar, block.ParentID);
+                        avatar.sittingOn = block.ParentID;
+
+                        SetAvatarSittingOn(simulator, avatar, block.ParentID, oldSeatID);

                         // Set this avatar online and in a region
                         avatar.Online = true;
@@ -2221,14 +2212,17 @@
             return prim;
         }

-        protected void SetAvatarSelfSittingOn(uint localid)
-        {
-            Client.Self.sittingOn = localid;
-        }
-
-        protected void SetAvatarSittingOn(Avatar av, uint localid)
-        {
+        protected void SetAvatarSittingOn(Simulator sim, Avatar av, uint localid, uint oldSeatID)
+        {
+            if (localid == Client.Self.LocalID) Client.Self.sittingOn = localid;
             av.sittingOn = localid;
+
+
+            if (OnAvatarSitChanged != null && oldSeatID != localid)
+            {
+                try { OnAvatarSitChanged(sim, av, localid, oldSeatID); }
+                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
+            }
         }

 		protected void UpdateDilation(Simulator s, uint dilation)
@@ -2290,15 +2284,6 @@
             if (OnNewAttachment != null)
             {
                 try { OnNewAttachment(simulator, prim, RegionHandle, TimeDilation); }
-                catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
-            }
-        }
-
-        protected void FireOnAvatarSitChanged(Simulator simulator, uint LocalID)
-        {
-            if (OnAvatarSitChanged != null)
-            {
-                try { OnAvatarSitChanged(simulator, Client.Self.sittingOn); }
                 catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); }
             }
         }


Made vertical size of all options equal

Made vertical size of all options equal

--- MainForm.Designer.cs
+++ MainForm.Designer.cs
@@ -291,8 +291,8 @@
             this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667F));
             this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667F));
             this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667F));
-            this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 22.72727F));
-            this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.62626F));
+            this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667F));
+            this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667F));
             this.tableLayoutPanel5.Size = new System.Drawing.Size(929, 198);
             this.tableLayoutPanel5.TabIndex = 0;
             this.tableLayoutPanel5.Paint += new System.Windows.Forms.PaintEventHandler(this.tableLayoutPanel5_Paint);
@@ -301,9 +301,9 @@
             //
             this.label18.AutoSize = true;
             this.label18.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.label18.Location = new System.Drawing.Point(237, 172);
+            this.label18.Location = new System.Drawing.Point(237, 165);
             this.label18.Name = "label18";
-            this.label18.Size = new System.Drawing.Size(689, 26);
+            this.label18.Size = new System.Drawing.Size(689, 33);
             this.label18.TabIndex = 15;
             this.label18.Text = resources.GetString("label18.Text");
             this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -313,9 +313,9 @@
             this.checkBox2Pass.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
             this.tableLayoutPanel5.SetColumnSpan(this.checkBox2Pass, 2);
             this.checkBox2Pass.Dock = System.Windows.Forms.DockStyle.Right;
-            this.checkBox2Pass.Location = new System.Drawing.Point(66, 175);
+            this.checkBox2Pass.Location = new System.Drawing.Point(66, 168);
             this.checkBox2Pass.Name = "checkBox2Pass";
-            this.checkBox2Pass.Size = new System.Drawing.Size(165, 20);
+            this.checkBox2Pass.Size = new System.Drawing.Size(165, 27);
             this.checkBox2Pass.TabIndex = 11;
             this.checkBox2Pass.Text = "Enable 2-pass encoding:";
             this.checkBox2Pass.UseVisualStyleBackColor = true;
@@ -324,9 +324,9 @@
             //
             this.label9.AutoSize = true;
             this.label9.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.label9.Location = new System.Drawing.Point(237, 128);
+            this.label9.Location = new System.Drawing.Point(237, 132);
             this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(689, 44);
+            this.label9.Size = new System.Drawing.Size(689, 33);
             this.label9.TabIndex = 13;
             this.label9.Text = "Advanced users only. Keep at default if you don\'t know what this means. Determine" +
     "s amount of threads ffmpeg uses. Try setting this to 1 if ffmpeg.exe crashes as " +
@@ -337,9 +337,9 @@
             //
             this.label7.AutoSize = true;
             this.label7.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.label7.Location = new System.Drawing.Point(3, 128);
+            this.label7.Location = new System.Drawing.Point(3, 132);
             this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(70, 44);
+            this.label7.Size = new System.Drawing.Size(70, 33);
             this.label7.TabIndex = 12;
             this.label7.Text = "Threads:";
             this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -354,12 +354,12 @@
             this.tableLayoutPanel9.Controls.Add(this.boxCropFrom, 0, 0);
             this.tableLayoutPanel9.Controls.Add(this.label17, 1, 0);
             this.tableLayoutPanel9.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tableLayoutPanel9.Location = new System.Drawing.Point(76, 32);
+            this.tableLayoutPanel9.Location = new System.Drawing.Point(76, 33);
             this.tableLayoutPanel9.Margin = new System.Windows.Forms.Padding(0);
             this.tableLayoutPanel9.Name = "tableLayoutPanel9";
             this.tableLayoutPanel9.RowCount = 1;
             this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanel9.Size = new System.Drawing.Size(158, 32);
+            this.tableLayoutPanel9.Size = new System.Drawing.Size(158, 33);
             this.tableLayoutPanel9.TabIndex = 4;
             //
             // boxCropTo
@@ -385,7 +385,7 @@
             this.label17.Location = new System.Drawing.Point(71, 0);
             this.label17.Margin = new System.Windows.Forms.Padding(0);
             this.label17.Name = "label17";
-            this.label17.Size = new System.Drawing.Size(16, 32);
+            this.label17.Size = new System.Drawing.Size(16, 33);
             this.label17.TabIndex = 1;
             this.label17.Text = "to";
             this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -398,12 +398,12 @@
             this.tableLayoutPanel7.Controls.Add(this.boxLimit, 0, 0);
             this.tableLayoutPanel7.Controls.Add(this.label16, 1, 0);
             this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tableLayoutPanel7.Location = new System.Drawing.Point(76, 96);
+            this.tableLayoutPanel7.Location = new System.Drawing.Point(76, 99);
             this.tableLayoutPanel7.Margin = new System.Windows.Forms.Padding(0);
             this.tableLayoutPanel7.Name = "tableLayoutPanel7";
             this.tableLayoutPanel7.RowCount = 1;
             this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanel7.Size = new System.Drawing.Size(158, 32);
+            this.tableLayoutPanel7.Size = new System.Drawing.Size(158, 33);
             this.tableLayoutPanel7.TabIndex = 10;
             //
             // boxLimit
@@ -420,7 +420,7 @@
             this.label16.Dock = System.Windows.Forms.DockStyle.Fill;
             this.label16.Location = new System.Drawing.Point(121, 0);
             this.label16.Name = "label16";
-            this.label16.Size = new System.Drawing.Size(34, 32);
+            this.label16.Size = new System.Drawing.Size(34, 33);
             this.label16.TabIndex = 1;
             this.label16.Text = "MB";
             this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -429,9 +429,9 @@
             //
             this.label15.AutoSize = true;
             this.label15.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.label15.Location = new System.Drawing.Point(3, 96);
+            this.label15.Location = new System.Drawing.Point(3, 99);
             this.label15.Name = "label15";
-            this.label15.Size = new System.Drawing.Size(70, 32);
+            this.label15.Size = new System.Drawing.Size(70, 33);
             this.label15.TabIndex = 9;
             this.label15.Text = "Size limit:";
             this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -440,9 +440,9 @@
             //
             this.label6.AutoSize = true;
             this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.label6.Location = new System.Drawing.Point(237, 96);
+            this.label6.Location = new System.Drawing.Point(237, 99);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(689, 32);
+            this.label6.Size = new System.Drawing.Size(689, 33);
             this.label6.TabIndex = 11;
             this.label6.Text = "Will adjust the quality to attempt to stay below this limit, and cut off the end " +
     "of a video if needed. Leave blank for no limit. The limit on 4chan is 3 MB. If e" +
@@ -453,9 +453,9 @@
             //
             this.label14.AutoSize = true;
             this.label14.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.label14.Location = new System.Drawing.Point(237, 64);
+            this.label14.Location = new System.Drawing.Point(237, 66);
             this.label14.Name = "label14";
-            this.label14.Size = new System.Drawing.Size(689, 32);
+            this.label14.Size = new System.Drawing.Size(689, 33);
             this.label14.TabIndex = 8;
             this.label14.Text = "Advanced users only. Keep blank if you don\'t know what this means, it\'ll get calc" +
     "ulated automatically based on size limit.";
@@ -469,13 +469,13 @@
             this.tableLayoutPanel8.Controls.Add(this.boxBitrate, 0, 0);
             this.tableLayoutPanel8.Controls.Add(this.label13, 1, 0);
             this.tableLayoutPanel8.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tableLayoutPanel8.Location = new System.Drawing.Point(76, 64);
+            this.tableLayoutPanel8.Location = new System.Drawing.Point(76, 66);
             this.tableLayoutPanel8.Margin = new System.Windows.Forms.Padding(0);
             this.tableLayoutPanel8.Name = "tableLayoutPanel8";
             this.tableLayoutPanel8.RowCount = 1;
             this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
             this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F));
-            this.tableLayoutPanel8.Size = new System.Drawing.Size(158, 32);
+            this.tableLayoutPanel8.Size = new System.Drawing.Size(158, 33);
             this.tableLayoutPanel8.TabIndex = 7;
             //
             // boxBitrate
@@ -492,7 +492,7 @@
             this.label13.Dock = System.Windows.Forms.DockStyle.Fill;
             this.label13.Location = new System.Drawing.Point(121, 0);
             this.label13.Name = "label13";
-            this.label13.Size = new System.Drawing.Size(34, 32);
+            this.label13.Size = new System.Drawing.Size(34, 33);
             this.label13.TabIndex = 1;
             this.label13.Text = "Kb/s";
             this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -501,9 +501,9 @@
             //
             this.label12.AutoSize = true;
             this.label12.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.label12.Location = new System.Drawing.Point(3, 64);
+            this.label12.Location = new System.Drawing.Point(3, 66);
             this.label12.Name = "label12";
-            this.label12.Size = new System.Drawing.Size(70, 32);
+            this.label12.Size = new System.Drawing.Size(70, 33);
             this.label12.TabIndex = 6;
             this.label12.Text = "Bitrate:";
             this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -512,9 +512,9 @@
             //
             this.label11.AutoSize = true;
             this.label11.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.label11.Location = new System.Drawing.Point(237, 32);
+            this.label11.Location = new System.Drawing.Point(237, 33);
             this.label11.Name = "label11";
-            this.label11.Size = new System.Drawing.Size(689, 32);
+            this.label11.Size = new System.Drawing.Size(689, 33);
             this.label11.TabIndex = 5;
             this.label11.Text = resources.GetString("label11.Text");
             this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@@ -523,9 +523,9 @@
             //
             this.label10.AutoSize = true;
             this.label10.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.label10.Location = new System.Drawing.Point(3, 32);
+            this.label10.Location = new System.Drawing.Point(3, 33);
             this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(70, 32);
+            this.label10.Size = new System.Drawing.Size(70, 33);
             this.label10.TabIndex = 3;
             this.label10.Text = "Crop video:";
             this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -536,7 +536,7 @@
             this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
             this.label5.Location = new System.Drawing.Point(237, 0);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(689, 32);
+            this.label5.Size = new System.Drawing.Size(689, 33);
             this.label5.TabIndex = 2;
             this.label5.Text = "Enter nothing to keep resolution intact. Enter -1 in one of the fields to scale a" +
     "ccording to aspect ratio.";
@@ -548,7 +548,7 @@
             this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
             this.label2.Location = new System.Drawing.Point(3, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(70, 32);
+            this.label2.Size = new System.Drawing.Size(70, 33);
             this.label2.TabIndex = 0;
             this.label2.Text = "Resolution:";
             this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -569,7 +569,7 @@
             this.tableLayoutPanel6.RowCount = 1;
             this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
             this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F));
-            this.tableLayoutPanel6.Size = new System.Drawing.Size(158, 32);
+            this.tableLayoutPanel6.Size = new System.Drawing.Size(158, 33);
             this.tableLayoutPanel6.TabIndex = 1;
             //
             // boxResH
@@ -595,7 +595,7 @@
             this.label8.Location = new System.Drawing.Point(71, 0);
             this.label8.Margin = new System.Windows.Forms.Padding(0);
             this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(16, 32);
+            this.label8.Size = new System.Drawing.Size(16, 33);
             this.label8.TabIndex = 1;
             this.label8.Text = "x";
             this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -608,11 +608,11 @@
             this.tableLayoutPanel10.Controls.Add(this.trackThreads, 0, 0);
             this.tableLayoutPanel10.Controls.Add(this.labelThreads, 1, 0);
             this.tableLayoutPanel10.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.tableLayoutPanel10.Location = new System.Drawing.Point(79, 131);
+            this.tableLayoutPanel10.Location = new System.Drawing.Point(79, 135);
             this.tableLayoutPanel10.Name = "tableLayoutPanel10";
             this.tableLayoutPanel10.RowCount = 1;
             this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
-            this.tableLayoutPanel10.Size = new System.Drawing.Size(152, 38);
+            this.tableLayoutPanel10.Size = new System.Drawing.Size(152, 27);
             this.tableLayoutPanel10.TabIndex = 25;
             //
             // trackThreads
@@ -623,7 +623,7 @@
             this.trackThreads.Maximum = 16;
             this.trackThreads.Minimum = 1;
             this.trackThreads.Name = "trackThreads";
-            this.trackThreads.Size = new System.Drawing.Size(131, 38);
+            this.trackThreads.Size = new System.Drawing.Size(131, 27);
             this.trackThreads.TabIndex = 0;
             this.trackThreads.Value = 1;
             this.trackThreads.Scroll += new System.EventHandler(this.trackThreads_Scroll);
@@ -635,7 +635,7 @@
             this.labelThreads.Location = new System.Drawing.Point(131, 0);
             this.labelThreads.Margin = new System.Windows.Forms.Padding(0);
             this.labelThreads.Name = "labelThreads";
-            this.labelThreads.Size = new System.Drawing.Size(21, 38);
+            this.labelThreads.Size = new System.Drawing.Size(21, 27);
             this.labelThreads.TabIndex = 1;
             this.labelThreads.Text = "1";
             this.labelThreads.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;


Allow to not define grid on axis

Allow to not define grid on axis

--- MatplotlibCS/Axes.cs
+++ MatplotlibCS/Axes.cs
@@ -22,6 +22,7 @@
             this.XTitle = xtitle;
             this.YTitle = ytitle;
             PlotItems = new List<PlotItem>();
+            Grid = new Grid();
         }
         #endregion


Fix typo

Fix typo

--- Mixpanel/Mixpanel.cs
+++ Mixpanel/Mixpanel.cs
@@ -120,11 +120,11 @@
             switch(Application.internetReachability)
             {
                 case NetworkReachability.NotReachable :
-                    return "none"
+                    return "none";
                 case NetworkReachability.ReachableViaCarrierDataNetwork :
-                    return "carrier"
+                    return "carrier";
                 case NetworkReachability.ReachableViaLocalAreaNetwork :
-                    return "wifi"
+                    return "wifi";
             }
             return "none";
         }


Add filename overload for GafReader constructor

--- TAUtil/Gaf/GafReader.cs
+++ TAUtil/Gaf/GafReader.cs
@@ -6,6 +6,11 @@
     public class GafReader : IDisposable
     {
         private readonly BinaryReader reader;
+
+        public GafReader(string filename)
+            : this(File.OpenRead(filename))
+        {
+        }

         public GafReader(Stream s)
             : this(new BinaryReader(s))


Fix youtube link titles, why did I change it to this

--- RohBot/LinkTitles.cs
+++ RohBot/LinkTitles.cs
@@ -97,7 +97,7 @@
             }
         }

-        private static Regex _youtube = new Regex(@"youtube\.com/watch\S*?(?:&v|\?v)=([a-zA-Z0-9-_]+)", RegexOptions.Compiled);
+        private static Regex _youtube = new Regex(@"youtube\.com/watch\S*?(?:&v|\?v)=([a-zA-Z0-9-_]+)", RegexOptions.Compiled);
         private static Regex _youtubeShort = new Regex(@"youtu\.be/([a-zA-Z0-9-_]+)", RegexOptions.Compiled);
         private static IEnumerable<Tuple<int, AsyncLazy<string>>> LookupYoutube(string message)
         {


Add tests for C# use of FuncConvert.ToFSharpFunc #11 (#4082)

* Add tests for C# use of FuncConvert.ToFSharpFunc

* Update test.cs

--- tests/fsharp/core/fsfromcs/test.cs
+++ tests/fsharp/core/fsfromcs/test.cs
@@ -81,6 +81,17 @@
                                         { Console.WriteLine("i after duplication (2nd technique) = {0}", s);}),
                myList2);

+          // No Func overloads are available for FuncConvert.ToFSharpFunc
+         // myList2 =
+         //   ListModule.Map<int,string>
+         //     (FuncConvert.ToFSharpFunc((Func<int,string>) delegate(int i) { return i.ToString() + i.ToString(); }),
+         //      myList);
+
+          ListModule.Iterate<string>(FuncConvert.ToFSharpFunc<string>(s => { Console.WriteLine("s = {0}", s);}),myList2);
+
+          //Note: This call becomes ambiguous if Func overloads of FuncConvert.ToFSharpFunc are added
+          myList2 = ListModule.Map<string,string>(FuncConvert.ToFSharpFunc<string,string>(i => i.ToString() + i.ToString()),myList2);
+
       }

        // Construct a value of each type from the library


[tests,zeromqtest] Updated to latest BAM API

--- tests/zeromqtest/bam/Scripts/zeromqtest.cs
+++ tests/zeromqtest/bam/Scripts/zeromqtest.cs
@@ -46,7 +46,7 @@
             if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows) &&
                 this.Linker is VisualCCommon.LinkerBase)
             {
-                this.CompilePubliclyAndLinkAgainst<WindowsSDK.WindowsSDK>(source);
+                this.CompileAndLinkAgainst<WindowsSDK.WindowsSDK>(source);
             }

             this.PrivatePatch(settings =>


Automatic merges often do this...

Automatic merges often do this...

git-svn-id: 6b7e1e5d0861e268462ba7828ef63c1bcab52a9b@809 d3cde5d6-82b8-4669-8b62-43054d6781d8

--- SDRSharp/MainForm.cs
+++ SDRSharp/MainForm.cs
@@ -971,8 +971,8 @@

         private void Open()
         {
-            var inputDevice = (AudioDevice)inputDeviceComboBox.SelectedItem;
-            var outputDevice = (AudioDevice)outputDeviceComboBox.SelectedItem;
+            var inputDevice = (AudioDevice) inputDeviceComboBox.SelectedItem;
+            var outputDevice = (AudioDevice) outputDeviceComboBox.SelectedItem;
             var oldCenterFrequency = centerFreqNumericUpDown.Value;
             Match match;
             if (SourceIsWaveFile)
@@ -981,7 +981,7 @@
                 {
                     throw new ApplicationException("No such file");
                 }
-                _streamControl.OpenFile(_waveFile, outputDevice.Index, (int) latencyNumericUpDown.Value);
+                _streamControl.OpenFile(_waveFile, outputDevice.Index, (int)latencyNumericUpDown.Value);

                 var friendlyFilename = "" + Path.GetFileName(_waveFile);
                 match = Regex.Match(friendlyFilename, "([0-9]+)kHz", RegexOptions.IgnoreCase);
@@ -1000,7 +1000,13 @@
             {
                 if (_frontendController == null || _frontendController.IsSoundCardBased)
                 {
-                    throw new ApplicationException("No such file");
+                    var sampleRate = 0.0;
+                    match = Regex.Match(sampleRateComboBox.Text, "([0-9\\.]+)", RegexOptions.IgnoreCase);
+                    if (match.Success)
+                    {
+                        sampleRate = double.Parse(match.Groups[1].Value);
+                    }
+                    _streamControl.OpenSoundDevice(inputDevice.Index, outputDevice.Index, sampleRate, (int) latencyNumericUpDown.Value);
                 }
                 else
                 {
@@ -1013,8 +1019,8 @@
             spectrumAnalyzer.SpectrumWidth = (int)_streamControl.SampleRate;
             waterfall.SpectrumWidth = spectrumAnalyzer.SpectrumWidth;

-            frequencyNumericUpDown.Maximum = (long)centerFreqNumericUpDown.Value + (int)(_streamControl.SampleRate / 2);
-            frequencyNumericUpDown.Minimum = (long)centerFreqNumericUpDown.Value - (int)(_streamControl.SampleRate / 2);
+            frequencyNumericUpDown.Maximum = (long) centerFreqNumericUpDown.Value + (int) (_streamControl.SampleRate / 2);
+            frequencyNumericUpDown.Minimum = (long) centerFreqNumericUpDown.Value - (int) (_streamControl.SampleRate / 2);

             if (centerFreqNumericUpDown.Value != oldCenterFrequency)
             {


Refactored Backward() and Forward().

Refactored Backward() and Forward().

--- Sandra.Chess/Game.cs
+++ Sandra.Chess/Game.cs
@@ -78,11 +78,11 @@
             }

             MoveIndex activeMoveIndex = activeVariation != null ? activeVariation.MoveIndex : MoveIndex.BeforeFirstMove;
-            if (activeMoveIndex.Value != value.Value)
+            if (!activeMoveIndex.EqualTo(value))
             {
                 Position newPosition = initialPosition.Copy();
                 Variation newActiveVariation = null;
-                if (value.Value != 0)
+                if (!value.EqualTo(MoveIndex.BeforeFirstMove))
                 {
                     // Linear search for the right move index.
                     Variation current = mainVariation;
@@ -113,8 +113,39 @@
         public bool IsLastMove => activeVariation == null ? mainVariation == null : activeVariation.Main == null;
         public Move PreviousMove() => activeVariation.Move;

-        public void Backward() => SetActiveMoveIndex(activeVariation.Parent != null ? activeVariation.Parent.MoveIndex : MoveIndex.BeforeFirstMove);
-        public void Forward() => SetActiveMoveIndex(activeVariation == null ? mainVariation.MoveIndex : activeVariation.Main.MoveIndex);
+        public void Backward()
+        {
+            if (IsFirstMove)
+            {
+                throw new InvalidOperationException("Cannot go backward when it's the first move.");
+            }
+
+            // Replay until the previous move.
+            Position newPosition = initialPosition.Copy();
+            Variation current = mainVariation;
+            while (current != activeVariation)
+            {
+                newPosition.FastMakeMove(current.Move);
+                current = current.Main;
+            }
+
+            currentPosition = newPosition;
+            activeVariation = activeVariation.Parent;
+            RaiseActiveMoveIndexChanged();
+        }
+
+        public void Forward()
+        {
+            if (IsLastMove)
+            {
+                throw new InvalidOperationException("Cannot go forward when it's the last move.");
+            }
+
+            Variation next = activeVariation != null ? activeVariation.Main : mainVariation;
+            currentPosition.FastMakeMove(next.Move);
+            activeVariation = next;
+            RaiseActiveMoveIndexChanged();
+        }

         public Variation MainVariation => mainVariation;


Add parameterless constructor to Chess.Game.

--- Sandra.Chess/Game.cs
+++ Sandra.Chess/Game.cs
@@ -52,6 +52,13 @@
         /// </summary>
         public Game(Position initialPosition) : this(initialPosition,
                                                      new MoveTree(initialPosition.SideToMove == Color.Black))
+        {
+        }
+
+        /// <summary>
+        /// Creates a new game with the default initial <see cref="Position"/>.
+        /// </summary>
+        public Game() : this(Position.GetInitialPosition())
         {
         }


JavaScriptSerializerを使用して実装中

JavaScriptSerializerを使用して実装中

--- Sdx/Data/TreeJson.cs
+++ Sdx/Data/TreeJson.cs
@@ -5,54 +5,54 @@
 using System.Text;
 using System.Diagnostics;
 using System.Web.Script.Serialization;
+using System.Collections;

 namespace Sdx.Data
 {
   public class TreeJson : Tree
   {
-    private dynamic BaseJson { get; set; }
+    public dynamic BaseJson { get; set; }

     public override void Load(TextReader input)
     {
       var serializer = new JavaScriptSerializer();
-
-      BaseJson = serializer.Deserialize<dynamic>(input.ReadToEnd());
+      BaseJson = serializer.Deserialize<Dictionary<string, object>>(input.ReadToEnd());
     }

     public override string ToValue()
     {
-      if (this.BaseJson == null)
+      if (BaseJson.GetType() == null)
       {
         throw new InvalidOperationException("Load before this.");
       }

-      if (this.BaseJson.GetType() == typeof(Dictionary<string,object>))
+      if (BaseJson.GetType() == typeof(Dictionary<string, object>))
       {
         throw new InvalidCastException("This is not String");
       }

-      return this.BaseJson;
+      return BaseJson.ToString();
     }

     protected override List<Tree> ToList()
     {
-      //if (this.BaseJson == null)
-      //{
-      //  throw new InvalidOperationException("Load before this.");
-      //}
+      if (BaseJson.GetType() == null)
+      {
+        throw new InvalidOperationException("Load before this.");
+      }

-      //if (this.BaseJson.Type != JTokenType.Array)
+      //if (!BaseJson.GetType())
       //{
       //  throw new InvalidCastException("Target is not List.");
       //}

       var list = new List<Tree>();
-      //foreach (var item in this.BaseJson)
-      //{
-      //  var row = new TreeJson();
-      //  row.BaseJson = item;
-      //  list.Add(row);
-      //}
+      foreach (var item in BaseJson)
+      {
+        var row = new TreeJson();
+        row.BaseJson = item;
+        list.Add(row);
+      }

       return list;
     }
@@ -60,38 +60,38 @@
     protected override Tree BuildTree(List<string> paths)
     {
       var TreeJson = new Sdx.Data.TreeJson();
-      var target = this.BaseJson;
+      TreeJson.BaseJson = BaseJson;
       var serializer = new JavaScriptSerializer();

       foreach (var item in paths)
       {
-        if (BaseJson[item].GetType() == typeof(string)){
-          BaseJson = BaseJson[item];
+        if (TreeJson.BaseJson[item].GetType() != typeof(Dictionary<string, object>))
+        {
+          TreeJson.BaseJson = TreeJson.BaseJson[item];
           break;
         }
-        target = serializer.Deserialize<dynamic>(serializer.Serialize(BaseJson[item]));
-        BaseJson = target;
+
+        TreeJson.BaseJson = serializer.Deserialize<Dictionary<string, object>>(serializer.Serialize(TreeJson.BaseJson[item]));
       }

-      TreeJson.BaseJson = BaseJson;
       return TreeJson;
     }

     protected override bool Exsits(List<string> paths)
     {
-      //var target = this.BaseJson;
+      var target = BaseJson;

-      //foreach (var item in paths)
-      //{
-      //  if (target.SelectToken(item) == null)
-      //  {
-      //    return false;
-      //  }
-      //  else
-      //  {
-      //    target = target.SelectToken(item);
-      //  }
-      //}
+      foreach (var item in paths)
+      {
+        if (target.ContainsKey(item))
+        {
+          target = (Dictionary<string,object>)target[item];
+        }
+        else
+        {
+          return false;
+        }
+      }

       return true;
     }


Server: update orders after suspension time

--- Server/DigiMarket.cs
+++ Server/DigiMarket.cs
@@ -266,8 +266,10 @@

             await Task.Delay(SuspendedTime);

-            foreach (var order in PurchaseOrders) // TODO: need update (match orders)
+            foreach (var order in PurchaseOrders)
                 order.Suspended = false;
+
+            UpdateOrders();

             PublishMessage(Update.General);
         }
@@ -287,8 +289,10 @@

             await Task.Delay(SuspendedTime);

-            foreach (var order in SalesOrders) // TODO: need update (match orders)
+            foreach (var order in SalesOrders)
                 order.Suspended = false;
+
+            UpdateOrders();

             PublishMessage(Update.General);
         }


Added a simple function to get tox's data

--- SharpTox/Core/Tox.cs
+++ SharpTox/Core/Tox.cs
@@ -991,6 +991,18 @@
                 );
         }

+        /// <summary>
+        /// Retrieves a byte array that contains the data of this tox instance.
+        /// </summary>
+        /// <returns></returns>
+        public byte[] GetDataBytes()
+        {
+            byte[] bytes = new byte[ToxFunctions.Size(tox)];
+            ToxFunctions.Save(tox, bytes);
+
+            return bytes;
+        }
+
         private void callbacks()
         {
             ToxFunctions.CallbackFriendRequest(tox, friendrequestdelegate = new ToxDelegates.CallbackFriendRequestDelegate((IntPtr t, byte[] id, byte[] message, ushort length, IntPtr userdata) =>


Internalize Common class.

Internalize Common class.

--- Strike.NET/Common.cs
+++ Strike.NET/Common.cs
@@ -6,7 +6,7 @@

 namespace StrikeNET
 {
-    public class Common
+    internal class Common
     {
         private static string _assemblyVersion;


Commented remaining Particle public methods and fields.

--- TAIO/PSO/Particle.cs
+++ TAIO/PSO/Particle.cs
@@ -8,11 +8,26 @@
     /// </summary>
     public class Particle
     {
+        /// <summary>
+        /// Personal best position of particle found during PSO algorthm run.
+        /// </summary>
         public Position PersonalBestPosition { get; private set; }
+        /// <summary>
+        /// Number of iterations since particle has changed it position.
+        /// </summary>
         public int timeSinceBestChanged = 0;
+        /// <summary>
+        /// Particle position in search space.
+        /// </summary>
+        public Position Position { get; set; }
         private Velocity _velocity;
-        public Position Position { get; set; }

+        /// <summary>
+        /// Creates particle for PSO algorithm that will traverse automata space.
+        /// </summary>
+        /// <param name="symbolCount"></param>
+        /// <param name="stateCount"></param>
+        /// <param name="seed"></param>
         public Particle(int symbolCount, int stateCount, int seed = 0)
         {
             Position = new Position(symbolCount, stateCount, seed);
@@ -34,6 +49,11 @@
             return currentParticleWord.Where((t, i) => t != anotherParticleWord[i]).Count();
         }

+        /// <summary>
+        /// TODO: Fix meeeeee!
+        /// </summary>
+        /// <param name="onePositions"></param>
+        /// <returns></returns>
         private bool[] ConstructWord(int[,] onePositions)
         {
             // Dimentions size
@@ -56,6 +76,13 @@
             return word;
         }

+        /// <summary>
+        /// Moves particle to another position according to PSO guidelines.
+        /// </summary>
+        /// <param name="globalBestPosition"></param>
+        /// <param name="c1"></param>
+        /// <param name="c2"></param>
+        /// <param name="localBestPosition"></param>
         public void MoveParticle(Position globalBestPosition, int c1, int c2, Position localBestPosition = null)
         {
             UpdateVelocity(globalBestPosition, c1, c2, localBestPosition);
@@ -63,7 +90,7 @@
             timeSinceBestChanged++;
             if (Position.CompareTo(PersonalBestPosition) < 0) { PersonalBestPosition = Position; timeSinceBestChanged = 0; }
         }
-
+
         private void UpdateVelocity(Position globalBestPosition, int c1, int c2, Position localBestPosition = null)
         {
             Random r = new Random();


fix crash when initializing sniffer

fix crash when initializing sniffer

--- TCC.Core/App.xaml.cs
+++ TCC.Core/App.xaml.cs
@@ -165,10 +165,10 @@
             SplashScreen.VM.Progress = 80;
             SplashScreen.VM.BottomText = "Initializing packet processor...";
             PacketAnalyzer.ProcessorReady += LoadModules;
-            await PacketAnalyzer.InitAsync(Settings.CaptureMode, ToolboxMode);
             PacketAnalyzer.InitServerDatabase(DataPath, Path.Combine(ResourcesPath, "config/server-overrides.txt"), string.IsNullOrEmpty(Settings.LastLanguage)
                 ? "EU-EN"
                 : Settings.LastLanguage);
+            await PacketAnalyzer.InitAsync(Settings.CaptureMode, ToolboxMode);
             _ = StubInterface.Instance.InitAsync(Settings.LfgWindowSettings.Enabled,
                                                  Settings.EnablePlayerMenu,
                                                  Settings.EnableProxy,


Update teTexture.cs

Update teTexture.cs

--- TankLib/teTexture.cs
+++ TankLib/teTexture.cs
@@ -142,8 +142,7 @@
             if (Header.PayloadCount - offset - 1 < 0) return new teResourceGUID(0);
             // ulong payloadGUID = (textureGUID & 0xFFF0FFFFFFFFUL) | ((ulong)(byte)(Header.PayloadCount - offset - 1) << 32) | 0x0320000000000000UL;
             // so basically: thing | (payloadIdx & 0xF) << 32) | 0x320000000000000i64
-            var payloadGUID = new teResourceGUID(teResourceGUID.Index(textureGUID));
-            payloadGUID.SetPlatform(teResourceGUID.Platform(textureGUID));
+            var payloadGUID = new teResourceGUID(textureGUID & 0xFFF0FFFFFFFFUL);
             payloadGUID.SetType(0x4D);
             payloadGUID.SetLocale((byte)(Header.PayloadCount - offset - 1));


Added debug output for selection

Added debug output for selection

--- Test2d/Editor/Editor.cs
+++ Test2d/Editor/Editor.cs
@@ -221,7 +221,12 @@
                 if (result.Count > 0)
                 {
                     // TODO:
+
+
+                    foreach (var shape in result)
+                        System.Diagnostics.Debug.Print("Selected: " + shape.GetType().ToString());

+
                     return true;
                 }
             }
@@ -237,6 +242,10 @@
                 container.CurrentShape = result;

                 // TODO:
+
+
+                System.Diagnostics.Debug.Print("Selected: " + result.GetType().ToString());
+

                 return true;
             }


Added some new properties for jobs.

Added some new properties for jobs.

--- NtApiDotNet/NtJob.cs
+++ NtApiDotNet/NtJob.cs
@@ -273,7 +273,7 @@
         }

         /// <summary>
-        /// Set the active process limit and whether breakaway is OK.
+        /// Set the active process limit.
         /// </summary>
         /// <param name="active_process_limit">The number of active processes in the job.</param>
         /// <param name="throw_on_error">True to throw on error.</param>
@@ -288,12 +288,137 @@
         }

         /// <summary>
-        /// Set the active process limit and whether breakaway is OK.
+        /// Set the active process limit.
         /// </summary>
         /// <param name="active_process_limit">The number of active processes in the job.</param>
         public void SetActiveProcessLimit(int active_process_limit)
         {
             SetActiveProcessLimit(active_process_limit, true);
+        }
+
+        /// <summary>
+        /// Set minimum and maximum working set size.
+        /// </summary>
+        /// <param name="minimum_working_set_size">The minimum working set size.</param>
+        /// <param name="maximum_working_set_size">The maximum working set size.</param>
+        /// <param name="throw_on_error">True to throw on error.</param>
+        /// <returns>The NT status code.</returns>
+        public NtStatus SetWorkingSetSize(long minimum_working_set_size, long maximum_working_set_size, bool throw_on_error)
+        {
+            return SetExtendedLimitInformation(i => {
+                i.BasicLimitInformation.MinimumWorkingSetSize = new IntPtr(minimum_working_set_size);
+                i.BasicLimitInformation.MaximumWorkingSetSize = new IntPtr(maximum_working_set_size);
+                i.BasicLimitInformation.LimitFlags |= JobObjectLimitFlags.WorkingSet;
+                return i;
+            }, throw_on_error);
+        }
+
+        /// <summary>
+        /// Set minimum and maximum working set size.
+        /// </summary>
+        /// <param name="minimum_working_set_size">The minimum working set size.</param>
+        /// <param name="maximum_working_set_size">The maximum working set size.</param>
+        public void SetWorkingSetSize(long minimum_working_set_size, long maximum_working_set_size)
+        {
+            SetWorkingSetSize(minimum_working_set_size, maximum_working_set_size, true);
+        }
+
+        /// <summary>
+        /// Set the process memory limit.
+        /// </summary>
+        /// <param name="process_memory_limit">The memory limit for a process.</param>
+        /// <param name="throw_on_error">True to throw on error.</param>
+        /// <returns>The NT status code.</returns>
+        public NtStatus SetProcessMemoryLimit(long process_memory_limit, bool throw_on_error)
+        {
+            return SetExtendedLimitInformation(i => {
+                i.ProcessMemoryLimit = new IntPtr(process_memory_limit);
+                i.BasicLimitInformation.LimitFlags |= JobObjectLimitFlags.ProcessMemory;
+                return i;
+            }, throw_on_error);
+        }
+
+        /// <summary>
+        /// Set the process memory limit.
+        /// </summary>
+        /// <param name="process_memory_limit">The memory limit for a process.</param>
+        /// <returns>The NT status code.</returns>
+        public void SetProcessMemoryLimit(long process_memory_limit)
+        {
+            SetProcessMemoryLimit(process_memory_limit, true);
+        }
+
+        /// <summary>
+        /// Set the job memory limit.
+        /// </summary>
+        /// <param name="job_memory_limit">The memory limit for a job.</param>
+        /// <param name="throw_on_error">True to throw on error.</param>
+        /// <returns>The NT status code.</returns>
+        public NtStatus SetJobMemoryLimit(long job_memory_limit, bool throw_on_error)
+        {
+            return SetExtendedLimitInformation(i => {
+                i.JobMemoryLimit = new IntPtr(job_memory_limit);
+                i.BasicLimitInformation.LimitFlags |= JobObjectLimitFlags.JobMemory;
+                return i;
+            }, throw_on_error);
+        }
+
+        /// <summary>
+        /// Set the job memory limit.
+        /// </summary>
+        /// <param name="process_memory_limit">The memory limit for a job.</param>
+        /// <returns>The NT status code.</returns>
+        public void SetJobMemoryLimit(long process_memory_limit)
+        {
+            SetJobMemoryLimit(process_memory_limit, true);
+        }
+
+        /// <summary>
+        /// Set the time limit for a process.
+        /// </summary>
+        /// <param name="process_time_limit">The time limit for a process, in 100ns ticks.</param>
+        /// <param name="throw_on_error">True to throw on error.</param>
+        /// <returns>The NT status code.</returns>
+        public NtStatus SetProcessTimeLimit(long process_time_limit, bool throw_on_error)
+        {
+            return SetExtendedLimitInformation(i => {
+                i.BasicLimitInformation.PerProcessUserTimeLimit = new LargeIntegerStruct() { QuadPart = process_time_limit };
+                i.BasicLimitInformation.LimitFlags |= JobObjectLimitFlags.ProcessTime;
+                return i;
+            }, throw_on_error);
+        }
+
+        /// <summary>
+        /// Set the time limit for a process.
+        /// </summary>
+        /// <param name="process_time_limit">The time limit for a process, in 100ns ticks.</param>
+        public void SetProcessTimeLimit(long process_time_limit)
+        {
+            SetProcessTimeLimit(process_time_limit, true);
+        }
+
+        /// <summary>
+        /// Set the time limit for a job.
+        /// </summary>
+        /// <param name="job_time_limit">The time limit for a job, in 100ns ticks.</param>
+        /// <param name="throw_on_error">True to throw on error.</param>
+        /// <returns>The NT status code.</returns>
+        public NtStatus SetJobTimeLimit(long job_time_limit, bool throw_on_error)
+        {
+            return SetExtendedLimitInformation(i => {
+                i.BasicLimitInformation.PerJobUserTimeLimit = new LargeIntegerStruct() { QuadPart = job_time_limit };
+                i.BasicLimitInformation.LimitFlags |= JobObjectLimitFlags.JobTime;
+                return i;
+            }, throw_on_error);
+        }
+
+        /// <summary>
+        /// Set the time limit for a job.
+        /// </summary>
+        /// <param name="job_time_limit">The time limit for a job, in 100ns ticks.</param>
+        public void SetJobTimeLimit(long job_time_limit)
+        {
+            SetProcessTimeLimit(job_time_limit, true);
         }

         /// <summary>
@@ -401,14 +526,8 @@
         [SupportedVersion(SupportedVersion.Windows10)]
         public ulong? MaxBandwidth
         {
-            get
-            {
-                return GetNetRateValue(JobObjectNetRateControlFlags.MaxBandwidth, r => r.MaxBandwidth);
-            }
-            set
-            {
-                SetNetRateValue(value, JobObjectNetRateControlFlags.MaxBandwidth, (v, r) => { r.MaxBandwidth = v; return r; });
-            }
+            get => GetNetRateValue(JobObjectNetRateControlFlags.MaxBandwidth, r => r.MaxBandwidth);
+            set => SetNetRateValue(value, JobObjectNetRateControlFlags.MaxBandwidth, (v, r) => { r.MaxBandwidth = v; return r; });
         }

         /// <summary>
@@ -417,14 +536,8 @@
         [SupportedVersion(SupportedVersion.Windows10)]
         public byte? DscpTag
         {
-            get
-            {
-                return GetNetRateValue(JobObjectNetRateControlFlags.DscpTag, r => r.DscpTag);
-            }
-            set
-            {
-                SetNetRateValue(value, JobObjectNetRateControlFlags.DscpTag, (v, r) => { r.DscpTag = v; return r; });
-            }
+            get => GetNetRateValue(JobObjectNetRateControlFlags.DscpTag, r => r.DscpTag);
+            set => SetNetRateValue(value, JobObjectNetRateControlFlags.DscpTag, (v, r) => { r.DscpTag = v; return r; });
         }

         /// <summary>
@@ -432,16 +545,80 @@
         /// </summary>
         public int ActiveProcessLimit
         {
-            get => Query<JobObjectExtendedLimitInformation>(JobObjectInformationClass.JobObjectExtendedLimitInformation).BasicLimitInformation.ActiveProcessLimit;
+            get => GetExtendedLimitInfo().BasicLimitInformation.ActiveProcessLimit;
             set => SetActiveProcessLimit(value, true);
         }

         /// <summary>
+        /// Get or set the minimum working set size.
+        /// </summary>
+        public long MinimumWorkingSetSize
+        {
+            get => GetExtendedLimitInfo().BasicLimitInformation.MinimumWorkingSetSize.ToInt64();
+            set => SetWorkingSetSize(value, MaximumWorkingSetSize, true);
+        }
+
+        /// <summary>
+        /// Get or set the maximum working set size.
+        /// </summary>
+        public long MaximumWorkingSetSize
+        {
+            get => GetExtendedLimitInfo().BasicLimitInformation.MaximumWorkingSetSize.ToInt64();
+            set => SetWorkingSetSize(MinimumWorkingSetSize, value, true);
+        }
+
+        /// <summary>
+        /// Get or set the process time limit.
+        /// </summary>
+        public long ProcessTime
+        {
+            get => GetExtendedLimitInfo().BasicLimitInformation.PerProcessUserTimeLimit.QuadPart;
+            set => SetProcessTimeLimit(value, true);
+        }
+
+        /// <summary>
+        /// Get or set the process time limit.
+        /// </summary>
+        public long JobTime
+        {
+            get => GetExtendedLimitInfo().BasicLimitInformation.PerJobUserTimeLimit.QuadPart;
+            set => SetJobTimeLimit(value, true);
+        }
+
+        /// <summary>
+        /// Get or set the process memory limit.
+        /// </summary>
+        public long ProcessMemory
+        {
+            get => GetExtendedLimitInfo().ProcessMemoryLimit.ToInt64();
+            set => SetProcessMemoryLimit(value, true);
+        }
+
+        /// <summary>
+        /// Get or set the process memory limit.
+        /// </summary>
+        public long JobMemory
+        {
+            get => GetExtendedLimitInfo().JobMemoryLimit.ToInt64();
+            set => SetJobMemoryLimit(value, true);
+        }
+
+        /// <summary>
+        /// Get used peak job memory used.
+        /// </summary>
+        public long PeakJobMemoryUsed => GetExtendedLimitInfo().PeakJobMemoryUsed.ToInt64();
+
+        /// <summary>
+        /// Get used peak job memory used.
+        /// </summary>
+        public long PeakProcessMemoryUsed => GetExtendedLimitInfo().PeakProcessMemoryUsed.ToInt64();
+
+        /// <summary>
         /// Get or set the job limit flags.
         /// </summary>
         public JobObjectLimitFlags LimitFlags
         {
-            get => Query<JobObjectExtendedLimitInformation>(JobObjectInformationClass.JobObjectExtendedLimitInformation).BasicLimitInformation.LimitFlags;
+            get => GetExtendedLimitInfo().BasicLimitInformation.LimitFlags;
             set => SetLimitFlags(value);
         }

@@ -452,6 +629,44 @@
         {
             get => (JobObjectUiLimitFlags)Query<int>(JobObjectInformationClass.JobObjectBasicUIRestrictions);
             set => SetUiRestrictionFlags(value);
+        }
+
+        /// <summary>
+        /// Get or set whether job breakaway is allowed.
+        /// </summary>
+        public bool BreakawayOk
+        {
+            get => (LimitFlags & JobObjectLimitFlags.BreakawayOk) == JobObjectLimitFlags.BreakawayOk;
+            set
+            {
+                if (value)
+                {
+                    LimitFlags |= JobObjectLimitFlags.BreakawayOk;
+                }
+                else
+                {
+                    LimitFlags &= ~JobObjectLimitFlags.BreakawayOk;
+                }
+            }
+        }
+
+        /// <summary>
+        /// Get or set whether silenty job breakaway is allowed.
+        /// </summary>
+        public bool SilentBreakawayOk
+        {
+            get => (LimitFlags & JobObjectLimitFlags.SilentBreakawayOk) == JobObjectLimitFlags.SilentBreakawayOk;
+            set
+            {
+                if (value)
+                {
+                    LimitFlags |= JobObjectLimitFlags.SilentBreakawayOk;
+                }
+                else
+                {
+                    LimitFlags &= ~JobObjectLimitFlags.SilentBreakawayOk;
+                }
+            }
         }

         /// <summary>
@@ -530,6 +745,11 @@
             return SetLimitInformation(JobObjectInformationClass.JobObjectExtendedLimitInformation, set_limit, throw_on_error);
         }

+        private JobObjectExtendedLimitInformation GetExtendedLimitInfo()
+        {
+            return Query<JobObjectExtendedLimitInformation>(JobObjectInformationClass.JobObjectExtendedLimitInformation);
+        }
+
         #endregion
     }
 }


NyaaSpam: Fix display bug

NyaaSpam: Fix display bug

We want to show the end-of-list indicator even if they're 0 patterns.

--- NyaaSpam/NyaaSpam.cs
+++ NyaaSpam/NyaaSpam.cs
@@ -293,17 +293,18 @@
             patterns = feedPatterns.GetGlobalExcludePatterns(channel);
         }

+        IrcShow(nick, patterns);
+    }
+
+    void IrcShow(string nick, string[] patterns)
+    {
         if (patterns.Length > 0)
-            IrcShow(nick, patterns);
-    }
-
-    void IrcShow(string nick, string[] patterns)
-    {
-        foreach (string line in OutputTools.TwoColumns(patterns))
-        {
-            irc.SendNotice(nick, line);
-        }
-
+        {
+            foreach (string line in OutputTools.TwoColumns(patterns))
+            {
+                irc.SendNotice(nick, line);
+            }
+        }
         irc.SendNotice(nick, " -----");
     }
 }


Don't change scroll position on note save events (BGO #588593)

--- Tomboy/RecentChanges.cs
+++ Tomboy/RecentChanges.cs
@@ -650,7 +650,9 @@

 		void OnNoteSaved (Note note)
 		{
+			var rect = tree.VisibleRect;
 			UpdateResults ();
+			tree.ScrollToPoint (rect.X, rect.Y);
 		}

 		void OnTreeViewDragDataGet (object sender, Gtk.DragDataGetArgs args)


Revert temporary debugging change

Revert temporary debugging change

--- TrueCraft/Program.cs
+++ TrueCraft/Program.cs
@@ -51,7 +51,7 @@
             }
             catch
             {
-                world = new World("default", new FlatlandGenerator());
+                world = new World("default", new StandardGenerator());
                 world.BlockRepository = Server.BlockRepository;
                 world.Save("world");
                 Server.AddWorld(world);


Fixed a bug where temporary tox profiles were saved to disk

--- Toxy/MainWindow.xaml.cs
+++ Toxy/MainWindow.xaml.cs
@@ -1683,12 +1683,12 @@
             }
             else
             {
-                KillTox();
+                KillTox(true);
                 nIcon.Dispose();
             }
         }

-        private void KillTox()
+        private void KillTox(bool save)
         {
             if (call != null)
             {
@@ -1715,7 +1715,9 @@

             if (tox != null)
             {
-                saveTox();
+                if (save)
+                    saveTox();
+
                 tox.Dispose();
             }

@@ -2701,7 +2703,7 @@
             if (!File.Exists(Path.Combine(toxDataDir, profile + ".tox")))
                 return false;

-            KillTox();
+            KillTox(false);
             ViewModel.ChatCollection.Clear();

             config.ProfileName = profile;


Fix attempting to use "home" key binding while exiting game causing errors

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -839,7 +839,9 @@
                 OnHome = delegate
                 {
                     CloseAllOverlays(false);
-                    menuScreen?.MakeCurrent();
+
+                    if (menuScreen?.GetChildScreen() != null)
+                        menuScreen.MakeCurrent();
                 },
             }, topMostOverlayContent.Add);


要素作成時のタイプが適切に設定されているかどうかのテストを作成

要素作成時のタイプが適切に設定されているかどうかのテストを作成

--- UnitTest/ElementTest.cs
+++ UnitTest/ElementTest.cs
@@ -38,5 +38,20 @@
             }

         }
+
+        [TestCase("B31", Result="B31")]
+        [TestCase("S4R", Result="S4R")]
+        [TestCase("S4", Result="S4")]
+        [TestCase("s4", Result="S4")]
+        [TestCase("C3d8", Result="C3D8")]
+        [TestCase("c3D20", Result="C3D20")]
+        public string ElementTipeTest(string type)
+        {
+            //Assert.Fail();
+            var e = new Element(type, "1, 2, 3");
+            return e.type;
+        }
+
+
     }
 }


Log the messages before logging the URL and title. This way flows better in reading the logs.

--- UrlTitling/Threading.cs
+++ UrlTitling/Threading.cs
@@ -204,8 +204,8 @@
             if (result.PrintTitle)
                 irc.SendMessage(Channel, result.Title);

+            log.Message(result.Messages);
             log.Message("{0} -- {1}", result.Requested, result.Title);
-            log.Message(result.Messages);
         }
         else
         {