Added support for record parameter list

Added support for record parameter list

Parameters from record parameter list are added as properties.
Automatically generated constructor and methods are not included.

For now, NotSupportedExcception is thrown, if code is called
with "CreateAssociation".

--- src/PlantUmlClassDiagramGenerator.Library/ClassDiagramGenerator.cs
+++ src/PlantUmlClassDiagramGenerator.Library/ClassDiagramGenerator.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
@@ -83,6 +83,47 @@
             WriteLine($"class {type} {modifiers}<<record>> {{");

             nestingDepth++;
+
+            foreach(var parameter in node.ParameterList.Parameters)
+            {
+                // Code copied from "VisitPropertyDeclaration":
+
+                var parameterType = parameter.Type;
+
+                var parentClass = (parameter.Parent as TypeDeclarationSyntax);
+                var isTypeParameterProp = parentClass?.TypeParameterList?.Parameters
+                    .Any(t => t.Identifier.Text == type.ToString()) ?? false;
+
+                if (!createAssociation || parameterType.GetType() == typeof(PredefinedTypeSyntax) || parameterType.GetType() == typeof(NullableTypeSyntax) || isTypeParameterProp)
+                {
+                    // ParameterList-Property: always public
+                    var parameterModifiers = "+ ";
+                    var parameterName = parameter.Identifier.ToString();
+
+                    // ParameterList-Property always have get and init accessor
+                    var accessorStr = "<<get>> <<init>>";
+
+
+                    var useLiteralInit =
+                        //node.Initializer?.Value?.Kind().ToString().EndsWith("LiteralExpression") ?? false;
+                        parameter.Default?.Value is not null;
+                    var initValue = useLiteralInit
+                        ? (" = " + escapeDictionary.Aggregate(parameter.Default.Value.ToString(),
+                            (n, e) => Regex.Replace(n, e.Key, e.Value)))
+                        : "";
+
+                    WriteLine($"{parameterModifiers}{parameterName} : {parameterType} {accessorStr}{initValue}");
+                }
+                else
+                {
+                    throw new NotSupportedException("-createAssciation is not supported with record types yet!");
+                    // if (type.GetType() == typeof(GenericNameSyntax))
+                    // {
+                    //     additionalTypeDeclarationNodes.Add(parameterType);
+                    // }
+                    // relationships.AddAssociationFrom(parameter);
+                }
+            }
             base.VisitRecordDeclaration(node);
             nestingDepth--;


Use the viewBag Title rather than the hard coded one.

--- src/SFA.DAS.EmployerUsers.Web/Views/Login/AuthorizeResponse.cshtml
+++ src/SFA.DAS.EmployerUsers.Web/Views/Login/AuthorizeResponse.cshtml
@@ -7,7 +7,7 @@
 }

-
You've logged in

+
@ViewBag.Title

 <form id="mainForm" method="post" action="@Model.ResponseFormUri">

Please wait...

     @Html.Raw(Model.ResponseFormFields)


fixed null reference

fixed null reference

--- src/biz.dfch.CS.CoffeeTracker.Core/Managers/CoffeeOrdersManager.cs
+++ src/biz.dfch.CS.CoffeeTracker.Core/Managers/CoffeeOrdersManager.cs
@@ -31,15 +31,15 @@
         private readonly CoffeeTrackerDbContext db;
         private readonly ApplicationUserManager userManager;
         private readonly PermissionChecker permissionChecker;
-        public readonly CoffeeOrdersValidator validator;
-
+        public readonly CoffeeOrdersValidator Validator;

         public CoffeeOrdersManager()
         {

             db = new CoffeeTrackerDbContext();
             userManager = new ApplicationUserManager(new AppUserStore());
-            validator = new CoffeeOrdersValidator(this);
+            Validator = new CoffeeOrdersValidator(this);
+            permissionChecker = new PermissionChecker(userManager.GetCurrentUser());
         }

         public IEnumerable<CoffeeOrder> GetCoffeeOrdersOfCurrentUser()
@@ -102,7 +102,7 @@
             Contract.Requires(null != update, "|400|");
             Contract.Requires(0 < key, "|404|");

-            var exists = validator.ExistsInDatabase(key);
+            var exists = Validator.ExistsInDatabase(key);
             Contract.Assert(exists, "|404|");

             var hasPermission = permissionChecker.HasPermission(Get(key));


Simplify

Simplify

--- src/EditorFeatures/Core/Wrapping/ChainedExpression/AbstractChainedExpressionWrapper.cs
+++ src/EditorFeatures/Core/Wrapping/ChainedExpression/AbstractChainedExpressionWrapper.cs
@@ -257,15 +257,12 @@

             if (node != null)
             {
-                if (_syntaxFacts.IsAnyMemberAccessExpression(node) ||
-                    _syntaxFacts.IsInvocationExpression(node) ||
-                    _syntaxFacts.IsElementAccessExpression(node) ||
-                    _syntaxFacts.IsPostfixUnaryExpression(node) ||
-                    _syntaxFacts.IsConditionalAccessExpression(node) ||
-                    _syntaxFacts.IsMemberBindingExpression(node))
-                {
-                    return true;
-                }
+                return _syntaxFacts.IsAnyMemberAccessExpression(node)
+                       || _syntaxFacts.IsInvocationExpression(node)
+                       || _syntaxFacts.IsElementAccessExpression(node)
+                       || _syntaxFacts.IsPostfixUnaryExpression(node)
+                       || _syntaxFacts.IsConditionalAccessExpression(node)
+                       || _syntaxFacts.IsMemberBindingExpression(node);
             }

             return false;


Save native layout before asking for vertex offsets (#2626)

I called this out as a comment in #2574 after it got merged...

--- src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/GenericMethodsHashtableNode.cs
+++ src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/GenericMethodsHashtableNode.cs
@@ -43,6 +43,9 @@
             // This node does not trigger generation of other nodes.
             if (relocsOnly)
                 return new ObjectData(Array.Empty<byte>(), Array.Empty<Relocation>(), 1, new ISymbolNode[] { this });
+
+            // Ensure the native layout data has been saved, in order to get valid Vertex offsets for the signature Vertices
+            factory.MetadataManager.NativeLayoutInfo.SaveNativeLayoutInfoWriter(factory);

             NativeWriter nativeWriter = new NativeWriter();
             VertexHashtable hashtable = new VertexHashtable();


Fix renamed method in knockout templates

--- src/IntelliTect.Coalesce.CodeGeneration.Knockout/Templates/Views/Api/EditorHtml.cshtml
+++ src/IntelliTect.Coalesce.CodeGeneration.Knockout/Templates/Views/Api/EditorHtml.cshtml
@@ -6,7 +6,7 @@

 @{ ClassViewModel model = Model;}

-    @foreach (var prop in model.ClientProperties.Where(f => !f.IsHidden(HiddenAttribute.Areas.Edit) && f.SecurityInfo.IsReadable(User)).OrderBy(f => f.EditorOrder))
+    @foreach (var prop in model.ClientProperties.Where(f => !f.IsHidden(HiddenAttribute.Areas.Edit) && f.SecurityInfo.IsReadAllowed(User)).OrderBy(f => f.EditorOrder))
     {
         if (ViewBag.SimpleEditorOnly == null || ViewBag.SimpleEditorOnly == false ||
                         (prop.IsManytoManyCollection == prop.Type.IsCollection))
@@ -14,7 +14,7 @@

                 @prop.DisplayName

-                    @Display.Property(prop, prop.SecurityInfo.IsEditable(User))
+                    @Display.Property(prop, prop.SecurityInfo.IsEditAllowed(User))
                     @*@Editors.DisplayOrEdit(prop, true, false)*@


cleaning

cleaning

--- src/Xablu.Walkthrough/Plugin.Xablu.Walkthrough.Abstractions/Pages/IForestPrimesPage.cs
+++ src/Xablu.Walkthrough/Plugin.Xablu.Walkthrough.Abstractions/Pages/IForestPrimesPage.cs
@@ -4,8 +4,8 @@
 {
     public interface IForestPrimesPage
     {
-        public ImageControl ImageControl { get; set; }
-        public TextControl TitleControl { get; set; }
-        public TextControl DescriptionControl { get; set; }
+        ImageControl ImageControl { get; set; }
+        TextControl TitleControl { get; set; }
+        TextControl DescriptionControl { get; set; }
     }
 }


Incremented timeouts for some tests that could time out on build machine

--- test/Microsoft.AspNet.WebHooks.Custom.AzureStorage.Test/Storage/StorageManagerTests.cs
+++ test/Microsoft.AspNet.WebHooks.Custom.AzureStorage.Test/Storage/StorageManagerTests.cs
@@ -21,6 +21,7 @@
         private const string TestPartition = "12345";
         private const int MaxDataEntries = 16;

+        private readonly TimeSpan _timeout = TimeSpan.FromMinutes(2);
         private readonly Mock<ILogger> _loggerMock;
         private readonly IStorageManager _manager;

@@ -379,7 +380,7 @@
             CloudQueue queue = InitializeQueue();

             // Act
-            IEnumerable<CloudQueueMessage> actual = await _manager.GetMessagesAsync(queue, 16, TimeSpan.FromMinutes(1));
+            IEnumerable<CloudQueueMessage> actual = await _manager.GetMessagesAsync(queue, 16, _timeout);

             // Assert
             Assert.Empty(actual);
@@ -394,7 +395,7 @@

             // Act
             await _manager.AddMessagesAsync(queue, expected);
-            IEnumerable<CloudQueueMessage> actual = await _manager.GetMessagesAsync(queue, 16, TimeSpan.FromMinutes(1));
+            IEnumerable<CloudQueueMessage> actual = await _manager.GetMessagesAsync(queue, 16, _timeout);

             // Assert
             Assert.Equal(expected.Count(), actual.Count());
@@ -409,9 +410,9 @@
             await _manager.AddMessagesAsync(queue, messages);

             // Act
-            IEnumerable<CloudQueueMessage> initial = await _manager.GetMessagesAsync(queue, MaxDataEntries, TimeSpan.FromMinutes(1));
+            IEnumerable<CloudQueueMessage> initial = await _manager.GetMessagesAsync(queue, MaxDataEntries, _timeout);
             await _manager.DeleteMessagesAsync(queue, initial);
-            IEnumerable<CloudQueueMessage> final = await _manager.GetMessagesAsync(queue, MaxDataEntries, TimeSpan.FromMinutes(1));
+            IEnumerable<CloudQueueMessage> final = await _manager.GetMessagesAsync(queue, MaxDataEntries, _timeout);

             // Assert
             Assert.Equal(MaxDataEntries, initial.Count());
@@ -427,10 +428,10 @@
             await _manager.AddMessagesAsync(queue, messages);

             // Act
-            IEnumerable<CloudQueueMessage> initial = await _manager.GetMessagesAsync(queue, MaxDataEntries, TimeSpan.FromMinutes(1));
+            IEnumerable<CloudQueueMessage> initial = await _manager.GetMessagesAsync(queue, MaxDataEntries, _timeout);
             await _manager.DeleteMessagesAsync(queue, initial);
             await _manager.DeleteMessagesAsync(queue, initial);
-            IEnumerable<CloudQueueMessage> final = await _manager.GetMessagesAsync(queue, MaxDataEntries, TimeSpan.FromMinutes(1));
+            IEnumerable<CloudQueueMessage> final = await _manager.GetMessagesAsync(queue, MaxDataEntries, _timeout);

             // Assert
             Assert.Equal(MaxDataEntries, initial.Count());


fix unity plugin compilation

fix unity plugin compilation

--- debugger/debugger-worker/src/UnityDebuggerWorkerHost.cs
+++ debugger/debugger-worker/src/UnityDebuggerWorkerHost.cs
@@ -7,7 +7,7 @@
     [DebuggerGlobalComponent]
     public class UnityDebuggerWorkerHost : IStartable
     {
-        public UnityDebuggerWorkerHost(DebuggerWorker debuggerWorker)
+        public UnityDebuggerWorkerHost(RiderDebuggerWorker debuggerWorker)
         {
             // Get/create the model. This registers serialisers for all types in the model, including the start info
             // derived types used in the root protocol, not in our extension


added first derivative of interpolation function

--- ACQ.Excel/Objects/ExcelInterpolator.cs
+++ ACQ.Excel/Objects/ExcelInterpolator.cs
@@ -81,6 +81,24 @@
             return ExcelError.ExcelErrorRef;
         }

+        [ExcelFunction(Description = "Evaluate derivative of interpolated function at specified point", Category = AddInInfo.Category, IsThreadSafe = false)]
+        public static object acq_interpolator_eval_deriv(
+            [ExcelArgument(Description = "Interpolator object")] string handle,
+            [ExcelArgument(Description = "Interpolation point")] double x)
+        {
+            ACQ.Math.Interpolation.InterpolationInterface interpolator;
+
+            if (ACQ.Excel.Handles.GlobalCache.TryGetObject<ACQ.Math.Interpolation.InterpolationInterface>(handle, out interpolator))
+            {
+                if (interpolator != null)
+                {
+                    return ExcelHelper.CheckNan(interpolator.EvalDeriv(x));
+                }
+            }
+            return ExcelError.ExcelErrorRef;
+        }
+
+

         [ExcelFunction(Description = "Evaluate interpolation at specified point (thread safe version)", Category = AddInInfo.Category, IsThreadSafe = false)]
         public static object acq_interpolator_eval_tsafe(


clean code

clean code

--- Aiv.Research.Shared/TrainingService.cs
+++ Aiv.Research.Shared/TrainingService.cs
@@ -114,7 +114,7 @@
             if (hWorkItem == null)
                 return;
             m_hTrainingInProgress.TryAdd(hWorkItem, 0);
-            hWorkItem.StartTraing();
+            hWorkItem.StartTraining();
             while (hWorkItem.IsTraining)
             {
                 //Aspetto che finisca di fa il training
@@ -127,52 +127,50 @@

     public class TrainingSet
     {
-        public NetworkCreationConfig NetworkConfing { get; private set; }
-        public int Iterations { get; private set; }
+        public NetworkCreationConfig NetworkConfig { get; private set; }
         public bool IsTraining { get; private set; }
         private BasicNetwork m_hNetwork;

         public TrainingSet(NetworkCreationConfig hConfig)
         {
-            NetworkConfing = hConfig;
-            Iterations = hConfig.iIterations;
+            NetworkConfig = hConfig;
         }
-        public void StartTraing()
+        public void StartTraining()
         {
             IsTraining = true;
             m_hNetwork = new BasicNetwork();
-            if(NetworkConfing.InputSize > 0)
-                m_hNetwork.AddLayer(new BasicLayer(NetworkConfing.Activation, true, NetworkConfing.InputSize));
-            if(NetworkConfing.HL0Size > 0)
-                m_hNetwork.AddLayer(new BasicLayer(NetworkConfing.Activation, true, NetworkConfing.HL0Size));
-            if(NetworkConfing.HL1Size > 0)
-                m_hNetwork.AddLayer(new BasicLayer(NetworkConfing.Activation, true, NetworkConfing.HL1Size));
-            if(NetworkConfing.HL2Size > 0)
-                m_hNetwork.AddLayer(new BasicLayer(NetworkConfing.Activation, true, NetworkConfing.HL2Size));
-            if(NetworkConfing.OutputSize > 0)
-                m_hNetwork.AddLayer(new BasicLayer(NetworkConfing.Activation, true, NetworkConfing.OutputSize));
+            if(NetworkConfig.InputSize > 0)
+                m_hNetwork.AddLayer(new BasicLayer(NetworkConfig.Activation, true, NetworkConfig.InputSize));
+            if(NetworkConfig.HL0Size > 0)
+                m_hNetwork.AddLayer(new BasicLayer(NetworkConfig.Activation, true, NetworkConfig.HL0Size));
+            if(NetworkConfig.HL1Size > 0)
+                m_hNetwork.AddLayer(new BasicLayer(NetworkConfig.Activation, true, NetworkConfig.HL1Size));
+            if(NetworkConfig.HL2Size > 0)
+                m_hNetwork.AddLayer(new BasicLayer(NetworkConfig.Activation, true, NetworkConfig.HL2Size));
+            if(NetworkConfig.OutputSize > 0)
+                m_hNetwork.AddLayer(new BasicLayer(NetworkConfig.Activation, true, NetworkConfig.OutputSize));

             m_hNetwork.Structure.FinalizeStructure();
             m_hNetwork.Reset();

-            double[][] input = new double[NetworkConfing.Samples.Count][];
-            double[][] ideal = new double[NetworkConfing.Samples.Count][];
-            for (int i = 0; i < NetworkConfing.Samples.Count; i++)
+            double[][] input = new double[NetworkConfig.Samples.Count][];
+            double[][] ideal = new double[NetworkConfig.Samples.Count][];
+            for (int i = 0; i < NetworkConfig.Samples.Count; i++)
             {
-                input[i] = NetworkConfing.Samples[i].Values;
-                ideal[i] = NetworkConfing.Samples[i].Ideal;
+                input[i] = NetworkConfig.Samples[i].Values;
+                ideal[i] = NetworkConfig.Samples[i].Ideal;
             }

             INeuralDataSet hNeuralDataSet = new BasicNeuralDataSet(input, ideal);
             ITrain hTraining = new ResilientPropagation(m_hNetwork, hNeuralDataSet);
-            hTraining.Iteration(Iterations);
+            hTraining.Iteration(NetworkConfig.iIterations);

             IsTraining = false;
         }

         public double[] TestNetwork(double[] input)
         {
-            double[] output = new double[NetworkConfing.OutputSize];
+            double[] output = new double[NetworkConfig.OutputSize];
             m_hNetwork.Compute(input, output);
             return output;
         }


Added created date to job details

Added created date to job details

--- EmpleoDotNet/Views/JobOpportunity/Detail.cshtml
+++ EmpleoDotNet/Views/JobOpportunity/Detail.cshtml
@@ -19,6 +19,7 @@
                         Remoto
                     }

+
 @Model.Created.ToShortDateString()


iOS ToArgbPixels,ToJpeg Fixed

iOS ToArgbPixels,ToJpeg Fixed

--- ImageEdit/Plugin.ImageEdit.iOS/EditableImage.cs
+++ ImageEdit/Plugin.ImageEdit.iOS/EditableImage.cs
@@ -8,7 +8,7 @@

 namespace Plugin.ImageEdit
 {
-    public class EditableImage:IEditableImage
+    public class EditableImage : IEditableImage
     {
         public int Height { get; private set; }
         public int Width { get; private set; }
@@ -140,6 +140,22 @@

         public byte[] ToJpeg(float quality = 80)
         {
+            //If the image orientation is not up,reset orientation.
+            if (_image.Orientation != UIImageOrientation.Up) {
+                var rect = new CGRect(0, 0, _image.Size.Width, _image.Size.Height);
+                UIGraphics.BeginImageContext(rect.Size);
+
+                _image.Draw(rect);
+
+                var newImage = UIGraphics.GetImageFromCurrentImageContext();
+
+                UIGraphics.EndImageContext();
+
+                using (var data = newImage.AsJPEG(quality)) {
+                    newImage.Dispose();
+                    return data.ToArray();
+                }
+            }
             using (var data = _image.AsJPEG(quality)) {
                 return data.ToArray();
             }
@@ -170,6 +186,13 @@

         int[] GetBitmapPixels(NSData data)
         {
+            var alphaInfo = _image.CGImage.AlphaInfo;
+            var adjustOrder = 2;
+            if (alphaInfo == CGImageAlphaInfo.First ||
+                alphaInfo == CGImageAlphaInfo.PremultipliedFirst) {
+                adjustOrder = 0;
+            }
+
             var bytesPerPixel = _image.CGImage.BitsPerPixel / 8;

             // Order by ARGB
@@ -180,9 +203,10 @@
                     var addr = (i * Width + j) * bytesPerPixel;
                     pixels[idx++] =
                         (data[addr + 3] << 24) |
-                        (data[addr] << 16) |
+                        (data[addr + 2 - adjustOrder] << 16) |
                         (data[addr + 1] << 8) |
-                        (data[addr + 2]);
+                        (data[addr + adjustOrder]);
+
                 }
             }


update

update

--- Longgan/Longgan.Web/Views/Home/Advantage.cshtml
+++ Longgan/Longgan.Web/Views/Home/Advantage.cshtml
@@ -35,15 +35,15 @@
                         为什么选择我们?

-
节能：运行费用是电锅炉的1/4、燃油锅炉的1/3、燃气锅炉的1/2，比太阳能热水系统还节能。能效比高，节能效果非常明显。

-
省钱：热泵机组安装在楼顶或室外，无须建锅炉房，节省土地投资；无须年检和运行附加费；无须燃料运送和存储；无须专人值守；无须复杂的维护、检修、投资回收期短。

-
安全：热泵机组无燃料泄露、火灾、爆炸等安全隐患。机组内设有高压保护、低压保护、压缩机过滤保护、水温超高温保护、水箱水位自动控制等多重安全保护，从根本上杜绝漏电、干烧、超高温等安全隐患。

-
环保:热泵机组对环境无任何污染，属于高效节能环保型产品，符合我国能源产业和环境保护政策。

-
简便：机组全自动智能控制，模块化设计，安装简单，使用方便。

-
耐用：主机选用名优品牌压缩机、采用五重防锈技术，经久耐用

-
自动化霜：智能柔性除霜，可以根据不同的地区气候条件设定除霜参数和控制方案，使除霜更彻底、更灵活、更节能。

-
模块化控制功能：可根据用户实际需要灵活添加多台机组构成的热水供水系统，实现模块化控制，自动调节每台机组运行时间和投入运行的顺序，保证每台机组运行时间一致，整个热水供水系统的高效优质运行。

-
适用范围广：一年四季全天候工作，不受昼夜、阴晴、风雨气候影响。可满足学校、医院、宾馆、工厂澡堂、家庭小区住宅、洗浴中心等行业热水需要。

+
节能：运行费用是电锅炉的1/4、燃油锅炉的1/3、燃气锅炉的1/2，比太阳能热水系统还节能。能效比高，节能效果非常明显。

+
省钱：热泵机组安装在楼顶或室外，无须建锅炉房，节省土地投资；无须年检和运行附加费；无须燃料运送和存储；无须专人值守；无须复杂的维护、检修、投资回收期短。

+
安全：热泵机组无燃料泄露、火灾、爆炸等安全隐患。机组内设有高压保护、低压保护、压缩机过滤保护、水温超高温保护、水箱水位自动控制等多重安全保护，从根本上杜绝漏电、干烧、超高温等安全隐患。

+
环保:热泵机组对环境无任何污染，属于高效节能环保型产品，符合我国能源产业和环境保护政策。

+
简便：机组全自动智能控制，模块化设计，安装简单，使用方便。

+
耐用：主机选用名优品牌压缩机、采用五重防锈技术，经久耐用

+
自动化霜：智能柔性除霜，可以根据不同的地区气候条件设定除霜参数和控制方案，使除霜更彻底、更灵活、更节能。

+
模块化控制功能：可根据用户实际需要灵活添加多台机组构成的热水供水系统，实现模块化控制，自动调节每台机组运行时间和投入运行的顺序，保证每台机组运行时间一致，整个热水供水系统的高效优质运行。

+
适用范围广：一年四季全天候工作，不受昼夜、阴晴、风雨气候影响。可满足学校、医院、宾馆、工厂澡堂、家庭小区住宅、洗浴中心等行业热水需要。


ScriptEngine/Shared: Fix bug 5473 (v2).

ScriptEngine/Shared: Fix bug 5473 (v2).

--- OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -1536,6 +1536,7 @@
         public struct LSLInteger
         {
             public int value;
+            private static readonly Regex castRegex = new Regex(@"(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*(-?|\+?)[0-9][0-9]*)");

             #region Constructors
             public LSLInteger(int i)
@@ -1555,9 +1556,10 @@

             public LSLInteger(string s)
             {
-                Regex r = new Regex("(^[ ]*0[xX][0-9A-Fa-f][0-9A-Fa-f]*)|(^[ ]*-?[0-9][0-9]*)");
-                Match m = r.Match(s);
+                Match m = castRegex.Match(s);
                 string v = m.Groups[0].Value;
+                // Leading plus sign is allowed, but ignored
+                v = v.Replace("+", "");

                 if (v == String.Empty)
                 {


fixup price types

fixup price types

--- ArmasSalesTracker/Models/PriceTypes.cs
+++ ArmasSalesTracker/Models/PriceTypes.cs
@@ -4,7 +4,7 @@
     {
         Default = 1,

-        Discount = 2,
+        Current = 2,

         Premium = 3
     }


- продолжение описания клиентской части

- продолжение описания клиентской части

--- ThinkingHomeSite/Views/Home/UiForPlugins.cshtml
+++ ThinkingHomeSite/Views/Home/UiForPlugins.cshtml
@@ -146,7 +146,7 @@

             Веб-интерфейс загружает разделы через require.js
             по мере необходимости. Чтобы файл с кодом раздела автоматически подгрузился в браузер,
-            опишите раздел в виде отдельного модуля require.js (для этого используйте функцию define).
+            опишите раздел в виде отдельного модуля require.js (для этого используйте глобальную функцию define).

 define(['lib'], function (lib) {
@@ -167,10 +167,10 @@
             инициализации вашего модуля.

-            В примере указана только одна зависимость: 'lib' - это предопределенное имя
+            В примере указана только одна зависимость: 'lib' - это название
             специального модуля, который содержит библиотеки общего назначения (jQuery,
             underscore, backbone.js,
-            marionette.js и др.)
+            marionette.js и другие).

             Функция инициализации - будет вызвана один раз, после окончания загрузки файла с кодом вашего модуля.
@@ -178,21 +178,27 @@
             если укажут ваш модуль в списке зависимостей.

-            Для того, чтобы модуль мог быть использован веб-интерфейсом, необходимо, чтобы он
-            являлся экземпляром прототипа AppSection из модуля lib.common.
-

-
Переделать
-

-

-            содержал метод с названием start. По сути, когда пользователь
-            нажимает на ссылку перехода в какой-либо раздел, система загружает js-файл раздела
-            при помощи require.js, далее вызывается функция инициализации (если это не было
+            Чтобы ваш модуль мог быть использован веб-интерфейсом, необходимо,
+            унаследовать его (с помощью функции extend) от объекта AppSection
+            из модуля lib.common. AppSection уже содержит некоторый API, нужный
+            для работы модуля в веб-интерфейсе системы. Вы можете переопределить методы AppSection
+            и добавить в них нужное поведение.
+

+

+            В приведенном выше примере переопределен метод start, который автоматически вызывается,
+            когда пользователь хочет открыть ваш раздел. Как видите, внутри просто вызывается функция
+            alert с текстом "module started!". Т.е. при открытии раздела содержимое на экране не поменяется,
+            просто отобразится сообщение "module started!".
+

+

+            Таким образом, когда пользователь нажимает на ссылку перехода в какой-либо раздел, система загружает js-файл раздела
+            при помощи require.js, далее вызывается функция инициализации модуля (если это не было
             сделано ранее) и у объекта, полученного из функции инициализации, вызывается метод
             start.

-

-            В приведенном выше примере модуль ничего не отображает на странице. Он просто
-            выдает пользователю alert с текстом "module started!".
+
Методы AppSection

+

+

Отображение данных на странице


Force add AllowVoiceChat to parcel flags, since it doesn't always get added for some reason.

--- Aurora/Framework/SceneInfo/LandData.cs
+++ Aurora/Framework/SceneInfo/LandData.cs
@@ -309,7 +309,7 @@
         /// </summary>
         public uint Flags
         {
-            get { return _flags; }
+            get { return _flags | (uint) ParcelFlags.AllowVoiceChat; }//Force add allow voice chat
             set { _flags = value; }
         }


Adding logging to license validator, to allow troubleshooting what is going on when it fails

git-svn-id: 6eea8ec865c4fa60105bc56808c028bdcf72a817@2157 079b0acf-d9fa-0310-9935-e5ade295c882

--- licensing/Rhino.Licensing/LicenseValidator.cs
+++ licensing/Rhino.Licensing/LicenseValidator.cs
@@ -3,6 +3,7 @@
 using System.Security.Cryptography;
 using System.Security.Cryptography.Xml;
 using System.Xml;
+using log4net;

 namespace Rhino.Licensing
 {
@@ -12,6 +13,8 @@

 	public class LicenseValidator
 	{
+		private readonly ILog log = LogManager.GetLogger(typeof (LogManager));
+
 		private readonly string licensePath;
 		private readonly string licenseServerUrl;
 		private readonly Guid clientId;
@@ -55,11 +58,14 @@
 		public void AssertValidLicense()
 		{
 			if (File.Exists(licensePath) == false)
+			{
+				log.WarnFormat("Could not find license file: {0}", licensePath);
 				throw new LicenseFileNotFoundException();
+			}

 			if (HasExistingLicense())
 				return;
-
+			log.WarnFormat("Could not find an existing license in {0}", licensePath);
 			throw new LicenseNotFoundException();
 		}

@@ -68,11 +74,18 @@
 			try
 			{
 				if (File.Exists(licensePath) == false)
-					return false;
+				{
+					log.WarnFormat("Could not find license file: {0}", licensePath);
+					return false;
+				}

 				if (TryValidate() == false)
-					return false;
-
+				{
+					log.WarnFormat("Failed validating license file: {0}", licensePath);
+					return false;
+				}
+				log.InfoFormat("License {0} expiration date is {0}", licensePath, ExpirationDate);
+
 				return DateTime.Now < ExpirationDate;
 			}
 			catch (Exception)
@@ -94,24 +107,34 @@
 				doc.Load(licensePath);

 				if (TryGetValidDocument(publicKey, doc) == false)
-					return false;
+				{
+					log.WarnFormat("Could not validate xml signature of {0}", licensePath);
+					return false;
+				}

 				if (doc.FirstChild == null)
-					return false;
+				{
+					log.WarnFormat("Could not find first child of {0}", licensePath);
+					return false;
+				}

 				if (doc.SelectSingleNode("/floating-license") != null)
 				{
 					var node = doc.SelectSingleNode("/floating-license/license-server-public-key/text()");
 					if (node == null)
+					{
+						log.WarnFormat("Invalid license file {0}, floating license without license server public key", licensePath);
 						throw new InvalidOperationException(
 							"Invalid license file format, floating license without license server public key");
+					}
 					return ValidateFloatingLicense(node.InnerText);
 				}

 				return ValidateXmlDocumentLicense(doc);
 			}
-			catch (Exception)
-			{
+			catch (Exception e)
+			{
+				log.ErrorFormat("Could not validate license", e);
 				return false;
 			}
 		}
@@ -119,7 +142,10 @@
 		private bool ValidateFloatingLicense(string publicKeyOfFloatingLicense)
 		{
 			if (licenseServerUrl == null)
+			{
+				log.Warn("Could not find license server url");
 				throw new InvalidOperationException("Floating license encountered, but licenseServerUrl was not set");
+			}

 			var success = false;
 			var licensingService = ChannelFactory<ILicensingService>.CreateChannel(new WSHttpBinding(), new EndpointAddress(licenseServerUrl));
@@ -135,13 +161,17 @@
 				doc.LoadXml(leasedLicense);

 				if (TryGetValidDocument(publicKeyOfFloatingLicense, doc) == false)
-					return false;
+				{
+					log.WarnFormat("Could not get valid license from floating license server{0}", licensePath);
+					return false;
+				}

 				var validLicense = ValidateXmlDocumentLicense(doc);
 				if (validLicense)
 				{
 					//setup next lease
 					var time = (ExpirationDate.AddMinutes(-5) - DateTime.Now);
+					log.Debug("Will lease license again at {0}", time);
 					nextLeaseTimer.Change(time, time);
 				}
 				return validLicense;
@@ -157,41 +187,58 @@
 		{
 			XmlNode id = doc.SelectSingleNode("/license/@id");
 			if (id == null)
-				return false;
+			{
+				log.WarnFormat("Could not find id attribute in {0}", licensePath);
+				return false;
+			}

 			UserId = new Guid(id.Value);

 			XmlNode date = doc.SelectSingleNode("/license/@expiration");
 			if (date == null)
-				return false;
+			{
+				log.WarnFormat("Could not find expiration in {0}", licensePath);
+				return false;
+			}

 			ExpirationDate = DateTime.ParseExact(date.Value, "yyyy-MM-ddTHH:mm:ss.fffffff", CultureInfo.CurrentCulture);

 			XmlNode licenseType = doc.SelectSingleNode("/license/@type");
 			if (licenseType == null)
-				return false;
+			{
+				log.WarnFormat("Could not find license type in {0}", licenseType);
+				return false;
+			}

 			LicenseType = (LicenseType)Enum.Parse(typeof(LicenseType), licenseType.Value);

 			XmlNode name = doc.SelectSingleNode("/license/name/text()");
 			if (name == null)
-				return false;
+			{
+				log.WarnFormat("Could not find licensee's name in {0}", licensePath);
+				return false;
+			}

 			Name = name.Value;

 			return true;
 		}

-		private bool TryGetValidDocument(string licensePrivateKey, XmlDocument doc)
+		private bool TryGetValidDocument(string licensePublicKey, XmlDocument doc)
 		{
 			var rsa = new RSACryptoServiceProvider();
-			rsa.FromXmlString(licensePrivateKey);
+			rsa.FromXmlString(licensePublicKey);

 			var nsMgr = new XmlNamespaceManager(doc.NameTable);
 			nsMgr.AddNamespace("sig", "http://www.w3.org/2000/09/xmldsig#");

 			var signedXml = new SignedXml(doc);
 			var sig = (XmlElement)doc.SelectSingleNode("//sig:Signature", nsMgr);
+			if(sig == null)
+			{
+				log.WarnFormat("Could not find this signature node on {0}", licensePath);
+				return false;
+			}
 			signedXml.LoadXml(sig);

 			return signedXml.CheckSignature(rsa);


Fixed a typo with sync line Y position

Fixed a typo with sync line Y position

--- Brofiler/ThreadView/EventsThreadRow.cs
+++ Brofiler/ThreadView/EventsThreadRow.cs
@@ -217,7 +217,7 @@

                         // draw sleep
                         Color waitColor = IsUserInitiatedSync(stallReason) ? SynchronizationColorUser : SynchronizationColor;
-                        syncBuilder.AddRect(new Rect(syncInterval.Left, RenderParams.BaseMargin / Height, syncWidth, SyncLineHeight / Height), waitColor);
+                        syncBuilder.AddRect(new Rect(syncInterval.Left, 0, syncWidth, SyncLineHeight / Height), waitColor);
                     }

 					stallFrom = workFinish;


fixed bug: syntax error

fixed bug: syntax error

--- vActiveRecord/Base.cs
+++ vActiveRecord/Base.cs
@@ -1,488 +1,488 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Data.SQLite;
-using System.IO;
-using System.Text;
-
-namespace vActiveRecord
-{
-    public class Base
-    {
-        #region Local Variables
-
-        SQLiteCommand _cmd;
-        SQLiteTransaction _transaction;
-
-        #endregion
-
-        #region Public Properties
-
-        protected string file_name { get; set; }
-
-        protected string table_name { get; set; }
-
-        public bool is_new_record { get; set; }
-
-        #endregion
-
-        #region Public Static Properties
-
-        public static SQLiteConnection connection { get; set; }
-
-        #endregion
-
-        #region Constructors
-
-        public Base()
-        {
-        }
-
-        #endregion
-
-        #region Private Methods
-
-        private List<Hashtable> _create_record(Hashtable attributes)
-        {
-            StringBuilder sb0 = new StringBuilder();
-            StringBuilder sb1 = new StringBuilder();
-            bool is_first = true;
-
-            if (attributes.ContainsKey("id"))
-            {
-                attributes.Remove("id");
-            }
-
-            sb0.Append("INSERT INTO " + this.table_name + "(");
-
-            foreach (string key in attributes.Keys)
-            {
-                if (is_first)
-                {
-                    sb0.Append(key);
-                    sb1.Append("'" + attributes[key].ToString() + "'");
-                    is_first = false;
-                }
-                else
-                {
-                    sb0.Append("," + key);
-                    sb1.Append(",'" + attributes[key].ToString() + "'");
-                }
-            }
-
-            sb0.Append(") VALUES(" + sb1.ToString() + ");");
-
-            int rowsAffected = 0;
-
-            this.ExecuteNonQuery(sb0.ToString(), ref rowsAffected);
-
-            if (rowsAffected == 0)
-            {
-                return null;
-            }
-
-            //object obj;
-
-            List<Hashtable> rows = this.last();
-
-            return rows;
-        }
-
-        private List<Hashtable> _update_record(Hashtable attributes)
-        {
-            StringBuilder sb = new StringBuilder();
-            bool is_first = true;
-
-            sb.Append("UPDATE " + this.table_name + " SET ");
-
-            foreach (string key in attributes.Keys)
-            {
-                if (key == "id")
-                    continue;
-
-                if (is_first)
-                {
-                    sb.Append(key + "='" + attributes[key].ToString() + "'");
-                    is_first = false;
-                }
-                else
-                {
-                    sb.Append("," + key + "='" + attributes[key].ToString() + "'");
-                }
-            }
-
-            sb.Append(" WHERE id=" + attributes["id"].ToString() + ";");
-
-            int rowsAffected = 0;
-
-            this.ExecuteNonQuery(sb.ToString(), ref rowsAffected);
-
-            if (rowsAffected == 0)
-            {
-                return null;
-            }
-            else
-            {
-                List<Hashtable> rows = new List<Hashtable>();
-                rows.Add(attributes);
-                return rows;
-            }
-        }
-
-        private List<Hashtable> create_or_update(Hashtable attributes)
-        {
-            if (attributes.ContainsKey("id"))
-            {
-                return _update_record(attributes);
-            }
-            else
-            {
-                return _create_record(attributes);
-            }
-        }
-
-        private List<Hashtable> ExecuteReader(string sql, ref List<Hashtable> rows)
-        {
-            SQLiteDataReader dr = null;
-
-            if (this.ExecuteReader(sql, ref dr))
-            {
-                if (dr.HasRows)
-                {
-                    rows = new List<Hashtable>();
-
-                    while (dr.Read())
-                    {
-                        Hashtable c = new Hashtable();
-
-                        int i = 0;
-                        while (i < dr.FieldCount)
-                        {
-                            c.Add(dr.GetName(i), dr.GetValue(i));
-                            i++;
-                        }
-                        rows.Add(c);
-                    }
-                }
-                dr.Close();
-            }
-            return rows;
-        }
-
-        #endregion
-
-        #region Protected Methods
-
-        protected bool ExecuteNonQuery(string cmdText, ref int rowsAffected)
-        {
-            if (Base.connection != null)
-            {
-                if (Base.connection.FileName != this.file_name)
-                {
-                    Base.establish_connection(this.file_name);
-                }
-            }
-
-            if (Base.connection.State == System.Data.ConnectionState.Closed)
-                Base.connection.Open();
-
-            _cmd = new SQLiteCommand(cmdText, Base.connection);
-            rowsAffected = _cmd.ExecuteNonQuery();
-            return true;
-        }
-
-        protected bool ExecuteReader(string cmdText, ref SQLiteDataReader dr)
-        {
-            if (Base.connection != null)
-            {
-                if (Base.connection.FileName != this.file_name)
-                {
-                    Base.establish_connection(this.file_name);
-                }
-            }
-
-            if (Base.connection.State == System.Data.ConnectionState.Closed)
-                Base.connection.Open();
-
-            _cmd = new SQLiteCommand(cmdText, Base.connection);
-            dr = _cmd.ExecuteReader();
-            return true;
-        }
-
-        protected bool ExecuteScalar(string cmdText, ref object obj)
-        {
-            if (Base.connection != null)
-            {
-                if (Base.connection.FileName != this.file_name)
-                {
-                    Base.establish_connection(this.file_name);
-                }
-            }
-
-            if (Base.connection.State == System.Data.ConnectionState.Closed)
-                Base.connection.Open();
-
-            _cmd = new SQLiteCommand(cmdText, Base.connection);
-            obj = _cmd.ExecuteScalar();
-            return true;
-        }
-
-        #endregion
-
-        #region Public Methods
-
-        public List<Hashtable> all()
-        {
-            List<Hashtable> cList = null;
-
-            string cmdText = "SELECT * FROM " + table_name + ";";
-
-            SQLiteDataReader dr = null;
-
-            if (this.ExecuteReader(cmdText, ref dr))
-            {
-                if (dr.HasRows)
-                {
-                    cList = new List<Hashtable>();
-
-                    while (dr.Read())
-                    {
-                        Hashtable c = new Hashtable();
-
-                        int i = 0;
-                        while (i < dr.FieldCount)
-                        {
-                            c.Add(dr.GetName(i), dr.GetValue(i));
-                            i++;
-                        }
-
-                        cList.Add(c);
-                    }
-                }
-                dr.Close();
-            }
-            return cList;
-        }
-
-        public long count()
-        {
-            Hashtable args = new Hashtable();
-
-            args.Add("select", "count(*) AS _count");
-
-            List<Hashtable> rList = this.find(args);
-
-            return (long)rList[0]["_count"];
-        }
-
-        public long count(Hashtable options)
-        {
-            if (options.ContainsKey("select"))
-                options["select"] = "count(*) AS _count";
-
-            List<Hashtable> rList = this.find(options);
-
-            return (long)rList[0]["_count"];
-        }
-
-        public long count_by_sql(string sql)
-        {
-            List<Hashtable> rows = null;
-
-            this.ExecuteReader(sql, ref rows);
-
-            return (long)rows[0]["_count"];
-        }
-
-        public List<Hashtable> create(Hashtable attributes)
-        {
-            return _create_record(attributes);
-        }
-
-        public int delete(int id)
-        {
-            string sql = "DELETE FROM " + this.table_name + " WHERE id=" + id;
-
-            int rowsAffected = 0;
-
-            this.ExecuteNonQuery(sql, ref rowsAffected);
-
-            return rowsAffected;
-        }
-
-        public int delete_all()
-        {
-            return this.delete_all(null);
-        }
-
-        public int delete_all(string conditions)
-        {
-            string sql = "DELETE FROM " + this.table_name;
-
-            if (conditions != null)
-                sql += " WHERE " + conditions + ";";
-
-            int rowsAffected = 0;
-
-            this.ExecuteNonQuery(sql, ref rowsAffected);
-
-            return rowsAffected;
-        }
-
-        public List<Hashtable> find(Hashtable args)
-        {
-            string conditions = string.Empty;
-            string order = string.Empty;
-            string group = string.Empty;
-            string having = string.Empty;
-            string limit = string.Empty;
-            string offset = string.Empty;
-            string joins = string.Empty;
-            string include = string.Empty;
-            string select = string.Empty;
-            string from = string.Empty;
-
-            foreach (string k in args.Keys)
-            {
-                switch (k)
-                {
-                    case "conditions":
-                        conditions = args["conditions"].ToString();
-                        break;
-                    case "order":
-                        order = args["order"].ToString();
-                        break;
-                    case "group":
-                        group = args["group"].ToString();
-                        break;
-                    case "limit":
-                        limit = args["limit"].ToString();
-                        break;
-                    case "offset":
-                        offset = args["offset"].ToString();
-                        break;
-                    case "joins":
-                        joins = args["joins"].ToString();
-                        break;
-                    case "select":
-                        select = args["select"].ToString();
-                        break;
-                }
-            }
-
-            List<Hashtable> rows = null;
-
-            StringBuilder sb = new StringBuilder();
-
-            if (string.IsNullOrEmpty(select))
-                select = "*";
-
-            sb.Append("SELECT " + select + " FROM " + table_name);
-
-            if (!string.IsNullOrEmpty(joins))
-                sb.Append(" " + joins);
-
-            if (!string.IsNullOrEmpty(conditions))
-                sb.Append(" WHERE " + conditions);
-
-            if (!string.IsNullOrEmpty(group))
-                sb.Append(" GROUP BY " + group);
-
-            if (!string.IsNullOrEmpty(order))
-                sb.Append(" ORDER BY " + order);
-
-            if (!string.IsNullOrEmpty(limit))
-                sb.Append(" LIMIT " + limit);
-
-            if (!string.IsNullOrEmpty(offset))
-                sb.Append(" OFFSET " + group);
-
-            return this.ExecuteReader(sb.ToString(), ref rows);
-        }
-
-        public List<Hashtable> find(int id)
-        {
-            List<Hashtable> rows = null;
-
-            string sql = "SELETC * FROM " + this.table_name + " WHERE id=" + id;
-
-            return this.ExecuteReader(sql, ref rows);
-        }
-
-        public List<Hashtable> find_by_sql(string sql)
-        {
-            List<Hashtable> rows = null;
-
-            return this.ExecuteReader(sql, ref rows);
-        }
-
-        public List<Hashtable> first()
-        {
-            Hashtable args = new Hashtable();
-            args.Add("order", "id");
-            args.Add("limit", "1");
-
-            return this.find(args);
-        }
-
-        public List<Hashtable> last()
-        {
-            Hashtable args = new Hashtable();
-
-            args.Add("order", "id DESC");
-            args.Add("limit", "1");
-
-            return this.find(args);
-        }
-
-        public List<Hashtable> save(Hashtable attributes)
-        {
-            return create_or_update(attributes);
-        }
-
-        public void transaction_do()
-        {
-            _transaction = Base.connection.BeginTransaction();
-        }
-
-        public void transaction_end()
-        {
-            _transaction.Commit();
-        }
-
-        #endregion
-
-        #region Public Static Methods
-
-        public static void establish_connection(string database)
-        {
-            if (Base.connection != null)
-            {
-                if (Base.connection.State == System.Data.ConnectionState.Open)
-                {
-                    if (Base.connection.FileName == database)
-                        return;
-                }
-            }
-
-            Base.close_connection();
-
-            string connectionString = "Data Source=" + database + ";new=false;Version=3;";
-            Base.connection = new SQLiteConnection(connectionString);
-
-            if (Base.connection.State == System.Data.ConnectionState.Closed)
-                Base.connection.Open();
-        }
-
-        public static void close_connection()
-        {
-            if (Base.connection != null)
-            {
-                if (Base.connection.State == System.Data.ConnectionState.Open)
-                    Base.connection.Close();
-            }
-        }
-
-        #endregion
-    }
-}
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data.SQLite;
+using System.IO;
+using System.Text;
+
+namespace vActiveRecord
+{
+    public class Base
+    {
+        #region Local Variables
+
+        SQLiteCommand _cmd;
+        SQLiteTransaction _transaction;
+
+        #endregion
+
+        #region Public Properties
+
+        protected string file_name { get; set; }
+
+        protected string table_name { get; set; }
+
+        public bool is_new_record { get; set; }
+
+        #endregion
+
+        #region Public Static Properties
+
+        public static SQLiteConnection connection { get; set; }
+
+        #endregion
+
+        #region Constructors
+
+        public Base()
+        {
+        }
+
+        #endregion
+
+        #region Private Methods
+
+        private List<Hashtable> _create_record(Hashtable attributes)
+        {
+            StringBuilder sb0 = new StringBuilder();
+            StringBuilder sb1 = new StringBuilder();
+            bool is_first = true;
+
+            if (attributes.ContainsKey("id"))
+            {
+                attributes.Remove("id");
+            }
+
+            sb0.Append("INSERT INTO " + this.table_name + "(");
+
+            foreach (string key in attributes.Keys)
+            {
+                if (is_first)
+                {
+                    sb0.Append(key);
+                    sb1.Append("'" + attributes[key].ToString() + "'");
+                    is_first = false;
+                }
+                else
+                {
+                    sb0.Append("," + key);
+                    sb1.Append(",'" + attributes[key].ToString() + "'");
+                }
+            }
+
+            sb0.Append(") VALUES(" + sb1.ToString() + ");");
+
+            int rowsAffected = 0;
+
+            this.ExecuteNonQuery(sb0.ToString(), ref rowsAffected);
+
+            if (rowsAffected == 0)
+            {
+                return null;
+            }
+
+            //object obj;
+
+            List<Hashtable> rows = this.last();
+
+            return rows;
+        }
+
+        private List<Hashtable> _update_record(Hashtable attributes)
+        {
+            StringBuilder sb = new StringBuilder();
+            bool is_first = true;
+
+            sb.Append("UPDATE " + this.table_name + " SET ");
+
+            foreach (string key in attributes.Keys)
+            {
+                if (key == "id")
+                    continue;
+
+                if (is_first)
+                {
+                    sb.Append(key + "='" + attributes[key].ToString() + "'");
+                    is_first = false;
+                }
+                else
+                {
+                    sb.Append("," + key + "='" + attributes[key].ToString() + "'");
+                }
+            }
+
+            sb.Append(" WHERE id=" + attributes["id"].ToString() + ";");
+
+            int rowsAffected = 0;
+
+            this.ExecuteNonQuery(sb.ToString(), ref rowsAffected);
+
+            if (rowsAffected == 0)
+            {
+                return null;
+            }
+            else
+            {
+                List<Hashtable> rows = new List<Hashtable>();
+                rows.Add(attributes);
+                return rows;
+            }
+        }
+
+        private List<Hashtable> create_or_update(Hashtable attributes)
+        {
+            if (attributes.ContainsKey("id"))
+            {
+                return _update_record(attributes);
+            }
+            else
+            {
+                return _create_record(attributes);
+            }
+        }
+
+        private List<Hashtable> ExecuteReader(string sql, ref List<Hashtable> rows)
+        {
+            SQLiteDataReader dr = null;
+
+            if (this.ExecuteReader(sql, ref dr))
+            {
+                if (dr.HasRows)
+                {
+                    rows = new List<Hashtable>();
+
+                    while (dr.Read())
+                    {
+                        Hashtable c = new Hashtable();
+
+                        int i = 0;
+                        while (i < dr.FieldCount)
+                        {
+                            c.Add(dr.GetName(i), dr.GetValue(i));
+                            i++;
+                        }
+                        rows.Add(c);
+                    }
+                }
+                dr.Close();
+            }
+            return rows;
+        }
+
+        #endregion
+
+        #region Protected Methods
+
+        protected bool ExecuteNonQuery(string cmdText, ref int rowsAffected)
+        {
+            if (Base.connection != null)
+            {
+                if (Base.connection.FileName != this.file_name)
+                {
+                    Base.establish_connection(this.file_name);
+                }
+            }
+
+            if (Base.connection.State == System.Data.ConnectionState.Closed)
+                Base.connection.Open();
+
+            _cmd = new SQLiteCommand(cmdText, Base.connection);
+            rowsAffected = _cmd.ExecuteNonQuery();
+            return true;
+        }
+
+        protected bool ExecuteReader(string cmdText, ref SQLiteDataReader dr)
+        {
+            if (Base.connection != null)
+            {
+                if (Base.connection.FileName != this.file_name)
+                {
+                    Base.establish_connection(this.file_name);
+                }
+            }
+
+            if (Base.connection.State == System.Data.ConnectionState.Closed)
+                Base.connection.Open();
+
+            _cmd = new SQLiteCommand(cmdText, Base.connection);
+            dr = _cmd.ExecuteReader();
+            return true;
+        }
+
+        protected bool ExecuteScalar(string cmdText, ref object obj)
+        {
+            if (Base.connection != null)
+            {
+                if (Base.connection.FileName != this.file_name)
+                {
+                    Base.establish_connection(this.file_name);
+                }
+            }
+
+            if (Base.connection.State == System.Data.ConnectionState.Closed)
+                Base.connection.Open();
+
+            _cmd = new SQLiteCommand(cmdText, Base.connection);
+            obj = _cmd.ExecuteScalar();
+            return true;
+        }
+
+        #endregion
+
+        #region Public Methods
+
+        public List<Hashtable> all()
+        {
+            List<Hashtable> cList = null;
+
+            string cmdText = "SELECT * FROM " + table_name + ";";
+
+            SQLiteDataReader dr = null;
+
+            if (this.ExecuteReader(cmdText, ref dr))
+            {
+                if (dr.HasRows)
+                {
+                    cList = new List<Hashtable>();
+
+                    while (dr.Read())
+                    {
+                        Hashtable c = new Hashtable();
+
+                        int i = 0;
+                        while (i < dr.FieldCount)
+                        {
+                            c.Add(dr.GetName(i), dr.GetValue(i));
+                            i++;
+                        }
+
+                        cList.Add(c);
+                    }
+                }
+                dr.Close();
+            }
+            return cList;
+        }
+
+        public long count()
+        {
+            Hashtable args = new Hashtable();
+
+            args.Add("select", "count(*) AS _count");
+
+            List<Hashtable> rList = this.find(args);
+
+            return (long)rList[0]["_count"];
+        }
+
+        public long count(Hashtable options)
+        {
+            if (options.ContainsKey("select"))
+                options["select"] = "count(*) AS _count";
+
+            List<Hashtable> rList = this.find(options);
+
+            return (long)rList[0]["_count"];
+        }
+
+        public long count_by_sql(string sql)
+        {
+            List<Hashtable> rows = null;
+
+            this.ExecuteReader(sql, ref rows);
+
+            return (long)rows[0]["_count"];
+        }
+
+        public List<Hashtable> create(Hashtable attributes)
+        {
+            return _create_record(attributes);
+        }
+
+        public int delete(int id)
+        {
+            string sql = "DELETE FROM " + this.table_name + " WHERE id=" + id;
+
+            int rowsAffected = 0;
+
+            this.ExecuteNonQuery(sql, ref rowsAffected);
+
+            return rowsAffected;
+        }
+
+        public int delete_all()
+        {
+            return this.delete_all(null);
+        }
+
+        public int delete_all(string conditions)
+        {
+            string sql = "DELETE FROM " + this.table_name;
+
+            if (conditions != null)
+                sql += " WHERE " + conditions + ";";
+
+            int rowsAffected = 0;
+
+            this.ExecuteNonQuery(sql, ref rowsAffected);
+
+            return rowsAffected;
+        }
+
+        public List<Hashtable> find(Hashtable args)
+        {
+            string conditions = string.Empty;
+            string order = string.Empty;
+            string group = string.Empty;
+            string having = string.Empty;
+            string limit = string.Empty;
+            string offset = string.Empty;
+            string joins = string.Empty;
+            string include = string.Empty;
+            string select = string.Empty;
+            string from = string.Empty;
+
+            foreach (string k in args.Keys)
+            {
+                switch (k)
+                {
+                    case "conditions":
+                        conditions = args["conditions"].ToString();
+                        break;
+                    case "order":
+                        order = args["order"].ToString();
+                        break;
+                    case "group":
+                        group = args["group"].ToString();
+                        break;
+                    case "limit":
+                        limit = args["limit"].ToString();
+                        break;
+                    case "offset":
+                        offset = args["offset"].ToString();
+                        break;
+                    case "joins":
+                        joins = args["joins"].ToString();
+                        break;
+                    case "select":
+                        select = args["select"].ToString();
+                        break;
+                }
+            }
+
+            List<Hashtable> rows = null;
+
+            StringBuilder sb = new StringBuilder();
+
+            if (string.IsNullOrEmpty(select))
+                select = "*";
+
+            sb.Append("SELECT " + select + " FROM " + table_name);
+
+            if (!string.IsNullOrEmpty(joins))
+                sb.Append(" " + joins);
+
+            if (!string.IsNullOrEmpty(conditions))
+                sb.Append(" WHERE " + conditions);
+
+            if (!string.IsNullOrEmpty(group))
+                sb.Append(" GROUP BY " + group);
+
+            if (!string.IsNullOrEmpty(order))
+                sb.Append(" ORDER BY " + order);
+
+            if (!string.IsNullOrEmpty(limit))
+                sb.Append(" LIMIT " + limit);
+
+            if (!string.IsNullOrEmpty(offset))
+                sb.Append(" OFFSET " + group);
+
+            return this.ExecuteReader(sb.ToString(), ref rows);
+        }
+
+        public List<Hashtable> find(int id)
+        {
+            List<Hashtable> rows = null;
+
+            string sql = "SELECT * FROM " + this.table_name + " WHERE id=" + id;
+
+            return this.ExecuteReader(sql, ref rows);
+        }
+
+        public List<Hashtable> find_by_sql(string sql)
+        {
+            List<Hashtable> rows = null;
+
+            return this.ExecuteReader(sql, ref rows);
+        }
+
+        public List<Hashtable> first()
+        {
+            Hashtable args = new Hashtable();
+            args.Add("order", "id");
+            args.Add("limit", "1");
+
+            return this.find(args);
+        }
+
+        public List<Hashtable> last()
+        {
+            Hashtable args = new Hashtable();
+
+            args.Add("order", "id DESC");
+            args.Add("limit", "1");
+
+            return this.find(args);
+        }
+
+        public List<Hashtable> save(Hashtable attributes)
+        {
+            return create_or_update(attributes);
+        }
+
+        public void transaction_do()
+        {
+            _transaction = Base.connection.BeginTransaction();
+        }
+
+        public void transaction_end()
+        {
+            _transaction.Commit();
+        }
+
+        #endregion
+
+        #region Public Static Methods
+
+        public static void establish_connection(string database)
+        {
+            if (Base.connection != null)
+            {
+                if (Base.connection.State == System.Data.ConnectionState.Open)
+                {
+                    if (Base.connection.FileName == database)
+                        return;
+                }
+            }
+
+            Base.close_connection();
+
+            string connectionString = "Data Source=" + database + ";new=false;Version=3;";
+            Base.connection = new SQLiteConnection(connectionString);
+
+            if (Base.connection.State == System.Data.ConnectionState.Closed)
+                Base.connection.Open();
+        }
+
+        public static void close_connection()
+        {
+            if (Base.connection != null)
+            {
+                if (Base.connection.State == System.Data.ConnectionState.Open)
+                    Base.connection.Close();
+            }
+        }
+
+        #endregion
+    }
+}


Pass through message language.

Pass through message language.

--- CSharp/Library/Dialogs/Conversation.cs
+++ CSharp/Library/Dialogs/Conversation.cs
@@ -31,17 +31,13 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //

+using Autofac;
+using Microsoft.Bot.Builder.Dialogs.Internals;
+using Microsoft.Bot.Connector;
 using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
+using System.Globalization;
 using System.Threading;
 using System.Threading.Tasks;
-
-using Microsoft.Bot.Connector;
-using Microsoft.Bot.Builder.Dialogs.Internals;
-
-using Autofac;

 namespace Microsoft.Bot.Builder.Dialogs
 {
@@ -92,6 +88,10 @@
         {
             using (var scope = DialogModule.BeginLifetimeScope(SendToBotContainer, toBot))
             {
+                if (toBot.Language != null)
+                {
+                    Thread.CurrentThread.CurrentUICulture = new CultureInfo(toBot.Language);
+                }
                 return await SendAsync(scope, toBot, MakeRoot, token);
             }
         }


No border on the register button

No border on the register button

--- CoderCamp/CoderCamp/Views/EventView.cs
+++ CoderCamp/CoderCamp/Views/EventView.cs
@@ -20,7 +20,7 @@
                 Children = {
                     new StackLayout {
                     HorizontalOptions = LayoutOptions.FillAndExpand,
-                    Padding = new Thickness(10, 20, 10, 40),
+                    Padding = new Thickness(10, 20, 10, 40),
                     BackgroundColor = Color.FromRgb(0x5F, 0x00, 0x0B),
                     Children = {
                             new Label {
@@ -47,8 +47,8 @@
                         Text = "Register",
                         TextColor = Color.White,
                         BackgroundColor = Color.FromRgb(0x2B, 0x8D, 0x11),
-                        BorderColor = Color.FromRgb(0x24, 0x76, 0x0E),
-                        BorderWidth = 4,
+                        BorderColor = Color.FromRgb(0x2B, 0x8D, 0x11),
+                        BorderWidth = 0,
                         BorderRadius = 0,
                         HorizontalOptions = LayoutOptions.FillAndExpand,
                         Command = new Command(async () => await CrossShare.Current


Add support for ordering links and external links

Adds support for the isExternal and asLastNode parameters of NavigationExtensions.AddNavigationNode

--- Commands/Branding/AddNavigationNode.cs
+++ Commands/Branding/AddNavigationNode.cs
@@ -1,4 +1,4 @@
-using Microsoft.SharePoint.Client;
+using Microsoft.SharePoint.Client;
 using SharePointPnP.PowerShell.Commands.Enums;
 using System;
 using System.Management.Automation;
@@ -18,6 +18,14 @@
         Code = @"PS:> Add-SPONavigationNode -Title ""Contoso USA"" -Url ""http://contoso.sharepoint.com/sites/contoso/usa/"" -Location ""QuickLaunch"" -Header ""Contoso""",
         Remarks = @"Adds a navigation node to the quicklaunch. The navigation node will have the title ""Contoso USA"", will link to the url ""http://contoso.sharepoint.com/sites/contoso/usa/"" and will have ""Contoso"" as a parent navigation node.",
         SortOrder = 2)]
+    [CmdletExample(
+        Code = @"PS:> Add-SPONavigationNode -Title ""Contoso"" -Url ""http://contoso.sharepoint.com/sites/contoso/"" -Location ""QuickLaunch"" -First",
+        Remarks = @"Adds a navigation node to the quicklaunch, as the first item. The navigation node will have the title ""Contoso"" and will link to the url ""http://contoso.sharepoint.com/sites/contoso/""",
+        SortOrder = 3)]
+    [CmdletExample(
+        Code = @"PS:> Add-SPONavigationNode -Title ""Contoso Pharmaceuticals"" -Url ""http://contoso.sharepoint.com/sites/contosopharma/"" -Location ""QuickLaunch"" -External",
+        Remarks = @"Adds a navigation node to the quicklaunch. The navigation node will have the title ""Contoso Pharmaceuticals"" and will link to the external url ""http://contoso.sharepoint.com/sites/contosopharma/""",
+        SortOrder = 4)]
     public class AddNavigationNode : SPOWebCmdlet
     {
         [Parameter(Mandatory = true, HelpMessage = "The location of the node to add. Either TopNavigationBar, QuickLaunch or SearchNav")]
@@ -29,8 +37,14 @@
         [Parameter(Mandatory = false, HelpMessage = "The url to navigate to when clicking the new menu item.")]
         public string Url;

-        [Parameter(Mandatory = false, HelpMessage = "Optionally value of a header entry to add the menu item to.")]
+        [Parameter(Mandatory = false, HelpMessage = "Optionallly value of a header entry to add the menu item to.")]
         public string Header;
+
+        [Parameter(Mandatory = false, HelpMessage = "Add the new menu item to beginning of the collection.")]
+        public SwitchParameter First;
+
+        [Parameter(Mandatory = false, HelpMessage = "Indicates the destination URL is outside of the site collection.")]
+        public SwitchParameter External;

         protected override void ExecuteCmdlet()
         {
@@ -40,10 +54,7 @@
                 ClientContext.ExecuteQueryRetry();
                 Url = SelectedWeb.Url;
             }
-            SelectedWeb.AddNavigationNode(Title, new Uri(Url), Header, Location);
+            SelectedWeb.AddNavigationNode(Title, new Uri(Url), Header, Location, External.IsPresent, !First.IsPresent);
         }
-
     }
-
-
 }


Remove debugging detection cascade.

Remove debugging detection cascade.

--- CompressedImageView/MainWindow.xaml.cs
+++ CompressedImageView/MainWindow.xaml.cs
@@ -162,8 +162,6 @@
                     }
                 }));

-                // drawing boxes ????
-                int x = 0, y = 0;
                 while (ROS.ok)
                 {
                     Dispatcher.BeginInvoke(new Action(() =>
@@ -172,9 +170,6 @@
                         {
                             detectors[i].churnAndBurn();
                         }
-                        DateTime dt = DateTime.Now;
-                        if (!detectors[0].boxesOnScreen.ContainsKey(dt))
-                            detectors[0].boxesOnScreen.Add(dt, mainImages[0].DrawABox(new System.Windows.Point((x++) % (int)Math.Round(mainImages[0].ActualWidth), (y++) % (int)Math.Round(mainImages[0].ActualHeight)), 50, 50, mainImages[0].ActualWidth, mainImages[0].ActualHeight));
                     }));
                     Thread.Sleep(10);
                 }


Avoid making new constants -1, 0, 1.

Avoid making new constants -1, 0, 1.

--- ComputerAlgebra/Expression/Constant.cs
+++ ComputerAlgebra/Expression/Constant.cs
@@ -9,21 +9,28 @@

         protected Constant(Real x) { this.x = x; }

+        private static readonly Constant NegativeOne = new Constant(-1);
+        private static readonly Constant Zero = new Constant(0);
         private static readonly Constant One = new Constant(1);
-        private static readonly Constant Zero = new Constant(0);
+        private static readonly Constant Two = new Constant(2);

-        public static Constant New(int x) { return new Constant(x); }
+        public static Constant New(int x) {
+            if (x == -1) return NegativeOne;
+            if (x == 0) return Zero;
+            if (x == 1) return One;
+            return new Constant(x);
+        }
         public static Constant New(double x) { return new Constant(x); }
         public static Constant New(decimal x) { return new Constant(x); }
         public static Constant New(Real x) { return new Constant(x); }
         public static Constant New(bool x) { return x ? One : Zero; }
         public static Expression New(object x)
         {
-            if (x.GetType() == typeof(int)) return New((int)x);
-            if (x.GetType() == typeof(double)) return New((double)x);
-            if (x.GetType() == typeof(decimal)) return New((decimal)x);
-            if (x.GetType() == typeof(bool)) return New((bool)x);
-            if (x.GetType() == typeof(Real)) return New((Real)x);
+            if (x is int i) return New(i);
+            if (x is double dbl) return New(dbl);
+            if (x is decimal d) return New(d);
+            if (x is bool b) return New(b);
+            if (x is Real r) return New(r);
             throw new InvalidCastException();
         }

@@ -52,15 +59,13 @@
         {
             if (R is Constant RC)
                 return Real.Abs(RC.Value).CompareTo(Real.Abs(Value));
-
             return base.CompareTo(R);
         }
         public override bool Equals(Expression E)
         {
-            Constant C = E as Constant;
-            if ((C is null)) return base.Equals(E);
-
-            return Value.Equals(C.Value);
+            if (E is Constant C)
+                return Value.Equals(C.Value);
+            return base.Equals(E);
         }
     }
 }


tray notification for started intervals

tray notification for started intervals

--- ConsoleApp/Notifications/TrayBubble.cs
+++ ConsoleApp/Notifications/TrayBubble.cs
@@ -64,6 +64,15 @@
             pomodoroNotifier.IntervalFinished += IntervalFinished;
             pomodoroNotifier.Tick += OnTick;
             pomodoroNotifier.IntervalInterrupted += IntervalInterrupted;
+            pomodoroNotifier.IntervalStarted += IntervalStarted;
+        }
+
+        private void IntervalStarted(object sender, IntervalStartedEventArgs e)
+        {
+            string bubbleTitle = string.Format("{0} started!", e.Type);
+            string bubbleText = string.Format("duration: {0}", e.Duration);
+            ShowPopup(bubbleTitle, bubbleText);
+            SetIconText(bubbleTitle + " " + bubbleText);
         }
     }
 }


Fix missing null conditional

Fix missing null conditional

--- Content.Server/Atmos/TileAtmosphere.cs
+++ Content.Server/Atmos/TileAtmosphere.cs
@@ -467,7 +467,7 @@
                     foreach (var direction in Cardinal)
                     {
                         if (!tile._adjacentTiles.TryGetValue(direction, out var tile2)) continue;
-                        if (tile2?.Air.Compare(Air) == GasMixture.GasCompareResult.NoExchange) continue;
+                        if (tile2?.Air?.Compare(Air) == GasMixture.GasCompareResult.NoExchange) continue;
                         _gridAtmosphereComponent.AddActiveTile(tile2);
                         break;
                     }


Fix TestFlash

Fix TestFlash

--- Core/Simulation/Physics/Core/LSBody.cs
+++ Core/Simulation/Physics/Core/LSBody.cs
@@ -868,13 +868,16 @@
             }
             flashRoutines.Clear();

+
             Renderer ren = this.GetComponentInChildren<Renderer>();
+
+            if (ren != null) {
             Color col = Color.white;
             ren.material.color = Color.red;
             yield return null;
             yield return new WaitForSeconds(.08f);
             ren.material.color = col;
-
+            }
             yield break;
         }
     }


Fixing naming convention on CacheDict

Fixing naming convention on CacheDict

--- Core/System/Dynamic/Utils/CacheDict.cs
+++ Core/System/Dynamic/Utils/CacheDict.cs
@@ -18,15 +18,15 @@
         // class, to ensure atomic updates.
         private sealed class Entry
         {
-            internal readonly int _hash;
-            internal readonly TKey _key;
-            internal readonly TValue _value;
+            internal readonly int Hash;
+            internal readonly TKey Key;
+            internal readonly TValue Value;

             internal Entry(int hash, TKey key, TValue value)
             {
-                _hash = hash;
-                _key = key;
-                _value = value;
+                Hash = hash;
+                Key = key;
+                Value = value;
             }
         }

@@ -47,9 +47,9 @@
             var idx = hash & _mask;

             var entry = Volatile.Read(ref _entries[idx]);
-            if (entry != null && entry._hash == hash && entry._key.Equals(key))
+            if (entry != null && entry.Hash == hash && entry.Key.Equals(key))
             {
-                value = entry._value;
+                value = entry.Value;
                 return true;
             }

@@ -63,7 +63,7 @@
             var idx = hash & _mask;

             var entry = Volatile.Read(ref _entries[idx]);
-            if (entry == null || entry._hash != hash || !entry._key.Equals(key))
+            if (entry == null || entry.Hash != hash || !entry.Key.Equals(key))
             {
                 Volatile.Write(ref _entries[idx], new Entry(hash, key, value));
             }


Removing async from tests

Removing async from tests

--- NoTPK.APIWrapper.ObsidianPortal/APIWrapper.ObsidianPortal.Tests/API_Characters_Tests.cs
+++ NoTPK.APIWrapper.ObsidianPortal/APIWrapper.ObsidianPortal.Tests/API_Characters_Tests.cs
@@ -40,83 +40,83 @@
 		}

 		[TestMethod]
-		public async Task Test_Characters_Index__ByCampaignId()
+		public void Test_Characters_Index__ByCampaignId()
 		{
 			var approved = Helpers.GetApprovedResults("Index_Character");
 			var campaignId = (string)_testVariables.Element("CampaignId");

-			var result = await API_Characters.IndexByCampaignId(_appId, _appSecret, _token, _tokenSecret, campaignId);
+			var result = API_Characters.IndexByCampaignId(_appId, _appSecret, _token, _tokenSecret, campaignId).Result;
 			Assert.AreEqual(approved, result);
 		}

 		[TestMethod]
-		public async Task Test_Characters_Show__ByCharacterId()
+		public void Test_Characters_Show__ByCharacterId()
 		{
 			var approved = Helpers.GetApprovedResults("Show_CharacterById");
 			var campaignId = (string)_testVariables.Element("CampaignId");
 			var characterId = (string)_testVariables.Element("CharacterId");

-			var result = await API_Characters.ShowById(_appId, _appSecret, _token, _tokenSecret, campaignId, characterId);
+			var result = API_Characters.ShowById(_appId, _appSecret, _token, _tokenSecret, campaignId, characterId).Result;
 			Assert.AreEqual(approved, result);
 		}

 		[TestMethod]
-		public async Task Test_Characters_Show__ByCharacterSlug()
+		public void Test_Characters_Show__ByCharacterSlug()
 		{
 			var approved = Helpers.GetApprovedResults("Show_CharacterBySlug");
 			var campaignId = (string)_testVariables.Element("CampaignId");
 			var characterSlug = (string)_testVariables.Element("CharacterSlug");

-			var result = await API_Characters.ShowBySlug(_appId, _appSecret, _token, _tokenSecret, campaignId, characterSlug);
+			var result = API_Characters.ShowBySlug(_appId, _appSecret, _token, _tokenSecret, campaignId, characterSlug).Result;
 			Assert.AreEqual(approved, result);
 		}

 		[TestMethod]
 		[Ignore] // Destructive -- Need mocking, perhaps
-		public async Task Test_Characters_Create__ByCampaignId()
+		public void Test_Characters_Create__ByCampaignId()
 		{
 			var approved = Helpers.GetApprovedResults("Show_CreateCharacter");
 			var campaignId = (string)_testVariables.Element("ModifiableCampaign");
 			var newCharacter = (string)_testVariables.Element("NewCharacter");

-			var result = await API_Characters.Create(_appId, _appSecret, _token, _tokenSecret, campaignId, newCharacter);
+			var result = API_Characters.Create(_appId, _appSecret, _token, _tokenSecret, campaignId, newCharacter).Result;
 			Assert.AreEqual(approved, result);
 		}

 		[TestMethod]
 		[Ignore] // Destructive -- Need mocking, perhaps
-		public async Task Test_Characters_Update__ByCharacterId()
+		public void Test_Characters_Update__ByCharacterId()
 		{
 			var approved = Helpers.GetApprovedResults("Show_UpdateCharacter");
 			var campaignId = (string) _testVariables.Element("ModifiableCampaign");
 			var updateCharacter = (string)_testVariables.Element("UpdateCharacterId");
 			var updateContent = (string) _testVariables.Element("UpdateContent");

-			var result = await API_Characters.Update(_appId, _appSecret, _token, _tokenSecret, campaignId, updateCharacter, updateContent);
+			var result = API_Characters.Update(_appId, _appSecret, _token, _tokenSecret, campaignId, updateCharacter, updateContent).Result;
 			Assert.AreEqual(approved, result);
 		}

 		[TestMethod]
 		[Ignore] // Destructive -- Need mocking, perhaps
-		public async Task Test_Characters_Delete__ByCharacterId()
+		public void Test_Characters_Delete__ByCharacterId()
 		{
 			var approved = Helpers.GetApprovedResults("Show_DeleteCharacter");
 			var campaignId = (string) _testVariables.Element("ModifiableCampaign");
 			var deleteCharacter = (string) _testVariables.Element("DeleteCharacterId");

-			var result = await API_Characters.Delete(_appId, _appSecret, _token, _tokenSecret, campaignId, deleteCharacter);
+			var result = API_Characters.Delete(_appId, _appSecret, _token, _tokenSecret, campaignId, deleteCharacter).Result;
 			Assert.AreEqual(approved, result);
 		}

 		[TestMethod]
-		public async Task Test_Characters_StoreLocal__ByCharacterId()
+		public void Test_Characters_StoreLocal__ByCharacterId()
 		{
 			// Store the character locally to allow for undoing
 			var approved = Helpers.GetApprovedResults("Show_CharacterById");
 			var campaignId = (string)_testVariables.Element("CampaignId");
 			var characterId = (string)_testVariables.Element("CharacterId");

-			var result = await API_Characters.ShowById(_appId, _appSecret, _token, _tokenSecret, campaignId, characterId);
+			var result = API_Characters.ShowById(_appId, _appSecret, _token, _tokenSecret, campaignId, characterId).Result;

 			var storageLocation = API_Characters.StoreLocal(characterId, result);


Manual merge of pr369 (from Nanddeep Nachan)

--- OfficeDevPnP.Core/OfficeDevPnP.Core/AppModelExtensions/FieldAndContentTypeExtensions.cs
+++ OfficeDevPnP.Core/OfficeDevPnP.Core/AppModelExtensions/FieldAndContentTypeExtensions.cs
@@ -558,10 +558,11 @@
         /// <param name="listTitle">Title of the list</param>
         /// <param name="contentTypeID">Complete ID for the content type</param>
         /// <param name="defaultContent">Optionally make this the default content type</param>
-        public static void AddContentTypeToListById(this Web web, string listTitle, string contentTypeId, bool defaultContent = false)
+        /// <param name="searchContentTypeInSiteHierarchy">search for content type in site hierarchy</param>
+        public static void AddContentTypeToListById(this Web web, string listTitle, string contentTypeId, bool defaultContent = false, bool searchContentTypeInSiteHierarchy = false)
         {
             // Get content type instance
-            ContentType contentType = GetContentTypeById(web, contentTypeId);
+            ContentType contentType = GetContentTypeById(web, contentTypeId, searchContentTypeInSiteHierarchy);
             // Add content type to list
             AddContentTypeToList(web, listTitle, contentType, defaultContent);
         }
@@ -573,10 +574,11 @@
         /// <param name="listTitle">Title of the list</param>
         /// <param name="contentTypeName">Name of the content type</param>
         /// <param name="defaultContent">Optionally make this the default content type</param>
-        public static void AddContentTypeToListByName(this Web web, string listTitle, string contentTypeName, bool defaultContent = false)
+        /// <param name="searchContentTypeInSiteHierarchy">search for content type in site hierarchy</param>
+        public static void AddContentTypeToListByName(this Web web, string listTitle, string contentTypeName, bool defaultContent = false, bool searchContentTypeInSiteHierarchy = false)
         {
             // Get content type instance
-            ContentType contentType = GetContentTypeByName(web, contentTypeName);
+            ContentType contentType = GetContentTypeByName(web, contentTypeName, searchContentTypeInSiteHierarchy);
             // Add content type to list
             AddContentTypeToList(web, listTitle, contentType, defaultContent);
         }
@@ -602,10 +604,11 @@
         /// <param name="list">List to add content type to</param>
         /// <param name="contentTypeID">Complete ID for the content type</param>
         /// <param name="defaultContent">If set true, content type is updated to be default content type for the list</param>
-        public static void AddContentTypeToListById(this List list, string contentTypeID, bool defaultContent = false)
+        /// <param name="searchContentTypeInSiteHierarchy">search for content type in site hierarchy</param>
+        public static void AddContentTypeToListById(this List list, string contentTypeID, bool defaultContent = false, bool searchContentTypeInSiteHierarchy = false)
         {
             Web web = list.ParentWeb;
-            ContentType contentType = GetContentTypeById(web, contentTypeID);
+            ContentType contentType = GetContentTypeById(web, contentTypeID, searchContentTypeInSiteHierarchy);
             AddContentTypeToList(list, contentType, defaultContent);
         }

@@ -615,10 +618,11 @@
         /// <param name="list">List to add content type to</param>
         /// <param name="contentTypeName">Name of the content type</param>
         /// <param name="defaultContent">If set true, content type is updated to be default content type for the list</param>
-        public static void AddContentTypeToListByName(this List list, string contentTypeName, bool defaultContent = false)
+        /// <param name="searchContentTypeInSiteHierarchy">search for content type in site hierarchy</param>
+        public static void AddContentTypeToListByName(this List list, string contentTypeName, bool defaultContent = false, bool searchContentTypeInSiteHierarchy = false)
         {
             Web web = list.ParentWeb;
-            ContentType contentType = GetContentTypeByName(web, contentTypeName);
+            ContentType contentType = GetContentTypeByName(web, contentTypeName, searchContentTypeInSiteHierarchy);
             AddContentTypeToList(list, contentType, defaultContent);
         }


Version number updated

Version number updated

--- AngleSharp/Properties/AssemblyInfo.cs
+++ AngleSharp/Properties/AssemblyInfo.cs
@@ -12,5 +12,5 @@
 [assembly: AssemblyCulture("")]
 [assembly: InternalsVisibleToAttribute("UnitTests")]
 [assembly: ComVisible(false)]
-[assembly: AssemblyVersion("0.3.6.*")]
-[assembly: AssemblyFileVersion("0.3.6")]+[assembly: AssemblyVersion("0.3.7.*")]
+[assembly: AssemblyFileVersion("0.3.7")]


Increasing the number of random values from just 0.

--- Assets/new_multiplayer/NewGameUnit.cs
+++ Assets/new_multiplayer/NewGameUnit.cs
@@ -86,7 +86,7 @@
 			this.properties.isAttackCooldownEnabled = false;
 			this.properties.isRecoveryEnabled = false;
 			this.properties.targetUnit = null;
-			this.properties.teamFactionID = (int)(Random.value); //This is never to be changed.
+			this.properties.teamFactionID = (int)(Random.value * 10f); //This is never to be changed.
 			this.updateProperties += NewProperty;
 			NewSelectionRing[] selectionRings = this.GetComponentsInChildren<NewSelectionRing>(true);
 			foreach (NewSelectionRing ring in selectionRings) {


some mapping fixes

some mapping fixes


Added LoadFromStream() methods to ComponentBase, so calendar components can be loaded directly


Fix one class svm to use shrinking heuristics.

Fixes issue #271.

--- Sources/Accord.MachineLearning/VectorMachines/Learning/OneclassSupportVectorLearning.cs
+++ Sources/Accord.MachineLearning/VectorMachines/Learning/OneclassSupportVectorLearning.cs
@@ -197,7 +197,7 @@
             var s = new FanChenLinQuadraticOptimization(alpha.Length, Q, zeros, ones)
             {
                 Tolerance = eps,
-                Shrinking = true,
+                Shrinking = this.shrinking,
                 Solution = alpha
             };


Update ReserveBankOfAustraliaTests.cs

Update ReserveBankOfAustraliaTests.cs

--- TIKSN.Framework.IntegrationTests/Finance/ForeignExchange/ReserveBankOfAustraliaTests.cs
+++ TIKSN.Framework.IntegrationTests/Finance/ForeignExchange/ReserveBankOfAustraliaTests.cs
@@ -17,43 +17,43 @@
         public ReserveBankOfAustraliaTests()
         {
             var services = new ServiceCollection();
-            services.AddMemoryCache();
-            services.AddSingleton<ICurrencyFactory, CurrencyFactory>();
-            services.AddSingleton<IRegionFactory, RegionFactory>();
-            services.AddSingleton<ITimeProvider, TimeProvider>();
+            _ = services.AddMemoryCache();
+            _ = services.AddSingleton<ICurrencyFactory, CurrencyFactory>();
+            _ = services.AddSingleton<IRegionFactory, RegionFactory>();
+            _ = services.AddSingleton<ITimeProvider, TimeProvider>();

             var serviceProvider = services.BuildServiceProvider();
-            _currencyFactory = serviceProvider.GetRequiredService<ICurrencyFactory>();
-            _timeProvider = serviceProvider.GetRequiredService<ITimeProvider>();
-        }
-
-        [Fact]
-        public async Task ConversionDirection001()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
+            this._currencyFactory = serviceProvider.GetRequiredService<ICurrencyFactory>();
+            this._timeProvider = serviceProvider.GetRequiredService<ITimeProvider>();
+        }
+
+        [Fact]
+        public async Task ConversionDirection001Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);

             var AustralianDollar = new CurrencyInfo(new System.Globalization.RegionInfo("AU"));
             var PoundSterling = new CurrencyInfo(new System.Globalization.RegionInfo("GB"));

             var BeforeInPound = new Money(PoundSterling, 100m);

-            var AfterInDollar = await Bank.ConvertCurrencyAsync(BeforeInPound, AustralianDollar, DateTime.Now, default);
+            var AfterInDollar = await Bank.ConvertCurrencyAsync(BeforeInPound, AustralianDollar, DateTime.Now, default).ConfigureAwait(true);

             Assert.True(BeforeInPound.Amount < AfterInDollar.Amount);
         }

         [Fact]
-        public async Task ConvertCurrency001()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default);
-
-            foreach (CurrencyPair pair in CurrencyPairs)
+        public async Task ConvertCurrency001Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default).ConfigureAwait(true);
+
+            foreach (var pair in CurrencyPairs)
             {
                 var Before = new Money(pair.BaseCurrency, 10m);

-                var After = await Bank.ConvertCurrencyAsync(Before, pair.CounterCurrency, DateTime.Now, default);
+                var After = await Bank.ConvertCurrencyAsync(Before, pair.CounterCurrency, DateTime.Now, default).ConfigureAwait(true);

                 Assert.True(After.Amount > decimal.Zero);
                 Assert.True(After.Currency == pair.CounterCurrency);
@@ -61,64 +61,64 @@
         }

         [Fact]
-        public async Task ConvertCurrency002()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default);
-
-            foreach (CurrencyPair pair in CurrencyPairs)
+        public async Task ConvertCurrency002Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default).ConfigureAwait(true);
+
+            foreach (var pair in CurrencyPairs)
             {
                 var Before = new Money(pair.BaseCurrency, 10m);

-                var rate = await Bank.GetExchangeRateAsync(pair, DateTime.Now, default);
-
-                var After = await Bank.ConvertCurrencyAsync(Before, pair.CounterCurrency, DateTime.Now, default);
+                var rate = await Bank.GetExchangeRateAsync(pair, DateTime.Now, default).ConfigureAwait(true);
+
+                var After = await Bank.ConvertCurrencyAsync(Before, pair.CounterCurrency, DateTime.Now, default).ConfigureAwait(true);

                 Assert.True(After.Amount == Before.Amount * rate);
             }
         }

         [Fact]
-        public async Task ConvertCurrency003()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default);
-
-            foreach (CurrencyPair pair in CurrencyPairs)
+        public async Task ConvertCurrency003Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default).ConfigureAwait(true);
+
+            foreach (var pair in CurrencyPairs)
             {
                 var Before = new Money(pair.BaseCurrency, 10m);

-                await
+                _ = await
                     Assert.ThrowsAsync<ArgumentException>(
                         async () =>
-                            await Bank.ConvertCurrencyAsync(Before, pair.CounterCurrency, DateTime.Now.AddMinutes(1d), default));
-            }
-        }
-
-        [Fact]
-        public async Task ConvertCurrency004()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default);
-
-            foreach (CurrencyPair pair in CurrencyPairs)
+                            await Bank.ConvertCurrencyAsync(Before, pair.CounterCurrency, DateTime.Now.AddMinutes(1d), default).ConfigureAwait(true)).ConfigureAwait(true);
+            }
+        }
+
+        [Fact]
+        public async Task ConvertCurrency004Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default).ConfigureAwait(true);
+
+            foreach (var pair in CurrencyPairs)
             {
                 var Before = new Money(pair.BaseCurrency, 10m);

-                await
+                _ = await
                     Assert.ThrowsAsync<ArgumentException>(
                         async () =>
-                            await Bank.ConvertCurrencyAsync(Before, pair.CounterCurrency, DateTime.Now.AddDays(-20d), default));
-            }
-        }
-
-        [Fact]
-        public async Task ConvertCurrency005()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
+                            await Bank.ConvertCurrencyAsync(Before, pair.CounterCurrency, DateTime.Now.AddDays(-20d), default).ConfigureAwait(true)).ConfigureAwait(true);
+            }
+        }
+
+        [Fact]
+        public async Task ConvertCurrency005Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);

             var Armenia = new System.Globalization.RegionInfo("AM");
             var Belarus = new System.Globalization.RegionInfo("BY");
@@ -128,26 +128,26 @@

             var Before = new Money(ArmenianDram, 10m);

-            await
+            _ = await
                     Assert.ThrowsAsync<ArgumentException>(
                         async () =>
-                            await Bank.ConvertCurrencyAsync(Before, BelarusianRuble, DateTime.Now, default));
-        }
-
-        [Fact]
-        public async Task Fetch001()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            await Bank.GetExchangeRatesAsync(DateTimeOffset.Now, default);
-        }
-
-        [Fact]
-        public async Task GetCurrencyPairs001()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default);
+                            await Bank.ConvertCurrencyAsync(Before, BelarusianRuble, DateTime.Now, default).ConfigureAwait(true)).ConfigureAwait(true);
+        }
+
+        [Fact]
+        public async Task Fetch001Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            _ = await Bank.GetExchangeRatesAsync(DateTimeOffset.Now, default).ConfigureAwait(true);
+        }
+
+        [Fact]
+        public async Task GetCurrencyPairs001Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default).ConfigureAwait(true);

             Assert.Contains(CurrencyPairs, P => P.ToString() == "USD/AUD");
             Assert.Contains(CurrencyPairs, P => P.ToString() == "CNY/AUD");
@@ -191,13 +191,13 @@
         }

         [Fact]
-        public async Task GetCurrencyPairs002()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default);
-
-            foreach (CurrencyPair pair in CurrencyPairs)
+        public async Task GetCurrencyPairs002Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default).ConfigureAwait(true);
+
+            foreach (var pair in CurrencyPairs)
             {
                 var reversedPair = new CurrencyPair(pair.CounterCurrency, pair.BaseCurrency);

@@ -206,86 +206,86 @@
         }

         [Fact]
-        public async Task GetCurrencyPairs003()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
+        public async Task GetCurrencyPairs003Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);

             var PairSet = new System.Collections.Generic.HashSet<CurrencyPair>();

-            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default);
-
-            foreach (CurrencyPair pair in CurrencyPairs)
-            {
-                PairSet.Add(pair);
+            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default).ConfigureAwait(true);
+
+            foreach (var pair in CurrencyPairs)
+            {
+                _ = PairSet.Add(pair);
             }

             Assert.True(PairSet.Count == CurrencyPairs.Count());
         }

         [Fact]
-        public async Task GetCurrencyPairs004()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            await
+        public async Task GetCurrencyPairs004Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            _ = await
                 Assert.ThrowsAsync<ArgumentException>(
                     async () =>
-                        await Bank.GetCurrencyPairsAsync(DateTime.Now.AddMinutes(10), default));
-        }
-
-        [Fact]
-        public async Task GetCurrencyPairs005()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            await Assert.ThrowsAsync<ArgumentException>(
+                        await Bank.GetCurrencyPairsAsync(DateTime.Now.AddMinutes(10), default).ConfigureAwait(true)).ConfigureAwait(true);
+        }
+
+        [Fact]
+        public async Task GetCurrencyPairs005Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            _ = await Assert.ThrowsAsync<ArgumentException>(
                     async () =>
-                        await Bank.GetCurrencyPairsAsync(DateTime.Now.AddDays(-20), default));
-        }
-
-        [Fact]
-        public async Task GetExchangeRate001()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default);
-
-            foreach (CurrencyPair pair in CurrencyPairs)
-            {
-                Assert.True(await Bank.GetExchangeRateAsync(pair, DateTime.Now, default) > decimal.Zero);
-            }
-        }
-
-        [Fact]
-        public async Task GetExchangeRate002()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default);
-
-            foreach (CurrencyPair pair in CurrencyPairs)
-            {
-                await Assert.ThrowsAsync<ArgumentException>(async () => await Bank.GetExchangeRateAsync(pair, DateTime.Now.AddMinutes(1d), default));
-            }
-        }
-
-        [Fact]
-        public async Task GetExchangeRate003()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
-
-            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default);
-
-            foreach (CurrencyPair pair in CurrencyPairs)
-            {
-                await Assert.ThrowsAsync<ArgumentException>(async () => await Bank.GetExchangeRateAsync(pair, DateTime.Now.AddDays(-20d), default));
-            }
-        }
-
-        [Fact]
-        public async Task GetExchangeRate004()
-        {
-            var Bank = new ReserveBankOfAustralia(_currencyFactory, _timeProvider);
+                        await Bank.GetCurrencyPairsAsync(DateTime.Now.AddDays(-20), default).ConfigureAwait(true)).ConfigureAwait(true);
+        }
+
+        [Fact]
+        public async Task GetExchangeRate001Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default).ConfigureAwait(true);
+
+            foreach (var pair in CurrencyPairs)
+            {
+                Assert.True(await Bank.GetExchangeRateAsync(pair, DateTime.Now, default).ConfigureAwait(true) > decimal.Zero);
+            }
+        }
+
+        [Fact]
+        public async Task GetExchangeRate002Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default).ConfigureAwait(true);
+
+            foreach (var pair in CurrencyPairs)
+            {
+                _ = await Assert.ThrowsAsync<ArgumentException>(async () => await Bank.GetExchangeRateAsync(pair, DateTime.Now.AddMinutes(1d), default).ConfigureAwait(true)).ConfigureAwait(true);
+            }
+        }
+
+        [Fact]
+        public async Task GetExchangeRate003Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);
+
+            var CurrencyPairs = await Bank.GetCurrencyPairsAsync(DateTime.Now, default).ConfigureAwait(true);
+
+            foreach (var pair in CurrencyPairs)
+            {
+                _ = await Assert.ThrowsAsync<ArgumentException>(async () => await Bank.GetExchangeRateAsync(pair, DateTime.Now.AddDays(-20d), default).ConfigureAwait(true)).ConfigureAwait(true);
+            }
+        }
+
+        [Fact]
+        public async Task GetExchangeRate004Async()
+        {
+            var Bank = new ReserveBankOfAustralia(this._currencyFactory, this._timeProvider);

             var Armenia = new System.Globalization.RegionInfo("AM");
             var Belarus = new System.Globalization.RegionInfo("BY");
@@ -295,7 +295,7 @@

             var pair = new CurrencyPair(ArmenianDram, BelarusianRuble);

-            await Assert.ThrowsAsync<ArgumentException>(async () => await Bank.GetExchangeRateAsync(pair, DateTime.Now, default));
+            _ = await Assert.ThrowsAsync<ArgumentException>(async () => await Bank.GetExchangeRateAsync(pair, DateTime.Now, default).ConfigureAwait(true)).ConfigureAwait(true);
         }
     }
 }