Cleanup the MUMmerAligner Class

Cleanup the MUMmerAligner Class

The MUMmer aligner exposed a PairWiseAlgorithm to be used to stitching
together of different seeds. There were however a number of constraints
that this algorithm must obey but which were not controlled for here.
In particular, the algorithm must be a global aligner that returns only
one alignment per sequence pair, but this was not enforced.  As we only
have the NeedleManWunsch aligner that fits the global bill here, I
enforced that this class must use this aligner for stitching together
seeds.  This is a breaking API change, but if anyone was using the old
way their code would silently be giving bad results, so it is an
appropriate change.

This change also added comments for the aligner.

Finally, it also fixes an issue where the insertions were not
tallied correctly as it was converting to List<int> instead of
List<long>

--- src/Source/Framework/Bio.Core/Algorithms/MUMmer/MUMmerAligner.cs
+++ src/Source/Framework/Bio.Core/Algorithms/MUMmer/MUMmerAligner.cs
@@ -13,6 +13,15 @@
 {
     /// <summary>
     /// This class is used for Align MUMs.
+    ///
+    ///
+    /// This is a 'quasi' global aligner in that the alignment is guaranteed to span the entire
+    /// reference and read.  Only 1 alignment will be returned per query sequence.  The
+    /// aligner uses a collection of exact match seeds and "stitches" these seeds together
+    /// by using a NeedlemanWunsch global aligner to get the areas in the middle as well as the
+    /// ends.  In the event no matches are found, a full global alignment will be done, which will
+    /// be very slow for large sequences.
+    ///
     /// </summary>
     public class MUMmerAligner : ISequenceAligner
     {
@@ -107,10 +116,11 @@
         public IConsensusResolver ConsensusResolver { get; set; }

         /// <summary>
-        /// Gets or sets the pair wise aligner which will be executed
-        /// by end of Mummer.
-        /// </summary>
-        public IPairwiseSequenceAligner PairWiseAlgorithm { get; set; }
+        /// Gets or sets the NeedlemanWunschAligner which will be executed
+        /// to stitch gaps between seeds as well as the ends.  Note this algorithm
+        /// must be a global one.
+        /// </summary>
+        public NeedlemanWunschAligner PairWiseAlgorithm { get; set; }

         /// <summary>
         /// Gets the name of the Aligner. Intended to be filled in
@@ -502,19 +512,14 @@
                             alignment.PairwiseAlignedSequences.Add(
                                 this.ProcessGaps(referenceSequence, sequence, finalMumList));
                         }
-
                         results.Add(alignment);
                     }
-                    else
+                    else // Default to a full global alignment - very expensive for large sequences.
                     {
-                        IList<IPairwiseSequenceAlignment> sequenceAlignment = this.RunPairWise(
+                        IPairwiseSequenceAlignment pairwiseAlignment = this.RunPairWise(
                                 referenceSequence,
                                 sequence);
-
-                        foreach (IPairwiseSequenceAlignment pairwiseAlignment in sequenceAlignment)
-                        {
-                            results.Add(pairwiseAlignment);
-                        }
+                        results.Add(pairwiseAlignment);
                     }
                 }
             }
@@ -584,35 +589,25 @@
                     LongestIncreasingSubsequence lis = new LongestIncreasingSubsequence();
                     IList<Match> sortedMumList = lis.SortMum(GetMumsForLIS(mum));

-                    if (sortedMumList.Count > 0)
-                    {
+                    if (sortedMumList.Count > 0) {
                         // Step3(b) : LIS using greedy cover algorithm
                         IList<Match> finalMumList = lis.GetLongestSequence(sortedMumList);

-                        if (finalMumList.Count > 0)
-                        {
+                        if (finalMumList.Count > 0) {
                             // Step 4 : get all the gaps in each sequence and call
                             // pairwise alignment
-                            alignment.PairwiseAlignedSequences.Add(
-                                this.ProcessGaps(referenceSequence, sequence, finalMumList));
+                            alignment.PairwiseAlignedSequences.Add (
+                                this.ProcessGaps (referenceSequence, sequence, finalMumList));
                         }
-
-                        results.Add(alignment);
+                        results.Add (alignment);
+                    } else {
+                        IPairwiseSequenceAlignment pairwiseAlignment = this.RunPairWise (
+                                                                           referenceSequence,
+                                                                           sequence);
+                        results.Add (pairwiseAlignment);
                     }
-                    else
-                    {
-                        IList<IPairwiseSequenceAlignment> sequenceAlignment = this.RunPairWise(
-                                referenceSequence,
-                                sequence);
-
-                        foreach (IPairwiseSequenceAlignment pairwiseAlignment in sequenceAlignment)
-                        {
-                            results.Add(pairwiseAlignment);
-                        }
-                    }
-                }
-            }
-
+                }
+            }
             return results;
         }

@@ -622,14 +617,13 @@
         /// <param name="seq1">Sequence 1.</param>
         /// <param name="seq2">Sequence 2.</param>
         /// <returns>A list of sequence alignments.</returns>
-        private IList<IPairwiseSequenceAlignment> RunPairWise(ISequence seq1, ISequence seq2)
-        {
-            IList<IPairwiseSequenceAlignment> sequenceAlignment = null;
-
-            if (this.PairWiseAlgorithm == null)
-            {
-                this.PairWiseAlgorithm = new NeedlemanWunschAligner();
-            }
+        private IPairwiseSequenceAlignment RunPairWise(ISequence seq1, ISequence seq2)
+        {
+            IPairwiseSequenceAlignment sequenceAlignment = null;
+
+            if (this.PairWiseAlgorithm == null) {
+                this.PairWiseAlgorithm = new NeedlemanWunschAligner ();
+            }

             this.PairWiseAlgorithm.SimilarityMatrix = SimilarityMatrix;
             this.PairWiseAlgorithm.GapOpenCost = this.GapOpenCost;
@@ -638,15 +632,30 @@
             if (this.UseGapExtensionCost)
             {
                 this.PairWiseAlgorithm.GapExtensionCost = this.GapExtensionCost;
-                sequenceAlignment = this.PairWiseAlgorithm.Align(seq1, seq2);
+                sequenceAlignment = this.PairWiseAlgorithm.Align(seq1, seq2).FirstOrDefault();
             }
             else
             {
-                sequenceAlignment = this.PairWiseAlgorithm.AlignSimple(seq1, seq2);
-            }
-
-            // MUMmer does not support other aligners. Throw exception.
+                sequenceAlignment = this.PairWiseAlgorithm.AlignSimple(seq1, seq2).FirstOrDefault();
+            }
+            // NeedlemanWunsch is a global aligner that should always return exactly one alignment
+            if (sequenceAlignment == null || sequenceAlignment.PairwiseAlignedSequences.Count != 1 || sequenceAlignment.PairwiseAlignedSequences[0] == null) {
+                throw new Exception ("NeedlemanWunsch failed to return an alignment when gaps in mummer were being processed");
+            }
             return sequenceAlignment;
+        }
+
+        /// <summary>
+        /// Convenience method to get the needlemanWunsch global alignment,
+        /// but return only the aligned sequences, not the larger
+        /// IPairwiseSequenceAlignment object with both.
+        /// </summary>
+        /// <returns>The pair wise return just alignment.</returns>
+        /// <param name="seq1">Seq1.</param>
+        /// <param name="seq2">Seq2.</param>
+        private PairwiseAlignedSequence RunPairWiseReturnJustAlignment(ISequence seq1, ISequence seq2) {
+            var aln = RunPairWise (seq1, seq2);
+            return aln.PairwiseAlignedSequences.First ();
         }

         /// <summary>
@@ -752,16 +761,10 @@
                 alphabet,
                 consensus);

-            // Offset is not required as Smith Waterman will  fragmented alignment.
-            // Offset is the starting position of alignment of sequence1 with respect to sequence2.
-            if (this.PairWiseAlgorithm is NeedlemanWunschAligner)
-            {
-                alignedSequence.FirstOffset = alignedSequence.FirstSequence.IndexOfNonGap() -
-                    referenceSequence.IndexOfNonGap();
-                alignedSequence.SecondOffset = alignedSequence.SecondSequence.IndexOfNonGap() -
-                    sequence.IndexOfNonGap();
-            }
-
+            alignedSequence.FirstOffset = alignedSequence.FirstSequence.IndexOfNonGap() - referenceSequence.IndexOfNonGap();
+            alignedSequence.SecondOffset = alignedSequence.SecondSequence.IndexOfNonGap() - sequence.IndexOfNonGap();
+
+
             List<long> startOffsets = new List<long>(2);
             List<long> endOffsets = new List<long>(2);
             startOffsets.Add(0);
@@ -803,7 +806,6 @@
             long score = 0;
             ISequence sequence1 = null;
             ISequence sequence2 = null;
-            IList<IPairwiseSequenceAlignment> sequenceAlignment = null;
             byte[] mum1String;
             byte[] mum2String;

@@ -840,57 +842,42 @@
             long referenceGapStartIndex = mum1ReferenceStartIndex + mum1Length;
             long queryGapStartIndex = mum1QueryStartIndex + mum1Length;

+            /* Stich the exact matches together according to if both sequences have data
+             * in the gap (in which case use a global alignment) or if only one does
+             * (in which case just insert gaps).
+             */
             if (mum2ReferenceStartIndex > referenceGapStartIndex
-                && mum2QueryStartIndex > queryGapStartIndex)
-            {
+                && mum2QueryStartIndex > queryGapStartIndex) // Both sequences have data in the gap.
+            {
+                // Get the sequences in between
                 sequence1 = referenceSequence.GetSubSequence(
                     referenceGapStartIndex,
                     mum2ReferenceStartIndex - referenceGapStartIndex);
                 sequence2 = querySequence.GetSubSequence(
                     queryGapStartIndex,
                     mum2QueryStartIndex - queryGapStartIndex);
-
-                sequenceAlignment = this.RunPairWise(sequence1, sequence2);
-
-                if (sequenceAlignment != null)
-                {
-                    foreach (IPairwiseSequenceAlignment pairwiseAlignment in sequenceAlignment)
-                    {
-                        foreach (PairwiseAlignedSequence alignment in pairwiseAlignment.PairwiseAlignedSequences)
-                        {
-                            sequenceResult1.InsertRange(
-                                    sequenceResult1.Count,
-                                    alignment.FirstSequence);
-                            sequenceResult2.InsertRange(
-                                    sequenceResult2.Count,
-                                    alignment.SecondSequence);
-                            consensusResult.InsertRange(
-                                consensusResult.Count,
-                                    alignment.Consensus);
-
-                            score += alignment.Score;
-
-                            if (alignment.Metadata.ContainsKey("Insertions"))
-                            {
-                                List<int> gapinsertions = alignment.Metadata["Insertions"] as List<int>;
-                                if (gapinsertions != null)
-                                {
-                                    if (gapinsertions.Count > 0)
-                                    {
-                                        insertions[0] += gapinsertions[0];
-                                    }
-
-                                    if (gapinsertions.Count > 1)
-                                    {
-                                        insertions[1] += gapinsertions[1];
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            else if (mum2ReferenceStartIndex > referenceGapStartIndex)
+
+                // Do a pairwise alignment (must be needleman wunsh)
+                var alignment = this.RunPairWiseReturnJustAlignment(sequence1, sequence2);
+                sequenceResult1.AddRange(alignment.FirstSequence);
+                sequenceResult2.AddRange(alignment.SecondSequence);
+                consensusResult.AddRange(alignment.Consensus);
+
+                score += alignment.Score;
+
+                if (!alignment.Metadata.ContainsKey ("Insertions")) {
+                    // Should never happen - can remove later.
+                    throw new Exception ("NeedlemanWunsch alignment did not have an insertion entry");
+                }
+                List<long> gapinsertions = alignment.Metadata ["Insertions"] as List<long>;
+                if (gapinsertions == null || gapinsertions.Count != 2) {
+                    // Should never happen - can remove later
+                    throw new Exception("Alignment Insertions were not available as a size 2 list");
+                }
+                insertions [0] += gapinsertions [0];
+                insertions [1] += gapinsertions [1];
+            }
+            else if (mum2ReferenceStartIndex > referenceGapStartIndex) // Only the reference has data, insert gaps for the query
             {
                 sequence1 = referenceSequence.GetSubSequence(
                     referenceGapStartIndex,
@@ -911,7 +898,7 @@
                     score = sequence1.Count * this.GapOpenCost;
                 }
             }
-            else if (mum2QueryStartIndex > queryGapStartIndex)
+            else if (mum2QueryStartIndex > queryGapStartIndex) // Only the query has data, insert gaps for the reference
             {
                 sequence2 = querySequence.GetSubSequence(
                     queryGapStartIndex,


Default plan id.

Default plan id.

--- src/Squidex.Domain.Apps.Entities/Apps/AppHistoryEventsCreator.cs
+++ src/Squidex.Domain.Apps.Entities/Apps/AppHistoryEventsCreator.cs
@@ -209,7 +209,7 @@

             return Task.FromResult(
                 ForEvent(@event, channel)
-                    .AddParameter("Plan", @event.PlanId));
+                    .AddParameter("Plan", @event.PlanId ?? "free"));
         }

         protected Task<HistoryEvent> On(AppRoleDeleted @event)


fix format change on IOperation dumper

fix format change on IOperation dumper

--- src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs
+++ src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs
@@ -237,7 +237,13 @@
         {
             Debug.Assert(!string.IsNullOrEmpty(header));

-            var elementCount = logElementCount ? $"({list.Count()})" : string.Empty;
+            var count = list.Count();
+            if (count == 0)
+            {
+                return;
+            }
+
+            var elementCount = logElementCount ? $"({count})" : string.Empty;
             Indent();
             LogString($"{header}{elementCount}: ");
             VisitArray(list);


Append the database field to MySqlCommandTests.cs connection string

--- src/Tests/Tests.Daterpillar/IntegrationTest/MySqlCommandTests.cs
+++ src/Tests/Tests.Daterpillar/IntegrationTest/MySqlCommandTests.cs
@@ -1,5 +1,6 @@
 using Gigobyte.Daterpillar.Data;
 using Gigobyte.Daterpillar.Data.Linq;
+using Gigobyte.Daterpillar.Transformation;
 using Gigobyte.Daterpillar.Transformation.Template;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using MySql.Data.MySqlClient;
@@ -15,12 +16,15 @@
         [ClassInitialize]
         public static void Setup(TestContext context)
         {
+            var schema = Schema.Load(SampleData.GetFile(SampleData.MusicxddlXML).OpenRead());
             _connectionString = ConfigurationManager.ConnectionStrings["mysql"].ConnectionString;
-            _unableToRunTests = !SampleData.TryCreateSampleDatabase(new MySqlConnection(_connectionString), new MySqlTemplate(new MySqlTemplateSettings()
+            _unableToRunTests = !SampleData.TryCreateSampleDatabase(new MySqlConnection(_connectionString), schema, new MySqlTemplate(new MySqlTemplateSettings()
             {
                 CommentsEnabled = false,
                 DropDatabaseIfExist = true
             }));
+
+            _connectionString += $"database={schema.Name}";
         }

         [TestMethod]


Quiet down the graph tracer

Quiet down the graph tracer

--- produce/Builder/Tracer.cs
+++ produce/Builder/Tracer.cs
@@ -52,13 +52,10 @@
 ClearDots()
 {
     if (!Enabled) return;
-    using (LogicalOperation.Start("Deleting existing graph drawings"))
-    {
-        DotCount = 0;
-        var debugDir = Graph.Workspace.GetDebugDirectory();
-        foreach (var file in Directory.GetFiles(debugDir, "*.dot")) File.Delete(file);
-        foreach (var file in Directory.GetFiles(debugDir, "*.dot.png")) File.Delete(file);
-    }
+    DotCount = 0;
+    var debugDir = Graph.Workspace.GetDebugDirectory();
+    foreach (var file in Directory.GetFiles(debugDir, "*.dot")) File.Delete(file);
+    foreach (var file in Directory.GetFiles(debugDir, "*.dot.png")) File.Delete(file);
 }

@@ -70,13 +67,8 @@
     var dotFile = Path.Combine(debugDir, $"graph{DotCount:d2}.dot");
     var pngFile = Path.Combine(debugDir, $"graph{DotCount:d2}.dot.png");
     var dot = "C:\\Program Files (x86)\\Graphviz2.38\\bin\\dot.exe";
-
-    using (LogicalOperation.Start($"Drawing graph {dotFile}"))
-    {
-        File.WriteAllLines(dotFile, ToDot(targetToBuild));
-        ProcessExtensions.Execute(true, true, null, dot, "-Tpng", "-o" + pngFile, dotFile);
-    }
-
+    File.WriteAllLines(dotFile, ToDot(targetToBuild));
+    ProcessExtensions.Execute(false, false, null, dot, "-Tpng", "-o" + pngFile, dotFile);
     DotCount++;
 }


it is called 'control' connection, not command connection

--- lib/Session.cs
+++ lib/Session.cs
@@ -22,7 +22,7 @@
         // Result for FEAT command
         private static string[] FEATURES = { "MDTM", "PASV", "SIZE", "UTF8" };

-        private Socket commandSocket;
+        private Socket controlSocket;
         private IAuthHandler authHandler;
         private IFileSystemHandler fsHandler;
         private ILogHandler logHandler;
@@ -41,7 +41,7 @@

         public Session(Socket socket, IAuthHandler authHandler, IFileSystemHandler fileSystemHandler, ILogHandler logHandler)
         {
-            this.commandSocket = socket;
+            this.controlSocket = socket;
             this.authHandler = authHandler;
             this.fsHandler = fileSystemHandler;
             this.logHandler = logHandler;
@@ -69,8 +69,8 @@
             if (thread.IsAlive)
                 thread.Abort();

-            if (commandSocket.Connected)
-                commandSocket.Close();
+            if (controlSocket.Connected)
+                controlSocket.Close();

             if (dataSocket != null && dataSocket.Connected)
                 dataSocket.Close();
@@ -87,13 +87,13 @@
                     loggedIn = true;
                 }

-                while (commandSocket.Connected) {
+                while (controlSocket.Connected) {
                     string verb;
                     string args;
                     if (!ReadCommand(out verb, out args)) {
-                        if (commandSocket.Connected) {
+                        if (controlSocket.Connected) {
                             Respond(500, "Failed to read command, closing connection.");
-                            commandSocket.Close();
+                            controlSocket.Close();
                         }
                         break;
                     } else if (verb.Trim() == "") {
@@ -106,7 +106,7 @@
                             ProcessCommand(verb, args);
                         else if (verb == "QUIT") { // QUIT should always be allowed
                             Respond(221, "Bye.");
-                            commandSocket.Close();
+                            controlSocket.Close();
                         } else {
                             HandleAuth(verb, args);
                         }
@@ -115,8 +115,8 @@
                     }
                 }
             } finally {
-                if (commandSocket.Connected)
-                    commandSocket.Close();
+                if (controlSocket.Connected)
+                    controlSocket.Close();

                 logHandler.ClosedControlConnection(peerEndPoint);
             }
@@ -133,7 +133,7 @@
                 case "QUIT":
                 {
                     Respond(221, "Bye.");
-                    commandSocket.Close();
+                    controlSocket.Close();
                     break;
                 }
                 case "FEAT":
@@ -171,7 +171,7 @@
                         break;
                     }

-                    IPAddress clientIP = ((IPEndPoint) commandSocket.RemoteEndPoint).Address;
+                    IPAddress clientIP = ((IPEndPoint) controlSocket.RemoteEndPoint).Address;
                     if (!port.Address.Equals(clientIP)) {
                         Respond(500, "Specified IP differs from client IP");
                         break;
@@ -309,7 +309,7 @@

             do {
                 int freeBytes = cmdRcvBuffer.Length - cmdRcvBytes;
-                int bytes = commandSocket.Receive(cmdRcvBuffer, cmdRcvBytes, freeBytes, SocketFlags.None);
+                int bytes = controlSocket.Receive(cmdRcvBuffer, cmdRcvBytes, freeBytes, SocketFlags.None);
                 cmdRcvBytes += bytes;

                 // search \r\n
@@ -344,7 +344,7 @@
             response += "\r\n";

             byte[] sendBuffer = EncodeString(response);
-            commandSocket.Send(sendBuffer);
+            controlSocket.Send(sendBuffer);

             logHandler.SentResponse(peerEndPoint, code, desc);
         }
@@ -522,7 +522,7 @@
             dataSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);

             if (listen) {
-                IPAddress serverIP = ((IPEndPoint) commandSocket.LocalEndPoint).Address;
+                IPAddress serverIP = ((IPEndPoint) controlSocket.LocalEndPoint).Address;
                 dataSocket.Bind(new IPEndPoint(serverIP, 0));
                 dataSocket.Listen(1);
             }


Update #439 - Initial commit of config generator

--- source/Glimpse.Core/Resource/ConfigurationResource.cs
+++ source/Glimpse.Core/Resource/ConfigurationResource.cs
@@ -84,19 +84,72 @@
             var packages = FindPacakges();

             content.Append("<!DOCTYPE html><title>Glimpse - Configuration Page</title><link rel=\"shortcut icon\" href=\"http://getglimpse.com/content/_v1/app-config-favicon.png?version=" + GlimpseRuntime.Version + "\" />");
-            content.Append("");
+            content.Append("");
             content.Append("");
             content.Append("");
             content.Append("

v" + GlimpseRuntime.Version + " (core)

Bookmarklets
“Drag us to your favorites bar for quick and easy access to Glimpse”

find out moreTurn Glimpse OnTurn Glimpse OffSet Glimpse Session Name

");
             content.Append("
");

             //Duplicate resource
-            var duplicateResources = this.DetectDuplicateResources(configuration.Resources);
+            var duplicateResources = DetectDuplicateResources(configuration.Resources);
             if (duplicateResources.Any())
             {
                 var instances = string.Join(", ", duplicateResources.Select(x => string.Format("{0}", x)).ToArray());
                 content.AppendFormat("
Houston we have a problem :(
 We have detected that the following resources have been duplicated - {0}. Typically when this happens, Glimpse will fail to operate correctly and lead to ambiguous references.
", instances);
             }
+
+            //Configuration generator
+            content.Append("

Configuration Helper
");
+            content.Append("
NOTE: The below is only designed to help generate the config which needs be copied over to your web.config
");
+            content.Append("

<input type=\"checkbox\" data-show=\"code-logging\"> Turn Logging On?

<input type=\"checkbox\" data-show=\"code-runtimePolicies-blacklist\"> Blacklist URIs?

<input type=\"checkbox\" data-show=\"code-runtimePolicies-statusCodes\"> Status Codes?

<input type=\"checkbox\" data-show=\"code-runtimePolicies-contentTypes\"> Content Types?

");
+            content.Append("
x
");
+            content.Append("
");
+
+            content.AppendFormat("
{0}
", Escape("<glimpse defaultRuntimePolicy=\"On\" endpointBaseUri=\"~/Glimpse.axd\">"));
+
+            content.AppendFormat("
{0}
", Escape("    <logging level=\"Trace\" />"));
+
+            content.AppendFormat("
{0}
", Escape("    "));
+
+            content.AppendFormat("

{0}
", Escape("    <tabs>"));
+            content.Append("
");
+            content.AppendFormat("
{0}
", Escape("        <ignoredTypes>"));
+            content.Append("

");
+            content.AppendFormat("
{0}
", Escape("        </ignoredTypes>"));
+            content.Append("
");
+            content.AppendFormat("
{0}

", Escape("    </tabs>"));
+
+            content.AppendFormat("
{0}
", Escape("    "));
+
+            content.AppendFormat("

{0}
", Escape("    <runtimePolicies>"));
+            content.Append("
");
+            content.AppendFormat("
{0}
", Escape("        <ignoredTypes>"));
+            content.Append("

");
+            content.AppendFormat("
{0}
", Escape("        </ignoredTypes>"));
+            content.Append("
");
+            content.Append("
");
+            content.AppendFormat("
{0}
", Escape("        <uris>\n            <add regex=\".*/admin.*\"/>\n        </uris>"));
+            content.Append("
");
+            content.Append("
");
+            content.AppendFormat("
{0}
", Escape("        <statusCodes>\n            <add statusCode=\"404\"/>\n        </statusCodes>"));
+            content.Append("
");
+            content.Append("
");
+            content.AppendFormat("
{0}
", Escape("        <contentTypes>\n            <add contentType=\"application/xml\"/>\n        </contentTypes>"));
+            content.Append("
");
+            content.AppendFormat("
{0}

", Escape("    </runtimePolicies>"));
+
+            content.AppendFormat("

{0}
", Escape("    <inspectors>"));
+            content.Append("
");
+            content.AppendFormat("
{0}
", Escape("        <ignoredTypes>"));
+            content.Append("

");
+            content.AppendFormat("
{0}
", Escape("        </ignoredTypes>"));
+            content.Append("
");
+            content.AppendFormat("
{0}

", Escape("    </inspectors>"));
+
+            content.AppendFormat("
{0}
", Escape("</glimpse>"));
+
+            content.Append("
");
+            content.Append("
");

             //Update notification
             content.Append("");
@@ -105,16 +158,17 @@
             //Cookie status on/off/other
             content.Append("");
             //Configuration help
-            content.Append("

Configuration Help?
Want to learn more about configuring Glimpse or how to disable Tabs or Policies, head over to our config help page
");
+            content.Append("

Configuration Help?
Want to learn more about configuring Glimpse or how to disable Tabs or Policies?
Start Config Helper
");  //head over to our config help page
             content.Append("
");

             //Registered  Tabs
-            content.Append("

Registered  Tabs:
");
-            GroupContent(content, (x, y) => x.AppendFormat("
{0} - {1} - {2}
", y.Name, y.GetType().FullName, y.ExecuteOn), configuration.Tabs.OrderBy(x => x.Name), packages);
+            content.Append("
Standard Settings
");
+            content.Append("

Registered  Tabs:
");
+            GroupContent(content, (x, y) => x.AppendFormat("
<input type=\"checkbox\" data-type=\"{1}, {3}\" checked=\"checked\" />{0} - {1} - {2}
", y.Name, y.GetType().FullName, y.ExecuteOn, y.GetType().Assembly.GetName().Name), configuration.Tabs.OrderBy(x => x.Name), packages);
             content.Append("
Want to create your own Tabs - see here!");

             //Runtime Policies
-            content.Append("

Runtime Policies:
");
+            content.Append("

Runtime Policies:
");
             GroupContent(content, (x, y) => {
                     var warning = string.Empty;
                     if (y.GetType().FullName == "Glimpse.AspNet.Policy.LocalPolicy")
@@ -122,7 +176,7 @@
                         warning = "*This policy means that Glimpse won't run remotely.*";
                     }

-                    x.AppendFormat("
{0} - {1} {2}
", y.GetType().FullName, y.ExecuteOn, warning);
+                    x.AppendFormat("
<input type=\"checkbox\" data-type=\"{0}, {3}\" checked=\"checked\" />{0} - {1} {2}
", y.GetType().FullName, y.ExecuteOn, warning, y.GetType().Assembly.GetName().Name);
                 }, configuration.RuntimePolicies.OrderBy(x => x.GetType().FullName), packages);
             content.Append("
Learn how to create your own policies - see here!

");

@@ -130,8 +184,8 @@
             content.Append("More details?Less details?
");

             //Detailed Settings
-            content.Append("
Detailed Settings:

Inspectors:
");
-            GroupContent(content, (x, y) => x.AppendFormat("
{0}
", y.GetType().FullName), configuration.Inspectors.OrderBy(x => x.GetType().FullName), packages);
+            content.Append("
Detailed Settings:

Inspectors:
");
+            GroupContent(content, (x, y) => x.AppendFormat("
<input type=\"checkbox\" data-type=\"{0}, {1}\" checked=\"checked\" />{0}
", y.GetType().FullName, y.GetType().Assembly.GetName().Name), configuration.Inspectors.OrderBy(x => x.GetType().FullName), packages);

             //Resources
             content.Append("

Resources:
");
@@ -183,6 +237,8 @@
             content.Append("
");
             content.Append("
");
             content.Append("

For more info see getGlimpse.com

 Found an error? Help us improve.    Have a question? Tweet us using #glimpse.

");
+            content.Append("");
+            content.Append("");
             content.Append("");

             return new HtmlResourceResult(content.ToString());
@@ -252,6 +308,11 @@
             return resources.GroupBy(x => x.Name).Where(x => x.Count() > 1).Select(x => x.Key);
         }

+        private string Escape(string content)
+        {
+            return content.Replace("<", "<");
+        }
+
         private class PackageItem<T>
         {
             public PackageItem()


Fixed logging to trace

Fixed logging to trace

Former-commit-id: 68171039343cefa90ca3fed519c4a14faacb1c2d

--- MeTLMeeting/SandRibbon/Utils/Logger.cs
+++ MeTLMeeting/SandRibbon/Utils/Logger.cs
@@ -1,5 +1,6 @@
 using System;
 using System.IO;
+using System.Diagnostics;

 namespace SandRibbon.Utils
 {
@@ -12,26 +13,12 @@
         {/*Interesting quirk about the formatting: \n is the windows line ending but ruby assumes
           *nix endings, which are \r.  Safest to use both, I guess.*/
             var now = SandRibbonObjects.DateTimeFactory.Now();
-            lock(Logger.logLock)
-                log = string.Format("{0}{1}.{2}: {3}\r\n", log, now, now.Millisecond, appendThis);
+            Trace.TraceInformation("{0}{1}.{2}: {3}\r\n", log, now, now.Millisecond, appendThis);
         }
         public static void Log(string format, params object[] args)
         {
             var s = string.Format(format, args);
             Log(s);
         }
-        public static void Dump()
-        {
-            try
-            {
-                using (var stream = new FileStream(logDump, FileMode.Append, FileAccess.Write))
-                using (var writer = new StreamWriter(stream))
-                    writer.Write(log);
-            }
-            catch (Exception)
-            {
-                //Mm.
-            }
-        }
     }
 }


Fix CommandConnection methods in Test

Fix CommandConnection methods in Test

--- Mycroft.Tests/TestCommandConnection.cs
+++ Mycroft.Tests/TestCommandConnection.cs
@@ -17,7 +17,7 @@
         public async Task TestBodylessMessage(){
             var s = new MemoryStream(Encoding.UTF8.GetBytes("6\nAPP_UP"));
             var cmd = new CommandConnection(s);
-            var msg = await cmd.getCommandAsync();
+            var msg = await cmd.GetCommandAsync();
             Trace.WriteLine(msg);
             if (msg != "APP_UP")
                 throw new Exception("Incorrect message!");
@@ -29,7 +29,7 @@
             var input = "30\nMSG_BROADCAST {\"key\": \"value\"}";
             var s = new MemoryStream(Encoding.UTF8.GetBytes(input));
             var cmd = new CommandConnection(s);
-            var msg = await cmd.getCommandAsync();
+            var msg = await cmd.GetCommandAsync();
             Trace.WriteLine(msg);
             Trace.WriteLine(input.Substring(3));
             if (msg != input.Substring(3))


Fix bad field tests with seconds that were not exercising the right case

--- NCrontab.Tests/CrontabScheduleTests.cs
+++ NCrontab.Tests/CrontabScheduleTests.cs
@@ -300,54 +300,62 @@
             });
         }

-        [TestCase("bad * * * * *")]
-        public void BadSecondsField(string expression) =>
-            Assert.Throws<CrontabException>(() => CrontabSchedule.Parse(expression));
-
-        [TestCase("bad * * * *")]
-        [TestCase("* bad * * * *")]
-        public void BadMinutesField(string expression) =>
-            Assert.Throws<CrontabException>(() => CrontabSchedule.Parse(expression));
-
-        [TestCase("* bad * * *")]
-        [TestCase("* * bad * * *")]
-        public void BadHoursField(string expression) =>
-            Assert.Throws<CrontabException>(() => CrontabSchedule.Parse(expression));
-
-        [TestCase("* * bad * *")]
-        [TestCase("* * * bad * *")]
-        public void BadDayField(string expression) =>
-            Assert.Throws<CrontabException>(() => CrontabSchedule.Parse(expression));
-
-        [TestCase("* * * bad *")]
-        [TestCase("* * * * bad *")]
-        public void BadMonthField(string expression) =>
-            Assert.Throws<CrontabException>(() => CrontabSchedule.Parse(expression));
-
-        [TestCase("* * * * mon,bad,wed")]
-        [TestCase("* * * * * mon,bad,wed")]
-        public void BadDayOfWeekField(string expression) =>
-            Assert.Throws<CrontabException>(() => CrontabSchedule.Parse(expression));
-
-        [TestCase("* 1,2,3,456,7,8,9 * * *")]
-        [TestCase("* * 1,2,3,456,7,8,9 * * *")]
-        public void OutOfRangeField(string expression) =>
-            Assert.Throws<CrontabException>(() => CrontabSchedule.Parse(expression));
-
-        [TestCase("* 1,Z,3,4 * * *")]
-        [TestCase("* * 1,Z,3,4 * * *")]
-        public void NonNumberValueInNumericOnlyField(string expression) =>
-            Assert.Throws<CrontabException>(() => CrontabSchedule.Parse(expression));
-
-        [TestCase("* 1/Z * * *")]
-        [TestCase("* * 1/Z * * *")]
-        public void NonNumericFieldInterval(string expression) =>
-            Assert.Throws<CrontabException>(() => CrontabSchedule.Parse(expression));
-
-        [TestCase("* 3-l2 * * *")]
-        [TestCase("* * 3-l2 * * *")]
-        public void NonNumericFieldRangeComponent(string expression) =>
-            Assert.Throws<CrontabException>(() => CrontabSchedule.Parse(expression));
+        static void BadField(string expression, bool includingSeconds)
+        {
+            Assert.Throws<CrontabException>(() => CrontabSchedule.Parse(expression, new ParseOptions
+            {
+                IncludingSeconds = includingSeconds
+            }));
+        }
+
+        [TestCase("bad * * * * *", false)]
+        public void BadSecondsField(string expression, bool includingSeconds) =>
+            BadField(expression, includingSeconds);
+
+        [TestCase("bad * * * *", false)]
+        [TestCase("* bad * * * *", true)]
+        public void BadMinutesField(string expression, bool includingSeconds) =>
+            BadField(expression, includingSeconds);
+
+        [TestCase("* bad * * *", false)]
+        [TestCase("* * bad * * *", true)]
+        public void BadHoursField(string expression, bool includingSeconds) =>
+            BadField(expression, includingSeconds);
+
+        [TestCase("* * bad * *", false)]
+        [TestCase("* * * bad * *", true)]
+        public void BadDayField(string expression, bool includingSeconds) =>
+            BadField(expression, includingSeconds);
+
+        [TestCase("* * * bad *", false)]
+        [TestCase("* * * * bad *", true)]
+        public void BadMonthField(string expression, bool includingSeconds) =>
+            BadField(expression, includingSeconds);
+
+        [TestCase("* * * * mon,bad,wed", false)]
+        [TestCase("* * * * * mon,bad,wed", true)]
+        public void BadDayOfWeekField(string expression, bool includingSeconds) =>
+            BadField(expression, includingSeconds);
+
+        [TestCase("* 1,2,3,456,7,8,9 * * *", false)]
+        [TestCase("* * 1,2,3,456,7,8,9 * * *", true)]
+        public void OutOfRangeField(string expression, bool includingSeconds) =>
+            BadField(expression, includingSeconds);
+
+        [TestCase("* 1,Z,3,4 * * *", false)]
+        [TestCase("* * 1,Z,3,4 * * *", true)]
+        public void NonNumberValueInNumericOnlyField(string expression, bool includingSeconds) =>
+            BadField(expression, includingSeconds);
+
+        [TestCase("* 1/Z * * *", false)]
+        [TestCase("* * 1/Z * * *", true)]
+        public void NonNumericFieldInterval(string expression, bool includingSeconds) =>
+            BadField(expression, includingSeconds);
+
+        [TestCase("* 3-l2 * * *", false)]
+        [TestCase("* * 3-l2 * * *", true)]
+        public void NonNumericFieldRangeComponent(string expression, bool includingSeconds) =>
+            BadField(expression, includingSeconds);

         static void CronCall(string startTimeString, string cronExpression, string nextTimeString, ParseOptions options)
         {


add pipeline created status

add pipeline created status

--- NGitLab/NGitLab/Models/PipelineData.cs
+++ NGitLab/NGitLab/Models/PipelineData.cs
@@ -5,6 +5,7 @@
         undefined,
         pending,
         success,
+        created,
         failed,
         aborted,
         running,


remove private accessor

remove private accessor

--- NJetty.Servlet_3_0.Spec/Http/Cookie.cs
+++ NJetty.Servlet_3_0.Spec/Http/Cookie.cs
@@ -381,7 +381,7 @@
         /// </summary>
         /// <param name="value">the string to be tested</param>
         /// <returns>true if the string is a reserved token; false if it is not</returns>
-        private bool IsToken(string value)
+        bool IsToken(string value)
         {
             int len = value.Length;


Remove statement from logs

Remove statement from logs

ARKADE-228

--- src/Arkivverket.Arkade/Logging/TestSessionXmlGenerator.cs
+++ src/Arkivverket.Arkade/Logging/TestSessionXmlGenerator.cs
@@ -21,7 +21,6 @@
             string pathToLogFile = testSession.Archive.WorkingDirectory.RepositoryOperations()
                 .WithFile(ArkadeConstants.ArkadeXmlLogFileName)
                 .FullName;
-            _log.Information("Writing xml log file to {LogFile}", pathToLogFile);

             testSessionLog log = GetTestSessionLog(testSession);
             FileStream fs = new FileStream(pathToLogFile, FileMode.Create);


Fixed SynchronizeItems adding duplicate items.

--- src/Avalonia.Controls/Primitives/SelectingItemsControl.cs
+++ src/Avalonia.Controls/Primitives/SelectingItemsControl.cs
@@ -639,20 +639,20 @@
         /// <param name="desired">The desired items.</param>
         internal static void SynchronizeItems(IList items, IEnumerable<object> desired)
         {
-            int index = 0;
-
-            foreach (var i in desired)
-            {
-                if (index < items.Count)
-                {
-                    if (items[index] != i)
-                    {
-                        items[index] = i;
-                    }
-                }
-                else
-                {
-                    items.Add(i);
+            var index = 0;
+
+            foreach (object item in desired)
+            {
+                int itemIndex = items.IndexOf(item);
+
+                if (itemIndex == -1)
+                {
+                    items.Insert(index, item);
+                }
+                else if(itemIndex != index)
+                {
+                    items.RemoveAt(itemIndex);
+                    items.Insert(index, item);
                 }

                 ++index;


Cleaned up code and added more comments

Cleaned up code and added more comments

--- PixelCamera.cs
+++ PixelCamera.cs
@@ -218,15 +218,10 @@
 			// Find the settings to be used for drawing the GL quad
 			Vector2 pixelSize = new Vector2(pixelRenderSize[0], pixelRenderSize[1]) * zoomLevel;
 			if (cam.orthographic)
+			{
+				// Orthographic camera needs to use screen size when calculating quad offset
 				screenRenderSize = new Vector2(Screen.width, Screen.height);

-			quadOffset = pixelSize - screenRenderSize;
-			quadOffset /= 2;
-			quadOffset.x /= Screen.width;
-			quadOffset.y /= Screen.height;
-
-			if (cam.orthographic)
-			{
 				// Set the camera's size, according to pixel size
 				float targetHeight = pixelRenderSize[1];
 				// Use pixel density to convert to world units
@@ -235,6 +230,13 @@
 				// Change orthographic size so camera is sized to world unit
 				cam.orthographicSize = targetHeight;
 			}
+
+			quadOffset = pixelSize - screenRenderSize;
+			quadOffset /= 2;
+			quadOffset.x /= Screen.width;
+			quadOffset.y /= Screen.height;
+
+			// Set camera aspect ratio, since pixel aspect ratio will be different from current aspect
 			float targetAspect = (float)pixelRenderSize[0] / (float)pixelRenderSize[1];
 			cam.aspect = targetAspect;

@@ -255,7 +257,7 @@
 			// Make main camera render into it
 			cam.targetTexture = renderTexture;

-			// Set render texture as _MainTex on the materials
+			// Set render texture as _MainTex on materials
 			fallbackMaterial.SetTexture("_MainTex", renderTexture);
 			if (advancedSettings != null)
 				CameraMaterial = advancedSettings.cameraMaterial;


Adding constants for string fields

Adding constants for string fields

--- src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs
+++ src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs
@@ -14,7 +14,7 @@
         private const string ConfirmSwitchTitle = "Confirm branch switch";
         private const string ConfirmSwitchMessage = "Switch branch to {0}?";
         private const string ConfirmSwitchOK = "Switch";
-        private const string ConfirmSwitchCancel = "Cancel";
+        private const string ConfirmSwitchCancel = CancelButtonLabel;
         private const string NewBranchCancelButton = "x";
         private const string NewBranchConfirmButton = "Create";
         private const string FavoritesSetting = "Favorites";
@@ -23,6 +23,10 @@
         private const string LocalTitle = "Local branches";
         private const string RemoteTitle = "Remote branches";
         private const string CreateBranchButton = "New Branch";
+        private const string DeleteBranchMessageFormatString = "Are you sure you want to delete the branch: {0}?";
+        private const string DeleteBranchTitle = "Delete Branch?";
+        private const string DeleteBranchButton = "Delete";
+        private const string CancelButtonLabel = "Cancel";

         private bool showLocalBranches = true;
         private bool showRemoteBranches = true;
@@ -460,12 +464,11 @@
                 var disableDelete = activeBranchNode == selectedNode;
                 EditorGUI.BeginDisabledGroup(disableDelete);
                 {
-                    if (GUILayout.Button("Delete", EditorStyles.miniButton, GUILayout.ExpandWidth(false)))
+                    if (GUILayout.Button(DeleteBranchButton, EditorStyles.miniButton, GUILayout.ExpandWidth(false)))
                     {
                         var selectedBranchName = selectedNode.Name;
-                        var dialogTitle = "Delete Branch: " + selectedBranchName;
-                        var dialogMessage = "Are you sure you want to delete the branch: " + selectedBranchName + "?";
-                        if (EditorUtility.DisplayDialog("Delete Branch?", dialogMessage, "Delete", "Cancel"))
+                        var dialogMessage = string.Format(DeleteBranchMessageFormatString, selectedBranchName);
+                        if (EditorUtility.DisplayDialog(DeleteBranchTitle, dialogMessage, DeleteBranchButton, CancelButtonLabel))
                         {
                             GitClient.DeleteBranch(selectedBranchName, true).Start();
                         }


Renaming method

Renaming method

--- src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs
+++ src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs
@@ -91,7 +91,7 @@

             if (branchesHasChanged)
             {
-                RunRefreshEmbeddedOnMainThread();
+                RunUpdateBranchesOnMainThread();
                 branchesHasChanged = false;
             }
         }
@@ -108,7 +108,7 @@
             if (repository == null)
                 return;

-            repository.OnLocalBranchListChanged += RunRefreshEmbeddedOnMainThread;
+            repository.OnLocalBranchListChanged += RunUpdateBranchesOnMainThread;
             repository.OnCurrentBranchChanged += HandleRepositoryBranchChangeEvent;
             repository.OnCurrentRemoteChanged += HandleRepositoryBranchChangeEvent;
         }
@@ -117,23 +117,23 @@
         {
             if (repository == null)
                 return;
-            repository.OnLocalBranchListChanged -= RunRefreshEmbeddedOnMainThread;
+            repository.OnLocalBranchListChanged -= RunUpdateBranchesOnMainThread;
             repository.OnCurrentBranchChanged -= HandleRepositoryBranchChangeEvent;
             repository.OnCurrentRemoteChanged -= HandleRepositoryBranchChangeEvent;
         }

         private void HandleRepositoryBranchChangeEvent(string obj)
         {
-            RunRefreshEmbeddedOnMainThread();
-        }
-
-        private void RunRefreshEmbeddedOnMainThread()
-        {
-            new ActionTask(TaskManager.Token, _ => RefreshEmbedded())
+            RunUpdateBranchesOnMainThread();
+        }
+
+        private void RunUpdateBranchesOnMainThread()
+        {
+            new ActionTask(TaskManager.Token, _ => UpdateBranches())
                 .ScheduleUI(TaskManager);
         }

-        public void RefreshEmbedded()
+        public void UpdateBranches()
         {
             if (Repository == null)
                 return;


EntityDestroy gib

EntityDestroy gib

this is the right way to do it:
http://rustdev.facepunchstudios.com/programming/simple-networking

--- Pluton/Util.cs
+++ Pluton/Util.cs
@@ -45,7 +45,7 @@

         public void DestroyEntityGib(BaseEntity ent)
         {
-            ent.GetComponent<BaseNetworkable>().Kill(ProtoBuf.EntityDestroy.Mode.Gib);
+            ent.GetComponent<BaseNetworkable>().Kill(ProtoBuf.EntityDestroy.Mode.Gib, 2, 1, ent.transform.position);
         }

         public void DestroyObject(GameObject go)


I'd like to return a vowel

I'd like to return a vowel

--- src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs
+++ src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs
@@ -15,8 +15,8 @@
         private const string ConfirmSwitchCancel = "Cancel";
         private const string NewBranchCancelButton = "x";
         private const string NewBranchConfirmButton = "Create";
-        private const string FavouritesSetting = "Favourites";
-        private const string FavouritesTitle = "Favourites";
+        private const string FavoritesSetting = "Favorites";
+        private const string FavoritesTitle = "Favorites";
         private const string LocalTitle = "Local branches";
         private const string RemoteTitle = "Remote branches";
         private const string CreateBranchButton = "+ New branch";
@@ -125,7 +125,7 @@
                 // Favourites list
                 if (favourites.Count > 0)
                 {
-                    GUILayout.Label(FavouritesTitle);
+                    GUILayout.Label(FavoritesTitle);
                     GUILayout.BeginHorizontal();
                     {
                         GUILayout.BeginVertical();
@@ -258,7 +258,7 @@
                 return false;
             }

-            return EntryPoint.LocalSettings.Get(FavouritesSetting, new List<string>()).Contains(branchName);
+            return EntryPoint.LocalSettings.Get(FavoritesSetting, new List<string>()).Contains(branchName);
         }

         private void OnLocalBranchesUpdate(IEnumerable<GitBranch> list)
@@ -286,7 +286,7 @@

             // Prepare for updated favourites listing
             favourites.Clear();
-            var cachedFavs = EntryPoint.LocalSettings.Get<List<string>>(FavouritesSetting, new List<string>());
+            var cachedFavs = EntryPoint.LocalSettings.Get<List<string>>(FavoritesSetting, new List<string>());

             // Just build directly on the local root, keep track of active branch
             localRoot = new BranchTreeNode("", NodeType.Folder, false);
@@ -407,13 +407,13 @@
             if (!favourite)
             {
                 favourites.Remove(branch);
-                EntryPoint.LocalSettings.Set(FavouritesSetting, favourites.Select(x => x.Name).ToList());
+                EntryPoint.LocalSettings.Set(FavoritesSetting, favourites.Select(x => x.Name).ToList());
             }
             else
             {
                 favourites.Remove(branch);
                 favourites.Add(branch);
-                EntryPoint.LocalSettings.Set(FavouritesSetting, favourites.Select(x => x.Name).ToList());
+                EntryPoint.LocalSettings.Set(FavoritesSetting, favourites.Select(x => x.Name).ToList());
             }
         }


Cleanup binding resolving.

Cleanup binding resolving.

--- NtApiDotNet/Win32/RpcEndpointMapper.cs
+++ NtApiDotNet/Win32/RpcEndpointMapper.cs
@@ -140,22 +140,25 @@
             }
         }

-        private static string MapBindingToBindingString(NtResult<SafeRpcBindingHandle> binding, Guid interface_id, Version interface_version)
-        {
-            if (!binding.IsSuccess)
-                return string.Empty;
-
+        private static Win32Error ResolveBinding(SafeRpcBindingHandle binding, Guid interface_id, Version interface_version)
+        {
             RPC_SERVER_INTERFACE ifspec = new RPC_SERVER_INTERFACE();
             ifspec.Length = Marshal.SizeOf(ifspec);
             ifspec.InterfaceId.SyntaxGUID = interface_id;
             ifspec.InterfaceId.SyntaxVersion = interface_version.ToRpcVersion();

-            var result = Win32NativeMethods.RpcEpResolveBinding(binding.Result, ref ifspec);
-            if (result != Win32Error.SUCCESS)
-            {
+            return Win32NativeMethods.RpcEpResolveBinding(binding, ref ifspec);
+        }
+
+        private static string MapBindingToBindingString(NtResult<SafeRpcBindingHandle> binding, Guid interface_id, Version interface_version)
+        {
+            if (!binding.IsSuccess)
                 return string.Empty;
-            }
-
+
+            if (ResolveBinding(binding.Result, interface_id, interface_version) != Win32Error.SUCCESS)
+            {
+                return string.Empty;
+            }
             return binding.Result.ToString();
         }

@@ -454,21 +457,7 @@
         {
             using (var binding = SafeRpcBindingHandle.Create(null, protocol_seq, network_address, null, null, false))
             {
-                if (!binding.IsSuccess)
-                    return string.Empty;
-
-                RPC_SERVER_INTERFACE ifspec = new RPC_SERVER_INTERFACE();
-                ifspec.Length = Marshal.SizeOf(ifspec);
-                ifspec.InterfaceId.SyntaxGUID = interface_id;
-                ifspec.InterfaceId.SyntaxVersion = interface_version.ToRpcVersion();
-
-                var result = Win32NativeMethods.RpcEpResolveBinding(binding.Result, ref ifspec);
-                if (result != Win32Error.SUCCESS)
-                {
-                    return string.Empty;
-                }
-
-                return binding.Result.ToString();
+                return MapBindingToBindingString(binding, interface_id, interface_version);
             }
         }


Session ID

Session ID

Added SessionId to model

--- OpenOrderFramework/Models/P4MModels.cs
+++ OpenOrderFramework/Models/P4MModels.cs
@@ -95,6 +95,7 @@
     {
         public string Id { get; set; }
         public string Reference { get; set; }
+        public string SessionId { get; set; }
         public string AddressId { get; set; }
         public string BillingAddressId { get; set; }
         public DateTime? Date { get; set; }


Remove test code

Remove test code

--- src/Build.OM.UnitTests/Construction/SolutionFile_Tests.cs
+++ src/Build.OM.UnitTests/Construction/SolutionFile_Tests.cs
@@ -78,13 +78,6 @@
                 TransientTestFolder folder = testEnvironment.CreateFolder(createFolder: true);
                 TransientTestFile sln = testEnvironment.CreateFile(folder, "Dev.sln");
                 TransientTestFile slnf = testEnvironment.CreateFile(folder, "Dev.slnf", slnfValue.Replace(@"C:\\notAPath\\MSBuild.Dev.sln", sln.Path.Replace("\\", "\\\\")));
-                try
-                {
-                    SolutionFile.Parse(slnf.Path);
-                } catch (Exception ex)
-                {
-                    Console.WriteLine(ex);
-                }
                 InvalidProjectFileException e = Should.Throw<InvalidProjectFileException>(() => SolutionFile.Parse(slnf.Path));
                 e.HelpKeyword.ShouldBe(exceptionReason);
             }


Fix expectations

Fix expectations

--- src/Burble.Tests/simple_scenarios/get_server_not_found.cs
+++ src/Burble.Tests/simple_scenarios/get_server_not_found.cs
@@ -14,8 +14,8 @@

    [TestFixture("GET", "http://fail", "/ping", "http://fail/ping", "Server unavailable, GET http://fail/ping")]
    [TestFixture("GET", null, "http://fail/ping", "http://fail/ping", "Server unavailable, GET http://fail/ping")]
-   [TestFixture("HEAD", "http://fail", "/ping", "http://fail/ping", "Server unavailable, GET http://fail/ping")]
-   [TestFixture("HEAD", null, "http://fail/ping", "http://fail/ping", "Server unavailable, GET http://fail/ping")]
+   [TestFixture("HEAD", "http://fail", "/ping", "http://fail/ping", "Server unavailable, HEAD http://fail/ping")]
+   [TestFixture("HEAD", null, "http://fail/ping", "http://fail/ping", "Server unavailable, HEAD http://fail/ping")]
    public class get_server_not_found
    {
       private readonly string _exceptionUrl;


fix missing return for classic

fix missing return for classic

--- src/Acr.UserDialogs.Android/Builders/PromptBuilder.cs
+++ src/Acr.UserDialogs.Android/Builders/PromptBuilder.cs
@@ -120,7 +120,7 @@

             var old = dialog as AlertDialog;
             if (old != null)
-                old.GetButton(buttonId);
+                return old.GetButton(buttonId);

             return null;
         }


Simplify.

Simplify.

--- src/Compilers/Core/Portable/Serialization/ObjectWriter.cs
+++ src/Compilers/Core/Portable/Serialization/ObjectWriter.cs
@@ -709,10 +709,11 @@
             }
             else
             {
-                if (instanceAsWritableOpt == null)
-                {
-                    instanceAsWritableOpt = instance as IObjectWritable;
-                    if (instanceAsWritableOpt == null)
+                var writable = instanceAsWritableOpt;
+                if (writable == null)
+                {
+                    writable = instance as IObjectWritable;
+                    if (writable == null)
                     {
                         throw NoSerializationWriterException($"{instance.GetType()} must implement {nameof(IObjectWritable)}");
                     }
@@ -727,7 +728,7 @@
                     // don't blow the stack.  'LongRunning' ensures that we get a dedicated thread
                     // to do this work.  That way we don't end up blocking the threadpool.
                     var task = Task.Factory.StartNew(
-                        () => WriteObjectWorker(instance, instanceAsWritableOpt),
+                        () => WriteObjectWorker(instance, writable),
                         _cancellationToken,
                         TaskCreationOptions.LongRunning,
                         TaskScheduler.Default);
@@ -735,7 +736,7 @@
                 }
                 else
                 {
-                    WriteObjectWorker(instance, instanceAsWritableOpt);
+                    WriteObjectWorker(instance, writable);
                 }

                 _recursionDepth--;


Update AvaloniaImageImporter.cs

Update AvaloniaImageImporter.cs

--- src/Core2D.UI.Avalonia/Importers/AvaloniaImageImporter.cs
+++ src/Core2D.UI.Avalonia/Importers/AvaloniaImageImporter.cs
@@ -62,7 +62,7 @@
             }
             catch (Exception ex)
             {
-                _serviceProvider.GetService<ILog>()?.LogException(ex)
+                _serviceProvider.GetService<ILog>()?.LogException(ex);
             }

             return default;


Make ItemContainerInfo.Index setter public.

It's needed to implement custom `ItemContainerGenerator`s.

--- src/Avalonia.Controls/Generators/ItemContainerInfo.cs
+++ src/Avalonia.Controls/Generators/ItemContainerInfo.cs
@@ -37,6 +37,6 @@
         /// <summary>
         /// Gets the index of the item in the <see cref="ItemsControl.Items"/> collection.
         /// </summary>
-        public int Index { get; internal set; }
+        public int Index { get; set; }
     }
-}+}


Core CLR http connection implementation is now more defensive in how it queries the header collection

--- src/Elasticsearch.Net/Connection/HttpConnection-CoreFx.cs
+++ src/Elasticsearch.Net/Connection/HttpConnection-CoreFx.cs
@@ -1,6 +1,7 @@
 #if DOTNETCORE
 using System;
 using System.Collections.Concurrent;
+using System.Collections.Generic;
 using System.IO;
 using System.IO.Compression;
 using System.Net;
@@ -92,7 +93,9 @@
 				var response = await client.SendAsync(requestMessage, cancellationToken).ConfigureAwait(false);
 				requestData.MadeItToResponse = true;
 				builder.StatusCode = (int)response.StatusCode;
-				builder.DeprecationWarnings = response.Headers.GetValues("Warning");
+				IEnumerable<string> warnings;
+				if (response.Headers.TryGetValues("Warning", out warnings))
+					builder.DeprecationWarnings = warnings;

 				if (response.Content != null)
 					builder.Stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false);


TraversalExtensions.Fuse: Save some allocations.

--- src/ExRam.Gremlinq.Core/Extensions/TraversalExtensions.cs
+++ src/ExRam.Gremlinq.Core/Extensions/TraversalExtensions.cs
@@ -80,25 +80,23 @@
         }

         public static IEnumerable<Traversal> Fuse(
-            this IEnumerable<Traversal> traversals,
+            this List<Traversal> traversals,
             Func<P, P, P> fuse)
         {
-            var traversalsArray = traversals.ToArray();
-
-            if (traversalsArray.Any())
+            if (traversals.Count > 0)
             {
-                if (traversalsArray.All(x => x.Count == 1))
+                if (traversals.All(x => x.Count == 1))
                 {
-                    if (traversalsArray.All(x => x[0] is HasPredicateStep))
+                    if (traversals.All(x => x[0] is HasPredicateStep))
                     {
-                        var groups = traversalsArray
-                            .Select(x => (HasPredicateStep)x[0])
-                            .GroupBy(x => x.Key);
+                        var groups = traversals
+                            .GroupBy(
+                                x => ((HasPredicateStep)x[0]).Key,
+                                x => ((HasPredicateStep)x[0]).Predicate);

                         foreach (var group in groups)
                         {
                             var effective = group
-                                .Select(x => x.Predicate)
                                 .Aggregate(fuse);

                             yield return new HasPredicateStep(group.Key, effective);
@@ -107,9 +105,9 @@
                         yield break;
                     }

-                    if (traversalsArray.All(x => x[0] is IsStep))
+                    if (traversals.All(x => x[0] is IsStep))
                     {
-                        var effective = traversalsArray
+                        var effective = traversals
                             .Select(x => ((IsStep)x[0]).Predicate)
                             .Aggregate(fuse);

@@ -121,7 +119,7 @@
                     }
                 }

-                foreach (var traversal in traversalsArray)
+                foreach (var traversal in traversals)
                 {
                     yield return traversal;
                 }


Fix git version parsing

Fix git version parsing

--- src/GitHub.Api/OutputProcessors/VersionOutputProcessor.cs
+++ src/GitHub.Api/OutputProcessors/VersionOutputProcessor.cs
@@ -15,9 +15,9 @@
                 return;

             var match = GitVersionRegex.Match(line);
-            if (match.Groups.Count > 0)
+            if (match.Groups.Count > 1)
             {
-                var version = TheVersion.Parse(match.Groups[0].Value);
+                var version = TheVersion.Parse(match.Groups[1].Value);
                 RaiseOnEntry(version);
             }
         }


Added section view re-initialization when active repo changes

--- src/GitHub.TeamFoundation.14/Sync/GitHubPublishSection.cs
+++ src/GitHub.TeamFoundation.14/Sync/GitHubPublishSection.cs
@@ -48,10 +48,15 @@
             ShowGetStarted = false;
             IsVisible = false;
             IsExpanded = true;
-            var view = new GitHubInvitationContent();
-            SectionContent = view;
-            view.DataContext = this;
-        }
+			InitializeSectionView();
+		}
+
+		void InitializeSectionView()
+		{
+			var view = new GitHubInvitationContent();
+			SectionContent = view;
+			view.DataContext = this;
+		}

         async void Setup()
         {
@@ -77,7 +82,8 @@
         {
             base.RepoChanged(changed);
             Setup();
-        }
+			InitializeSectionView();
+		}

         public async void Connect()
         {


Settings now accessible from other threads.

--- src/GitHub.Unity/Assets/Plugins/GitHub/Editor/Settings.cs
+++ src/GitHub.Unity/Assets/Plugins/GitHub/Editor/Settings.cs
@@ -14,16 +14,22 @@
 			values = new List<string>();

+		static Settings asset;
+
+
 		static Settings GetAsset()
 		{
-			string path = Utility.ExtensionInstallPath + "/GitHub.local.asset";
-
-			Settings asset = AssetDatabase.LoadMainAssetAtPath(path) as Settings;
-
 			if (asset == null)
 			{
-				AssetDatabase.CreateAsset(CreateInstance<Settings>(), path);
+				string path = Utility.ExtensionInstallPath + "/GitHub.local.asset";
+
 				asset = AssetDatabase.LoadMainAssetAtPath(path) as Settings;
+
+				if (asset == null)
+				{
+					AssetDatabase.CreateAsset(CreateInstance<Settings>(), path);
+					asset = AssetDatabase.LoadMainAssetAtPath(path) as Settings;
+				}
 			}

 			return asset;


Disable mod-rewrite functionality

Disable mod-rewrite functionality

It be broke

--- PhpManager/Views/Shared/_Layout.cshtml
+++ PhpManager/Views/Shared/_Layout.cshtml
@@ -41,12 +41,6 @@
                                         Title = "PHP Info",
                                         Action = "PhpInfo",
                                         Controller = "Home"
-                                    },
-                                    new
-                                    {
-                                        Title = "Import mod_rewrite",
-                                        Action = "Import",
-                                        Controller = "Home"
                                     }
                                 };
                     }


Updated quote block test to also test quote author

--- test/Piranha.Tests/Blocks.cs
+++ test/Piranha.Tests/Blocks.cs
@@ -465,6 +465,10 @@
             var models = new List<Extend.Block>();
             models.Add(new Extend.Blocks.QuoteBlock
             {
+                Author = new Extend.Fields.StringField
+                {
+                    Value = "Joe Doe"
+                },
                 Body = new Extend.Fields.TextField
                 {
                     Value = "Lorem ipsum"
@@ -477,8 +481,10 @@
             Assert.Single(blocks);

             Assert.Equal(typeof(Extend.Blocks.QuoteBlock).FullName, blocks[0].CLRType);
-            Assert.Equal(typeof(Extend.Fields.TextField).FullName, blocks[0].Fields[0].CLRType);
-            Assert.Equal("Lorem ipsum", blocks[0].Fields[0].Value);
+            Assert.Equal(typeof(Extend.Fields.StringField).FullName, blocks[0].Fields[0].CLRType);
+            Assert.Equal(typeof(Extend.Fields.TextField).FullName, blocks[0].Fields[1].CLRType);
+            Assert.Equal("Joe Doe", blocks[0].Fields[0].Value);
+            Assert.Equal("Lorem ipsum", blocks[0].Fields[1].Value);
         }
     }
 }


change assemblyversion

change assemblyversion

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


Lucene.Net.Core.Codecs.Compressing.CompressionMode refactor: renamed private/internal fields camelCase

--- src/Lucene.Net.Core/Codecs/Compressing/CompressionMode.cs
+++ src/Lucene.Net.Core/Codecs/Compressing/CompressionMode.cs
@@ -173,31 +173,31 @@

         private sealed class LZ4FastCompressor : Compressor
         {
-            private readonly LZ4.HashTable Ht;
+            private readonly LZ4.HashTable ht;

             internal LZ4FastCompressor()
             {
-                Ht = new LZ4.HashTable();
+                ht = new LZ4.HashTable();
             }

             public override void Compress(byte[] bytes, int off, int len, DataOutput @out)
             {
-                LZ4.Compress(bytes, off, len, @out, Ht);
+                LZ4.Compress(bytes, off, len, @out, ht);
             }
         }

         private sealed class LZ4HighCompressor : Compressor
         {
-            internal readonly LZ4.HCHashTable Ht;
+            internal readonly LZ4.HCHashTable ht;

             internal LZ4HighCompressor()
             {
-                Ht = new LZ4.HCHashTable();
+                ht = new LZ4.HCHashTable();
             }

             public override void Compress(byte[] bytes, int off, int len, DataOutput @out)
             {
-                LZ4.CompressHC(bytes, off, len, @out, Ht);
+                LZ4.CompressHC(bytes, off, len, @out, ht);
             }
         }


Lucene.Net.Core.Index.NumericDocValuesFieldUpdates: removed new keyword on Iterator because it is not required.

--- src/Lucene.Net.Core/Index/NumericDocValuesFieldUpdates.cs
+++ src/Lucene.Net.Core/Index/NumericDocValuesFieldUpdates.cs
@@ -37,7 +37,7 @@
     /// </summary>
     internal class NumericDocValuesFieldUpdates : AbstractDocValuesFieldUpdates
     {
-        new internal sealed class Iterator : AbstractDocValuesFieldUpdates.IIterator
+        internal sealed class Iterator : AbstractDocValuesFieldUpdates.IIterator
         {
             private readonly int size;
             private readonly PagedGrowableWriter values;