255: insertIndex

255: insertIndex

--- src/SharpConnect.MySql/0_Public_TaskAsync/MySqlBasicAsyncTasks.cs
+++ src/SharpConnect.MySql/0_Public_TaskAsync/MySqlBasicAsyncTasks.cs
@@ -62,10 +62,10 @@
             {
                 cmd.ExecuteReader(reader =>
                 {
-
+
                     readerReady(reader);
                     ch.Next();
-
+
                 });

             }, false);
@@ -175,40 +175,59 @@

     public class TaskChain
     {
+        /// <summary>
+        /// latest run task index
+        /// </summary>
         int currentIndex = -1;
+        int insertIndex = -1;
         Action onFinish;
         Action onBeginTask;
         bool pleaseStop;
         List<BasicTaskBase> taskList = new List<BasicTaskBase>();

-        public ActionTask AddTask(Action a, bool autoCallNext = true)
-        {
-            var actionTask = new ActionTask(this, a, autoCallNext);
-            if (currentIndex < 0)
+
+        void AddTask(BasicTaskBase actionTask)
+        {
+            if (insertIndex < 0)
             {
                 //un-start so
                 taskList.Add(actionTask);
             }
             else
             {
-                if (currentIndex == taskList.Count - 1)
+                if (insertIndex == taskList.Count - 1)
                 {
                     //append to last task
                     taskList.Add(actionTask);
                 }
                 else
                 {
-                    taskList.Insert(currentIndex + 1, actionTask);
-                }
-            }
+                    taskList.Insert(insertIndex + 1, actionTask);
+                }
+
+                insertIndex++;
+            }
+        }
+
+        public ActionTask AddTask(Action a, bool autoCallNext = true)
+        {
+            var actionTask = new ActionTask(this, a, autoCallNext);
+            AddTask(actionTask);
             return actionTask;
+        }
+        public void Wait(Action<WaitState> action)
+        {
+            AutoCallNext = false;
+            WaitTask waitTask = new WaitTask(this, action);
+            AddTask(waitTask);
         }
         public void Start()
         {
             pleaseStop = false;
             if (taskList.Count > 0)
             {
-                currentIndex = 0;
+                //update insert index= current index
+                insertIndex = currentIndex = 0;
                 if (onBeginTask != null)
                 {
                     onBeginTask();
@@ -241,7 +260,10 @@
             {
                 if (currentIndex + 1 < taskList.Count)
                 {
-                    currentIndex++;
+
+                    insertIndex = (currentIndex++);
+                    //update insert index= current index
+
                     if (onBeginTask != null)
                     {
                         onBeginTask();
@@ -273,33 +295,12 @@

             }
         }
-
-
         public bool AutoCallNext
         {
             get;
             set;
         }
-        public void Wait(Action<WaitState> action)
-        {
-            AutoCallNext = false;
-            if (currentIndex == 0)
-            {
-                taskList.Add(new WaitTask(this, action));
-            }
-            else
-            {
-                if (currentIndex == taskList.Count - 1)
-                {
-                    //append to last task
-                    taskList.Add(new WaitTask(this, action));
-                }
-                else
-                {
-                    taskList.Insert(currentIndex + 1, new WaitTask(this, action));
-                }
-            }
-        }
+
     }
     public class WaitState
     {


some compat improvements to the PDF file plotter

--- BCad/FilePlotters/PdfFilePlotter.cs
+++ BCad/FilePlotters/PdfFilePlotter.cs
@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.IO;
+using System.Linq;
 using System.Text;
 using BCad.Entities;

@@ -25,20 +26,27 @@
             OutputHeader(width, height);
             var body = new StringBuilder();
             body.AppendLine("/DeviceRGB CS");
+            // set line width with: body.AppendLine("0.5 w");  // 1 == 1/72"
             SetColor(body, CadColor.Black, doStroke: false);
-            foreach (var entity in entities)
+            foreach (var group in entities.GroupBy(e => e.OriginalLayer).OrderBy(l => l.Key.Name))
             {
-                switch (entity.Kind)
+                var layer = group.Key;
+                body.AppendLine();
+                body.AppendLine($"% layer '{layer.Name}'");
+                foreach (var entity in group)
                 {
-                    case EntityKind.Line:
-                        var line = (ProjectedLine)entity;
-                        SetColor(body, line.OriginalLine.Color ?? line.OriginalLayer.Color ?? AutoColor);
-                        body.AppendLine($"{line.P1.X:f} {line.P1.Y:f} m");
-                        body.AppendLine($"{line.P2.X:f} {line.P2.Y:f} l");
-                        break;
-                    default:
-                        // TODO:
-                        break;
+                    switch (entity.Kind)
+                    {
+                        case EntityKind.Line:
+                            var line = (ProjectedLine)entity;
+                            SetColor(body, line.OriginalLine.Color ?? line.OriginalLayer.Color ?? AutoColor);
+                            body.AppendLine($"{line.P1.X:f} {line.P1.Y:f} m");
+                            body.AppendLine($"{line.P2.X:f} {line.P2.Y:f} l");
+                            break;
+                        default:
+                            // TODO:
+                            break;
+                    }
                 }
             }
             body.AppendLine("S"); // final stroke
@@ -53,14 +61,15 @@
             _builder.AppendLine();
             _builder.AppendLine("xref");
             var xrefLoc = CurrentOffset;
-            _builder.AppendLine("0 5");
-            _builder.AppendLine($"0000000000 {ushort.MaxValue} f");
+            var xrefCount = _objectOffsets.Count + 1; // + 1 to account for the required zero-id free object
+            _builder.AppendLine($"0 {xrefCount}");
+            _builder.AppendLine($"0000000000 {ushort.MaxValue} f"); // said required zero-id free object
             for (int i = 0; i < _objectOffsets.Count; i++)
             {
                 _builder.AppendLine($"{_objectOffsets[i].ToString().PadLeft(10, '0')} {(0).ToString().PadLeft(5, '0')} n");
             }

-            _builder.AppendLine("trailer <</Size 6 /Root 1 0 R>>");
+            _builder.AppendLine($"trailer <</Size {xrefCount} /Root 1 0 R>>");
             _builder.AppendLine("startxref");
             _builder.AppendLine(xrefLoc.ToString());
             _builder.AppendLine("%%EOF");


Deterministic sorting

Deterministic sorting

--- Griddly.Mvc/Results/QueryableResult.cs
+++ Griddly.Mvc/Results/QueryableResult.cs
@@ -12,17 +12,24 @@
     {
         IQueryable<T> _result;
         Func<IQueryable<T>, IQueryable<T>> _massage = null;
-
-        public QueryableResult(IQueryable<T> result, string viewName = null, Func<IQueryable<T>, IQueryable<T>> massage = null)
+        string _finalSortField;
+
+        static readonly bool _typeHasId = typeof(T).GetProperty("Id") != null;
+
+        public QueryableResult(IQueryable<T> result, string viewName = null, Func<IQueryable<T>, IQueryable<T>> massage = null, string finalSortField = null)
             : base(viewName)
         {
             _result = result;
             _massage = massage;
+            _finalSortField = finalSortField;
+
+            if (_finalSortField == null && _typeHasId)
+                _finalSortField = "Id";
         }

         public override IEnumerable<T> GetAll(SortField[] sortFields)
         {
-            IQueryable<T> sortedQuery = ApplySortFields(_result, sortFields);
+            IQueryable<T> sortedQuery = ApplySortFields(_result, sortFields, _finalSortField);

             if (_massage != null)
                 sortedQuery = _massage(sortedQuery);
@@ -32,7 +39,7 @@

         public override IList<T> GetPage(int pageNumber, int pageSize, SortField[] sortFields)
         {
-            IQueryable<T> sortedQuery = ApplySortFields(_result, sortFields);
+            IQueryable<T> sortedQuery = ApplySortFields(_result, sortFields, _finalSortField);

             if (_massage != null)
                 sortedQuery = _massage(sortedQuery);
@@ -102,7 +109,7 @@

         public override IEnumerable<P> GetAllForProperty<P>(string propertyName, SortField[] sortFields)
         {
-            return ApplySortFields(_result, sortFields)
+            return ApplySortFields(_result, sortFields, _finalSortField)
                 .Select<P>(propertyName, null);
         }

@@ -111,7 +118,7 @@
             return _result.Count();
         }

-        protected static IQueryable<T> ApplySortFields(IQueryable<T> source, SortField[] sortFields)
+        protected static IQueryable<T> ApplySortFields(IQueryable<T> source, SortField[] sortFields, string finalSortField)
         {
             IOrderedQueryable<T> sortedQuery = null;

@@ -136,6 +143,14 @@
                             sortedQuery = ThenByDescending(sortedQuery, sortField.Field);
                     }
                 }
+            }
+
+            if (finalSortField != null)
+            {
+                if (sortedQuery == null)
+                    sortedQuery = OrderByDescending(source, finalSortField);
+                else
+                    sortedQuery = ThenByDescending(sortedQuery, finalSortField);
             }

             return sortedQuery ?? source;


Simplifying IsVector helper method

Simplifying IsVector helper method

--- src/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs
+++ src/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs
@@ -734,9 +734,8 @@
         public static bool IsVector(this Type type)
         {
             // Unfortunately, the IsSzArray property of System.Type is inaccessible to us,
-            // but the ToString representation of the type is sufficient to differentiate
-            // a vector (X[]) from a multi-dimensional array of rank 1 (X[*]).
-            return type.GetArrayRank() == 1 && type.ToString().EndsWith("[]");
+            // so we use a little equality comparison trick instead:
+            return type == type.GetElementType().MakeArrayType();
         }
     }
 }


ForLoop codeDom

ForLoop codeDom

--- Guerilla/CodeDom/GuerillaBlockClass.cs
+++ Guerilla/CodeDom/GuerillaBlockClass.cs
@@ -141,33 +141,71 @@
                 new CodeVariableDeclarationStatement(binaryReaderReference,
                    binaryReader, new CodeObjectCreateExpression(binaryReaderReference));
             method.Statements.Add(binaryReaderVariableDeclaration);
+            var binaryReaderVariable = new CodeVariableReferenceExpression(binaryReader);

             foreach (CodeObject codeObject in _targetClass.Members)
             {
                 if (!(codeObject is CodeMemberField)) continue;
-
-                //
                 var field = (CodeMemberField)codeObject;
-

                 var systemType = Type.GetType(field.Type.BaseType);
-                if(systemType != null)
+                if (systemType != null)
                 {
-                    var methodName = BinaryIOReflection.GetBinaryReaderMethodName(systemType);
-                    var binaryReaderVariable = new CodeVariableReferenceExpression(binaryReader);
-
-                    //this.Name
-                    var fieldReference = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), field.Name);
-                    var fieldAssignment = new CodeAssignStatement(fieldReference,
-                        new CodeMethodInvokeExpression(binaryReaderVariable, methodName, new CodeArgumentReferenceExpression()));
-                    method.Statements.Add(fieldAssignment);
-
+                    //  Single dimensional arrays
+                    if (field.Type.ArrayRank == 1)
+                    {
+                        var fieldInitializer = (CodeArrayCreateExpression) field.InitExpression;
+                        var fieldReference = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(),
+                            field.Name);
+                        if (systemType == typeof (byte))
+                        {
+                            var methodName = StaticReflection.GetMemberName((BinaryReader item) => item.ReadBytes(0));
+                            var fieldAssignment = new CodeAssignStatement(fieldReference,
+                                new CodeMethodInvokeExpression(binaryReaderVariable, methodName,
+                                    new CodePrimitiveExpression(fieldInitializer.Size)));
+                            method.Statements.Add(fieldAssignment);
+                        }
+                        else if (systemType == typeof (short))
+                        {
+                            var methodName = StaticReflection.GetMemberName((BinaryReader item) => item.ReadInt16());
+                            var loopVariable = new CodeVariableReferenceExpression("i");
+                            var forLoop = new CodeIterationStatement(
+                                new CodeAssignStatement(loopVariable, new CodePrimitiveExpression(0)),
+                                new CodeBinaryOperatorExpression(loopVariable, CodeBinaryOperatorType.LessThan,
+                                    new CodePrimitiveExpression(fieldInitializer.Size)),
+                                new CodeAssignStatement(loopVariable,
+                                    new CodeBinaryOperatorExpression(loopVariable, CodeBinaryOperatorType.Add,
+                                        new CodePrimitiveExpression(1))),
+                                new CodeStatement[]
+                                {
+                                    //  loop block
+                                    new CodeAssignStatement(
+                                        new CodeArrayIndexerExpression(fieldReference, loopVariable),
+                                        new CodeMethodInvokeExpression(binaryReaderVariable, methodName,
+                                            new CodeArgumentReferenceExpression()))
+                                }
+                                );
+                            method.Statements.Add(forLoop);
+                        }
+                    }
+                    else
+                    {
+                        var methodName = BinaryIOReflection.GetBinaryReaderMethodName(systemType);
+
+                        //this.Name
+                        var fieldReference = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(),
+                            field.Name);
+                        var fieldAssignment = new CodeAssignStatement(fieldReference,
+                            new CodeMethodInvokeExpression(binaryReaderVariable, methodName,
+                                new CodeArgumentReferenceExpression()));
+                        method.Statements.Add(fieldAssignment);
+                    }
                 }
             }
             _targetClass.Members.Add(method);
         }

-        private void GenerateFields(IList<MoonfishTagField> fields)
+        private void GenerateFields(IEnumerable<MoonfishTagField> fields)
         {
             foreach (var field in fields)
             {
@@ -388,7 +426,9 @@
                     case MoonfishFieldType.FieldSkip:
                     case MoonfishFieldType.FieldPad:
                     {
-                        var member = GenerateCodeMemberField<byte>(field, MemberAttributes.Private);
+                        var member = GenerateCodeMemberField<byte[]>(field, MemberAttributes.Private);
+
+                        member.InitExpression = new CodeArrayCreateExpression(member.Type, field.Count);
                         _targetClass.Members.Add(member);
                     }
                         break;


Honor user supplied point size

Honor user supplied point size

--- Gui/RadioButton/RadioButtonViewText.cs
+++ Gui/RadioButton/RadioButtonViewText.cs
@@ -58,7 +58,7 @@
 			radioCircle = new RadioCircleWidget();
 			this.AddChild(radioCircle);

-			labelTextWidget = new TextWidget(label, fontSize);
+			labelTextWidget = new TextWidget(label, pointSize: fontSize);
 			this.AddChild(labelTextWidget);
 		}


Move.

Move.

--- src/Workspaces/Core/Portable/Rename/LightweightRenameLocations.cs
+++ src/Workspaces/Core/Portable/Rename/LightweightRenameLocations.cs
@@ -36,8 +36,6 @@
         private readonly SerializableReferenceLocation[]? _implicitLocations;
         private readonly SerializableSymbolAndProjectId[]? _referencedSymbols;

-
-
         /// <summary>
         /// Cancellation controlling a keep-alive communication channel we have with the OOP service. We do this to ensure
         /// that for the entirety of the inline-rename session
@@ -52,10 +50,10 @@
             SerializableReferenceLocation[]? implicitLocations,
             SerializableSymbolAndProjectId[]? referencedSymbols)
         {
+            Contract.ThrowIfNull(locations);
             Solution = solution;
             Options = options;
             FallbackOptions = fallbackOptions;
-            Contract.ThrowIfNull(locations);
             Locations = locations;
             _implicitLocations = implicitLocations;
             _referencedSymbols = referencedSymbols;


Chang the display name for SSD

Chang the display name for SSD

--- Battery-Commander.Web/Models/SSD.cs
+++ Battery-Commander.Web/Models/SSD.cs
@@ -92,18 +92,24 @@

         public class SSDStatusModel
         {
+            [Display(Name = "Updated")]
             public DateTimeOffset? AsOf { get; set; }

             // Humanized time since

+            [Display(Name = "SSD 1")]
             public decimal? SSD_1 { get; set; }

+            [Display(Name = "SSD 2")]
             public decimal? SSD_2 { get; set; }

+            [Display(Name = "SSD 3")]
             public decimal? SSD_3 { get; set; }

+            [Display(Name = "SSD 4")]
             public decimal? SSD_4 { get; set; }

+            [Display(Name = "SSD 5")]
             public decimal? SSD_5 { get; set; }
         }
     }


cleanup

cleanup

--- BitSharp.Daemon/BlockchainDaemon.cs
+++ BitSharp.Daemon/BlockchainDaemon.cs
@@ -51,10 +51,7 @@

         private readonly CancellationTokenSource shutdownToken;

-        private readonly WorkerMethod validationWorker;
         private readonly WorkerMethod blockchainWorker;
-        private readonly WorkerMethod validateCurrentChainWorker;
-        private readonly WorkerMethod writeBlockchainWorker;
         private readonly ChainingWorker chainingWorker;
         private readonly TargetChainWorker targetChainWorker;

@@ -82,17 +79,8 @@
             this.cacheContext.ChainedBlockCache.OnModification += OnChainedBlockModification;

             // create workers
-            this.validationWorker = new WorkerMethod("BlockchainDaemon.ValidationWorker", ValidationWorker,
-                runOnStart: true, waitTime: TimeSpan.FromSeconds(10), maxIdleTime: TimeSpan.FromMinutes(5));
-
             this.blockchainWorker = new WorkerMethod("BlockchainDaemon.BlockchainWorker", BlockchainWorker,
                 runOnStart: true, waitTime: TimeSpan.FromSeconds(1), maxIdleTime: TimeSpan.FromMinutes(5));
-
-            this.validateCurrentChainWorker = new WorkerMethod("BlockchainDaemon.ValidateCurrentChainWorker", ValidateCurrentChainWorker,
-                runOnStart: true, waitTime: TimeSpan.FromMinutes(30), maxIdleTime: TimeSpan.FromMinutes(30));
-
-            this.writeBlockchainWorker = new WorkerMethod("BlockchainDaemon.WriteBlockchainWorker", WriteBlockchainWorker,
-                runOnStart: true, waitTime: TimeSpan.FromMinutes(5), maxIdleTime: TimeSpan.FromMinutes(30));

             this.chainingWorker = new ChainingWorker(rules, cacheContext);
             this.targetChainWorker = new TargetChainWorker(rules, cacheContext);
@@ -136,10 +124,7 @@
                 //TODO LoadExistingState();

                 // startup workers
-                //TODO this.validationWorker.Start();
                 this.blockchainWorker.Start();
-                //TODO this.validateCurrentChainWorker.Start();
-                //TODO this.writeBlockchainWorker.Start();
                 this.chainingWorker.Start();
                 this.targetChainWorker.Start();
             }
@@ -166,10 +151,7 @@
             // cleanup workers
             new IDisposable[]
             {
-                this.validationWorker,
                 this.blockchainWorker,
-                this.validateCurrentChainWorker,
-                this.writeBlockchainWorker,
                 this.chainingWorker,
                 this.targetChainWorker,
                 this.shutdownToken
@@ -361,9 +343,6 @@
                                 this.blockchainWorker.NotifyWork();
                                 cancelToken.Cancel();
                             }
-
-                            // let the blockchain writer know there is new work
-                            this.writeBlockchainWorker.NotifyWork();
                         });
                 }
             }
@@ -385,12 +364,6 @@

             // collect after processing
             //GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, blocking: true);
-
-            // whenever the chain is successfully advanced, keep looking for more
-            //this.blockchainWorker.NotifyWork();
-
-            // kick off a blockchain revalidate after update
-            this.validateCurrentChainWorker.NotifyWork();
         }

         private void WriteBlockchainWorker()


rename

rename

--- _Src/Container/Implementation/ComponentsRunner.cs
+++ _Src/Container/Implementation/ComponentsRunner.cs
@@ -27,12 +27,12 @@
 					lock (component)
 						if (!component.runCalled)
 						{
-							var serviceInstance = new ServiceName(instance.GetType(), containerService.FinalUsedContracts);
+							var name = new ServiceName(instance.GetType(), containerService.FinalUsedContracts);
 							if (infoLogger != null)
-								infoLogger(serviceInstance, "run started");
+								infoLogger(name, "run started");
 							componentInstance.Run();
 							if (infoLogger != null)
-								infoLogger(serviceInstance, "run finished");
+								infoLogger(name, "run finished");
 							component.runCalled = true;
 						}
 			}


Changed HeaderText to Upper case

Changed HeaderText to Upper case

--- CodeHub/ViewModels/MainViewmodel.cs
+++ CodeHub/ViewModels/MainViewmodel.cs
@@ -99,7 +99,7 @@
                                             DestPage =typeof(MyReposView) },
                 };

-            HeaderText = HamItems[0].Label;
+            HeaderText = HamItems[0].Label.ToUpper();
             HamItems[0].IsSelected = true;

         }
@@ -277,7 +277,7 @@
         }
         public void setHeadertext(string pageName)
         {
-            HeaderText = pageName;
+            HeaderText = pageName.ToUpper();
         }

         public void mainFrame_Navigated(object sender, NavigationEventArgs e)


Moved displayResult inside try to handle errors while enumerating

--- IntelliFind/IntelliFindControl.xaml.cs
+++ IntelliFind/IntelliFindControl.xaml.cs
@@ -67,22 +67,22 @@
                 var scriptGlobals = new ScriptGlobals(_cancellationTokenSource.Token);

                 var scriptText = CheckBoxSelectMode.IsChecked ?? false ? TextBoxInput.SelectedText : TextBoxInput.Text;
-                object scriptResult;
                 try
                 {
-                    scriptResult = await Task.Run(() => CSharpScriptWrapper.EvaluateAsync<object>(
+                    var scriptResult = await Task.Run(() => CSharpScriptWrapper.EvaluateAsync<object>(
                         scriptText,
                         scriptGlobals,
                         ReferencedAssemblies,
                         Usings,
                         _cancellationTokenSource.Token), _cancellationTokenSource.Token);
+
+                    DisplayResult(scriptResult);
                 }
                 catch (Exception ex)
                 {
-                    scriptResult = ex;
+                    DisplayResult(ex);
                 }

-                DisplayResult(scriptResult);
             }
             finally
             {
@@ -97,7 +97,8 @@
         {
             typeof (System.Object),
             typeof (System.Linq.Enumerable),
-            typeof (Microsoft.CodeAnalysis.Workspace),
+            typeof (Microsoft.CodeAnalysis.Workspace),
+            typeof (Microsoft.CodeAnalysis.ModelExtensions),
             typeof (Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode),
             typeof (Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax),
         };


[feature] JetImageLoaderConfig added check for MemoryCacheImpl

--- JetImageLoader/JetImageLoaderConfig.cs
+++ JetImageLoader/JetImageLoaderConfig.cs
@@ -83,6 +83,11 @@

             private void CheckParams()
             {
+                if ((CacheMode == CacheMode.MemoryAndStorageCache || CacheMode == CacheMode.OnlyMemoryCache) && MemoryCacheImpl == null)
+                {
+                    throw new ArgumentException("CacheMode " + CacheMode + " requires MemoryCacheImpl");
+                }
+
                 if ((CacheMode == CacheMode.MemoryAndStorageCache || CacheMode == CacheMode.OnlyStorageCache) && StorageCacheImpl == null)
                 {
                     throw new ArgumentException("CacheMode " + CacheMode + " requires StorageCacheImpl");


Update Microsoft.NET.Sdk.Functions to alpha5

--- Kudu.Core/Functions/FunctionManager.cs
+++ Kudu.Core/Functions/FunctionManager.cs
@@ -471,7 +471,7 @@
         {
             const string microsoftAzureWebJobsVersion = "2.1.0-beta1";
             const string microsoftAzureWebJobsExtensionsHttpVersion = "1.0.0-beta1";
-            const string microsoftNETSdkFunctionsVersion = "1.0.0-alpha4";
+            const string microsoftNETSdkFunctionsVersion = "1.0.0-alpha5";

             var csprojFile = new StringBuilder();
             csprojFile.AppendLine(


remove unused using statement

remove unused using statement

--- LogicAppTemplate/TemplateGenerator.cs
+++ LogicAppTemplate/TemplateGenerator.cs
@@ -2,10 +2,8 @@
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
-using System.Collections.Generic;
 using System.IO;
 using System.Linq;
-using System.Management.Automation;
 using System.Text;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;


Add 'unwind.wast' spec test to whitelist

--- unit-tests/Scripts/ScriptTests.cs
+++ unit-tests/Scripts/ScriptTests.cs
@@ -45,6 +45,7 @@
             "traps.wast",
             "type.wast",
             "unreached-invalid.wast",
+            "unwind.wast",
             "utf8-custom-section-id.wast",
             "utf8-import-field.wast",
             "utf8-import-module.wast",
@@ -66,7 +67,7 @@

         private void RunSpecScript(string scriptPath)
         {
-            var log = new TestLog(new[] { Severity.Error }, NullLog.Instance);
+            var log = new TestLog(new[] { Severity.Error }, Pixie.Terminal.TerminalLog.Acquire());
             var runner = new ScriptRunner(log);
             var scriptText = File.ReadAllText(scriptPath);
             runner.Run(scriptText, scriptPath);


Fixes

Fixes

--- MCBTask/MCBTask.ButtonRacing/Form1.cs
+++ MCBTask/MCBTask.ButtonRacing/Form1.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Diagnostics;
 using System.Drawing;
 using System.Threading;
@@ -9,77 +10,57 @@
 {
     public partial class Form1 : Form
     {
-        private CancellationTokenSource _cts;
-        private CancellationToken _token;
+        private readonly CancellationTokenSource _cts;
+        private readonly CancellationToken _token;
+
+        private readonly List<Button> _buttons;
+        private Task[] _tasks;
+
         public Form1()
         {
             InitializeComponent();
             _cts = new CancellationTokenSource();
             _token = _cts.Token;
+            _buttons = new List<Button> { Racer0, Racer1, Racer2, Racer3 };
         }

         private void StartRaceButon_Click(object sender, EventArgs e)
         {
-            var task0 = Task.Factory.StartNew(() => GoTask(Racer0), _token);
-            var task1 = Task.Factory.StartNew(() => GoTask(Racer1), _token);
-            var task2 = Task.Factory.StartNew(() => GoTask(Racer2), _token);
-            var task3 = Task.Factory.StartNew(() => GoTask(Racer3), _token);
+            var index = 0;
+            _tasks = new Task[_buttons.Count];
+            foreach (var btn in _buttons)
+            {
+                _tasks[index] = Task.Factory.StartNew(() => GoTask(btn), _token);
+                ++index;
+            }
         }

         private void GoTask(Control button)
         {
-            while (button.Location.X + button.Width < Width)
+            var x = button.Location.X;
+            var width = button.Width;
+            while (x + width < Width)
             {
                 var rand = new Random();
+                x += rand.Next(1, 50) / 4;
                 button.Invoke((Action)(() =>
                 {
                     var rnd = rand.Next(1, 50) / 4;
                     Debug.WriteLine(button.Name + ":" + rnd);
-                    button.Location = new Point(button.Location.X + rnd, button.Location.Y);
+                    button.Location = new Point(x + rnd, button.Location.Y);
                 }));
                 Thread.CurrentThread.Join(70);
             }
-        }
-        private void Go(Control button)
-        {
-            ThreadPool.QueueUserWorkItem(sender =>
-            {
-
-                var btn = (Button)sender;
-                while (btn.Location.X + btn.Width < Width && !_cts.Token.IsCancellationRequested)
-                {
-                    var rand = new Random();
-                    btn.Invoke((Action)(() =>
-                    {
-                        var rnd = rand.Next(1, 50) / 5;
-                        Debug.WriteLine(button.Name + ":" + rnd);
-                        btn.Location = new Point(btn.Location.X + rnd, btn.Location.Y);
-                    }));
-                    Thread.CurrentThread.Join(70);
-                }
-            }, button);
         }

         private void ResetRaceButton_Click(object sender, EventArgs e)
         {
             _cts.Cancel();
-            Racer0.Location = new Point(12, Racer0.Location.Y);
-            Racer1.Location = new Point(12, Racer1.Location.Y);
-            Racer2.Location = new Point(12, Racer2.Location.Y);
-            Racer3.Location = new Point(12, Racer3.Location.Y);
-        }
-
-
-        private static void Reset(Button button)
-        {
-            ThreadPool.QueueUserWorkItem(sender =>
+            Task.WaitAll(_tasks);
+            foreach (var button in _buttons)
             {
-                var btn = (Button)sender;
-                btn.Invoke((Action)(() =>
-                {
-                    btn.Location = new Point(12, btn.Location.Y);
-                }));
-            }, button);
+                button.Location = new Point(12, button.Location.Y);
+            }
         }
     }
 }


Changed version number.

Changed version number.

--- MathParser/Properties/AssemblyInfo.cs
+++ MathParser/Properties/AssemblyInfo.cs
@@ -11,7 +11,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("Artem Los")]
 [assembly: AssemblyProduct("MathParser")]
-[assembly: AssemblyCopyright("Copyright © 2012-2014 Artem Los")]
+[assembly: AssemblyCopyright("Copyright © 2012-2015 Artem Los")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

@@ -27,6 +27,6 @@
 // Можно задать все значения или принять номер построения и номер редакции по умолчанию,
 // используя "*", как показано ниже:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.8.1")]
-[assembly: AssemblyFileVersion("1.0.8.1")]
+[assembly: AssemblyVersion("1.0.10.1")]
+[assembly: AssemblyFileVersion("1.0.10.1")]
 [assembly: NeutralResourcesLanguageAttribute("")]


rack.uri_scheme (cherry picked from commit aeebcb0ec8247684a62e0a023a94fb3bb23e49b6)

--- Merlin/Main/Hosts/IronRack/Request.cs
+++ Merlin/Main/Hosts/IronRack/Request.cs
@@ -20,10 +20,7 @@
             }

             // http or https
-            var splitUrl = request.RawUrl.Split(new string[] { "://" }, StringSplitOptions.None);
-            if (splitUrl.Length > 0) {
-                this.scheme = splitUrl[0];
-            }
+            this.scheme = request.Url.Scheme;

             // go through the headers of the request and move to a more tenable
             // storage location than NameValueCollection


Thougts on retrieving deleted items in history

Also need some considerations around how we can provide means to delete
all history for an item.

--- DotJEM.Json.Storage/IStorageArea.cs
+++ DotJEM.Json.Storage/IStorageArea.cs
@@ -28,8 +28,14 @@

     public interface IStorageAreaHistory
     {
+        IEnumerable<JObject> GetDeleted(string contentType, DateTime? from = null, DateTime? to = null);
         IEnumerable<JObject> Get(string contentType, Guid guid, DateTime? from = null, DateTime? to = null);
         void Insert(Guid id, string contentType, DateTime created, JObject obj);
+    }
+
+    public enum History
+    {
+        Update, Delete
     }

     public class SqlServerStorageAreaHistory : IStorageAreaHistory
@@ -44,6 +50,11 @@
             throw new NotImplementedException();
         }

+        public IEnumerable<JObject> GetDeleted(string contentType, DateTime? @from = null, DateTime? to = null)
+        {
+            throw new NotImplementedException();
+        }
+
         public void Insert(Guid id, string contentType, DateTime created, JObject obj)
         {

@@ -55,6 +66,11 @@
         public IEnumerable<JObject> Get(string contentType, Guid guid, DateTime? @from = null, DateTime? to = null)
         {
             throw new  InvalidOperationException("History must be enabled for an area in order to query history data.");
+        }
+
+        public IEnumerable<JObject> GetDeleted(string contentType, DateTime? @from = null, DateTime? to = null)
+        {
+            throw new InvalidOperationException("History must be enabled for an area in order to query history data.");
         }

         public void Insert(Guid id, string contentType, DateTime created, JObject obj)


Fix UTC being converted to local time during migration

--- EDDiscovery/DB/SQLiteDBUserClass.cs
+++ EDDiscovery/DB/SQLiteDBUserClass.cs
@@ -5,6 +5,7 @@
 using System.Linq;
 using System.Text;
 using System.Windows.Forms;
+using System.Globalization;

 namespace EDDiscovery.DB
 {
@@ -479,8 +480,9 @@
                             cmd.AddParameterWithValue("@et", "FSDJump");

                             JObject je = new JObject();
-
-                            je["timestamp"] = DateTime.SpecifyKind((DateTime)array[1], DateTimeKind.Local).ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'");
+                            DateTime eventtime = DateTime.SpecifyKind((DateTime)array[1], DateTimeKind.Local).ToUniversalTime();
+
+                            je["timestamp"] = eventtime.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'");
                             je["event"] = "FSDJump";
                             je["StarSystem"] = ((string)array[0]);

@@ -495,7 +497,7 @@
                             }

                             je["EDDMapColor"] = ((long)array[5]);
-                            cmd.AddParameterWithValue("@etime", (DateTime)je["timestamp"]);
+                            cmd.AddParameterWithValue("@etime", eventtime);
                             cmd.AddParameterWithValue("@edata", je.ToString());    // order number - look at the dbcommand above

                             long edsmid = 0;


Fix wrong or missing tabs

Fix wrong or missing tabs

--- EDDiscovery/TravelHistoryControl.cs
+++ EDDiscovery/TravelHistoryControl.cs
@@ -583,9 +583,9 @@

             // NO NEED to reload the three tabstrips - code below will cause a LoadLayout on the one selected.

-            tabStripBottom.SelectedIndex = SQLiteDBClass.GetSettingInt("TravelControlBottomTab", (int)PopOuts.Scan);
-            tabStripBottomRight.SelectedIndex = SQLiteDBClass.GetSettingInt("TravelControlBottomRightTab", (int)PopOuts.Log);
-            tabStripMiddleRight.SelectedIndex = SQLiteDBClass.GetSettingInt("TravelControlMiddleRightTab", (int)PopOuts.NS);
+            tabStripBottom.SelectedIndex = SQLiteDBClass.GetSettingInt("TravelControlBottomTab", (int)PopOuts.Scan - 1);
+            tabStripBottomRight.SelectedIndex = SQLiteDBClass.GetSettingInt("TravelControlBottomRightTab", (int)PopOuts.Log - 1);
+            tabStripMiddleRight.SelectedIndex = SQLiteDBClass.GetSettingInt("TravelControlMiddleRightTab", (int)PopOuts.NS - 1);
         }

         public void SaveSettings()     // called by form when closing


Add more storage tests

Add more storage tests

--- LiteDB.Tests/Database/Storage_Tests.cs
+++ LiteDB.Tests/Database/Storage_Tests.cs
@@ -39,11 +39,11 @@
         }

         [TestMethod]
-        public void Storage_Upload()
+        public void Storage_Upload_Download()
         {
-            //using (var f = new TempFile())
-            //using (var db = new LiteDatabase(f.Filename))
-            using (var db = new LiteDatabase(@"c:\temp\file.db"))
+            using (var f = new TempFile())
+            using (var db = new LiteDatabase(f.Filename))
+            //using (var db = new LiteDatabase(@"c:\temp\file.db"))
             {
                 var fs = db.GetStorage<int>("_files", "_chunks");

@@ -69,7 +69,12 @@
                 Assert.AreEqual(repl.Chunks, nrepl.Chunks);

                 // update metadata
-                fs.SetMetadata(100, new BsonDocument { ["x"] = 100 });
+                fs.SetMetadata(100, new BsonDocument { ["x"] = 100, ["y"] = 99 });
+
+                // find using metadata
+                var md = fs.Find(x => x.Metadata["x"] == 100).FirstOrDefault();
+
+                Assert.AreEqual(99, md.Metadata["y"].AsInt32);
             }
         }


_writer => Lazy<BinaryWriter>

_writer => Lazy<BinaryWriter>

--- LiteDB/Storage/Services/DiskService.cs
+++ LiteDB/Storage/Services/DiskService.cs
@@ -12,10 +12,10 @@
     {
         private const int LOCK_POSITION = 0;

-        private ConnectionString _connectionString;
+				private readonly Lazy<BinaryWriter> _writer;
+				private ConnectionString _connectionString;

         private BinaryReader _reader;
-        private BinaryWriter _writer;

         public DiskService(ConnectionString connectionString)
         {
@@ -25,6 +25,7 @@
             var stream = new FileStream(_connectionString.Filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, BasePage.PAGE_SIZE);

             _reader = new BinaryReader(stream);
+            _writer = new Lazy<BinaryWriter>(GetWriter);
         }

         /// <summary>
@@ -40,6 +41,11 @@
                 }
             }
         }
+
+		    /// <summary>
+        /// Get BinaryWriter
+        /// </summary>
+        public BinaryWriter Writer { get { return _writer.Value; } }

         /// <summary>
         /// Create a new Page instance and read data from disk
@@ -133,8 +139,7 @@
         /// </summary>
         public void AllocateDiskSpace(long length)
         {
-            var writer = this.GetWriter();
-            var stream = writer.BaseStream as FileStream;
+            var stream = Writer.BaseStream as FileStream;

             if (length > stream.Length)
             {
@@ -143,22 +148,16 @@
         }

         /// <summary>
-        /// Get BinaryWriter
+        /// Create BinaryWriter
         /// </summary>
         private BinaryWriter GetWriter()
         {
-            // If no writer - re-open file in Write Mode
-            if (_writer == null)
-            {
-                _reader.Close(); // Close reader
-
-                var stream = new FileStream(_connectionString.Filename, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite, BasePage.PAGE_SIZE);
-
-                _reader = new BinaryReader(stream);
-                _writer = new BinaryWriter(stream);
-            }
-
-            return _writer;
+            _reader.Close(); // Close reader
+
+            var stream = new FileStream(_connectionString.Filename, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite, BasePage.PAGE_SIZE);
+
+            _reader = new BinaryReader(stream);
+            return new BinaryWriter(stream);
         }

         #region Lock/Unlock functions
@@ -168,7 +167,7 @@
         /// </summary>
         public void Lock()
         {
-            var stream = this.GetWriter().BaseStream as FileStream;
+            var stream = this.Writer.BaseStream as FileStream;

             TryExec(_connectionString.Timeout, () =>
             {
@@ -183,14 +182,14 @@
         /// </summary>
         public void UnLock()
         {
-            var stream = this.GetWriter().BaseStream as FileStream;
+            var stream = this.Writer.BaseStream as FileStream;

             stream.Unlock(LOCK_POSITION, 1);
         }

         public void Flush()
         {
-            this.GetWriter().BaseStream.Flush();
+            this.Writer.BaseStream.Flush();
         }

         /// <summary>
@@ -198,7 +197,7 @@
         /// </summary>
         public void ProtectWriteFile(Action action)
         {
-            var stream = this.GetWriter().BaseStream as FileStream;
+            var stream = this.Writer.BaseStream as FileStream;
             var fileLength = stream.Length;

             stream.Lock(LOCK_POSITION + 1, fileLength);
@@ -241,9 +240,9 @@
         {
             _reader.Close();

-            if (_writer != null)
-            {
-                _writer.Close();
+            if (_writer.IsValueCreated)
+            {
+                _writer.Value.Close();
             }
         }
     }


Filter label by name by excluding names using regular expression

--- GitTfs/Commands/Labels.cs
+++ GitTfs/Commands/Labels.cs
@@ -3,6 +3,7 @@
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
+using System.Text.RegularExpressions;
 using NDesk.Options;
 using Sep.Git.Tfs.Core;
 using StructureMap;
@@ -25,6 +26,7 @@
         public string ParentBranch { get; set; }
         public bool LabelAllBranches { get; set; }
         public string NameFilter { get; set; }
+        public string ExcludeNameFilter { get; set; }
         string AuthorsFilePath { get; set; }

         public Labels(TextWriter stdout, Globals globals, AuthorsFile authors)
@@ -42,6 +44,7 @@
                 {
                     { "all|fetch-all", "Fetch all the labels on all the TFS remotes (For TFS 2010 and later)", v => LabelAllBranches = v != null },
                     { "n|label-name=", "Fetch all the labels respecting this name filter", v => NameFilter = v },
+                    { "e|exclude-label-name=", "Exclude all the labels respecting this regex name filter", v => ExcludeNameFilter = v },
                     { "u|username=", "TFS username", v => TfsUsername = v },
                     { "p|password=", "TFS password", v => TfsPassword = v },
                     { "a|authors=", "Path to an Authors file to map TFS users to Git users", v => AuthorsFilePath = v },
@@ -94,8 +97,16 @@
             _stdout.WriteLine("Looking for label on " + tfsRemote.TfsRepositoryPath + "...");
             var labels = tfsRemote.Tfs.GetLabels(tfsRemote.TfsRepositoryPath, NameFilter);
             _stdout.WriteLine(labels.Count() +" labels found!");
+
+            Regex exludeRegex = null;
+            if (ExcludeNameFilter != null)
+                exludeRegex = new Regex(ExcludeNameFilter);
+
             foreach (var label in labels)
             {
+                if (ExcludeNameFilter != null && exludeRegex.IsMatch(label.Name))
+                    continue;
+
                 Trace.WriteLine("LabelId:" + label.Id + "/ChangesetId:" + label.ChangesetId + "/LabelName:" + label.Name + "/Owner:" + label.Owner);
                 Trace.WriteLine("Try to find changeset in git repository...");
                 string sha1TagCommit = _globals.Repository.FindCommitHashByCommitMessage("git-tfs-id: .*;C" + label.ChangesetId + "[^0-9]");


realized I didn't need to up the rev since it's not published.

--- Manatee.Wpf/Properties/AssemblyInfo.cs
+++ Manatee.Wpf/Properties/AssemblyInfo.cs
@@ -52,5 +52,5 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.0.0")]
-[assembly: AssemblyFileVersion("1.0.1")]
-[assembly: AssemblyInformationalVersion("1.0.1")]+[assembly: AssemblyFileVersion("1.0.0")]
+[assembly: AssemblyInformationalVersion("1.0.0")]


Add an option to not verify case mismatch in the file paths

--- GitTfs/Commands/Verify.cs
+++ GitTfs/Commands/Verify.cs
@@ -27,8 +27,14 @@

         public OptionSet OptionSet
         {
-            get { return new OptionSet(); }
+            get { return new OptionSet()
+            {
+                    { "ignore-path-case-mismatch", "Ignore the case mismatch in the path when comparing the files.",
+                        v => IgnorePathCaseMismatch = v != null },
+            }; }
         }
+
+        public bool IgnorePathCaseMismatch { get; set; }

         public int Run()
         {
@@ -45,7 +51,7 @@
             int foundDiff = GitTfsExitCodes.OK;
             foreach (var parent in parents)
             {
-                foundDiff = Math.Max(foundDiff, _verifier.Verify(parent));
+                foundDiff = Math.Max(foundDiff, _verifier.Verify(parent, IgnorePathCaseMismatch));
             }
             return foundDiff;
         }
@@ -62,7 +68,7 @@
             _tfs = tfs;
         }

-        public int Verify(TfsChangesetInfo changeset)
+        public int Verify(TfsChangesetInfo changeset, bool ignorePathCaseMismatch)
         {
             _stdout.WriteLine("Comparing TFS changeset " + changeset.ChangesetId + " to git commit " + changeset.GitCommit);
             var tfsTree = changeset.Remote.GetChangeset(changeset.ChangesetId).GetTree().ToDictionary(entry => entry.FullName.ToLowerInvariant().Replace("/",@"\"));
@@ -80,7 +86,7 @@
                 {
                     if(gitTree.ContainsKey(file))
                     {
-                        if (Compare(tfsTree[file], gitTree[file]))
+                        if (Compare(tfsTree[file], gitTree[file], ignorePathCaseMismatch))
                             foundDiff = Math.Max(foundDiff, GitTfsExitCodes.VerifyContentMismatch);
                     }
                     else
@@ -100,10 +106,10 @@
             return foundDiff;
         }

-        private bool Compare(TfsTreeEntry tfsTreeEntry, GitTreeEntry gitTreeEntry)
+        private bool Compare(TfsTreeEntry tfsTreeEntry, GitTreeEntry gitTreeEntry, bool ignorePathCaseMismatch)
         {
             var different = false;
-            if (tfsTreeEntry.FullName.Replace("/",@"\") != gitTreeEntry.FullName)
+            if (!ignorePathCaseMismatch && tfsTreeEntry.FullName.Replace("/", @"\") != gitTreeEntry.FullName)
             {
                 _stdout.WriteLine("Name case mismatch:");
                 _stdout.WriteLine("  TFS: " + tfsTreeEntry.FullName);


Нельзя дергать IsDirty\Flush при закрытии. #50

--- MangaReader.Core/NHibernate/Mapping.cs
+++ MangaReader.Core/NHibernate/Mapping.cs
@@ -44,11 +44,9 @@
         return;

       Log.Add("Closing database connect.");
-      if (Session.IsDirty())
-      {
-        Log.Add("Closing database connect : Session is dirty, force flush.");
-        Session.Flush();
-      }
+
+      Initialized = false;
+      Session.Close();
       sessionFactory.Close();
     }


Inventory Control > Items added Measurement and Item Tax Group in the HTML/UI

--- src/AccountGoWeb/Views/Inventory/Items.cshtml
+++ src/AccountGoWeb/Views/Inventory/Items.cshtml
@@ -20,6 +20,8 @@
     }},
     {headerName: "Code", field: "code", width: 100},
     {headerName: "Description", field: "description", width: 350},
+    {headerName: "Measurement", field: "messurement", width: 100},
+    {headerName: "Item Tax Group", field: "itemTaxGroup", width: 100},
     {headerName: "Cost", field: "cost", width: 100},
     {headerName: "Price", field: "price", width: 100},
     {headerName: "On Hand", field: "quantityOnHand", width: 100}


fix regression for tfvc gated check-in. (#1573)

--- src/Agent.Worker/Build/TfsVCCommandManager.cs
+++ src/Agent.Worker/Build/TfsVCCommandManager.cs
@@ -147,7 +147,7 @@

         protected Task<string> RunPorcelainCommandAsync(FormatFlags formatFlags, params string[] args)
         {
-            return RunPorcelainCommandAsync(FormatFlags.None, false, args);
+            return RunPorcelainCommandAsync(formatFlags, false, args);
         }

         protected async Task<string> RunPorcelainCommandAsync(FormatFlags formatFlags, bool ignoreStderr, params string[] args)


Reduce allocations in dynamic method helper.

--- src/AsmResolver.DotNet/DynamicMethodHelper.cs
+++ src/AsmResolver.DotNet/DynamicMethodHelper.cs
@@ -19,9 +19,9 @@
                 throw new ArgumentException("Method body should reference a serialized module.");

             var localsSignature = (LocalVariablesSignature) CallingConventionSignature.FromReader(
-                new BlobReadContext(module.ReaderContext),
+                new BlobReadContext(module.ReaderContext),
                 new ByteArrayReader(localSig));
-
+
             for (int i = 0; i < localsSignature?.VariableTypes.Count; i++)
                 methodBody.LocalVariables.Add(new CilLocalVariable(localsSignature.VariableTypes[i]));
         }
@@ -65,11 +65,11 @@
                 var handler = new CilExceptionHandler
                 {
                     HandlerType = handlerType,
-                    TryStart = instructions.GetByOffset(tryStart)?.CreateLabel() ?? new CilOffsetLabel(tryStart),
+                    TryStart = instructions.GetLabel(tryStart),
                     TryEnd = handlerType == CilExceptionHandlerType.Finally ? endFinallyLabel : endTryLabel,
                     FilterStart = null,
-                    HandlerStart = instructions.GetByOffset(handlerStart)?.CreateLabel() ?? new CilOffsetLabel(handlerStart),
-                    HandlerEnd = instructions.GetByOffset(handlerEnd)?.CreateLabel() ?? new CilOffsetLabel(handlerEnd),
+                    HandlerStart = instructions.GetLabel(handlerStart),
+                    HandlerEnd = instructions.GetLabel(handlerEnd),
                     ExceptionType = exceptionType != null ? importer.ImportType(exceptionType) : null
                 };

@@ -84,39 +84,42 @@
             {
                 case CilOperandType.InlineBrTarget:
                 case CilOperandType.ShortInlineBrTarget:
-                    return new CilInstructionLabel(
-                        methodBody.Instructions.GetByOffset(((ICilLabel) instruction.Operand).Offset));
-
+                    return methodBody.Instructions
+                        .GetByOffset(((ICilLabel) instruction.Operand).Offset)
+                        ?.CreateLabel();
+
                 case CilOperandType.InlineField:
                 case CilOperandType.InlineMethod:
                 case CilOperandType.InlineSig:
                 case CilOperandType.InlineTok:
                 case CilOperandType.InlineType:
                     return ReadToken(context, ((MetadataToken) instruction.Operand).ToUInt32(), tokens, importer);
-
+
                 case CilOperandType.InlineString:
                     return ReadToken(context, ((MetadataToken) instruction.Operand).ToUInt32(), tokens, importer);
-
+
                 case CilOperandType.InlineSwitch:
                     var result = new List<ICilLabel>();
-                    var labels = (IEnumerable<ICilLabel>) instruction.Operand;
-                    foreach (var label in labels)
+                    var labels = (IList<ICilLabel>) instruction.Operand;
+                    for (int i = 0; i < labels.Count; i++)
                     {
+                        var label = labels[i];
                         var target = methodBody.Instructions.GetByOffset(label.Offset);
-                        result.Add(target != null
-                            ? new CilInstructionLabel(target)
+                        result.Add(target != null
+                            ? new CilInstructionLabel(target)
                             : label);
                     }
+
                     return result;
-
+
                 case CilOperandType.InlineVar:
                 case CilOperandType.ShortInlineVar:
                     return resolver.ResolveLocalVariable(Convert.ToInt32(instruction.Operand));
-
+
                 case CilOperandType.InlineArgument:
                 case CilOperandType.ShortInlineArgument:
                     return resolver.ResolveParameter(Convert.ToInt32(instruction.Operand));
-
+
                 case CilOperandType.InlineI:
                 case CilOperandType.InlineI8:
                 case CilOperandType.InlineNone:
@@ -142,7 +145,7 @@
                     if (type is RuntimeTypeHandle runtimeTypeHandle)
                         return importer.ImportType(Type.GetTypeFromHandle(runtimeTypeHandle));
                     break;
-
+
                 case TableIndex.Field:
                     var field = tokens[(int) token.Rid];
                     if (field is null)
@@ -160,7 +163,7 @@
                     }

                     break;
-
+
                 case TableIndex.Method:
                 case TableIndex.MemberRef:
                     var obj = tokens[(int) token.Rid];
@@ -182,12 +185,12 @@
                     if (obj.GetType().FullName == "System.Reflection.Emit.VarArgMethod")
                         return importer.ImportMethod(FieldReader.ReadField<MethodInfo>(obj, "m_method"));
                     break;
-
+
                 case TableIndex.StandAloneSig:
                     return CallingConventionSignature.FromReader(
                         new BlobReadContext(readerContext),
                         new ByteArrayReader((byte[]) tokens[(int) token.Rid]));
-
+
                 case (TableIndex) 112:
                     return tokens[(int) token.Rid] as string;
             }
@@ -219,12 +222,12 @@
             {
                 var dynamicResolver = typeof(OpCode).Module.GetTypes()
                     .First(t => t.Name == "DynamicResolver");
-
+
                 var ilGenerator = dynamicMethodObj.GetType().GetRuntimeMethods().First(q => q.Name == "GetILGenerator")
                     .Invoke(dynamicMethodObj, null);
-
+
                 //Create instance of dynamicResolver
-                dynamicMethodObj = Activator.CreateInstance(dynamicResolver, (BindingFlags) (-1), null, new[]
+                dynamicMethodObj = Activator.CreateInstance(dynamicResolver, (BindingFlags) (-1), null, new[]
                 {
                     ilGenerator
                 }, null);
@@ -232,4 +235,4 @@
             return dynamicMethodObj;
         }
     }
-}+}


removed unique peptide import as we calculate this anyways

--- Morpheus_Spectral_Counter/Utilities.cs
+++ Morpheus_Spectral_Counter/Utilities.cs
@@ -149,7 +149,6 @@
                 string[] proteins = dataline[0].Split(splitOn, StringSplitOptions.None);
                 string[] proteinseq = dataline[1].Split(splitOn, StringSplitOptions.None);
                 string[] seqcoverages = dataline[8].Split(splitOnSequenceCoverage, StringSplitOptions.None);
-                string[] uniquepeptides = dataline[5].Split(splitOnSequenceCoverage, StringSplitOptions.None);
                 for (int index = 0; index < proteins.Length; index++)
                 {
                     Protein p = new Protein


Fix explicit StylingParent definition.

Fix explicit StylingParent definition.

--- src/Avalonia.Controls/Primitives/PopupRoot.cs
+++ src/Avalonia.Controls/Primitives/PopupRoot.cs
@@ -70,7 +70,7 @@
         /// <summary>
         /// Gets the styling parent of the popup root.
         /// </summary>
-        IStyleRoot IStyleHost.StylingParent => Parent;
+        IStyleHost IStyleHost.StylingParent => Parent;

         /// <inheritdoc/>
         public void Dispose() => PlatformImpl?.Dispose();


task count default 15

task count default 15

--- NBitcoin.Indexer/AzureBlockImporter.cs
+++ NBitcoin.Indexer/AzureBlockImporter.cs
@@ -171,6 +171,7 @@
 			if(configuration == null)
 				throw new ArgumentNullException("configuration");
 			_Configuration = configuration;
+			TaskCount = 15;
 		}

 		public void StartTransactionImportToAzure()


Added text to saving button to avoid duplicate shot submissions

--- src/BolfTracker.Web/Views/Game/Details.cshtml
+++ src/BolfTracker.Web/Views/Game/Details.cshtml
@@ -69,7 +69,7 @@
               Shot Made
             </label>
           </div>
-          <input type="submit" class="btn btn-primary" value="Save Shot" />
+          <input type="submit" id="btn-save-shot" data-loading-text="Saving..." class="btn btn-primary" value="Save Shot" />
         }
       }
     }
@@ -152,7 +152,7 @@
                     {
                       @Html.Hidden("scoreId", score.Id)
                       @Html.Hidden("gameId", score.Game.Id)
-                      <input type="submit" class="btn btn-danger btn-xs" value="Delete" />
+                      <input type="submit"  class="btn btn-danger btn-xs" value="Delete" />
                     }
                   }
                 }
@@ -223,6 +223,13 @@
             break;
         }
       });
+
+      $("#btn-save-shot").on("click", function()
+      {
+          var btn = $(this);
+          btn.button('loading');
+      });
+
     });
   </script>
 }


make test more resilient

make test more resilient

--- NTumbleBit.Tests/TumblerServerTests.cs
+++ NTumbleBit.Tests/TumblerServerTests.cs
@@ -147,7 +147,7 @@

 				transactions = untrustedBroadcast.TryBroadcast();
 				Assert.Equal(1, transactions.Length);
-				block = server.TumblerNode.FindBlock().First();
+				block = server.AliceNode.FindBlock().First();
 				//Should contains client cashout
 				Assert.Equal(2, block.Transactions.Count);


Added None to Sigmoid (for input layer).

--- NeuralNetwork/NeuralNetwork/Sigmoid.cs
+++ NeuralNetwork/NeuralNetwork/Sigmoid.cs
@@ -55,6 +55,9 @@
         public static Sigmoid Linear =
             new Sigmoid(x => x, x => 1);

+        public static Sigmoid None =
+            new Sigmoid(x => 0, x => 0);
+
         #endregion Sigmoids
     }
 }


Log more detailed exception information

Log more detailed exception information

Adding additional logging data to help track down the exception we are
seeing while calling `Mutex.ReleaseMutex`.

https://github.com/dotnet/coreclr/issues/26659
https://github.com/dotnet/roslyn/issues/37974

--- src/Compilers/Shared/BuildServerConnection.cs
+++ src/Compilers/Shared/BuildServerConnection.cs
@@ -161,6 +161,7 @@
                 CreateServerFunc createServerFunc,
                 CancellationToken cancellationToken)
             {
+                var originalThreadId = Thread.CurrentThread.ManagedThreadId;
                 var clientDir = buildPaths.ClientDirectory;
                 var timeoutNewProcess = timeoutOverride ?? TimeOutMsNewProcess;
                 var timeoutExistingProcess = timeoutOverride ?? TimeOutMsExistingProcess;
@@ -215,7 +216,16 @@
                 }
                 finally
                 {
-                    clientMutex?.Dispose();
+                    try
+                    {
+                        clientMutex?.Dispose();
+                    }
+                    catch (ApplicationException e)
+                    {
+                        var releaseThreadId = Thread.CurrentThread.ManagedThreadId;
+                        var message = $"ReleaseMutex failed. WaitOne Id: {originalThreadId} Release Id: {releaseThreadId}";
+                        throw new Exception(message, e);
+                    }
                 }
             }
         }


SomeChanges

SomeChanges

--- NotFuckingMinecraft/Entities/Player.cs
+++ NotFuckingMinecraft/Entities/Player.cs
@@ -17,17 +17,21 @@
 		Dictionary<Key, bool> Keyboard;

 		// TODO: Abstract later
-		[DllImport("user32.dll")]
-		static extern bool SetCursorPos(int X, int Y);
-		static bool SetCursorPos(Point P) {
-			return SetCursorPos(P.X, P.Y);
+		/*[DllImport("user32.dll")]
+		static extern bool SetCursorPos(int X, int Y);*/
+
+		bool SetCursorPos(Point P) {
+			return false;
+			//return SetCursorPos(P.X, P.Y);
 		}
-		[DllImport("user32.dll")]
+
+		/*[DllImport("user32.dll")]
 		[return: MarshalAs(UnmanagedType.Bool)]
-		static extern bool GetCursorPos(out Point lpPoint);
-		static Point GetCursorPos() {
-			Point R;
-			GetCursorPos(out R);
+		static extern bool GetCursorPos(out Point lpPoint);*/
+
+		Point GetCursorPos() {
+			Point R = new Point();
+			//GetCursorPos(out R);
 			return R;
 		}


View cache and stub for view creation in ViewEngineRegistry

--- src/Dolstagis.Web/Views/ViewEngineRegistry.cs
+++ src/Dolstagis.Web/Views/ViewEngineRegistry.cs
@@ -12,6 +12,9 @@
         private IDictionary<string, IViewEngine> _viewEngines
             = new Dictionary<string, IViewEngine>(StringComparer.OrdinalIgnoreCase);

+        private IDictionary<string, IView> _viewCache
+            = new Dictionary<string, IView>(StringComparer.OrdinalIgnoreCase);
+
         private ResourceLocator _locator;

         public ViewEngineRegistry(ResourceLocator locator, IEnumerable<IViewEngine> viewEngines)
@@ -21,5 +24,23 @@
                 foreach (var ext in engine.Extensions)
                     _viewEngines[ext] = engine;
         }
+
+        public IView GetView(VirtualPath pathToView)
+        {
+            if (pathToView == null) throw new ArgumentNullException("pathToView");
+            if (!pathToView.Parts.Any()) throw new ArgumentException("Path to view can not be empty.", "pathToView");
+            IView result;
+            string key = pathToView.Path;
+            if (!_viewCache.TryGetValue(key, out result)) {
+                result = CreateView(pathToView);
+                _viewCache[key] = result;
+            }
+            return result;
+        }
+
+        private IView CreateView(VirtualPath pathToView)
+        {
+            return null;
+        }
     }
 }


Updated Queue TTL to infinite for non net461 customers (#666)

--- src/DurableTask.AzureStorage/Storage/Queue.cs
+++ src/DurableTask.AzureStorage/Storage/Queue.cs
@@ -45,10 +45,16 @@

         public async Task AddMessageAsync(QueueMessage queueMessage, TimeSpan? visibilityDelay, Guid? clientRequestId = null)
         {
+            // Infinite time to live
+            TimeSpan? timeToLive = TimeSpan.FromSeconds(-1);
+#if NET461
+            // When using net461 SDK version WindowsAzure.Storage 7.2.1 does not allow infinite time to live. Passing in null will default the time to live to 7 days.
+            timeToLive = null;
+#endif
             await this.azureStorageClient.MakeQueueStorageRequest(
                 (context, cancellationToken) => this.cloudQueue.AddMessageAsync(
                     queueMessage.CloudQueueMessage,
-                    null /* timeToLive */,
+                    timeToLive,
                     visibilityDelay,
                     null,
                     context),


Fix time series index name bug

Fix time series index name bug

--- src/Elasticsearch/Configuration/DailyIndex.cs
+++ src/Elasticsearch/Configuration/DailyIndex.cs
@@ -24,7 +24,7 @@
         public DailyIndex(IElasticClient client, string name, int version = 1, ILoggerFactory loggerFactory = null): base(client, name, loggerFactory) {
             Version = version;
             AddAlias(name);
-            _currentVersionedNamePrefix = GetVersionedNamePrefix();
+            _currentVersionedNamePrefix = String.Concat(Name, "-v", version);
             _frozenAliases = new Lazy<IReadOnlyCollection<IndexAliasAge>>(() => _aliases.AsReadOnly());
         }


Update SvenMichaelStuebe.cs

Update SvenMichaelStuebe.cs

--- src/Firehose.Web/Authors/SvenMichaelStuebe.cs
+++ src/Firehose.Web/Authors/SvenMichaelStuebe.cs
@@ -10,7 +10,7 @@
     {
         public string FirstName => "Sven-Michael";
         public string LastName => "Stübe";
-        public string Title => "Expert Software at Zühlke";
+        public string Title => "software engineer at Zühlke";
         public string StateOrRegion => "Munich, Germany";
         public string EmailAddress => string.Empty;
         public string TwitterHandle => "stuebe2k14";
@@ -30,4 +30,4 @@
             return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("xamarin"));
         }
     }
-}+}


In the event of intermittent Azure DevOps API failures while submitting test result batches, attempt a fixed number of cool-downs/retries before determining that the API is unavailable.

--- src/Fixie/Internal/Listeners/AzureListener.cs
+++ src/Fixie/Internal/Listeners/AzureListener.cs
@@ -9,9 +9,11 @@
     using System.Reflection;
     using System.Runtime.Versioning;
     using System.Text;
+    using System.Threading;
     using Internal;
     using static System.Environment;
     using static Serialization;
+    using static System.Console;

     public class AzureListener :
         Handler<AssemblyStarted>,
@@ -34,6 +36,7 @@

         readonly int batchSize;
         readonly List<Result> batch;
+        bool apiUnavailable;

         public AzureListener()
             : this(
@@ -91,6 +94,8 @@

         public void Handle(CaseSkipped message)
         {
+            if (apiUnavailable) return;
+
             Include(message, x =>
             {
                 x.outcome = "Warning";
@@ -100,6 +105,8 @@

         public void Handle(CasePassed message)
         {
+            if (apiUnavailable) return;
+
             Include(message, x =>
             {
                 x.outcome = "Passed";
@@ -108,6 +115,8 @@

         public void Handle(CaseFailed message)
         {
+            if (apiUnavailable) return;
+
             Include(message, x =>
             {
                 x.outcome = "Failed";
@@ -121,6 +130,8 @@

         public void Handle(AssemblyCompleted message)
         {
+            if (apiUnavailable) return;
+
             if (batch.Any())
                 PostBatch();

@@ -149,9 +160,48 @@
                 PostBatch();
         }

+        int failuresToSimulate = 0;
         void PostBatch()
         {
-            send(client, HttpMethod.Post, $"{runUrl}/results?api-version={AzureDevOpsRestApiVersion+Guid.NewGuid()}", "application/json", Serialize(batch));
+            var attempt = 1;
+            const int maxAttempts = 5;
+            const int coolDownInSeconds = 5;
+
+            while (attempt <= maxAttempts)
+            {
+                try
+                {
+                    var failureSuffix = attempt <= failuresToSimulate ? Guid.NewGuid().ToString() : "";
+
+                    send(client, HttpMethod.Post, $"{runUrl}/results?api-version={AzureDevOpsRestApiVersion + failureSuffix}", "application/json", Serialize(batch));
+                    batch.Clear();
+
+                    if (attempt > 1)
+                    {
+                        WriteLine($"Successfully submitted test result batch to Azure DevOps API on attempt #{attempt}.");
+                        WriteLine();
+                    }
+
+                    failuresToSimulate++;
+
+                    return;
+                }
+                catch (Exception exception)
+                {
+                    WriteLine($"Failed to submit test result batch to Azure DevOps API (attempt #{attempt} of {maxAttempts}): " + exception);
+                    WriteLine();
+                    Thread.Sleep(TimeSpan.FromSeconds(coolDownInSeconds));
+                    attempt++;
+                }
+            }
+
+            WriteLine("Due to repeated failures while submitting test results to the Azure DevOps API,");
+            WriteLine("further attempts will be suppressed for the remainder of this test run. Full test");
+            WriteLine("results will continue to be reported to this console and to the test process exit");
+            WriteLine("code, but the Azure DevOps \"Tests\" summary will be incomplete.");
+            WriteLine();
+
+            apiUnavailable = true;
             batch.Clear();
         }


cleanup code

cleanup code

--- Packager/Extensions/ArrayExtensions.cs
+++ Packager/Extensions/ArrayExtensions.cs
@@ -18,7 +18,7 @@

         public static string ToSingularOrPlural<T, TU>(this Dictionary<T, TU> values, string singular, string plural)
         {
-            var count = values?.Count() ?? 0;
+            var count = values?.Count ?? 0;
             return count.ToSingularOrPlural(singular, plural);
         }


Add 33 byte checksum to seed.

Add 33 byte checksum to seed.

This is only being done for compatibility with older dcrwallet
versions that refuse to decode word list seeds that are not 33 words
long when entering them from the console (the gRPC API accepts seeds
as simply a byte array so long as they are within the correct length
range).

Fixes #108.

--- Paymetheus.Decred/Wallet/WalletSeed.cs
+++ Paymetheus.Decred/Wallet/WalletSeed.cs
@@ -74,6 +74,13 @@
             }
         }

-        public static string[] EncodeWordList(PgpWordList pgpWordList, byte[] seed) => pgpWordList.Encode(seed);
+        public static string[] EncodeWordList(PgpWordList pgpWordList, byte[] seed)
+        {
+            var seedHash = DoubleSha256(seed);
+            var seedWithChecksum = new byte[seed.Length + 1];
+            Array.Copy(seed, seedWithChecksum, seed.Length);
+            seedWithChecksum[seedWithChecksum.Length - 1] = seedHash[0];
+            return pgpWordList.Encode(seedWithChecksum);
+        }
     }
 }


Fix for breapoint issue 3696.

Fix for breapoint issue 3696.

--- src/Host/Client/Impl/Definitions/IRContext.cs
+++ src/Host/Client/Impl/Definitions/IRContext.cs
@@ -14,8 +14,11 @@

     public static class RContextExtensions {
         public static bool IsBrowser(this IReadOnlyList<IRContext> contexts) {
-            return contexts.SkipWhile(context => context.CallFlag.HasFlag(RContextType.Restart))
-                .FirstOrDefault()?.CallFlag.HasFlag(RContextType.Browser) == true;
+            bool isBrowser = contexts.SkipWhile(context => context.CallFlag.HasFlag(RContextType.Restart)).FirstOrDefault()?.CallFlag.HasFlag(RContextType.Browser) == true;
+            if (!isBrowser) {
+                isBrowser = contexts.Skip(1).SkipWhile(context => context.CallFlag.HasFlag(RContextType.Restart)).FirstOrDefault()?.CallFlag.HasFlag(RContextType.Browser) == true;
+            }
+            return isBrowser;
         }
     }
 }


Update Battle.cs

Update Battle.cs

pbHasType\?\s?\(:(\w+)\)
hasType(Types.$1)
Type == Types.$1

\.pbThis\((\w+)
.ToString($1

\.pbThis
.ToString()

\.include\?\(
.Contains(

\.push\(
.Add(

\.\blength\b
.Length

\.\bname\b
.Name

\.totalhp
.TotalHP

\.hp
.HP

\.item\b
.Item

\.species\b
.Species

def\s(\w+)\?(\(.+\))
public bool $1 $2 {

\(([\$@\[\]\w\d.+\-\/\*]+)\)\.floor
(int)Math.Floor($1)

case \(?([\S\w]+)\)?[\s\r\n]*?\r?
case ([\w.:\[\]]+)(?<!(:) *)(\s)$
switch ($1) {

^(\s+)when ([\w\S.:]+)
$1  break;\n$1case $2:


Fix agent definition and uri.Host reference

--- src/Jasper/Bus/Transports/Tcp/TcpTransport.cs
+++ src/Jasper/Bus/Transports/Tcp/TcpTransport.cs
@@ -68,12 +68,13 @@

             foreach (var uri in incoming)
             {
+                SocketListeningAgent agent;
                 // check the uri for an ip address to bind to
                 if (uri.HostNameType == UriHostNameType.IPv4 || uri.HostNameType == UriHostNameType.IPv6)
                 {
                     IPAddress ipaddr = IPAddress.Parse(uri.Host);
                     agent = new SocketListeningAgent(ipaddr, uri.Port, settings.Cancellation);
-                } else if (uri.HostName == "localhost") {
+                } else if (uri.Host == "localhost") {
                     agent = new SocketListeningAgent(IPAddress.Loopback, uri.Port, settings.Cancellation);
                 } else {
                     agent = new SocketListeningAgent(IPAddress.Any, uri.Port, settings.Cancellation);


Log sequence eagerly

Log sequence eagerly

--- PracticalLINQ/PracticalLINQ/Program.cs
+++ PracticalLINQ/PracticalLINQ/Program.cs
@@ -109,8 +109,8 @@
         private static void NonIdemPotent()
         {
             var generator = new Random();
-            var nonIdemPotent = Enumerable.Range(1, 10).LogSequence("After Range")
-                                .Select(n => generator.Next(25)).LogSequence("After Select");
+            var nonIdemPotent = Enumerable.Range(1, 10).LogSequenceEager("After Range")
+                                .Select(n => generator.Next(25)).LogSequenceEager("After Select");

             foreach (var item in nonIdemPotent)
                 Console.WriteLine(item);


Refactor  - Updaters - Extract Explicit types and make the members of the Program Class - PASS

--- src/Kata.GildedRose.CSharp.Console/Program.cs
+++ src/Kata.GildedRose.CSharp.Console/Program.cs
@@ -5,6 +5,11 @@
 {
     public class Program
     {
+        AgedBrieUpdater agedBrieUpdater = new AgedBrieUpdater();
+        BackStagePassesUpdater backStagepassUpdater = new BackStagePassesUpdater();
+        LegendaryItemsUpdater legendsUpdater = new LegendaryItemsUpdater();
+        StandardItemsUpdater standardUpdater = new StandardItemsUpdater();
+
         public IList<Item> Items;
         static void Main(string[] args)
         {
@@ -40,19 +45,17 @@
                 switch (item.Name)
                 {
                     case "Aged Brie":
-                        var updater = new AgedBrieUpdater();
-                        updater.AgedBrieUpdate(item);
+                        agedBrieUpdater.AgedBrieUpdate(item);
                         break;
                     case "Backstage passes to a TAFKAL80ETC concert":
-                        var backstageUpdater = new BackStagePassesUpdater();
-                        backstageUpdater.BackStagePassesUpdate(item);
+
+                        backStagepassUpdater.BackStagePassesUpdate(item);
                         break;
                     case "Sulfuras, Hand of Ragnaros":
-                        var legendsUpdater = new LegendaryItemsUpdater();
+
                         legendsUpdater.LegendaryItemsUpdate(item);
                         break;
                     default:
-                        var standardUpdater = new StandardItemsUpdater();
                         standardUpdater.StandardItemsUpdate(item);
                         break;
                 }


Avoid crash issues

Avoid crash issues

--- Project/CameraManager/CameraManager.cs
+++ Project/CameraManager/CameraManager.cs
@@ -180,7 +180,16 @@
             if (apiClient == null)
                 return;

-            var info = await apiClient.GetApplicationInfoAsync();
+            ServerAppInfo info = null;
+            try
+            {
+                info = await apiClient.GetApplicationInfoAsync();
+            }
+            catch (RemoteApiException e)
+            {
+                Debug.WriteLine("CameraManager: failed to get application info. - " + e.code);
+                return;
+            }
             Debug.WriteLine("Server Info: " + info.name + " ver " + info.version);
             try
             {
@@ -228,6 +237,10 @@

         private async void OpenLiveviewConnection(TimeSpan? connectionTimeout = null)
         {
+            if (apiClient == null)
+            {
+                return;
+            }
             AppStatus.GetInstance().IsTryingToConnectLiveview = true;
             try
             {


Remove unused usings

Remove unused usings

--- src/LazyStorage/InMemory/InMemorySingleton.cs
+++ src/LazyStorage/InMemory/InMemorySingleton.cs
@@ -1,6 +1,4 @@
-using System.Collections;
-using System.Collections.Generic;
-using LazyStorage.Interfaces;
+using System.Collections.Generic;

 namespace LazyStorage.InMemory
 {


Not to generate dummy contents

Not to generate dummy contents

--- Project/Pages/RemoteViewerPage.xaml.cs
+++ Project/Pages/RemoteViewerPage.xaml.cs
@@ -86,7 +86,7 @@

             LoadLocalContents();

-            AddDummyContentsAsync();
+            // AddDummyContentsAsync();

             CameraManager.CameraManager.GetInstance().Status.PropertyChanged += status_PropertyChanged;
             PictureSyncManager.Instance.Failed += OnDLError;


Opt in support for including subdirectories from nuget depdencies in publish output.

--- src/Microsoft.DotNet.Tools.Publish/Program.cs
+++ src/Microsoft.DotNet.Tools.Publish/Program.cs
@@ -26,6 +26,7 @@
             var output = app.Option("-o|--output <OUTPUT_PATH>", "Path in which to publish the app", CommandOptionType.SingleValue);
             var configuration = app.Option("-c|--configuration <CONFIGURATION>", "Configuration under which to build", CommandOptionType.SingleValue);
             var projectPath = app.Argument("<PROJECT>", "The project to publish, defaults to the current directory. Can be a path to a project.json or a project directory");
+            var subdirectories = app.Option("--subdir", "Include Subdirectories in native assets in the output", CommandOptionType.NoValue);

             app.OnExecute(() =>
             {
@@ -107,7 +108,7 @@
         /// <param name="outputPath">Location of published files</param>
         /// <param name="configuration">Debug or Release</param>
         /// <returns>Return 0 if successful else return non-zero</returns>
-        private static int Publish(ProjectContext context, string outputPath, string configuration)
+        private static int Publish(ProjectContext context, string outputPath, string configuration, bool subdirectories)
         {
             Reporter.Output.WriteLine($"Publishing {context.RootProject.Identity.Name.Yellow()} for {context.TargetFramework.DotNetFrameworkName.Yellow()}/{context.RuntimeIdentifier.Yellow()}");

@@ -158,8 +159,8 @@

                 Reporter.Verbose.WriteLine($"Publishing {export.Library.Identity.ToString().Green().Bold()} ...");

-                PublishFiles(export.RuntimeAssemblies, outputPath);
-                PublishFiles(export.NativeLibraries, outputPath);
+                PublishFiles(export.RuntimeAssemblies, outputPath, false);
+                PublishFiles(export.NativeLibraries, outputPath, subdirectories);
             }

             // Publish a host if this is an application
@@ -199,13 +200,44 @@
         {
             foreach (var file in files)
             {
-                var copyDir = subdirectories ? Path.Combine(outputPath, Path.GetDirectoryName(copyPath)) : outputPath;
-                if (!Directory.Exists(copyDir))
-                {
-                    Directory.CreateDirectory(copyDir);
-                }
-                File.Copy(path, Path.Combine(copyDir, Path.GetFileName(file.ResolvedPath)), overwrite: true);
-            }
+                var destinationDirectory = outputPath;
+
+                if (subdirectories)
+                {
+                    destinationDirectory = Path.Combine(outputPath, GetNativeRelativeSubdirectory(file.RelativePath));
+                }
+
+                if (!Directory.Exists(destinationDirectory))
+                {
+                    Directory.CreateDirectory(destinationDirectory);
+                }
+
+                File.Copy(file.ResolvedPath, Path.Combine(destinationDirectory, Path.GetFileName(file.ResolvedPath)), overwrite: true);
+            }
+        }
+
+        private static string GetNativeRelativeSubdirectory(string filepath)
+        {
+            string directoryPath = Path.GetDirectoryName(filepath);
+
+            string[] parts = directoryPath.Split(new string[] { "native" }, 2, StringSplitOptions.None);
+
+            if (parts.Length != 2)
+            {
+                throw new UnrecognizedNativeDirectoryFormat() { FailedPath = filepath };
+            }
+
+            string candidate = parts[1];
+            candidate = candidate.TrimStart(new char[] { '/', '\\' });
+
+            return candidate;
+        }
+
+        private class UnrecognizedNativeDirectoryFormat : Exception
+        {
+            public string FailedPath { get; set; }
         }
     }
+
+
 }


Set thread names (#202)

Set thread names (#202)

--- Prometheus.NetStandard/MetricServer.cs
+++ Prometheus.NetStandard/MetricServer.cs
@@ -35,6 +35,7 @@
             {
                 try
                 {
+                    Thread.CurrentThread.Name = "Metric Server";     //Max length 16 chars (Linux limitation)
                     while (!cancel.IsCancellationRequested)
                     {
                         // There is no way to give a CancellationToken to GCA() so, we need to hack around it a bit.
@@ -50,6 +51,7 @@

                               try
                               {
+                                  Thread.CurrentThread.Name = "Metric Process";
                                   try
                                   {
                                       // We first touch the response.OutputStream only in the callback because touching
@@ -82,7 +84,7 @@
                                   if (!_httpListener.IsListening)
                                       return; // We were shut down.

-                                  Trace.WriteLine(string.Format("Error in MetricsServer: {0}", ex));
+                                  Trace.WriteLine(string.Format("Error in {0}: {1}", nameof(MetricServer), ex));

                                   try
                                   {


Reenabled max message size

Reenabled max message size

--- Providers/Network/NetworkConnection.cs
+++ Providers/Network/NetworkConnection.cs
@@ -211,7 +211,6 @@
 		private int maxMessageLength = 1048576;

 		protected volatile bool disconnecting;
-		private readonly object socketStateSync = new object();
 		protected Socket reliableSocket;

 		protected byte[] rmessageBuffer = new byte[20480];
@@ -263,6 +262,12 @@
 				}

 				length = BitConverter.ToInt32 (buffer, messageOffset + 3) + BaseHeaderLength;
+				if (length > maxMessageLength)
+				{
+					Disconnect (true);
+					return;
+				}
+
 				if (remainingData < length)
 					break;


removed unnecessary table.

removed unnecessary table.

--- Purchasing.Core/Domain/ApprovalType.cs
+++ Purchasing.Core/Domain/ApprovalType.cs
@@ -1,20 +0,0 @@
-using FluentNHibernate.Mapping;
-using UCDArch.Core.DomainModel;
-
-namespace Purchasing.Core.Domain
-{
-    public class ApprovalType : DomainObjectWithTypedId<string>
-    {
-        public virtual string Name { get; set; }
-    }
-
-    public class ApprovalTypeMap : ClassMap<ApprovalType>
-    {
-        public ApprovalTypeMap()
-        {
-            Id(x => x.Id).GeneratedBy.Assigned();
-
-            Map(x => x.Name);
-        }
-    }
-}


Remove waiting for user input if bot token is missing.

--- src/NadekoBot/Services/Impl/BotCredentials.cs
+++ src/NadekoBot/Services/Impl/BotCredentials.cs
@@ -59,7 +59,6 @@
                 if (string.IsNullOrWhiteSpace(Token))
                 {
                     log.Error($"Token is missing from '{_credsFileName}' or Environment variables. Add it and restart the program.");
-                    Console.ReadKey();
                     Environment.Exit(3);
                 }
                 OwnerIds = data.GetSection("OwnerIds").GetChildren().Select(c => ulong.Parse(c.Value)).ToImmutableArray();


Fixes float statistics to culture invariant form

This fixes float statistics values to culture invariant form,
especially forces the decimal separator to be dot.
fixes decimal separator to use invariant culture separator

This is done to avoid problems when reading data from a storage
and it is converted back to floating point values.

Fixes #573.

--- src/Orleans/Statistics/FloatValueStatistic.cs
+++ src/Orleans/Statistics/FloatValueStatistic.cs
@@ -23,6 +23,7 @@

 using System;
 using System.Collections.Generic;
+using System.Globalization;
 using System.Linq;

 namespace Orleans.Runtime
@@ -137,7 +138,7 @@
         public string GetValueString()
         {
             float current = GetCurrentValue();
-            return String.Format("{0:0.000}", current);
+            return String.Format(CultureInfo.InvariantCulture, "{0:0.000}", current);
         }

         public string GetDeltaString()


Added banner

Added banner

--- src/PQDashboard/Views/Main/QuickSearch.cshtml
+++ src/PQDashboard/Views/Main/QuickSearch.cshtml
@@ -82,104 +82,110 @@

-

-
-

-

-

-                    <input class="form-control" id="datePicker" />
-                    (+/- min)
-                    <input id="minutes" value="10" class="form-control" />
-                    <button class="btn btn-primary" onclick="apply()">Apply</button>
-                    <button class="btn" onclick="openMultiNoteModalAll()"></button>
-

-

-

-
-

-
-
-

-
Events

-

-
Disturbances

-

-
Faults

-

-
Breaker

-

-
-

-
-
-

-

-
-
-

-

-                <button type="button" class="close" data-dismiss="modal">×</button>
-
Add a note to event record

+

+
+            Quick Search
+
+

+
+

+
+

+

+

+                        <input class="form-control" id="datePicker" />
+                        (+/- min)
+                        <input id="minutes" value="10" class="form-control" />
+                        <button class="btn btn-primary" onclick="apply()">Apply</button>
+                        <button class="btn" onclick="openMultiNoteModalAll()"></button>
+

+

+

+
+

+
+
+

+
Events

+

+
Disturbances

+

+
Faults

+

+
Breaker

+

+
+

+
+
+

+

+
+
+

+

+                    <button type="button" class="close" data-dismiss="modal">×</button>
+
Add a note to event record

+

+

+
+

+

+                    <textarea wrap="hard" id="note" class="form-control"></textarea>
+

+

+                    <button type="button" class="btn btn-primary" onclick="saveNote()">Add Note</button>
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+

-

-
+
+

+

+
+

+

+
+
+

+

+                    <button type="button" class="close" data-dismiss="modal">×</button>
+
Add a note to associated event records

+

+

+                    <textarea wrap="hard" id="multiNote" class="form-control"></textarea>
+

+

+                    <button type="button" class="btn btn-primary" onclick="saveMultiNote()" data-dismiss="modal">Add Note</button>
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+

-

-                <textarea wrap="hard" id="note" class="form-control"></textarea>
+
+

+

+
+
+

+

+
+
+

+

+                    <button type="button" class="close" data-dismiss="modal">×</button>
+
Add a note to all listed event records

+

+

+                    <textarea wrap="hard" id="multiNoteAll" class="form-control"></textarea>
+

+

+                    <button type="button" class="btn btn-primary" onclick="saveMultiNoteAll()" data-dismiss="modal">Add Note</button>
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+

-

-                <button type="button" class="btn btn-primary" onclick="saveNote()">Add Note</button>
-                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
-

+

-

-

-
-

-

-
-
-

-

-                <button type="button" class="close" data-dismiss="modal">×</button>
-
Add a note to associated event records

-

-

-                <textarea wrap="hard" id="multiNote" class="form-control"></textarea>
-

-

-                <button type="button" class="btn btn-primary" onclick="saveMultiNote()" data-dismiss="modal">Add Note</button>
-                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
-

-

-
-

-

-
-
-

-

-
-
-

-

-                <button type="button" class="close" data-dismiss="modal">×</button>
-
Add a note to all listed event records

-

-

-                <textarea wrap="hard" id="multiNoteAll" class="form-control"></textarea>
-

-

-                <button type="button" class="btn btn-primary" onclick="saveMultiNoteAll()" data-dismiss="modal">Add Note</button>
-                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
-

-

-
-

-

-
-
+    </script>


Made sure that progress 0 gets reported as well

--- src/Proyecto26.RestClient/Helpers/HttpBase.cs
+++ src/Proyecto26.RestClient/Helpers/HttpBase.cs
@@ -22,6 +22,8 @@
                     }
                     else
                     {
+                        options.ProgressCallback(0);
+
                         while (!sendRequest.isDone)
                         {
                             options.ProgressCallback(sendRequest.progress);


Fixed #103 Default button in marker settings dialog.

--- src/SolidGui/MarkerSettingsDialog.Designer.cs
+++ src/SolidGui/MarkerSettingsDialog.Designer.cs
@@ -57,8 +57,10 @@
             //
             // MarkerSettingsDialog
             //
+            this.AcceptButton = this._closeButton;
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.CancelButton = this._closeButton;
             this.ClientSize = new System.Drawing.Size(622, 375);
             this.ControlBox = false;
             this.Controls.Add(this._closeButton);


Gary/Clare #817 Refactor for readability.

--- src/StockportWebapp/Utils/PaginationHelper.cs
+++ src/StockportWebapp/Utils/PaginationHelper.cs
@@ -128,8 +128,9 @@
         {
             Pagination pagination = new Pagination(newsRoomNews.Count, currentPageNumber, "News articles");

+            int itemsOnPreviousPages = pagination.PageSize * (pagination.Page - 1);
             List<News> newsOnCurrentPage = newsRoomNews
-                    .Skip(pagination.PageSize * (pagination.Page - 1))
+                    .Skip(itemsOnPreviousPages)
                     .Take(pagination.PageSize).ToList();
             pagination.TotalItemsOnPage = newsOnCurrentPage.Count;


Delete Mark_Pins.cs

Delete Mark_Pins.cs

--- Highlighting/Mark_Pins.cs
+++ Highlighting/Mark_Pins.cs
@@ -1,48 +0,0 @@
-//-----------------------------------------------------------------------------------
-// PCB-Investigator Automation Script
-// Created on 2014-04-24
-// Autor support@easylogix.de
-// www.pcb-investigator.com
-// SDK online reference http://www.pcb-investigator.com/sites/default/files/documents/InterfaceDocumentation/Index.html
-// SDK http://www.pcb-investigator.com/en/sdk-participate
-// Mark Pins from special net with color.
-//-----------------------------------------------------------------------------------
-using System;
-using System.Collections.Generic;
-using System.Text;
-using PCBI.Plugin;
-using PCBI.Plugin.Interfaces;
-using System.Windows.Forms;
-using System.Drawing;
-using PCBI.Automation;
-using System.IO;
-using System.Drawing.Drawing2D;
-using PCBI.MathUtils;
-
-namespace PCBIScript
-{
-	public class PScript : IPCBIScript
-	{
-		public PScript()
-		{
-		}
-
-		public void Execute(IPCBIWindow parent)
-		{
-            IStep step = parent.GetCurrentStep();
-            IFilter filter = new IFilter(parent);
-            foreach (ICMPObject cmp in step.GetAllCMPObjects())
-            {
-                List<IPin> plist = cmp.GetPinList();
-                foreach (IPin pin in plist)
-                {
-                    if (pin.GetNetNameOnIPin(cmp).ToLower().Contains("gnd"))
-                    {
-                        pin.SetPinColor(Color.Blue, cmp);
-                    }
-                }
-            }
-            parent.UpdateView();
-        }
-    }
-}


FxCop portability message fix

FxCop portability message fix

--- src/System.Threading.Atomics/AtomicInteger.cs
+++ src/System.Threading.Atomics/AtomicInteger.cs
@@ -55,6 +55,7 @@
             }

             [StructLayout(LayoutKind.Explicit)]
+            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Portability", "CA1900:ValueTypeFieldsShouldBePortable", MessageId = "_alignedValue"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Portability", "CA1900:ValueTypeFieldsShouldBePortable", MessageId = "pad")]
             class AlignedBoxedInt32 : BoxedInt32
             {
                 [FieldOffset(0)]


Fixes: U4-3489 Member tree items should not have refresh node as an action

--- src/Umbraco.Web/Trees/MemberTreeController.cs
+++ src/Umbraco.Web/Trees/MemberTreeController.cs
@@ -1,4 +1,5 @@
-using System.Globalization;
+using System;
+using System.Globalization;
 using System.Linq;
 using System.Net.Http.Formatting;
 using System.Web.Security;
@@ -89,8 +90,16 @@
                 return menu;
             }

-            menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));
-            menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
+            Guid guid;
+            if (Guid.TryParse(id, out guid))
+            {
+                menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));
+            }
+            else
+            {
+                menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));
+                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
+            }
             return menu;
         }
     }


Ignore attachment fields when determining serialization conflicts

Fixes #21

--- src/Unicorn/SerializationConflictProcessor.cs
+++ src/Unicorn/SerializationConflictProcessor.cs
@@ -156,6 +156,7 @@
 					field.ID == FieldIDs.Created ||
 					field.ID == FieldIDs.CreatedBy ||
 					field.ID == FieldIDs.UpdatedBy ||
+					field.Type.Equals("attachment", StringComparison.OrdinalIgnoreCase) ||
 					!fieldPredicate.Includes(field.ID).IsIncluded) continue;
 				// we're doing a data comparison here - revision, created (by), updated (by) don't matter
 				// skipping these fields allows us to ignore spurious saves the template builder makes to unchanged items being conflicts


Fixed a bug, not using the specified frequency in the request for locally stored data.

--- QDMSServer/DataSources/MySQLStorage.cs
+++ QDMSServer/DataSources/MySQLStorage.cs
@@ -487,8 +487,6 @@
         /// <summary>
         /// Gets the range of dates for which data is available for the specified instrument, at the specified frequency.
         /// </summary>
-        /// <param name="instrumentID"></param>
-        /// <param name="frequency"></param>
         /// <returns>Null if no match was found. A SotredDataInfo otherwise.</returns>
         public StoredDataInfo GetStorageInfo(int instrumentID, BarSize frequency)
         {
@@ -501,7 +499,9 @@

             using (var cmd = new MySqlCommand("", connection))
             {
-                cmd.CommandText = "SELECT * FROM instrumentinfo WHERE InstrumentID = " + instrumentID;
+                cmd.CommandText = string.Format("SELECT * FROM instrumentinfo WHERE InstrumentID = {0} AND Frequency = {1}",
+                    instrumentID,
+                    frequency);
                 using (var reader = cmd.ExecuteReader())
                 {
                     if (reader.Read())


Add relay command for edit properties

Add relay command for edit properties

--- source/CoordinateConversion/ArcMapAddinCoordinateConversion/MainViewModel.cs
+++ source/CoordinateConversion/ArcMapAddinCoordinateConversion/MainViewModel.cs
@@ -41,6 +41,7 @@
             ActivatePointToolCommand = new RelayCommand(OnActivatePointToolCommand);
             FlashPointCommand = new RelayCommand(OnFlashPointCommand);
             CopyAllCommand = new RelayCommand(OnCopyAllCommand);
+            EditPropertiesDialogCommand = new RelayCommand(OnEditPropertiesDialogCommand);
             Mediator.Register(CoordinateConversionLibrary.Constants.RequestCoordinateBroadcast, OnBCNeeded);
             InputCoordinateHistoryList = new ObservableCollection<string>();

@@ -335,6 +336,11 @@
             if (commandItem != null)
                 application.CurrentTool = commandItem;
         }
+
+        private void OnEditPropertiesDialogCommand(object obj)
+        {
+
+        }

         private void OnAddNewOCCommand(object obj)
         {
@@ -360,6 +366,7 @@
         public RelayCommand ActivatePointToolCommand { get; set; }
         public RelayCommand FlashPointCommand { get; set; }
         public RelayCommand CopyAllCommand { get; set; }
+        public RelayCommand EditPropertiesDialogCommand { get; set; }

         public bool IsHistoryUpdate { get; set; }