inject attr can be inherit

inject attr can be inherit

--- CatLib.VS/CatLib.API/Support/Container/InjectAttribute.cs
+++ CatLib.VS/CatLib.API/Support/Container/InjectAttribute.cs
@@ -19,7 +19,7 @@
     [AttributeUsage(AttributeTargets.Interface |
                     AttributeTargets.Parameter |
                     AttributeTargets.Property)]
-    public sealed class InjectAttribute : Attribute
+    public class InjectAttribute : Attribute
     {
         /// <summary>
         /// 注入服务的别名或者服务名


Reorder members based on their internal dependencies.

--- src/Fixie/Internal/Runner.cs
+++ src/Fixie/Internal/Runner.cs
@@ -22,6 +22,29 @@
         public ExecutionSummary Run(Assembly assembly)
         {
             return Run(assembly, assembly.GetTypes());
+        }
+
+        public ExecutionSummary Run(Assembly assembly, Test[] tests)
+        {
+            var request = new Dictionary<string, HashSet<string>>();
+            var types = new List<Type>();
+
+            foreach (var test in tests)
+            {
+                if (!request.ContainsKey(test.Class))
+                {
+                    request.Add(test.Class, new HashSet<string>());
+
+                    var type = assembly.GetType(test.Class);
+
+                    if (type != null)
+                        types.Add(type);
+                }
+
+                request[test.Class].Add(test.Method);
+            }
+
+            return Run(assembly, types.ToArray(), method => request[method.ReflectedType.FullName].Contains(method.Name));
         }

         public ExecutionSummary Run(Assembly assembly, Type[] candidateTypes, Func<MethodInfo, bool> methodCondition = null)
@@ -70,28 +93,5 @@

             return assemblySummary;
         }
-
-        public ExecutionSummary Run(Assembly assembly, Test[] tests)
-        {
-            var request = new Dictionary<string, HashSet<string>>();
-            var types = new List<Type>();
-
-            foreach (var test in tests)
-            {
-                if (!request.ContainsKey(test.Class))
-                {
-                    request.Add(test.Class, new HashSet<string>());
-
-                    var type = assembly.GetType(test.Class);
-
-                    if (type != null)
-                        types.Add(type);
-                }
-
-                request[test.Class].Add(test.Method);
-            }
-
-            return Run(assembly, types.ToArray(), method => request[method.ReflectedType.FullName].Contains(method.Name));
-        }
     }
 }


Fixed styles of datetime field

Fixed styles of datetime field

--- CmsEngine.Ui/Views/Shared/EditorTemplates/DateTime.cshtml
+++ CmsEngine.Ui/Views/Shared/EditorTemplates/DateTime.cshtml
@@ -5,16 +5,10 @@
 }

-  @Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue.ToString(), htmlAttributes)
-
-
-
+    @Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue.ToString(), htmlAttributes)
+

+

+
+

+

-
-
-@*

-    <input asp-for="PublishedOn" class="form-control" />
-
-
-
-
*@


Don't break application at startup when can't migrate

--- src/FujiyBlog.Web/Program.cs
+++ src/FujiyBlog.Web/Program.cs
@@ -3,6 +3,8 @@
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+using System;

 namespace FujiyBlog.Web
 {
@@ -16,7 +18,16 @@
             {
                 var services = scope.ServiceProvider;
                 var db = services.GetRequiredService<FujiyBlogDatabase>();
-                db.Database.Migrate();
+
+                try
+                {
+                    db.Database.Migrate();
+                }
+                catch (Exception ex)
+                {
+                    var logger = services.GetRequiredService<ILogger<Program>>();
+                    logger.LogError(ex, "An error occurred while migrating the database.");
+                }
             }

             webHost.Run();


minor adjustments to css

--- NugetVisualizer/WebVisualizer/Views/Dashboard/Index.cshtml
+++ NugetVisualizer/WebVisualizer/Views/Dashboard/Index.cshtml
@@ -106,38 +106,25 @@
             width: 580px;
             margin: 0 auto;
         }
-        .third {
-            float: left;
-            width: 47.5%;
-            margin-left: 5%;
-        }
-        .third:first-child {
-            margin-left: 0;
-        }
-        .third:last-child {
-            display: block;
-            width: 100%;
-            margin-left: 0;
-        }
     }

     @@media only screen and (min-width:960px){
         .container {
             width: 940px;
         }
-        .third {
+        .half {
             float: left;
-            width: 30%;
-            margin-left: 2.5%;
-            margin-right: 2.5%;
-        }
-        .third:first-child {
+            width: 50%;
+            margin-left: 1.5%;
+            margin-right: 1.5%;
+        }
+        .half:first-child {
             margin-left: 0;
         }
-        .third:last-child {
+        .half:last-child {
             margin-right: 0;
-            margin-left: 2.5%;
-            width: 30%;
+            margin-left: 1.5%;
+            width: 47%;
         }
     }
     @@media only screen and (min-width:1140px){
@@ -159,15 +146,7 @@

-

-

-
Something

-

-

-                <canvas id="some stuff"></canvas>
-

-

-

+

Most used packages

@@ -180,7 +159,7 @@
                 </form>

-

+

Most used packages

@@ -191,6 +170,22 @@
                 <form asp-for="maxToRetrieve" asp-controller="Dashboard" asp-action="MostUsed" method="post">
                     @Html.DropDownListFor(model => model.MostUsedPackagesViewModel.MaxToRetrieve, new SelectList(new List<SelectListItem>() {  new SelectListItem() {  Text = "5", Value = "5"} , new SelectListItem() { Text = "10", Value = "10" }, new SelectListItem() { Text = "15", Value = "15" } }, "Text", "Value"), new { @onchange = "this.form.submit();" })
                 </form>
+

+

+

+

+

+

+
Another Graph

+

+

+

+

+

+

+
Another Graph

+

+


Increasted missile smoke/flame emission frequency

--- Demos/DemosCommon/Missiles/SSpaceMissilesRenderManager.cs
+++ Demos/DemosCommon/Missiles/SSpaceMissilesRenderManager.cs
@@ -98,8 +98,10 @@
                 _smokeColorEffector.particleLifetime = mParams.smokeDuration;
                 //_smokeColorEffector.colorMask = ;
                 _smokeColorEffector.keyframes.Clear();
-                _smokeColorEffector.keyframes.Add(0f, mParams.innerFlameColor);
-                var flameColor = mParams.outerFlameColor;
+                var flameColor = mParams.innerFlameColor;
+                flameColor.A = 0.9f;
+                _smokeColorEffector.keyframes.Add(0f, flameColor);
+                flameColor = mParams.outerFlameColor;
                 flameColor.A = 0.7f;
                 _smokeColorEffector.keyframes.Add(0.1f, flameColor);
                 var smokeColor = mParams.smokeColor;
@@ -114,8 +116,6 @@
                 _smokeScaleEffector = new SSMasterScaleKeyframesEffector ();
                 _smokeScaleEffector.maskMatchFunction = SSParticleEffector.MatchFunction.Equals;
                 _smokeScaleEffector.effectorMask = (ushort)ParticleEffectorMasks.Smoke;
-                _smokeScaleEffector.particleLifetime = mParams.smokeDuration;
-
                 _smokeScaleEffector.particleLifetime = mParams.smokeDuration;
                 _smokeScaleEffector.keyframes.Clear();
                 _smokeScaleEffector.keyframes.Add(0f, 0.3f);
@@ -225,7 +225,7 @@
                 bodyObj.Orient(missile.direction, missile.up);

                 var emissionRatio = missile.jetStrength / mParams.fullSmokeEmissionAcc;
-                var emissionFreq = 20f;
+                var emissionFreq = 40f;
                 //var emissionFreq = Interpolate.Lerp(
                 //   mParams.smokeEmissionFrequencyMin, mParams.smokeEmissionFrequencyMax, emissionRatio);


Update the assembly info

Update the assembly info

Update the assembly info

--- DevelopmentInProgress.DipState/Properties/AssemblyInfo.cs
+++ DevelopmentInProgress.DipState/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.0.1")]
+[assembly: AssemblyFileVersion("1.0.0.1")]


Updated HelpWriter

Updated HelpWriter

--- src/GitHubLink/HelpWriter.cs
+++ src/GitHubLink/HelpWriter.cs
@@ -30,10 +30,11 @@

 GitHubLink [solutionPath] -url [urlToRepository]

-    solutionPath     The directory containing the solution with the pdb files.
-    -url [url]       Url to remote git repository.
-    -b [branch]      Name of the branch to use on the remote repository.
-    -l [file]
+    solutionPath       The directory containing the solution with the pdb files.
+    -url [url]         Url to remote git repository.
+    -c [config]        Name of the configuration, default value is 'Release'.
+    -b [branch]        Name of the branch to use on the remote repository.
+    -l [file]          The log file to write to.
 ";
             writer(message);
         }


fix the break

fix the break

--- src/GlacierBackup/Program.cs
+++ src/GlacierBackup/Program.cs
@@ -104,7 +104,7 @@
                 Environment.Exit(2);
             }

-            var theBackupType = Enum.Parse(typeof(BackupType), backupType);
+            var theBackupType = (BackupType)Enum.Parse(typeof(BackupType), backupType);

             if(theBackupType == BackupType.File && !File.Exists(backupSource))
             {


updating soon to be obselete code on Startup code

--- src/HawkWingForge/Startup.cs
+++ src/HawkWingForge/Startup.cs
@@ -31,7 +31,7 @@
             if (env.IsDevelopment())
             {
                 // For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709
-                builder.AddUserSecrets();
+                builder.AddUserSecrets<Startup>();
             }

             builder.AddEnvironmentVariables();


修正一处日志错误

修正一处日志错误

--- GameFramework/Resource/ResourceManager.ResourceChecker.cs
+++ GameFramework/Resource/ResourceManager.ResourceChecker.cs
@@ -149,7 +149,7 @@
                                 IFileSystem fileSystem = m_ResourceManager.GetFileSystem(ci.ReadWriteFileSystemName, false);
                                 if (!fileSystem.SaveAsFile(resourceFullName, resourcePath))
                                 {
-                                    throw new GameFrameworkException(Utility.Text.Format("Save as file '{0}' to '{1}' from file system '{2}' error.", resourceFullName, fileSystem.FullPath));
+                                    throw new GameFrameworkException(Utility.Text.Format("Save as file '{0}' to '{1}' from file system '{2}' error.", resourceFullName, resourcePath, fileSystem.FullPath));
                                 }

                                 fileSystem.DeleteFile(resourceFullName);


Тесты сериализации Makaba Entity

Тесты сериализации Makaba Entity

--- Imageboard10/Imageboard10UnitTests/MakabaDtoParseTests.cs
+++ Imageboard10/Imageboard10UnitTests/MakabaDtoParseTests.cs
@@ -26,11 +26,13 @@
 using Imageboard10.Core.NetworkInterface.Html;
 using Imageboard10.Core.Utility;
 using Imageboard10.Makaba;
+using Imageboard10.Makaba.Models;
 using Imageboard10.Makaba.Network.Html;
 using Imageboard10.Makaba.Network.Json;
 using Imageboard10.Makaba.Network.JsonParsers;
 using Imageboard10.Makaba.Network.Uri;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Microsoft.VisualStudio.TestTools.UnitTesting.Logging;
 using Newtonsoft.Json;

 namespace Imageboard10UnitTests
@@ -55,6 +57,7 @@
             _collection.RegisterModule<AgilityHtmlDocumentFactory, IHtmlDocumentFactory>();
             _collection.RegisterModule<MakabaHtmlParser, IHtmlParser>();
             _collection.RegisterModule<MakabaPostDtoParsers, INetworkDtoParsers>();
+            MakabaModelsRegistration.RegisterModules(_collection);
             await _collection.Seal();
             _provider = _collection.GetModuleProvider();
         }
@@ -1177,6 +1180,318 @@
             Assert.AreEqual(expectedDateOffset, result.LastUpdate, "result.LastUpdate");
         }

+        [TestMethod]
+        public async Task MakabaEntitySerialization()
+        {
+            var jsonStr = await TestResources.ReadTestTextFile("mobi_thread.json");
+            var dto = JsonConvert.DeserializeObject<BoardEntity2>(jsonStr);
+            Assert.IsNotNull(dto, "dto != null");
+            var parser = _provider.FindNetworkDtoParser<ThreadData, IBoardPostCollectionEtag>();
+            Assert.IsNotNull(parser, "parser != null");
+            var param = new ThreadData()
+            {
+                Link = new ThreadLink() { Board = "mobi", Engine = MakabaConstants.MakabaEngineId, OpPostNum = 1153568 },
+                Etag = "##etag##",
+                LoadedTime = DateTimeOffset.Now,
+                Entity = dto
+            };
+            var result1 = parser.Parse(param);
+            var serialization = _provider.QueryModule<IObjectSerializationService>();
+            var bytes = serialization.SerializeToBytes(result1.Info);
+            Logger.LogMessage($"entity size in bytes = {bytes.Length}");
+
+            var deserialized = serialization.Deserialize(bytes) as IBoardPostCollectionInfoSet;
+            Assert.IsNotNull(deserialized, "deserialized != null AND is IBoardPostCollectionInfoSet");
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBoard>(deserialized, info =>
+            {
+                Assert.AreEqual("mobi", info.Board, "info,Board->Board");
+                Assert.AreEqual("Мобильные устройства и приложения", info.BoardName, "info, Board->BoardName");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBoardLimits>(deserialized, info =>
+            {
+                Assert.AreEqual("Аноним", info.DefaultName, "info,Limits->DefaultName");
+                Assert.AreEqual((ulong)(40960 * 1024), info.MaxFilesSize, "info,Limits->MaxFilesSize");
+                Assert.AreEqual(15000, info.MaxComment, "info,Limits->MaxComment");
+                Assert.IsNull(info.Pages, "info,Limits->Pages != null");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBoardDesc>(deserialized, info =>
+            {
+                var doc = new PostDocument()
+                {
+                    Nodes = new List<IPostNode>()
+                    {
+                        new TextPostNode() {Text = "Доска для мобильных анонов. О покупке и мелких вопросах спрашивают прикрепленном треде. Читалки - в /bo/, наушники и плееры - в /t/."}
+                    }
+                };
+                PostModelsTests.AssertDocuments(_provider, doc, info.BoardInfo);
+                Assert.AreEqual("мобильные телефоны, приложения, iphone, android, winphone, 2ch browser", info.BoardInfoOuter, "info,BoardDesc->BoardInfoOuter");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBoardBanner>(deserialized, info =>
+            {
+                Assert.AreEqual((new EngineMediaLink() { Engine = MakabaConstants.MakabaEngineId, Uri = "/ololo/t_1.jpg" }).GetLinkHash(), info.BannerImageLink?.GetLinkHash());
+                Assert.AreEqual((new BoardLink() { Engine = MakabaConstants.MakabaEngineId, Board = "t" }).GetLinkHash(), info.BannerBoardLink?.GetLinkHash());
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBoardsAdvertisement>(deserialized, info =>
+            {
+                Assert.IsNotNull(info.AdvertisementItems, "info,BoardsAdvertisement->AdvertisementItems != null");
+                Assert.AreEqual(6, info.AdvertisementItems.Count, "info,BoardsAdvertisement->AdvertisementItems.Count");
+                var expBoards = new ILink[]
+                {
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "2d"},
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "wwe"},
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "ch"},
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "int"},
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "ruvn"},
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "math"},
+                };
+                CollectionAssert.AreEqual(expBoards, info.AdvertisementItems.Select(i => i.BoardLink).ToList(), BoardLinkComparer.Instance as IComparer);
+                var eb = info.AdvertisementItems[0];
+                Assert.AreEqual("Щитпостинг, обсуждение вайфу, аватарки и прочее. Анимешный /b/, постинг 3d не приветствуется.", eb.Info);
+                Assert.AreEqual("Аниме/Беседка", eb.Name);
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBottomAdvertisement>(deserialized, info =>
+            {
+                var l1 = new EngineMediaLink() { Engine = MakabaConstants.MakabaEngineId, Uri = "/banners/kPptGmThLL7w9tz1.png" };
+                var l2 = new EngineUriLink() { Engine = MakabaConstants.MakabaEngineId, Uri = "/banners/kPptGmThLL7w9tz1/" };
+                Assert.AreEqual(l1.GetLinkHash(), info.AdvertisementBannerLink?.GetLinkHash());
+                Assert.AreEqual(l2.GetLinkHash(), info.AdvertisementClickLink?.GetLinkHash());
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoPostingSpeed>(deserialized, info =>
+            {
+                Assert.AreEqual(0, info.Speed, "info.Speed");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoNews>(deserialized, info =>
+            {
+                Assert.IsNotNull(info.NewsItems, "info.NewsItems != null");
+                Assert.AreEqual(3, info.NewsItems.Count, "info.NewsItems.Count");
+                var n = info.NewsItems[0];
+                Assert.IsNotNull(n, "info.NewsItems[0] != null");
+                Assert.AreEqual("02/12/16", n.Date, "info.NewsItems[0].Date");
+                Assert.AreEqual("Конкурс визуальных новелл доски /ruvn/", n.Title, "info.NewsItems[0].Title");
+                Assert.AreEqual((new ThreadLink()
+                {
+                    Engine = MakabaConstants.MakabaEngineId,
+                    Board = "abu",
+                    OpPostNum = 54946
+                }).GetLinkHash(), n.NewsLink.GetLinkHash(), "info.NewsItems[0].NewsLink");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoLocation>(deserialized, info =>
+            {
+                Assert.AreEqual("mobi", info.Board, "info,Location->Board");
+                Assert.IsNull(info.CurrentPage, "info,Location->CurrentPage");
+                Assert.AreEqual(1153568, info.CurrentThread, "info,Location->CurrentThread");
+                Assert.AreEqual(1155354, info.MaxPostNumber, "info,Location->MaxPostNumber");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoUniquePosters>(deserialized, info =>
+            {
+                Assert.AreEqual(81, info.UniquePosters, "info,UniquePosters->UniquePosters");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoTitle>(deserialized, info =>
+            {
+                Assert.AreEqual("Windows 10 Mobile #263 каникулярный", info.Title, "info,Title->Title");
+            });
+
+            AssertPostCollectionFlags(deserialized, new[]
+            {
+                (PostCollectionFlags.EnableDices, false, "EnableDices"),
+                (PostCollectionFlags.EnableCountryFlags, false, "EnableCountryFlags"),
+                (PostCollectionFlags.EnableIcons, false, "EnableIcons"),
+                (PostCollectionFlags.EnableImages, true, "EnableImages"),
+                (PostCollectionFlags.EnableLikes, false, "EnableLikes"),
+                (PostCollectionFlags.EnableNames, true, "EnableNames"),
+                (PostCollectionFlags.EnableOekaki, false, "EnableOekaki"),
+                (PostCollectionFlags.EnablePosting, true, "EnablePosting"),
+                (PostCollectionFlags.EnableSage, true, "EnableSage"),
+                (PostCollectionFlags.EnableShield, false, "EnableShield"),
+                (PostCollectionFlags.EnableSubject, true, "EnableSubject"),
+                (PostCollectionFlags.EnableThreadTags, true, "EnableThreadTags"),
+                (PostCollectionFlags.EnableTripcodes, false, "EnableTripcodes"),
+                (PostCollectionFlags.EnableVideo, true, "EnableVideo"),
+                (PostCollectionFlags.IsBoard, false, "IsBoard"),
+                (PostCollectionFlags.IsIndex, false, "IsIndex"),
+            });
+        }
+
+        [TestMethod]
+        public async Task MakabaEntitySerializationWithIcons()
+        {
+            var jsonStr = await TestResources.ReadTestTextFile("mlp_index.json");
+            var dto = JsonConvert.DeserializeObject<BoardEntity2>(jsonStr);
+            Assert.IsNotNull(dto, "dto != null");
+            var parser = _provider.FindNetworkDtoParser<BoardPageData, IBoardPageThreadCollection>();
+            Assert.IsNotNull(parser, "parser != null");
+            var param = new BoardPageData()
+            {
+                Link = new BoardPageLink() { Board = "mlp", Engine = MakabaConstants.MakabaEngineId, Page = 0 },
+                Etag = "##etag##",
+                LoadedTime = DateTimeOffset.Now,
+                Entity = dto
+            };
+            var result1 = parser.Parse(param);
+            var serialization = _provider.QueryModule<IObjectSerializationService>();
+            var bytes = serialization.SerializeToBytes(result1.Info);
+            Logger.LogMessage($"entity size in bytes = {bytes.Length}");
+
+            var deserialized = serialization.Deserialize(bytes) as IBoardPostCollectionInfoSet;
+            Assert.IsNotNull(deserialized, "deserialized != null AND is IBoardPostCollectionInfoSet");
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBoard>(deserialized, info =>
+            {
+                Assert.AreEqual("mlp", info.Board, "info,Board->Board");
+                Assert.AreEqual("My Little Pony", info.BoardName, "info, Board->BoardName");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBoardLimits>(deserialized, info =>
+            {
+                Assert.AreEqual("Pony", info.DefaultName, "info,Limits->DefaultName");
+                Assert.AreEqual((ulong)(40960 * 1024), info.MaxFilesSize, "info,Limits->MaxFilesSize");
+                Assert.AreEqual(15000, info.MaxComment, "info,Limits->MaxComment");
+                Assert.IsNotNull(info.Pages, "info,Limits->Pages != null");
+                CollectionAssert.AreEquivalent(new List<int>()
+                {
+                    0,
+                    1,
+                    2,
+                    3,
+                    4,
+                    5,
+                    6,
+                    7
+                } as ICollection, info.Pages as ICollection, "Limits->Pages != null");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBoardBanner>(deserialized, info =>
+            {
+                Assert.AreEqual(new SizeInt32() { Width = 300, Height = 100 }, info.BannerSize, "info,BoardBanner->BannerSize");
+                Assert.AreEqual((new EngineMediaLink() { Engine = MakabaConstants.MakabaEngineId, Uri = "/ololo/fet_1.jpg" }).GetLinkHash(), info.BannerImageLink?.GetLinkHash());
+                Assert.AreEqual((new BoardLink() { Engine = MakabaConstants.MakabaEngineId, Board = "fet" }).GetLinkHash(), info.BannerBoardLink?.GetLinkHash());
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBoardDesc>(deserialized, info =>
+            {
+                var doc = new PostDocument()
+                {
+                    Nodes = new List<IPostNode>()
+                    {
+                        new TextPostNode() {Text = "Правило 34 только в соответствующих тредах. Настоящие кони скачут в /ne/, фурри – в /fur/. Гуро и флаффи запрещены."}
+                    }
+                };
+                PostModelsTests.AssertDocuments(_provider, doc, info.BoardInfo);
+                Assert.AreEqual("Мои маленькие пони, дружба, магия", info.BoardInfoOuter, "info,BoardDesc->BoardInfoOuter");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBoardsAdvertisement>(deserialized, info =>
+            {
+                Assert.IsNotNull(info.AdvertisementItems, "info,BoardsAdvertisement->AdvertisementItems != null");
+                Assert.AreEqual(6, info.AdvertisementItems.Count, "info,BoardsAdvertisement->AdvertisementItems.Count");
+                var expBoards = new ILink[]
+                {
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "2d"},
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "wwe"},
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "ch"},
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "int"},
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "ruvn"},
+                    new BoardLink() {Engine = MakabaConstants.MakabaEngineId, Board = "math"},
+                };
+                CollectionAssert.AreEqual(expBoards, info.AdvertisementItems.Select(i => i.BoardLink).ToList(), BoardLinkComparer.Instance as IComparer);
+                var eb = info.AdvertisementItems[0];
+                Assert.AreEqual("Щитпостинг, обсуждение вайфу, аватарки и прочее. Анимешный /b/, постинг 3d не приветствуется.", eb.Info);
+                Assert.AreEqual("Аниме/Беседка", eb.Name);
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoBottomAdvertisement>(deserialized, info =>
+            {
+                var l1 = new EngineMediaLink() { Engine = MakabaConstants.MakabaEngineId, Uri = "/banners/kPptGmThLL7w9tz1.png" };
+                var l2 = new EngineUriLink() { Engine = MakabaConstants.MakabaEngineId, Uri = "/banners/kPptGmThLL7w9tz1/" };
+                Assert.AreEqual(l1.GetLinkHash(), info.AdvertisementBannerLink?.GetLinkHash());
+                Assert.AreEqual(l2.GetLinkHash(), info.AdvertisementClickLink?.GetLinkHash());
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoPostingSpeed>(deserialized, info =>
+            {
+                Assert.AreEqual(20, info.Speed);
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoIcons>(deserialized, info =>
+            {
+                Assert.IsNotNull(info.Icons, "info.Icons != null");
+                Assert.AreEqual(46, info.Icons.Count, "info.Icons.Count");
+                var i1 = info.Icons[0];
+                Assert.IsNotNull(i1, "info.Icons[0] != null");
+                Assert.AreEqual("1", i1.Id, "info.Icons[0].Id");
+                Assert.AreEqual("Twilight Sparkle", i1.Name, "info.Icons[0].Name");
+                var i2 = info.Icons[1];
+                Assert.IsNotNull(i1, "info.Icons[1] != null");
+                Assert.AreEqual("2", i2.Id, "info.Icons[1].Id");
+                Assert.AreEqual("Applejack", i2.Name, "info.Icons[1].Name");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoNews>(deserialized, info =>
+            {
+                Assert.IsNotNull(info.NewsItems, "info.NewsItems != null");
+                Assert.AreEqual(3, info.NewsItems.Count, "info.NewsItems.Count");
+                var n = info.NewsItems[0];
+                Assert.IsNotNull(n, "info.NewsItems[0] != null");
+                Assert.AreEqual("02/12/16", n.Date, "info.NewsItems[0].Date");
+                Assert.AreEqual("Конкурс визуальных новелл доски /ruvn/", n.Title, "info.NewsItems[0].Title");
+                Assert.AreEqual((new ThreadLink()
+                {
+                    Engine = MakabaConstants.MakabaEngineId,
+                    Board = "abu",
+                    OpPostNum = 54946
+                }).GetLinkHash(), n.NewsLink.GetLinkHash(), "info.NewsItems[0].NewsLink");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoLocation>(deserialized, info =>
+            {
+                Assert.AreEqual("mlp", info.Board, "info,Location->Board");
+                Assert.AreEqual(0, info.CurrentPage, "info,Location->CurrentPage");
+                Assert.AreEqual(0, info.CurrentThread, "info,Location->CurrentThread");
+                Assert.IsNull(info.MaxPostNumber, "info,Location->MaxPostNumber");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoUniquePosters>(deserialized, info =>
+            {
+                Assert.IsNull(info.UniquePosters, "info,UniquePosters->UniquePosters");
+            });
+
+            AssertCollectionInfo<IBoardPostCollectionInfoTitle>(deserialized, info =>
+            {
+                Assert.IsNull(info.Title, "info,Title->Title");
+            });
+
+            AssertPostCollectionFlags(deserialized, new[]
+            {
+                (PostCollectionFlags.EnableDices, true, "EnableDices"),
+                (PostCollectionFlags.EnableCountryFlags, false, "EnableCountryFlags"),
+                (PostCollectionFlags.EnableIcons, true, "EnableIcons"),
+                (PostCollectionFlags.EnableImages, true, "EnableImages"),
+                (PostCollectionFlags.EnableLikes, false, "EnableLikes"),
+                (PostCollectionFlags.EnableNames, true, "EnableNames"),
+                (PostCollectionFlags.EnableOekaki, false, "EnableOekaki"),
+                (PostCollectionFlags.EnablePosting, true, "EnablePosting"),
+                (PostCollectionFlags.EnableSage, true, "EnableSage"),
+                (PostCollectionFlags.EnableShield, false, "EnableShield"),
+                (PostCollectionFlags.EnableSubject, true, "EnableSubject"),
+                (PostCollectionFlags.EnableThreadTags, false, "EnableThreadTags"),
+                (PostCollectionFlags.EnableTripcodes, true, "EnableTripcodes"),
+                (PostCollectionFlags.EnableVideo, true, "EnableVideo"),
+                (PostCollectionFlags.IsBoard, true, "IsBoard"),
+                (PostCollectionFlags.IsIndex, false, "IsIndex"),
+            });
+        }
+
         private void AssertCollectionInfo<T>(IBoardPostCollectionInfoSet infoSet, Action<T> asserts)
             where T : class, IBoardPostCollectionInfo
         {


Fix UserValidator

Fix UserValidator

--- InfinniPlatform.Authentication/Properties/AssemblyInfo.cs
+++ InfinniPlatform.Authentication/Properties/AssemblyInfo.cs
@@ -1,9 +1,9 @@
 // 1
 // 0
 // 0
-// 6
+// 7
 // d9127c89-8481-426a-b93b-287557004c14
-// 2D5A820ADF191FB5F5C8552C4EDFC3FA
+// 604E64920F7133DF518B7841DB78E790
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
@@ -17,7 +17,7 @@
 [assembly: AssemblyCulture("")]
 [assembly: ComVisible(false)]
 [assembly: Guid("d9127c89-8481-426a-b93b-287557004c14")]
-[assembly: AssemblyVersion("1.0.0.6")]
-[assembly: AssemblyFileVersion("1.0.0.6")]
+[assembly: AssemblyVersion("1.0.0.7")]
+[assembly: AssemblyFileVersion("1.0.0.7")]
 [assembly: InternalsVisibleTo("InfinniPlatform.Authentication.Tests")]
 [assembly: AssemblyDescription("InfinniPlatform.Authentication")]


add xplatcppsdk to publish pipeline

add xplatcppsdk to publish pipeline

--- JenkinsConsoleUtility/jcuSrc/Commands/VersionVarWriter.cs
+++ JenkinsConsoleUtility/jcuSrc/Commands/VersionVarWriter.cs
@@ -128,6 +128,7 @@
                 case "unrealblueprintsdk": case "uebpbetasdk": case "uebppsnsdk": case "uebpxboxsdk": return "cpp-unreal";
                 case "unrealcppsdk": case "uecppbetasdk": case "uecpppsnsdk": case "uecppxboxsdk": return "cpp-ue4";
                 case "windowssdk": case "winbetasdk": case "winpsnsdk": case "winxboxsdk": return "windowssdk";
+                case "xplatcppsdk": case "xplatbetasdk": case "xplatpsnsdk": case "xplatxboxsdk": return "xplatcppsdk";

                 default: return sdkName.ToLower(); // Most new sdks have matching names
             }


git-svn-id: http://svn.castleproject.org:8080/svn/castle/trunk@916 73e77b4c-caa6-f847-a29a-24ab75ae54b6

--- MonoRail/Castle.MonoRail.Framework/Helpers/AjaxHelper2.cs
+++ MonoRail/Castle.MonoRail.Framework/Helpers/AjaxHelper2.cs
@@ -502,17 +502,20 @@

 			if (options.Contains("before"))
 			{
-				contents = new StringBuilder( String.Format("{0}; {1}", options["before"], contents.ToString()) );
+				contents = new StringBuilder( String.Format("{0}; {1}",
+					options["before"].ToString(), contents.ToString()) );
 			}

 			if (options.Contains("after"))
 			{
-				contents = new StringBuilder( String.Format("{1}; {0}", options["after"], contents.ToString()) );
+				contents = new StringBuilder( String.Format("{1}; {0}",
+					options["after"].ToString(), contents.ToString()) );
 			}

 			if (options.Contains("condition"))
 			{
-				contents = new StringBuilder( String.Format("if ({0}) { {1}; }", options["condition"], contents.ToString()) );
+				contents = new StringBuilder( String.Format("if ({0}) { {1}; }",
+					options["condition"].ToString(), contents.ToString()) );
 			}

 			return contents.ToString();


Parse all devices for all stats regardless of type (to get ASIC temp)

--- MultiMiner.Xgminer.Api/Parsers/DeviceInformationParser.cs
+++ MultiMiner.Xgminer.Api/Parsers/DeviceInformationParser.cs
@@ -54,19 +54,17 @@
                     if (keyValuePairs.ContainsKey("ID"))
                         newDevice.ID = TryToParseInt(keyValuePairs, "ID", newDevice.Index);

-                    if (newDevice.Kind.Equals("GPU"))
-                    {
-                        newDevice.Temperature = TryToParseDouble(keyValuePairs, "Temperature", 0.00);
-                        newDevice.FanSpeed = TryToParseInt(keyValuePairs, "Fan Speed", 0);
-                        newDevice.FanPercent = TryToParseInt(keyValuePairs, "Fan Percent", 0);
-                        newDevice.GpuClock = TryToParseInt(keyValuePairs, "GPU Clock", 0);
-                        newDevice.MemoryClock = TryToParseInt(keyValuePairs, "Memory Clock", 0);
-                        newDevice.GpuVoltage = TryToParseDouble(keyValuePairs, "GPU Voltage", 0.00);
-                        newDevice.GpuActivity = TryToParseInt(keyValuePairs, "GPU Activity", 0);
-                        newDevice.PowerTune = TryToParseInt(keyValuePairs, "Powertune", 0);
-                        if (keyValuePairs.ContainsKey("Intensity")) //check required for bfgminer 3.3.0
-                            newDevice.Intensity = keyValuePairs["Intensity"];
-                    }
+                    //parse regardless of device type = ASICs may have Temp
+                    newDevice.Temperature = TryToParseDouble(keyValuePairs, "Temperature", 0.00);
+                    newDevice.FanSpeed = TryToParseInt(keyValuePairs, "Fan Speed", 0);
+                    newDevice.FanPercent = TryToParseInt(keyValuePairs, "Fan Percent", 0);
+                    newDevice.GpuClock = TryToParseInt(keyValuePairs, "GPU Clock", 0);
+                    newDevice.MemoryClock = TryToParseInt(keyValuePairs, "Memory Clock", 0);
+                    newDevice.GpuVoltage = TryToParseDouble(keyValuePairs, "GPU Voltage", 0.00);
+                    newDevice.GpuActivity = TryToParseInt(keyValuePairs, "GPU Activity", 0);
+                    newDevice.PowerTune = TryToParseInt(keyValuePairs, "Powertune", 0);
+                    if (keyValuePairs.ContainsKey("Intensity")) //check required for bfgminer 3.3.0
+                        newDevice.Intensity = keyValuePairs["Intensity"];

                     newDevice.AverageHashrate = TryToParseDouble(keyValuePairs, "MHS av", 0.00) * 1000;


Prevent empty db entries

Prevent empty db entries

--- MyQuizBackend/src/MYVote/Controllers/DevicesController.cs
+++ MyQuizBackend/src/MYVote/Controllers/DevicesController.cs
@@ -39,6 +39,10 @@
             catch (Exception)
             {
                 return BadRequest("Cannot deserialize your input!");
+            }
+            if (string.IsNullOrWhiteSpace(registration.token) && string.IsNullOrWhiteSpace(registration.password))
+            {
+                return BadRequest("I need at least a token or a password!");
             }

             using (var db = new EF_DB_Context())


Lazily get the ETW SD.

Lazily get the ETW SD.

--- NtApiDotNet/Win32/Service/EtwServiceTriggerInformation.cs
+++ NtApiDotNet/Win32/Service/EtwServiceTriggerInformation.cs
@@ -12,6 +12,8 @@
 //  See the License for the specific language governing permissions and
 //  limitations under the License.

+using System;
+
 namespace NtApiDotNet.Win32.Service
 {
     /// <summary>
@@ -19,10 +21,12 @@
     /// </summary>
     public sealed class EtwServiceTriggerInformation : ServiceTriggerInformation
     {
+        private Lazy<SecurityDescriptor> _security_descriptor;
+
         /// <summary>
         /// The security descriptor for the ETW event. Needs administrator privileges.
         /// </summary>
-        public SecurityDescriptor SecurityDescriptor { get; }
+        public SecurityDescriptor SecurityDescriptor => _security_descriptor.Value;

         /// <summary>
         /// Trigger the service.
@@ -43,11 +47,7 @@
         internal EtwServiceTriggerInformation(SERVICE_TRIGGER trigger)
             : base(trigger)
         {
-            var sd = EventTracing.QueryTraceSecurity(SubType, false);
-            if (sd.IsSuccess)
-            {
-                SecurityDescriptor = sd.Result;
-            }
+            _security_descriptor = new Lazy<SecurityDescriptor>(() => EventTracing.QueryTraceSecurity(SubType, false).GetResultOrDefault());
         }
     }
 #pragma warning restore


dsadasdasdas

dsadasdasdas

--- PetSociety-for-Windows/PetSociety-for-Windows/Map.xaml.cs
+++ PetSociety-for-Windows/PetSociety-for-Windows/Map.xaml.cs
@@ -221,19 +221,34 @@
         {

         }
+        private void RetrieveStrayComplete(object sender, DownloadStringCompletedEventArgs e)
+        {
+            MessageBox.Show(e.Result.ToString());
+        }
         private void LoadUserPins()
         {

         }
+        private void RetrieveUserComplete(object sender, DownloadStringCompletedEventArgs e)
+        {
+            MessageBox.Show(e.Result.ToString());
+        }
         private void LoadEventPins()
         {

         }
+        private void RetrieveEventComplete(object sender, DownloadStringCompletedEventArgs e)
+        {
+            MessageBox.Show(e.Result.ToString());
+        }
         private void LoadLocationPins()
         {

         }
-
+        private void RetrieveLocationComplete(object sender, DownloadStringCompletedEventArgs e)
+        {
+            MessageBox.Show(e.Result.ToString());
+        }

     }


[GRAPHDB-382] GraphDSREST_Output now checking if short name is already used for another plugin and uses long name in case

--- Plugins/GraphDS/RESTService/Service/GraphDSREST_Output.cs
+++ Plugins/GraphDS/RESTService/Service/GraphDSREST_Output.cs
@@ -322,13 +322,23 @@

 			foreach (IOInterface _io_plugin in _Plugins.Values)
 			{
-				Runthrough++;
+                Runthrough++;
+                string name = _io_plugin.PluginShortName;
+                for (Int32 i=0; i < (Runthrough-1); i++)
+                {
+                    if (_Plugins.Values.ElementAt(i).PluginShortName == name)
+                    {
+                        // Another IO plugin already has the same shortname, so use the normal (long) name
+                        name = _io_plugin.PluginName;
+                        break;
+                    }
+                }

 				// we have the name and the content type
 				if (Runthrough == _Plugins.Values.Count)
-						jsonArray.AppendLine("			\""+_io_plugin.ContentType+"\":\""+_io_plugin.PluginShortName+"\"");
+						jsonArray.AppendLine("			\""+_io_plugin.ContentType+"\":\""+name+"\"");
 					else
-						jsonArray.AppendLine("			\""+_io_plugin.ContentType+"\":\""+_io_plugin.PluginShortName+"\",");
+						jsonArray.AppendLine("			\""+_io_plugin.ContentType+"\":\""+name+"\",");

 			}
 			jsonArray.AppendLine("		}");


Added /Organizations(1)/ItSystems(1) route

--- Presentation.Web/Controllers/OData/ItSystemsController.cs
+++ Presentation.Web/Controllers/OData/ItSystemsController.cs
@@ -23,5 +23,14 @@
             var result = Repository.AsQueryable().Where(m => m.OrganizationId == key || m.AccessModifier == AccessModifier.Public);
             return Ok(result);
         }
+
+        // GET /Organizations(1)/ItSystems(1)
+        [EnableQuery]
+        [ODataRoute("Organizations({orgKey})/ItSystems({sysKey})")]
+        public IHttpActionResult GetItSystems(int orgKey, int sysKey)
+        {
+            var result = Repository.AsQueryable().Where(m => m.Id == sysKey && (m.OrganizationId == orgKey || m.AccessModifier == AccessModifier.Public));
+            return Ok(result);
+        }
     }
 }


Change wasm-interp output formatting

Change wasm-interp output formatting

--- wasm-interp/Program.cs
+++ wasm-interp/Program.cs
@@ -111,14 +111,16 @@
             int exitCode = 0;
             try
             {
-                var output = funcToRun.Invoke(new object[0]);
+                IReadOnlyList<object> output = funcToRun.Invoke(new object[0]);
                 if (output.Count > 0)
                 {
-                    Console.Write("returned: ");
                     for (int i = 0; i < output.Count; i++)
                     {
-                        Console.Write(" ");
-                        Console.Write(output);
+                        if (i > 0)
+                        {
+                            Console.Write(" ");
+                        }
+                        Console.Write(output[i]);
                     }
                     Console.WriteLine();
                 }


Doing some small code cleanup.

Doing some small code cleanup.

--- eFormCore/Infrastructure/SqlController.cs
+++ eFormCore/Infrastructure/SqlController.cs
@@ -2126,10 +2126,11 @@
                                     {
                                         Data.Entities.UploadedData uploadedData =
                                             db.UploadedDatas.Single(x => x.Id == item.UploadedDataId);
-                                        if (customPathForUploadedData != null)
-                                            replyLst1.Add(new KeyValuePair(item.CaseId.ToString(), customPathForUploadedData + uploadedData.FileName, false, ""));
-                                        else
-                                            replyLst1.Add(new KeyValuePair(item.CaseId.ToString(), uploadedData.FileLocation + uploadedData.FileName, false, ""));
+                                        replyLst1.Add(customPathForUploadedData != null
+                                            ? new KeyValuePair(item.CaseId.ToString(),
+                                                customPathForUploadedData + uploadedData.FileName, false, "")
+                                            : new KeyValuePair(item.CaseId.ToString(),
+                                                uploadedData.FileLocation + uploadedData.FileName, false, ""));
                                     }
                                     else
                                     {


enable DStreamTextFileSample and add Window API

--- csharp/Samples/Microsoft.Spark.CSharp/DStreamSamples.cs
+++ csharp/Samples/Microsoft.Spark.CSharp/DStreamSamples.cs
@@ -21,7 +21,7 @@
     {
         private static int count;
         private static bool stopFileServer;
-        private static void StartFileServer(string directory, string pattern, int loop)
+        private static void StartFileServer(StreamingContext ssc, string directory, string pattern, int loops = 1)
         {
             string testDir = Path.Combine(directory, "test");
             if (!Directory.Exists(testDir))
@@ -33,26 +33,29 @@

             Task.Run(() =>
             {
+                int loop = 0;
                 while (!stopFileServer)
                 {
-                    DateTime now = DateTime.Now;
-                    foreach (string path in files)
+                    if (loop++ < loops)
                     {
-                        string text = File.ReadAllText(path);
-                        File.WriteAllText(testDir + "\\" + now.ToBinary() + "_" + Path.GetFileName(path), text);
+                        DateTime now = DateTime.Now;
+                        foreach (string path in files)
+                        {
+                            string text = File.ReadAllText(path);
+                            File.WriteAllText(testDir + "\\" + now.ToBinary() + "_" + Path.GetFileName(path), text);
+                        }
                     }
                     System.Threading.Thread.Sleep(200);
                 }

-                System.Threading.Thread.Sleep(3000);
-
-                foreach (var file in Directory.GetFiles(testDir, "*"))
-                    File.Delete(file);
+                ssc.Stop();
             });
-        }
-
-        [Sample("experimental")]
-        internal static void DStreamTextFileSamples()
+
+            System.Threading.Thread.Sleep(1);
+        }
+
+        [Sample]
+        internal static void DStreamTextFileSample()
         {
             count = 0;

@@ -78,7 +81,7 @@
                     // separate dstream transformations defined in CSharpDStream.scala
                     // an extra CSharpRDD is introduced in between these operations
                     var wordCounts = pairs.ReduceByKey((x, y) => x + y);
-                    var join = wordCounts.Join(wordCounts, 2);
+                    var join = wordCounts.Window(2, 2).Join(wordCounts, 2);
                     var state = join.UpdateStateByKey<string, Tuple<int, int>, int>(new UpdateStateHelper(b).Execute);

                     state.ForeachRDD((time, rdd) =>
@@ -94,21 +97,23 @@
                         foreach (object record in taken)
                         {
                             Console.WriteLine(record);
+
+                            var countByWord = (KeyValuePair<string, int>)record;
+                            Assert.AreEqual(countByWord.Value, countByWord.Key == "The" || countByWord.Key == "lazy" || countByWord.Key == "dog" ? 92 : 88);
                         }
                         Console.WriteLine();

-                        stopFileServer = count++ > 100;
+                        stopFileServer = true;
                     });

                     return context;
                 });

+            StartFileServer(ssc, directory, "words.txt");
+
             ssc.Start();

-            StartFileServer(directory, "words.txt", 100);
-
             ssc.AwaitTermination();
-            ssc.Stop();
         }

         private static string brokers = ConfigurationManager.AppSettings["KafkaTestBrokers"] ?? "127.0.0.1:9092";


HG: add missing information on GetRegion

--- OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
+++ OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
@@ -125,6 +125,7 @@
                 hash["hostname"] = regInfo.ExternalHostName;
                 hash["http_port"] = regInfo.HttpPort.ToString();
                 hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString();
+                hash["server_uri"] = regInfo.ServerURI;
             }

             if (message != null)


ImportManager reorder parameters

ImportManager reorder parameters

--- Signum.Engine.Extensions/Disconnected/ImportManager.cs
+++ Signum.Engine.Extensions/Disconnected/ImportManager.cs
@@ -479,7 +479,7 @@

                     Executor.ExecuteNonQuery(delete);

-                    SqlPreCommandSimple insert = InsertUpdatedRelationalTableScript(rt, machine, table, newDatabaseName);
+                    SqlPreCommandSimple insert = InsertUpdatedRelationalTableScript(machine, table, rt, newDatabaseName);

                     Executor.ExecuteNonQuery(insert);
                 }
@@ -488,7 +488,7 @@
             }
         }

-        protected virtual SqlPreCommandSimple InsertUpdatedRelationalTableScript(RelationalTable rt, DisconnectedMachineDN machine, Table table, DatabaseName newDatabaseName)
+        protected virtual SqlPreCommandSimple InsertUpdatedRelationalTableScript(DisconnectedMachineDN machine, Table table, RelationalTable rt, DatabaseName newDatabaseName)
         {
             ParameterBuilder pb = Connector.Current.ParameterBuilder;
             var columns = rt.Columns.Values.Where(c => !c.Identity);


fixed DataContextChanged stuff to work within and outside VisStudio

--- PanoramicDataWin8/view/vis/render/PlotRenderer.xaml.cs
+++ PanoramicDataWin8/view/vis/render/PlotRenderer.xaml.cs
@@ -38,8 +38,6 @@
     public sealed partial class PlotRenderer : Renderer, IScribbable, AttributeViewModelEventHandler
     {
         private PlotRendererContentProvider _plotRendererContentProvider = new PlotRendererContentProvider();
-        private readonly DispatcherTimer _operationViewMovingTimer = new DispatcherTimer();
-        private bool _ifNotLoadedYet = true;

         public PlotRenderer()
         {
@@ -48,29 +46,21 @@
             _plotRendererContentProvider.CompositionScaleX = dxSurface.CompositionScaleX;
             _plotRendererContentProvider.CompositionScaleY = dxSurface.CompositionScaleY;
             dxSurface.ContentProvider = _plotRendererContentProvider;
-            this.DataContextChanged += PlotRenderer_DataContextChanged;
             this.Loaded += PlotRenderer_Loaded;
-
-            _operationViewMovingTimer.Interval = TimeSpan.FromMilliseconds(200);
-            _operationViewMovingTimer.Tick += _operationViewMovingTimer_Tick;
-            _operationViewMovingTimer.Start();
-        }
-
-        private void _operationViewMovingTimer_Tick(object sender, object e)
-        {
-            var result = (DataContext as HistogramOperationViewModel)?.OperationModel?.Result;
-            if (result != null && _ifNotLoadedYet)
-            {
-                loadResult(result);
-                render();
-                _operationViewMovingTimer.Stop();
-            }
+            this.Unloaded += PlotRenderer_Unloaded;
+        }
+
+        private void PlotRenderer_Unloaded(object sender, RoutedEventArgs e)
+        {
+            DataContextChanged -= PlotRenderer_DataContextChanged;
         }

         void PlotRenderer_Loaded(object sender, RoutedEventArgs e)
         {
             _plotRendererContentProvider.CompositionScaleX = dxSurface.CompositionScaleX;
             _plotRendererContentProvider.CompositionScaleY = dxSurface.CompositionScaleY;
+            DataContextChanged += PlotRenderer_DataContextChanged;
+            configureDataContext();
         }

         public override void Dispose()
@@ -86,12 +76,17 @@

         void PlotRenderer_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
         {
-            if (args.NewValue != null)
-            {
-                (DataContext as HistogramOperationViewModel).OperationModel.OperationModelUpdated -= OperationModelUpdated;
-                (DataContext as HistogramOperationViewModel).OperationModel.OperationModelUpdated += OperationModelUpdated;
-                (DataContext as HistogramOperationViewModel).OperationModel.PropertyChanged -= OperationModel_PropertyChanged;
-                (DataContext as HistogramOperationViewModel).OperationModel.PropertyChanged += OperationModel_PropertyChanged;
+            configureDataContext();
+        }
+        void configureDataContext()
+        {
+            var model = (DataContext as HistogramOperationViewModel)?.HistogramOperationModel;
+            if (model != null)
+            {
+                model.OperationModelUpdated -= OperationModelUpdated;
+                model.OperationModelUpdated += OperationModelUpdated;
+                model.PropertyChanged -= OperationModel_PropertyChanged;
+                model.PropertyChanged += OperationModel_PropertyChanged;

                 var result = (DataContext as HistogramOperationViewModel).OperationModel.Result;
                 if (result != null)
@@ -101,9 +96,8 @@
                 }
                 else
                 {
-                    HistogramOperationModel operationModel = (HistogramOperationModel)((OperationViewModel)DataContext).OperationModel;
-                    if (!operationModel.GetAttributeUsageTransformationModel(AttributeUsage.X).Any() &&
-                        !operationModel.GetAttributeUsageTransformationModel(AttributeUsage.Y).Any())
+                    if (!model.GetAttributeUsageTransformationModel(AttributeUsage.X).Any() &&
+                        !model.GetAttributeUsageTransformationModel(AttributeUsage.Y).Any())
                     {
                         //viewBox.Visibility = Visibility.Visible;
                     }
@@ -150,7 +144,6 @@

         void loadResult(IResult result)
         {
-            _ifNotLoadedYet = false;
             _lastResult = result as HistogramResult;
             var model = (DataContext as HistogramOperationViewModel);
             _plotRendererContentProvider.UpdateFilterModels(model.HistogramOperationModel.FilterModels.ToList());


Add test that aggregate exception is last

--- tests/Bugsnag.Tests/Payload/ExceptionTests.cs
+++ tests/Bugsnag.Tests/Payload/ExceptionTests.cs
@@ -28,27 +28,46 @@
       Assert.Equal(2, exceptions.Count());
     }

-    [Fact]
-    public void HandleAggregateExceptions()
+    public class AggregateExceptions
     {
-      Exceptions exceptions = null;
-      var exceptionsToThrow = new[] { new System.Exception(), new System.DllNotFoundException() };
-      var tasks = exceptionsToThrow.Select(e => Task.Run(() => { throw e; })).ToArray();
+      Exception[] exceptions;

-      try
+      public AggregateExceptions()
       {
-        Task.WaitAll(tasks);
-      }
-      catch (System.Exception exception)
-      {
-        exceptions = new Exceptions(exception, 0);
+        Exceptions exceptions = null;
+        var exceptionsToThrow = new[] { new System.Exception(), new System.DllNotFoundException() };
+        var tasks = exceptionsToThrow.Select(e => Task.Run(() => { throw e; })).ToArray();
+
+        try
+        {
+          Task.WaitAll(tasks);
+        }
+        catch (System.Exception exception)
+        {
+          exceptions = new Exceptions(exception, 0);
+        }
+
+        this.exceptions = exceptions.ToArray();
       }

-      var results = exceptions.ToArray();
+      [Fact]
+      public void ContainsDllNotFoundException()
+      {
+        Assert.Contains(exceptions, exception => exception.ErrorClass == "System.DllNotFoundException");
+      }

-      Assert.Contains(results, exception => exception.ErrorClass == "System.DllNotFoundException");
-      Assert.Contains(results, exception => exception.ErrorClass == "System.Exception");
-      Assert.Contains(results, exception => exception.ErrorClass == "System.AggregateException");
+      [Fact]
+      public void ContainsException()
+      {
+        Assert.Contains(exceptions, exception => exception.ErrorClass == "System.Exception");
+      }
+
+      [Fact]
+      public void AggregateExceptionIsLast()
+      {
+        var lastException = exceptions.Last();
+        Assert.Equal("System.AggregateException", lastException.ErrorClass);
+      }
     }
   }
 }


Define method implementations with the correct attrs

--- TypeImplementer.cs
+++ TypeImplementer.cs
@@ -58,7 +58,8 @@
 				for (int i = 0 ; i < parms.Length ; i++)
 					parmTypes[i] = parms[i].ParameterType;

-				MethodBuilder method_builder = typeB.DefineMethod (declMethod.Name, MethodAttributes.Public | MethodAttributes.Virtual, declMethod.ReturnType, parmTypes);
+				MethodAttributes attrs = declMethod.Attributes ^ MethodAttributes.Abstract;
+				MethodBuilder method_builder = typeB.DefineMethod (declMethod.Name, attrs, declMethod.ReturnType, parmTypes);
 				typeB.DefineMethodOverride (method_builder, declMethod);

 				//define in/out/ref/name for each of the parameters


update FastConcat

update FastConcat

--- Utilities/Print.cs
+++ Utilities/Print.cs
@@ -7,7 +7,7 @@
 {
     static readonly StringBuilder _stringBuilder = new StringBuilder(256);

-    public static string FastConcat(this string str1, string str2)
+    public static string FastConcat<T>(this string str1, T str2)
     {
         lock (_stringBuilder)
         {


Fix startup errors

Fix startup errors

--- PogoLocationFeeder.GUI/Views/LatLngSettingView.xaml.cs
+++ PogoLocationFeeder.GUI/Views/LatLngSettingView.xaml.cs
@@ -59,10 +59,42 @@

         // Object used for communication from JS -> WPF
         [System.Runtime.InteropServices.ComVisibleAttribute(true)]
-        public class HtmlInteropInternalClass {
-            public double defaultlat = GlobalSettings.GeoLocationBounds.LatLng.Latitude;
-            public double defaultlng = GlobalSettings.GeoLocationBounds.LatLng.Longitude;
-            public int Zoom = GlobalSettings.GeoLocationBounds.Zoom;
+        public class HtmlInteropInternalClass
+        {
+            public double defaultlat;
+            public double defaultlng;
+            public int Zoom;
+
+            public HtmlInteropInternalClass()
+            {
+                if (GlobalSettings.GeoLocationBounds != null && GlobalSettings.GeoLocationBounds.LatLng != null &&
+                    GlobalSettings.GeoLocationBounds.LatLng.Latitude != default(double))
+                {
+                    defaultlat = GlobalSettings.GeoLocationBounds.LatLng.Latitude;
+                }
+                else
+                {
+                    defaultlat = 40.7728809861351;
+                }
+                if (GlobalSettings.GeoLocationBounds != null && GlobalSettings.GeoLocationBounds.LatLng != null &&
+     GlobalSettings.GeoLocationBounds.LatLng.Longitude != default(double))
+                {
+                    defaultlng = GlobalSettings.GeoLocationBounds.LatLng.Longitude;
+                }
+                else
+                {
+                    defaultlng = -73.96775443698732;
+                }
+                if (GlobalSettings.GeoLocationBounds != null && GlobalSettings.GeoLocationBounds.Zoom != default(double))
+                {
+                    Zoom = GlobalSettings.GeoLocationBounds.Zoom;
+                }
+                else
+                {
+                    Zoom = 13;
+                }
+            }
+

             public void setMapInfo(double lat, double lng, double swLat, double swLng, double neLat, double neLng, int zoom)
             {


Adaptive starts implemented.

Adaptive starts implemented.

--- SolverPrototype/SolverPrototype/Solver_LastDispatch.cs
+++ SolverPrototype/SolverPrototype/Solver_LastDispatch.cs
@@ -58,14 +58,17 @@
             }
         }
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        void TraverseForwardUntilBlocked<TStageFunction>(ref TStageFunction stageFunction, int blockIndex, ref WorkerBounds bounds, ref Buffer<WorkerBounds> allWorkerBounds, int workerIndex,
+        int TraverseForwardUntilBlocked<TStageFunction>(ref TStageFunction stageFunction, int blockIndex, ref WorkerBounds bounds, ref Buffer<WorkerBounds> allWorkerBounds, int workerIndex,
             int batchEnd, int claimedState, int unclaimedState)
             where TStageFunction : IStageFunction
         {
+            //If no claim is made, this defaults to an invalid interval endpoint.
+            int highestLocallyClaimedIndex = -1;
             while (true)
             {
                 if (Interlocked.CompareExchange(ref context.BlockClaims[blockIndex], claimedState, unclaimedState) == unclaimedState)
                 {
+                    highestLocallyClaimedIndex = blockIndex;
                     bounds.Max = blockIndex + 1; //Exclusive bound.
                     Debug.Assert(blockIndex <= batchEnd);
                     stageFunction.Execute(ref context.WorkBlocks[blockIndex]);
@@ -81,16 +84,20 @@
                 }
             }
             MergeWorkerBounds(ref bounds, ref allWorkerBounds, workerIndex);
+            return highestLocallyClaimedIndex;
         }
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        void TraverseBackwardUntilBlocked<TStageFunction>(ref TStageFunction stageFunction, int blockIndex, ref WorkerBounds bounds, ref Buffer<WorkerBounds> allWorkerBounds, int workerIndex,
+        int TraverseBackwardUntilBlocked<TStageFunction>(ref TStageFunction stageFunction, int blockIndex, ref WorkerBounds bounds, ref Buffer<WorkerBounds> allWorkerBounds, int workerIndex,
             int batchStart, int claimedState, int unclaimedState)
             where TStageFunction : IStageFunction
         {
+            //If no claim is made, this defaults to an invalid interval endpoint.
+            int lowestLocallyClaimedIndex = context.WorkBlocks.Count;
             while (true)
             {
                 if (Interlocked.CompareExchange(ref context.BlockClaims[blockIndex], claimedState, unclaimedState) == unclaimedState)
                 {
+                    lowestLocallyClaimedIndex = blockIndex;
                     bounds.Min = blockIndex;
                     Debug.Assert(blockIndex >= batchStart);
                     stageFunction.Execute(ref context.WorkBlocks[blockIndex]);
@@ -107,6 +114,7 @@
                 }
             }
             MergeWorkerBounds(ref bounds, ref allWorkerBounds, workerIndex);
+            return lowestLocallyClaimedIndex;
         }
         private void ExecuteStage<TStageFunction>(ref TStageFunction stageFunction, ref Buffer<WorkerBounds> allWorkerBounds, ref Buffer<WorkerBounds> previousWorkerBounds, int workerIndex,
             int batchStart, int batchEnd, ref int workerStart, ref int syncStage,
@@ -128,22 +136,45 @@
                 bounds.Min = blockIndex;

                 //Note that initialization guarantees a start index in the batch; no test required.
+                //Note that we track the largest contiguous region over the course of the stage execution. The batch start of this worker will be set to the
+                //minimum slot of the largest contiguous region so that following iterations will tend to have a better initial work distribution with less work stealing.
                 Debug.Assert(batchStart <= blockIndex && batchEnd > blockIndex);
-                TraverseForwardUntilBlocked(ref stageFunction, blockIndex, ref bounds, ref allWorkerBounds, workerIndex, batchEnd, claimedState, unclaimedState);
+                var highestLocalClaim = TraverseForwardUntilBlocked(ref stageFunction, blockIndex, ref bounds, ref allWorkerBounds, workerIndex, batchEnd, claimedState, unclaimedState);

                 //By now, we've reached the end of the contiguous region in the forward direction. Try walking the other way.
                 blockIndex = workerStart - 1;
                 //Note that there is no guarantee that the block will be in the batch- this could be the leftmost worker.
+                int lowestLocalClaim;
                 if (blockIndex >= batchStart)
                 {
-                    TraverseBackwardUntilBlocked(ref stageFunction, blockIndex, ref bounds, ref allWorkerBounds, workerIndex, batchStart, claimedState, unclaimedState);
-                }
+                    lowestLocalClaim = TraverseBackwardUntilBlocked(ref stageFunction, blockIndex, ref bounds, ref allWorkerBounds, workerIndex, batchStart, claimedState, unclaimedState);
+                }
+                else
+                {
+                    lowestLocalClaim = batchStart;
+                }
+                //These are actually two inclusive bounds, so this is count - 1, but as long as we're consistent it's fine.
+                //For this first region, we need to check that it's actually a valid region- if the claims were blocked, it might not be.
+                var largestContiguousRegionSize = highestLocalClaim - lowestLocalClaim;
+                if (largestContiguousRegionSize >= 0)
+                    workerStart = lowestLocalClaim;
+                else
+                    largestContiguousRegionSize = 0; //It was an invalid region, but later invalid regions should be rejected by size. Setting to zero guarantees that later regions have to have at least one open slot.
+

                 //All contiguous slots have been claimed. Now just traverse to the end along the right direction.
                 while (bounds.Max < batchEnd)
                 {
-                    TraverseForwardUntilBlocked(ref stageFunction, bounds.Max, ref bounds, ref allWorkerBounds, workerIndex, batchEnd, claimedState, unclaimedState);
-
+                    //Each of these iterations may find a contiguous region larger than our previous attempt.
+                    lowestLocalClaim = bounds.Max;
+                    highestLocalClaim = TraverseForwardUntilBlocked(ref stageFunction, bounds.Max, ref bounds, ref allWorkerBounds, workerIndex, batchEnd, claimedState, unclaimedState);
+                    //If the claim at index lowestLocalClaim was blocked, highestLocalClaim will be -1, so the size will be negative.
+                    var regionSize = highestLocalClaim - lowestLocalClaim; //again, actually count - 1
+                    if (regionSize > largestContiguousRegionSize)
+                    {
+                        workerStart = lowestLocalClaim;
+                        largestContiguousRegionSize = regionSize;
+                    }
                 }

                 //Traverse backwards.
@@ -151,7 +182,15 @@
                 {
                     //Note bounds.Min - 1; Min is inclusive, so in order to access a new location, it must be pushed out.
                     //Note that the above condition uses a > to handle this.
-                    TraverseBackwardUntilBlocked(ref stageFunction, bounds.Min - 1, ref bounds, ref allWorkerBounds, workerIndex, batchStart, claimedState, unclaimedState);
+                    highestLocalClaim = bounds.Min - 1;
+                    lowestLocalClaim = TraverseBackwardUntilBlocked(ref stageFunction, highestLocalClaim, ref bounds, ref allWorkerBounds, workerIndex, batchStart, claimedState, unclaimedState);
+                    //If the claim at highestLocalClaim was blocked, lowestLocalClaim will be workblocks.Count, so the size will be negative.
+                    var regionSize = highestLocalClaim - lowestLocalClaim; //again, actually count - 1
+                    if (regionSize > largestContiguousRegionSize)
+                    {
+                        workerStart = lowestLocalClaim;
+                        largestContiguousRegionSize = regionSize;
+                    }
                 }

                 Debug.Assert(bounds.Min == batchStart && bounds.Max == batchEnd);
@@ -186,6 +225,7 @@
             //The same concept applies to the prestep- the prestep covers all constraints at once, rather than batch by batch.
             var prestepStage = new PrestepStageFunction { Dt = context.Dt, InverseDt = context.InverseDt, Solver = this };
             Debug.Assert(Batches.Count > 0, "Don't dispatch if there are no constraints.");
+            //Technically this could mutate prestep starts, but at the moment we rebuild starts every frame anyway so it doesn't matter oen way or the other.
             ExecuteStage(ref prestepStage, ref bounds, ref boundsBackBuffer, workerIndex, 0, context.WorkBlocks.Count,
                 ref worker.PrestepStart, ref syncStage, claimedState, unclaimedState);


GSF.Security: Updated security provider to only reset authentication state of user-data instead of resetting all cached data.

--- Source/Libraries/GSF.Security/SecurityProviderCache.cs
+++ Source/Libraries/GSF.Security/SecurityProviderCache.cs
@@ -347,7 +347,7 @@
                     if (DateTime.UtcNow.Subtract(cache.CacheCreationTime).TotalMinutes > s_userCacheTimeout)
                     {
                         if ((object)cache.Provider != null && (object)cache.Provider.UserData != null)
-                            cache.Provider.UserData.Initialize();
+                            cache.Provider.UserData.IsAuthenticated = false;

                         s_cache.Remove(cacheKey);
                     }


GetEquatableMethod picks the right implementation of IEquatable<T>.Equals if an entity implements more that one IEquatable<T> interface (e.g. due to the reasons given in the previous commits)

--- Source/TrackableEntities.Client/TrackableExtensions.cs
+++ Source/TrackableEntities.Client/TrackableExtensions.cs
@@ -433,9 +433,12 @@

         private static MethodInfo GetEquatableMethod(Type type)
         {
+            string equatableMethod =
+                Constants.EquatableMembers.EquatableMethodStart +
+                type.FullName +
+                Constants.EquatableMembers.EquatableMethodEnd;
             var method = type.GetMethods(BindingFlags.Instance | BindingFlags.NonPublic)
-                .SingleOrDefault(m => m.Name.StartsWith(Constants.EquatableMembers.EquatableMethodStart)
-                    && m.Name.EndsWith(Constants.EquatableMembers.EquatableMethodEnd));
+                .SingleOrDefault(m => m.Name == equatableMethod);
             return method;
         }


update current task in code comments

update current task in code comments


Rename. No need to repeat SellMultipleProducts. It's obvious

--- RetailStore/RetailStore.Tests/SellMultipleProductsTests.cs
+++ RetailStore/RetailStore.Tests/SellMultipleProductsTests.cs
@@ -23,7 +23,7 @@
         }

         [Test]
-        public void SellMultipleProducts()
+        public void AllProductsFound()
         {
             m_RetailStore.OnBarcode("1");
             m_RetailStore.OnBarcode("2");
@@ -34,7 +34,7 @@
         }

         [Test]
-        public void SellMultipleProducts_AfterPreviousSale()
+        public void AllProductsFound_SecondSale()
         {
             m_RetailStore.OnBarcode("1");
             m_RetailStore.Total();
@@ -47,7 +47,7 @@
         }

         [Test]
-        public void SellMultipleProducts_SomeNotFound()
+        public void SomeProductsNotFound()
         {
             m_RetailStore.OnBarcode("1");
             m_RetailStore.OnBarcode("2-NotFound");
@@ -58,7 +58,7 @@
         }

         [Test]
-        public void SellMultipleProducts_NoProductsFound()
+        public void NoProductsFound()
         {
             m_RetailStore.OnBarcode("1-NotFound");
             m_RetailStore.OnBarcode("2-NotFound");


Guard against empty values early

Guard against empty values early

--- osu.Game/Overlays/Profile/Sections/Historical/ProfileLineChart.cs
+++ osu.Game/Overlays/Profile/Sections/Historical/ProfileLineChart.cs
@@ -26,8 +26,10 @@
             get => values;
             set
             {
-                values = value;
-                graph.Values = values;
+                if (value.Length == 0)
+                    throw new ArgumentException("At least one value expected!", nameof(value));
+
+                graph.Values = values = value;

                 createRowTicks();
                 createColumnTicks();


Update Security.cs

Update Security.cs

Comment added

--- WinMon/Security.cs
+++ WinMon/Security.cs
@@ -4,7 +4,7 @@
 // Because the console window does not support methods allowing the password to be masked,
 // it will be visible to anyone viewing the screen.
 // On Windows Vista and later this sample must be run as an administrator.
-
+// use LOGON32_LOGON_NEW_CREDENTIALS logon type instead of LOGON32_LOGON_INTERACTIVE for remote logon

 using System;
 using System.Runtime.InteropServices;


Cleanup

Cleanup

--- XamlCSS/BaseCss.cs
+++ XamlCSS/BaseCss.cs
@@ -171,7 +171,7 @@
                     SetupStyleInfo(domElement, item.StyleSheet, styleUpdateInfos, treeNodeProvider, dependencyPropertyService, nativeStyleService, discardOldMatchingStyles, item.ChangeKind == ChangeKind.Remove, SelectorType.VisualTree);
                 }

-                var tasks = new List<Task<IList<IDomElement<TDependencyObject, TDependencyProperty>>>>();
+                var results = new List<IList<IDomElement<TDependencyObject, TDependencyProperty>>>();
                 var distinctCopy = copy.Select(x => new { x.StartFrom, x.StyleSheetHolder, x.StyleSheet }).Distinct().ToList();

                 foreach (var item in distinctCopy)
@@ -185,13 +185,11 @@

                     var domElement = treeNodeProvider.GetDomElement(start);

-                    //var task = Task.Run(() => UpdateMatchingStyles(item.StyleSheet, domElement, styleUpdateInfos, dependencyPropertyService, nativeStyleService));
-                    //tasks.Add(task);
-                    tasks.Add(Task.FromResult(UpdateMatchingStyles(item.StyleSheet, domElement, styleUpdateInfos, dependencyPropertyService, nativeStyleService)));
-                }
-
-                //Task.WaitAll(tasks.ToArray());
-                var allFound = tasks.SelectMany(x => x.Result).ToList();
+                    var result = UpdateMatchingStyles(item.StyleSheet, domElement, styleUpdateInfos, dependencyPropertyService, nativeStyleService);
+                    results.Add(result);
+                }
+
+                var allFound = results.SelectMany(x => x);
                 var allFoundElements = allFound.Select(x => x.Element).ToHashSet();
                 var allNotFoundKeys = styleUpdateInfos
                     .Where(x => !allFoundElements.Contains(x.Key))
@@ -201,10 +199,10 @@
                 {
                     var styleUpdateInfo = item.Value;

-                    styleUpdateInfo.OldMatchedSelectors = emptySelectorList;// new LinkedHashSet<ISelector>();
+                    styleUpdateInfo.OldMatchedSelectors = emptySelectorList;
                     styleUpdateInfo.DoMatchCheck = SelectorType.None;
                     // remove style
-                    var initialStyle = (TStyle)styleUpdateInfo.InitialStyle; //dependencyPropertyService.GetInitialStyle(item.Key);
+                    var initialStyle = (TStyle)styleUpdateInfo.InitialStyle;

                     nativeStyleService.SetStyle(item.Key, initialStyle);
                 }


Clone font settings after system font backends swapping

--- Xwt/Xwt/Toolkit.cs
+++ Xwt/Xwt/Toolkit.cs
@@ -514,14 +514,14 @@
 				// to not corrupt the backend of the singletons
 				if (font.ToolkitEngine != this) {
 					var fbh = font.ToolkitEngine.FontBackendHandler;
-					if (font == fbh.SystemFont)
-						font = FontBackendHandler.SystemFont;
-					if (font == fbh.SystemMonospaceFont)
-						font = FontBackendHandler.SystemMonospaceFont;
-					if (font == fbh.SystemSansSerifFont)
-						font = FontBackendHandler.SystemSansSerifFont;
-					if (font == fbh.SystemSerifFont)
-						font = FontBackendHandler.SystemSerifFont;
+					if (font.Family == fbh.SystemFont.Family)
+						font = FontBackendHandler.SystemFont.WithSettings (font);
+					if (font.Family == fbh.SystemMonospaceFont.Family)
+						font = FontBackendHandler.SystemMonospaceFont.WithSettings (font);
+					if (font.Family == fbh.SystemSansSerifFont.Family)
+						font = FontBackendHandler.SystemSansSerifFont.WithSettings (font);
+					if (font.Family == fbh.SystemSerifFont.Family)
+						font = FontBackendHandler.SystemSerifFont.WithSettings (font);
 				}

 				font.InitForToolkit (this);


improve readability

improve readability

--- Advanced.Algorithms/DataStructures/Tree/RTree.cs
+++ Advanced.Algorithms/DataStructures/Tree/RTree.cs
@@ -78,8 +78,9 @@
         internal RTreeNode[] Children { get; set; }

         //leafs will hold the actual polygon
-        internal bool IsLeaf => KeyCount == 0
-            || Children[0].MBRectangle.Polygon != null;
+        //we assume here that bottom two node levels as leafs
+        internal bool IsLeaf => MBRectangle.Polygon != null
+                                || Children[0].MBRectangle.Polygon != null;

         internal RTreeNode(int maxKeysPerNode, RTreeNode parent)
         {


Sample disposition text

Sample disposition text

--- Anlab.Mvc/Views/Templates/_OrderFinalized.cshtml
+++ Anlab.Mvc/Views/Templates/_OrderFinalized.cshtml
@@ -5,7 +5,27 @@
     var host = Context.Request.Host;
     var path = $"{protocol}://{host}";
     var image = $"{path}/{Url.Content("~/Images/anlab170.png")}";
-    var dispositionText = $"This still needs to be updated by code. But it might say something like: Note that samples for work request {Model.RequestNum} will be discarded after SOMEDATE (1 month later). Or....  Please contact the lab to arrange pickup of your samples.";
+    var dispositionText = string.Empty;
+    switch (order.LabworksSampleDisposition.SafeToUpper())
+    {
+        case "S":
+            dispositionText = "I will pick up samples not later than 30 days from report date.";
+            break;
+        case "D":
+        case "A":
+            dispositionText = "Dispose of samples 30 days from report date.";
+            break;
+        case "R":
+            dispositionText = "Return samples at client cost.";
+            break;
+        case "H" :
+            dispositionText = "Samples are being held.";
+            break;
+        default:
+            dispositionText = "Please enquire about your sample disposition.";
+            break;
+    }
+
 }
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" style="background:#f3f3f3!important">


Fix "broken" XLSX via WebAPI GH-305

Fix "broken" XLSX via WebAPI GH-305

--- R7.University.Employees/Services/EmployeeController.cs
+++ R7.University.Employees/Services/EmployeeController.cs
@@ -48,9 +48,9 @@
         {
             // TODO: Get employee
             var employee = new EmployeeInfo ();
-            employee.LastName = "Ivanov";
-            employee.FirstName = "Ivan";
-            employee.OtherName = "Ivanovich";
+            employee.LastName = "Иванов";
+            employee.FirstName = "Иван";
+            employee.OtherName = "Иванович";

             return employee;
         }
@@ -82,16 +82,15 @@
                 }

                 var stream = GetEmployeeStream (employee);
-                var buffer = stream.GetBuffer ();
-                var outStream = new MemoryStream (buffer);
+
+                // stream.GetBuffer() returns bigger buffer, than data!
+                var buffer = stream.ToArray ();

                 var result = Request.CreateResponse (HttpStatusCode.OK);
-                result.Content = new StreamContent (outStream);
-
-                // FIXME: Downloaded file need to be repacked first!
+                result.Content = new ByteArrayContent (buffer);
                 // TODO: Introduce MimeTypes!
                 result.Content.Headers.ContentType = new MediaTypeHeaderValue ("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
-                //result.Content.Headers.ContentType = new MediaTypeHeaderValue ("application/octet-stream");
+                result.Content.Headers.ContentLength = buffer.Length;
                 result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue ("attachment") {
                     FileName = UniversityFormatHelper.AbbrName (
                         employee.FirstName,


Tab transtion direction

Tab transtion direction

--- Sources/Silphid.Showzup/Sources/Controls/TabControl.cs
+++ Sources/Silphid.Showzup/Sources/Controls/TabControl.cs
@@ -16,18 +16,19 @@
         Right = MoveDirection.Right
     }

-    public class TabControl : PresenterControl, ISelectHandler, IMoveHandler, ICancelHandler
+    public class TabControl : PresenterControl, IMoveHandler, ICancelHandler
     {
         public float SelectionDelay;
         public SelectionControl TabSelectionControl;
         public PresenterControl ContentTransitionControl;
         public TabPlacement TabPlacement = TabPlacement.Top;
-
+
         private readonly MoveHandler _moveHandler = new MoveHandler();
         private Options _lastOptions;
-
+
         private readonly ReactiveProperty<IView> _contentView = new ReactiveProperty<IView>();
         public ReadOnlyReactiveProperty<IView> ContentView => _contentView.ToReadOnlyReactiveProperty();
+        private int _currentIndex;

         public void Start()
         {
@@ -36,14 +37,15 @@
                 .BindTo(TabSelectionControl.SelectedView)
                 .AddTo(this);

-            TabSelectionControl.SelectedView
+            _currentIndex = TabSelectionControl.SelectedIndex.Value ?? 0;
+
+            TabSelectionControl.SelectedIndex
                 .WhereNotNull() // TODO SelectionControl should keep selection but can't with current unity select system
                 .LazyThrottle(TimeSpan.FromSeconds(SelectionDelay))
-                .Select(x => (x?.ViewModel as IContentProvider)?.GetContent() ?? x?.ViewModel?.Model)
-                .SelectMany(x => ContentTransitionControl.Present(x, _lastOptions))
+                .SelectMany(x => ShowContent(x ?? 0))
                 .Subscribe(x => _contentView.Value = x)
                 .AddTo(this);
-
+
             _moveHandler.BindBidirectional(
                 ContentTransitionControl,
                 TabSelectionControl,
@@ -57,6 +59,7 @@
                 .Subscribe(x => ContentTransitionControl.FirstView.Value?.SelectDeferred())
                 .AddTo(this);
         }
+

         public override IObservable<IView> Present(object input, Options options = null) =>
             TabSelectionControl.Present(input, _lastOptions = options);
@@ -76,9 +79,21 @@
         {
             if (!TabSelectionControl.IsSelfOrDescendantSelected())
             {
-                _moveHandler.OnMove(new AxisEventData(EventSystem.current) { moveDir = MoveDirection.Up});
+                _moveHandler.OnMove(new AxisEventData(EventSystem.current) {moveDir = MoveDirection.Up});
                 eventData.Use();
             }
         }
+
+        private IObservable<IView> ShowContent(int index)
+        {
+            var view = TabSelectionControl.GetViewAtIndex(index);
+            var direction = _currentIndex > index ? Direction.Backward : Direction.Forward;
+            _currentIndex = index;
+            return Observable.Return(view)
+                .Select(x => (x?.ViewModel as IContentProvider)?.GetContent() ?? x?.ViewModel?.Model)
+                .SelectMany(x => ContentTransitionControl
+                    .With(direction)
+                    .Present(x, _lastOptions));
+        }
     }
 }


Added inner exceptions to UWP stack traces. All of the frames get put into one big list due to server-side inability to deal with inner exception structure. The inner exception messages are put in the attached description if the user doesn't have a custom description loader already.

--- Src/Kit.UWP/Services/UnhandledExceptionTelemetryModule.cs
+++ Src/Kit.UWP/Services/UnhandledExceptionTelemetryModule.cs
@@ -3,6 +3,7 @@
     using System;
     using Channel;
     using DataContracts;
+    using Extensions;
     using Implementation.Tracing;

     using global::Windows.ApplicationModel.Core;
@@ -12,6 +13,7 @@
     using System.Diagnostics;
     using System.Globalization;
     using System.IO;
+    using System.Text;
     using Services;
     using Services.Device;
     using System.Threading.Tasks;
@@ -29,9 +31,9 @@
         internal UnhandledExceptionTelemetryModule()
         {
         }
-
+
         internal bool AlwaysHandleExceptions { get; set; }
-
+
         /// <summary>
         /// Unsubscribe from the <see cref="Application.UnhandledException"/> event.
         /// </summary>
@@ -51,7 +53,7 @@
         public void Initialize()
         {
             CoreApplication.UnhandledErrorDetected += CoreApplication_UnhandledErrorDetected;
-            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
+            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
         }

         private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
@@ -69,7 +71,7 @@
                     client.Flush();
                 }
             }
-            catch(Exception ex)
+            catch (Exception ex)
             {
                 CoreEventSource.Log.LogError("An exeption occured in UnhandledExceptionTelemetryModule.TaskScheduler_UnobservedTaskException: " + ex);
             }
@@ -91,21 +93,64 @@
             result.Headers.ExceptionType = exception.GetType().FullName;
             result.Headers.ExceptionReason = exception.Message;

-            if (HockeyClient.Current.AsInternal().DescriptionLoader != null)
-            {
-                try
-                {
-                    result.Attachments.Description = HockeyClient.Current.AsInternal().DescriptionLoader(exception);
-                }
-                catch (Exception ex)
-                {
-                    CoreEventSource.Log.LogError("An exception occured in TelemetryConfiguration.Active.DescriptionLoader callback : " + ex);
-                }
-            }
-
             CrashTelemetryThread thread = new CrashTelemetryThread { Id = Environment.CurrentManagedThreadId };
             result.Threads.Add(thread);
             HashSet<long> seenBinaries = new HashSet<long>();
+            StringBuilder exceptionMessagesBuilder = new StringBuilder();
+
+            AddExceptionInformation(exception, result, seenBinaries, exceptionMessagesBuilder);
+
+            bool hasNativeFrames = result.Threads != null && result.Threads.Count > 0 && result.Threads[0].Frames != null && result.Threads[0].Frames.Count > 0;
+
+            if (HockeyClient.Current.AsInternal().DescriptionLoader != null)
+            {
+                try
+                {
+                    result.Attachments.Description = HockeyClient.Current.AsInternal().DescriptionLoader(exception);
+                }
+                catch (Exception ex)
+                {
+                    CoreEventSource.Log.LogError("An exception occured in TelemetryConfiguration.Active.DescriptionLoader callback : " + ex);
+                }
+            }
+            else if (hasNativeFrames)
+            {
+                // If the user doesn't have a description loader, add info on all the inner exceptions.
+                result.Attachments.Description = exceptionMessagesBuilder.ToString();
+            }
+
+            result.StackTrace = GetStrackTrace(exception);
+            return result;
+        }
+
+        /// <summary>
+        /// Adds frames and binaries from this exception and all inner exceptions to the given telemetry result.
+        /// </summary>
+        /// <param name="exception">The exception to examine.</param>
+        /// <param name="telemetry">The telemetry object to add the frames to.</param>
+        /// <param name="seenBinaries">The set of binaries we have already added to the frame list.</param>
+        /// <param name="exceptionMessages">The list of exception types and messages seen.</param>
+        /// <remarks>This will produce a flat list with no indication of which frame belongs to which exception. This is a workaround
+        /// for the fact that the server side only knows how to process a flat list.</remarks>
+        private static void AddExceptionInformation(Exception exception, CrashTelemetry telemetry, HashSet<long> seenBinaries, StringBuilder exceptionMessages)
+        {
+            if (exception.InnerException != null)
+            {
+                var aggregateException = exception as AggregateException;
+                if (aggregateException != null)
+                {
+                    foreach (Exception innerException in aggregateException.InnerExceptions)
+                    {
+                        AddExceptionInformation(innerException, telemetry, seenBinaries, exceptionMessages);
+                    }
+                }
+                else
+                {
+                    AddExceptionInformation(exception.InnerException, telemetry, seenBinaries, exceptionMessages);
+                }
+            }
+
+            exceptionMessages.AppendLine($"{exception.GetType().FullName}: {exception.Message}");

             StackTrace stackTrace = new StackTrace(exception, true);
             var frames = stackTrace.GetFrames();
@@ -122,9 +167,9 @@
                         Address = string.Format(CultureInfo.InvariantCulture, "0x{0:x16}", frame.GetNativeIP().ToInt64())
                     };

-                    thread.Frames.Add(crashFrame);
+                    telemetry.Threads[0].Frames.Add(crashFrame);
                     long nativeImageBase = frame.GetNativeImageBase().ToInt64();
-                    if (seenBinaries.Contains(nativeImageBase) == true)
+                    if (seenBinaries.Contains(nativeImageBase))
                     {
                         continue;
                     }
@@ -146,13 +191,10 @@
                         CpuType = GetProcessorArchitecture()
                     };

-                    result.Binaries.Add(crashBinary);
+                    telemetry.Binaries.Add(crashBinary);
                     seenBinaries.Add(nativeImageBase);
                 }
             }
-
-            result.StackTrace = GetStrackTrace(exception);
-            return result;
         }

         private Exception FlattenAggregateException(Exception e)
@@ -174,20 +216,20 @@
             return e;
         }

-        private string GetStrackTrace(Exception e)
-        {
-            CultureInfo originalUICulture = CultureInfo.CurrentUICulture;
-            try
-            {
-                // we need to switch to invariant culture, because stack trace localized and we cannot parse it efficiently on the server side.
-                // see https://support.hockeyapp.net/discussions/problems/58504-non-english-stack-trace-not-displayed
-                CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
-                return e.StackTrace;
-            }
-            finally
-            {
-                CultureInfo.CurrentUICulture = originalUICulture;
-            }
+        private static string GetStrackTrace(Exception e)
+        {
+            CultureInfo originalUICulture = CultureInfo.CurrentUICulture;
+            try
+            {
+                // we need to switch to invariant culture, because stack trace localized and we cannot parse it efficiently on the server side.
+                // see https://support.hockeyapp.net/discussions/problems/58504-non-english-stack-trace-not-displayed
+                CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
+                return e.StackTraceToString();
+            }
+            finally
+            {
+                CultureInfo.CurrentUICulture = originalUICulture;
+            }
         }

         private void CoreApplication_UnhandledErrorDetected(object sender, UnhandledErrorDetectedEventArgs e)


Fixed ReplayInitData to work for 2.0.6 and 2.0.7

Unfortunately, "fixing" it means right now, parsing this file does
absolutely nothing in the end. GameType is missing, but we should be
able to use data here (swarm level, etc) if the player list is updated
to something more useful.

--- Starcraft2.ReplayParser/replay.initData/ReplayInitData.cs
+++ Starcraft2.ReplayParser/replay.initData/ReplayInitData.cs
@@ -12,6 +12,8 @@
     using System.IO;
     using System.Text;

+    using Starcraft2.ReplayParser.Streams;
+
     /// <summary> Parses the replay.Initdata file in the replay file. </summary>
     public class ReplayInitData
     {
@@ -22,36 +24,84 @@
         /// <param name="buffer"> The buffer containing the replay.initdata file. </param>
         public static void Parse(Replay replay, byte[] buffer)
         {
+
             using (var stream = new MemoryStream(buffer))
             {
-                using (var reader = new BinaryReader(stream))
+                var reader = new BitReader(stream);
+
+                var i = reader.ReadByte();
+
+                var playerList = new string[i];
+                for (int j = 0; j < i; j++)
                 {
-                    var i = reader.ReadByte();
+                    var nameLength = reader.ReadByte();
+                    reader.AlignToByte();
+                    var str = reader.ReadString(nameLength);

-                    var playerList = new string[i];
-                    for (int j = 0; j < i; j++)
+                    playerList[j] = str;
+
+                    if (replay.ReplayBuild < 24764)
                     {
-                        var str = ReadString(reader);
-
-                        playerList[j] = str;
                         reader.ReadBytes(5);
-                    }
-
-                    // Save the full list of clients.
-                    // This is no longer necessary since we get the client list elsewhere.
-                    //// replay.ClientList = playerList;
-
-                    if (PositionAfter(reader, new byte[] { 115, 50, 109, 97 }))
-                    {
-                        reader.ReadBytes(2);
-                        var gatewayStr = reader.ReadBytes(2);
-
-                        var gateway = Encoding.UTF8.GetString(gatewayStr);
-                        replay.Gateway = gateway;
                     }
                     else
                     {
-                        replay.GameType = GameType.SinglePlayer;
+                        if (reader.ReadBoolean())
+                        {
+                            var strLength = reader.ReadByte();
+                            reader.AlignToByte();
+                            var clanTag = reader.ReadString(strLength);
+                        }
+
+                        if (reader.ReadBoolean())
+                        {
+                            reader.ReadByte(); // Highest league
+                        }
+
+                        if (reader.ReadBoolean())
+                        {
+                            var swarmLevel = reader.ReadInt32(); // Swarm level
+                        }
+
+                        reader.ReadInt32(); // Random seed
+
+                        if (reader.ReadBoolean())
+                        {
+                            reader.ReadByte(); // Race Preference
+                        }
+
+                        if (reader.ReadBoolean())
+                        {
+                            reader.ReadByte(); // Team Preference
+                        }
+
+                        reader.ReadBoolean(); //test map
+                        reader.ReadBoolean(); //test auto
+                        reader.ReadBoolean(); //examine
+                        reader.ReadBoolean(); //custom interface
+                        reader.Read(2);   //observer
+                    }
+                }
+
+                if (replay.ReplayBuild < 24764)
+                {
+                    using (var binaryReader = new BinaryReader(stream))
+                    {
+                        // Save the full list of clients.
+                        // This is no longer necessary since we get the client list elsewhere.
+                        //// replay.ClientList = playerList;
+                        if (PositionAfter(binaryReader, new byte[] { 115, 50, 109, 97 }))
+                        {
+                            reader.ReadBytes(2);
+                            var gatewayStr = reader.ReadBytes(2);
+
+                            var gateway = Encoding.UTF8.GetString(gatewayStr);
+                            replay.Gateway = gateway;
+                        }
+                        else
+                        {
+                            replay.GameType = GameType.SinglePlayer;
+                        }
                     }
                 }
             }


Bug fix in FtpDirectory to prevent multiple listings when the directory is:
1) Empty
2) Has directories and no files
3) Has files and no directories

--HG--
extra : convert_revision : svn%3A7523448a-a8a0-4aac-83b0-0615d70583c7%404402

--- System.Net.FtpClient/System.Net.FtpClient/FtpDirectory.cs
+++ System.Net.FtpClient/System.Net.FtpClient/FtpDirectory.cs
@@ -63,13 +63,14 @@
 			private set { _lastWriteTime = value; }
 		}

-		List<FtpDirectory> _dirs = new List<FtpDirectory>();
+		List<FtpDirectory> _dirs = null;
 		/// <summary>
 		/// A list of directories within this directory
 		/// </summary>
 		public FtpDirectory[] Directories {
 			get {
-				if (this._dirs.Count < 1) {
+				if (this._dirs == null) {
+					this._dirs = new List<FtpDirectory>();
 					this.LoadListing();
 				}

@@ -77,13 +78,14 @@
 			}
 		}

-		List<FtpFile> _files = new List<FtpFile>();
+		List<FtpFile> _files = null;
 		/// <summary>
 		/// A list of files within this directory
 		/// </summary>
 		public FtpFile[] Files {
 			get {
-				if (this._files.Count < 1) {
+				if (this._files == null) {
+					this._files = new List<FtpFile>();
 					this.LoadListing();
 				}


Fixed AppendEvents in PlayerInputController

--- RTSGame/RTSEngine/Controllers/PlayerInputController.cs
+++ RTSGame/RTSEngine/Controllers/PlayerInputController.cs
@@ -25,9 +25,14 @@

         //Appends All Events In Concurrent Queue To Given List
         void AppendEvents(LinkedList<GameInputEvent> l) {
+            int count = eventQueue.Count;
             GameInputEvent e;
-            while(eventQueue.TryDequeue(out e)) {
-                l.AddLast(e);
+
+            while(count > 0) {
+                while(eventQueue.TryDequeue(out e)) {
+                    l.AddLast(e);
+                }
+                count--;
             }
         }
     }


Prevent overlapped WaitForLayerAndResume calls

--- Tests/MatterControl.AutomationTests/SliceSettingsTests.cs
+++ Tests/MatterControl.AutomationTests/SliceSettingsTests.cs
@@ -124,10 +124,12 @@

 			var printer = ApplicationController.Instance.ActivePrinter;

+			// Wait for layer
 			testRunner.Delay(() => printer.Bed.ActiveLayerIndex + 1 == indexToWaitFor, 30, 500);
 			Assert.AreEqual(indexToWaitFor, printer.Bed.ActiveLayerIndex + 1);

 			testRunner.ClickByName("No Button");
+			testRunner.WaitVanishForName("No Button", 10);
 		}

 		[Test /* Test will fail if screen size is and "HeatBeforeHoming" falls below the fold */]


fix less tests

fix less tests

--- RequestReduce.Facts/SassLessCoffee/LessHandlerFacts.cs
+++ RequestReduce.Facts/SassLessCoffee/LessHandlerFacts.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Specialized;
 using System.IO;
 using System.Web;
 using Moq;
@@ -17,6 +18,8 @@
                 MockedContext = new Mock<HttpContextBase>();
                 MockedContext.Setup(x => x.Request.Path)
                     .Returns("~/RRContent/css.less");
+                MockedContext.Setup(x => x.Request.QueryString)
+                    .Returns(new NameValueCollection());
                 MockedResponse = new Mock<HttpResponseBase>();
                 MockedContext.Setup(x => x.Response).Returns(MockedResponse.Object);
                 MockedServer = new Mock<HttpServerUtilityBase>();