added JsonHubProtocol example

added JsonHubProtocol example

--- Example/App.cs
+++ Example/App.cs
@@ -1,4 +1,5 @@
 using Bridge.AspNetCore.SignalR.Client;
+using Bridge.AspNetCore.SignalR.Client.Enumerations;
 using System;

 namespace Example
@@ -15,11 +16,25 @@
         /// </summary>
         public static void Main()
         {
+            HubConnectionExample();
+            HttpConnectionExample();
+            JsonHubProtocolExample();
+        }
+
+        #endregion
+
+        #region Private Static Methods
+
+        /// <summary>
+        /// <see cref="HubConnection"/> examples
+        /// </summary>
+        private static void HubConnectionExample()
+        {
             // Connect to a hub
             var hubConnection = new HubConnection("/test");

             // Setup on data received event handler
-            hubConnection.On("Send", (data) =>
+            hubConnection.On("Send", (data) =>
             {
                 // Log the received data to the console
                 Console.WriteLine(data);
@@ -34,7 +49,13 @@

             // Stop the connection
             hubConnection.Stop();
+        }

+        /// <summary>
+        /// <see cref="HttpConnection"/> examples
+        /// </summary>
+        private static void HttpConnectionExample()
+        {
             // Create an HTTP connection
             var httpConnection = new HttpConnection("/foo")
             {
@@ -49,18 +70,46 @@
             };

             // Start the connection
-            httpConnection.Start().Then(new Action(() =>
+            httpConnection.Start().Then(new Action(() =>
             {
                 // Get the features
                 var features = httpConnection.mFeatures;

                 // Send a message
-                httpConnection.Send("hello").Then(new Action(() =>
+                httpConnection.Send("hello").Then(new Action(() =>
                 {
                     // Stop the connection
                     httpConnection.Stop();
                 }));
             }));
+        }
+
+        /// <summary>
+        /// <see cref="JsonHubProtocol"/> examples
+        /// </summary>
+        private static void JsonHubProtocolExample()
+        {
+            // Create a new JSON hub
+            var jsonHub = new JsonHubProtocol();
+
+            // Get the hub's protocol name
+            var protocolName = jsonHub.Name;
+
+            // Get the hub's protocol type
+            var protocolType = jsonHub.Type;
+
+            // Create a new hub message
+            var hubMessage = new HubMessage
+            {
+                InvocationId = "34lknl23k",
+                Type = (MessageType)1
+            };
+
+            // Write a message
+            var message = jsonHub.WriteMessage(hubMessage);
+
+            // Parse a message
+            var parsedMessage = jsonHub.ParseMessages(message);
         }

         /// <summary>


Towers shoot lasers at creeps. Generic fx effect thing.

--- examples/Flight/Flight.cs
+++ examples/Flight/Flight.cs
@@ -408,8 +408,6 @@
     IDictionary<string, Model> models = new Dictionary<string, Model>();

     ICollection<Thing> things = new List<Thing>();
-
-    int particleTexture;
   }

@@ -581,7 +579,17 @@

     void Shoot(Thing target)
     {
-      // TODO: Shoot effect
+      Vec3 targetPos = new Vec3(target.Pos);
+      Flight.Spawn(
+        new Fx(
+          0.2,
+          time =>
+          Gfx.DrawBeam(Pos,
+                       targetPos,
+                       0.4,
+                       Color.White,
+                       Color.Cyan)));
+
       // TODO: Cooldown until next shot.
       target.Damage(power);
     }
@@ -638,4 +646,35 @@
     double lifetime;
     double scale;
   }
+
+
+  public class Fx : Thing
+  {
+    public Fx(double lifetime, Action<double> drawFunc)
+    {
+      this.drawFunc = drawFunc;
+      this.lifetime = lifetime;
+    }
+
+
+    public override void Update(double timeElapsed)
+    {
+      currentLife += timeElapsed;
+      if (currentLife > lifetime)
+      {
+        IsAlive = false;
+      }
+    }
+
+
+    public override void Draw(double timeElapsed)
+    {
+      drawFunc(currentLife);
+    }
+
+
+    Action<double> drawFunc;
+    double lifetime;
+    double currentLife = 0.0;
+  }
 }


20000006-1470 #328 - Ajuste merge.

20000006-1470 #328 - Ajuste merge.

--- Src/GestaoEscolar/Classe/RelatorioRecuperacaoParalela/Cadastro.aspx.cs
+++ Src/GestaoEscolar/Classe/RelatorioRecuperacaoParalela/Cadastro.aspx.cs
@@ -265,14 +265,14 @@

                     // Exibe o botão para incluir novo apenas se for do tipo periódica
                     CLS_RelatorioAtendimento relatorio = CLS_RelatorioAtendimentoBO.GetEntity(new CLS_RelatorioAtendimento { rea_id = UCCRelatorioAtendimento.Valor });
-                    divBotoes.Visible = VS_permiteEditar && relatorio.rea_periodicidadePreenchimento == (byte)CLS_RelatorioAtendimentoPeriodicidadePreenchimento.Periodico;
+                    divBotoes.Visible = VS_permiteEditar && relatorio.rea_periodicidadePreenchimento == (byte)CLS_RelatorioAtendimentoPeriodicidade.Periodico;

                     // Exibe o botão salvar apenas se o usuário tem permissão
                     btnSalvar.Visible = btnSalvarBaixo.Visible = VS_permiteEditar;

                     // Carrega lançamentos
                     VS_periodicidadePreenchimento = relatorio.rea_periodicidadePreenchimento;
-                    if (VS_periodicidadePreenchimento == (byte)CLS_RelatorioAtendimentoPeriodicidadePreenchimento.Periodico)
+                    if (VS_periodicidadePreenchimento == (byte)CLS_RelatorioAtendimentoPeriodicidade.Periodico)
                     {
                         UCCPeriodoCalendario.Visible = true;
                         pnlLancamento.Visible = false;


Reuse CSharpLanguage-const

Reuse CSharpLanguage-const

--- Src/XmlDocInspections.Plugin/Highlighting/MissingXmlDocHighlighting.cs
+++ Src/XmlDocInspections.Plugin/Highlighting/MissingXmlDocHighlighting.cs
@@ -1,5 +1,6 @@
 using JetBrains.DocumentModel;
 using JetBrains.ReSharper.Feature.Services.Daemon;
+using JetBrains.ReSharper.Psi.CSharp;
 using JetBrains.ReSharper.Psi.CSharp.Tree;
 using JetBrains.ReSharper.Psi.Tree;
 using ReSharperExtensionsShared.Highlighting;
@@ -22,7 +23,7 @@
     /// </summary>
     [ConfigurableSeverityHighlighting(
         SeverityId,
-        "CSHARP",
+        CSharpLanguage.Name,
         OverlapResolve = OverlapResolveKind.NONE,
         ToolTipFormatString = Message)]
     public class MissingXmlDocHighlighting : SimpleTreeNodeHighlightingBase<ICSharpDeclaration>


this fixes #ELLIPSW-26 -- if user not joined the community, cannot see the apps

--- Terradue.Tep/Terradue/Tep/WebServer/Application/ThematicApp.Service.cs
+++ Terradue.Tep/Terradue/Tep/WebServer/Application/ThematicApp.Service.cs
@@ -149,21 +149,26 @@
             context.Open ();
             context.LogInfo (this, string.Format ("/community/{{domain}}/apps/search GET domain='{0}'",request.Domain));

-			var domain = Domain.FromIdentifier(context, request.Domain);
+            var domain = ThematicCommunity.FromIdentifier(context, request.Domain);
 			IOpenSearchResultCollection result;
             OpenSearchEngine ose = MasterCatalogue.OpenSearchEngine;
             HttpRequest httpRequest = HttpContext.Current.Request;
             Type responseType = OpenSearchFactory.ResolveTypeFromRequest(httpRequest, ose);

 			if (request.cache) {
-
-				EntityList<ThematicApplicationCached> appsCached = new EntityList<ThematicApplicationCached>(context);
-				appsCached.SetFilter("DomainId", domain.Id);
-				appsCached.AddSort("LastUpdate", SortDirection.Descending);
-
-				result = ose.Query(appsCached, httpRequest.QueryString, responseType);
-				OpenSearchFactory.ReplaceOpenSearchDescriptionLinks(appsCached, result);
-
+
+                bool isjoined = domain.IsUserJoined(context.UserId);
+
+                    EntityList<ThematicApplicationCached> appsCached = new EntityList<ThematicApplicationCached>(context);
+                if (isjoined) {
+                    appsCached.SetFilter("DomainId", domain.Id.ToString());
+                } else {
+                    appsCached.SetFilter("DomainId", "-1");//if user is not joined we dont want him to see results
+                }
+                appsCached.AddSort("LastUpdate", SortDirection.Descending);
+                result = ose.Query(appsCached, httpRequest.QueryString, responseType);
+                OpenSearchFactory.ReplaceOpenSearchDescriptionLinks(appsCached, result);
+
 			} else {

 				var apps = new EntityList<DataPackage>(context);


Fix support for derived interfaces in 16.6

--- Tvl.VisualStudio.InheritanceMargin.CSharp/CSharpInheritanceAnalyzer.cs
+++ Tvl.VisualStudio.InheritanceMargin.CSharp/CSharpInheritanceAnalyzer.cs
@@ -121,18 +121,40 @@
                     null,
                     new[] { typeof(INamedTypeSymbol), typeof(Solution), typeof(CancellationToken) },
                     null);
-                if (declaredMethodInfo == null)
-                    return fallbackAccessor;
+
+                ParameterExpression typeParameter = Expression.Parameter(typeof(INamedTypeSymbol), "type");
+                Expression typeParameterReference;
+                if (declaredMethodInfo is object)
+                {
+                    // Our argument matches the one expected by FindImmediatelyDerivedAndImplementingTypesAsync
+                    typeParameterReference = typeParameter;
+                }
+                else
+                {
+                    // Roslyn 3.6 changed the first argument type
+                    declaredMethodInfo = DependentTypeFinder.Value.GetMethod(
+                        "FindImmediatelyDerivedAndImplementingTypesAsync",
+                        BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic,
+                        null,
+                        new[] { namedTypeSymbolAndProjectId, typeof(Solution), typeof(CancellationToken) },
+                        null);
+                    if (declaredMethodInfo == null)
+                        return fallbackAccessor;
+
+                    typeParameterReference = Expression.New(
+                        namedTypeSymbolAndProjectId.GetConstructors().Single(),
+                        typeParameter,
+                        Expression.Convert(Expression.Constant(null), typeof(ProjectId)));
+                }

                 // Here we build up the actual call to FindDerivedAndImplementingTypesAsync
-                ParameterExpression typeParameter = Expression.Parameter(typeof(INamedTypeSymbol), "type");
                 ParameterExpression solutionParameter = Expression.Parameter(typeof(Solution), "solution");
                 ParameterExpression cancellationTokenParameter = Expression.Parameter(typeof(CancellationToken), "cancellationToken");
                 Func<INamedTypeSymbol, Solution, CancellationToken, Task> callAsync =
                     Expression.Lambda<Func<INamedTypeSymbol, Solution, CancellationToken, Task>>(
                         Expression.Call(
                             declaredMethodInfo,
-                            typeParameter,
+                            typeParameterReference,
                             solutionParameter,
                             cancellationTokenParameter),
                         typeParameter,


Fix NullReferenceException opening a csx file without any solution open

Fixes #33

--- Tvl.VisualStudio.InheritanceMargin.CSharp/CSharpInheritanceAnalyzer.cs
+++ Tvl.VisualStudio.InheritanceMargin.CSharp/CSharpInheritanceAnalyzer.cs
@@ -309,7 +309,7 @@
                 Document document = snapshot.GetOpenDocumentInCurrentContextWithChanges();
                 SourceTextContainer textContainer = document != null ? document.GetTextAsync().Result.Container : null;
                 Project project = document != null ? document.Project : null;
-                Solution solution = project.Solution;
+                Solution solution = project != null ? project.Solution : null;

                 List<ITagSpan<IInheritanceTag>> tags = new List<ITagSpan<IInheritanceTag>>();


Some folder hierarchy

Some folder hierarchy

--- Assets/BuildingGenerator2D/BuildingGen2D.cs
+++ Assets/BuildingGenerator2D/BuildingGen2D.cs
@@ -12,6 +12,7 @@
     {
         [SerializeField]
         private List<STSpriteInfo> m_Sprites = new List<STSpriteInfo>();
+		private GameObject m_building;

 		public int MinLength { get; set; }
 		public int MaxLength { get; set; }
@@ -70,9 +71,17 @@
         }

 		public void GenerateBuilding() {
+
+			if (m_building == null || GameObject.Find(m_building.name) == null) {
+				m_building = new GameObject("Building");
+			}
+
 			GameObject go = new GameObject("Test");
+
+			go.transform.parent = m_building.transform;
 			SpriteRenderer renderer = go.AddComponent<SpriteRenderer>();
-			renderer.sprite = m_Sprites[0].target;
+			int random = Random.Range (0, m_Sprites.Count);
+			renderer.sprite = m_Sprites[random].target;
 			//Instantiate(m_Sprites[0].target);
 			Debug.Log ("Building thingy!");
 		}


Add TEAK_3_1_OR_NEWER

Add TEAK_3_1_OR_NEWER

--- Assets/Teak/Editor/TeakPreProcessDefiner.cs
+++ Assets/Teak/Editor/TeakPreProcessDefiner.cs
@@ -20,7 +20,8 @@
         "TEAK_2_1_OR_NEWER",
         "TEAK_2_2_OR_NEWER",
         "TEAK_2_3_OR_NEWER",
-        "TEAK_3_0_OR_NEWER"
+        "TEAK_3_0_OR_NEWER",
+        "TEAK_3_1_OR_NEWER"
     };

 #if UNITY_2018_1_OR_NEWER


add support TestCaseSourceAttribute

add support TestCaseSourceAttribute

--- AsyncConverter/Checkers/UnderTestChecker.cs
+++ AsyncConverter/Checkers/UnderTestChecker.cs
@@ -16,7 +16,8 @@
                                                                         new ClrTypeName("Xunit.FactAttribute"),
                                                                         new ClrTypeName("Xunit.TheoryAttribute"),
                                                                         new ClrTypeName("NUnit.Framework.TestAttribute"),
-                                                                        new ClrTypeName("NUnit.Framework.TestCaseAttribute")
+                                                                        new ClrTypeName("NUnit.Framework.TestCaseAttribute"),
+                                                                        new ClrTypeName("NUnit.Framework.TestCaseSourceAttribute"),
                                                                     };

         public bool IsUnder(IMethodDeclaration method) => method.AttributeSectionList != null && method.ContainsAttribute(testAttributesClass);


one-liner ftw!

one-liner ftw!

--- Aurora/AuroraDotNetEngine/APIs/LSL_Types.cs
+++ Aurora/AuroraDotNetEngine/APIs/LSL_Types.cs
@@ -1549,10 +1549,7 @@

             public static explicit operator LSLString(bool b)
             {
-                if (b)
-                    return new LSLString("1");
-                else
-                    return new LSLString("0");
+                return new LSLString(b ? "1" : "0");
             }

             #endregion


Bumping version number for release

Bumping version number for release

--- AuthenticodeLint/Properties/AssemblyInfo.cs
+++ AuthenticodeLint/Properties/AssemblyInfo.cs
@@ -12,5 +12,5 @@
 [assembly: ComVisible(false)]
 [assembly: Guid("ff77faed-3274-4c0e-bda0-98d8a5fa831e")]

-[assembly: AssemblyVersion("0.8.0.0")]
-[assembly: AssemblyFileVersion("0.8.0.0")]
+[assembly: AssemblyVersion("0.9.0.0")]
+[assembly: AssemblyFileVersion("0.9.0.0")]


put a sensible limit on missing block requests

--- BitSharp.Node/Workers/BlockRequestWorker.cs
+++ BitSharp.Node/Workers/BlockRequestWorker.cs
@@ -23,6 +23,7 @@
     {
         private static readonly TimeSpan STALE_REQUEST_TIME = TimeSpan.FromMinutes(5);
         private static readonly TimeSpan MISSING_STALE_REQUEST_TIME = TimeSpan.FromSeconds(15);
+        private static readonly int MAX_CRITICAL_LOOKAHEAD = 1.THOUSAND();

         private readonly Logger logger;
         private readonly LocalClient localClient;
@@ -155,6 +156,7 @@
                 // determine critical target chain look ahead
                 var criticalLookAheadTime = TimeSpan.FromSeconds(5);
                 this.criticalTargetChainLookAhead = 1 + (int)(criticalLookAheadTime.TotalSeconds / blockProcessingTime.TotalSeconds);
+                this.criticalTargetChainLookAhead = Math.Min(this.criticalTargetChainLookAhead, MAX_CRITICAL_LOOKAHEAD);

                 this.logger.Debug(new string('-', 80));
                 this.logger.Debug("Block Request Time: {0}".Format2(avgBlockRequestTime));


Adds test that verifies a half-finished failed task does not prevent subsequent builds.

--- Bud.Building.Test/BuildGlobToExtTaskTest.cs
+++ Bud.Building.Test/BuildGlobToExtTaskTest.cs
@@ -104,8 +104,36 @@
         FileAssert.AreEqual(dir.CreateFile("foo", "foo.expected"),
                             dir.CreatePath("build", "foo.txt.nospace"));
       }
-      // TODO: Add a test where a task fails, which prevents the deletion of the old state, and then a fresh task
-      // doesn't rebuild
+    }
+
+    [Test]
+    [Ignore("TODO")]
+    public void Half_finished_failed_task_does_not_prevent_subsequent_builds() {
+      using (var dir = new TmpDir()) {
+        dir.CreateFile("  foo  ", "src", "foo.txt");
+        RunBuild(TrimTxtFiles(outputDir: "build"), stdout: new StringWriter(), baseDir: dir.Path);
+
+        dir.CreateFile("  foo2  ", "src", "foo.txt");
+        try {
+          RunBuild(Build(ctx => {
+                           TrimVerb.TrimTxtFiles(ctx.SourceDir, ctx.Sources, ctx.OutputDir, ctx.OutputExt);
+                           throw new Exception("failure");
+                         },
+                         sourceDir: "src",
+                         sourceExt: "txt",
+                         outputDir: "build",
+                         outputExt: ".txt.nospace"),
+                   stdout: new StringWriter(),
+                   baseDir: dir.Path);
+        } catch (Exception) {
+          // ignored
+        }
+
+        dir.CreateFile("  foo  ", "src", "foo.txt");
+        RunBuild(TrimTxtFiles(outputDir: "build"), stdout: new StringWriter(), baseDir: dir.Path);
+
+        FileAssert.AreEqual(dir.CreateFile("foo", "foo.expected"), dir.CreatePath("build", "foo.txt.nospace"));
+      }
     }

     [Test]


Remove old code that doesn't apply to GTK#3

--- Pinta/Main.cs
+++ Pinta/Main.cs
@@ -81,10 +81,6 @@
                         }

 			GLib.ExceptionManager.UnhandledException += new GLib.UnhandledExceptionHandler (ExceptionManager_UnhandledException);
-
-			if (SystemManager.GetOperatingSystem () == OS.Windows) {
-				SetWindowsGtkPath ();
-			}

 			Application.Init ();
 			new MainWindow ();
@@ -175,42 +171,5 @@
 				e.Handled = true;
 			};
 		}
-
-		[DllImport ("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
-		[return: MarshalAs (UnmanagedType.Bool)]
-		static extern bool SetDllDirectory (string lpPathName);
-
-		/// <summary>
-		/// Explicitly add GTK+ to the search path.
-		/// From MonoDevelop: https://bugzilla.xamarin.com/show_bug.cgi?id=10558
-		/// </summary>
-		private static void SetWindowsGtkPath ()
-		{
-			// TODO-GTK3 - might not be needed since we aren't using the same GTK# installer as for GTK2.
-#if false
-			string location = null;
-			using (var key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey (@"SOFTWARE\Xamarin\GtkSharp\InstallFolder")) {
-				if (key != null) {
-					location = key.GetValue (null) as string;
-				}
-			}
-
-			if (location == null || !File.Exists (Path.Combine (location, "bin", "libgtk-win32-2.0-0.dll"))) {
-				System.Console.Error.WriteLine ("Did not find registered GTK# installation");
-				return;
-			}
-
-			var path = Path.Combine (location, @"bin");
-			try {
-				if (SetDllDirectory (path)) {
-					return;
-				}
-			}
-			catch (EntryPointNotFoundException) {
-			}
-
-			System.Console.Error.WriteLine ("Unable to set GTK# dll directory");
-#endif
-		}
 	}
 }


Delete FoodFactory.cs

Delete FoodFactory.cs

--- FoodFactory.cs
+++ FoodFactory.cs
@@ -1,27 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Drawing;
-namespace WindowsFormsApplication1
-{
-    class FoodFactory
-    {
-        private int x, y, width, height;
-        private SolidBrush brush;
-        public Rectangle food;
-
-        public FoodFactory(Random randomFood)
-        {
-            x = randomFood.Next(0, 280);
-            y = randomFood.Next(0, 290);
-            brush = new SolidBrush(Color.Black);
-            width = 10;
-            height = 10;
-            food = new Rectangle(x, y, width, height);
-        }
-
-
-    }
-}


Refactor ArgumentSyntaxExt.TryGetStringValue

--- WpfAnalyzers.Analyzers/Helpers/SyntaxtTreeHelpers/ArgumentSyntaxExt.cs
+++ WpfAnalyzers.Analyzers/Helpers/SyntaxtTreeHelpers/ArgumentSyntaxExt.cs
@@ -1,4 +1,4 @@
-namespace WpfAnalyzers
+namespace WpfAnalyzers
 {
     using System.Threading;

@@ -16,28 +16,26 @@
                 return false;
             }

-            if (argument.Expression.IsKind(SyntaxKind.NullLiteralExpression))
+            switch (argument.Expression)
             {
-                return true;
-            }
+                case LiteralExpressionSyntax literal when literal.IsKind(SyntaxKind.StringLiteralExpression) :
+                    result = literal.Token.ValueText;
+                    return true;
+                case LiteralExpressionSyntax literal when literal.IsKind(SyntaxKind.NullLiteralExpression) :
+                    result = null;
+                    return true;
+                case InvocationExpressionSyntax invocation when invocation.IsNameOf():
+                    var cv = semanticModel.GetConstantValueSafe(invocation, cancellationToken);
+                    if (cv.HasValue && cv.Value is string)
+                    {
+                        result = (string)cv.Value;
+                        return true;
+                    }

-            if (argument.Expression.IsKind(SyntaxKind.StringLiteralExpression) ||
-                argument.Expression.IsNameOf())
-            {
-                var cv = semanticModel.GetConstantValueSafe(argument.Expression, cancellationToken);
-                if (cv.HasValue && cv.Value is string)
-                {
-                    result = (string)cv.Value;
+                    return false;
+                case MemberAccessExpressionSyntax memberAccess when semanticModel.GetSymbolSafe(memberAccess, cancellationToken) == KnownSymbol.String.Empty:
+                    result = string.Empty;
                     return true;
-                }
-            }
-
-            var symbolInfo = semanticModel.GetSymbolSafe(argument.Expression, cancellationToken);
-            if (symbolInfo?.ContainingType?.Name == "String" &&
-                symbolInfo.Name == "Empty")
-            {
-                result = string.Empty;
-                return true;
             }

             return false;
@@ -68,4 +66,4 @@
             return (expression as InvocationExpressionSyntax)?.IsNameOf() == true;
         }
     }
-}+}


* replace HttpResponse.Write/WriteLine methods

--- Net/HttpResponse.cs
+++ Net/HttpResponse.cs
@@ -404,77 +404,55 @@
         }

         /// <summary>
-        /// Writes the provided strings to the response body.
-        /// </summary>
-        /// <param name="content">The strings to write.</param>
-        public void Write(params string[] content)
-        {
-            this._CheckClosed();
-
-            this._ConditionalWriteHeaders();
-
-            foreach (var s in content)
-            {
-                _nsw.Write(s);
-            }
-        }
-        /// <summary>
-        /// Writes the provided bytes to the response body.
-        /// </summary>
-        /// <param name="content">The bytes to write.</param>
-        public void Write(params byte[] content)
-        {
-            this._CheckClosed();
-            this._ConditionalWriteHeaders();
-
-            _nsw.BaseStream.Write(content, 0, content.Length);
-        }
-        /// <summary>
-        /// Writes the provided string with the inserts added.
-        /// </summary>
-        /// <param name="format">The format to write the string in.</param>
-        /// <param name="inserts">The content to insert in to the format.</param>
-        public void Write(string format, params object[] inserts)
-        {
-            this._CheckClosed();
-            this._ConditionalWriteHeaders();
-
-            _nsw.Write(format, inserts);
-        }
-        /// <summary>
-        /// Writes an empty line to the response body.
-        /// </summary>
-        public void WriteLine()
-        {
-            this._CheckClosed();
-            this._ConditionalWriteHeaders();
-
-            _nsw.WriteLine();
-        }
-        /// <summary>
-        /// Writes the provided line to the response body.
-        /// </summary>
-        /// <param name="line">The line to write.</param>
-        public void WriteLine(string line)
-        {
-            this._CheckClosed();
-            this._ConditionalWriteHeaders();
-
-            _nsw.WriteLine(line);
-        }
-        /// <summary>
-        /// Writes the line given in the format to the response body,
-        /// with inserts added where specified.
-        /// </summary>
-        /// <param name="format">The format to write to the response body.</param>
-        /// <param name="inserts">The items to insert in to the format.</param>
-        public void WriteLine(string format, params object[] inserts)
-        {
-            this._CheckClosed();
-            this._ConditionalWriteHeaders();
-
-            _nsw.WriteLine(format, inserts);
-        }
+        /// Writes the provided value to the response.
+        /// </summary>
+        /// <param name="value">The value to write.</param>
+        public void Write(object value)
+        {
+            _CheckClosed();
+            _ConditionalWriteHeaders();
+
+            _nsw.Write(value);
+        }
+        /// <summary>
+        /// Writes the provided values to the response in the
+        /// specified format.
+        /// </summary>
+        /// <param name="format">The format to write the values in.</param>
+        /// <param name="args">The values to write.</param>
+        public void Write(string format, params object[] args)
+        {
+            _CheckClosed();
+            _ConditionalWriteHeaders();
+
+            _nsw.Write(format, args);
+        }
+        /// <summary>
+        /// Writes the provided value to the response, followed
+        /// by a new-line.
+        /// </summary>
+        /// <param name="value">The value to write.</param>
+        public void WriteLine(object value)
+        {
+            _CheckClosed();
+            _ConditionalWriteHeaders();
+
+            _nsw.WriteLine(value);
+        }
+        /// <summary>
+        /// Writes the provided values to the response in the
+        /// specified format, followed by a new-line.
+        /// </summary>
+        /// <param name="format">The format to write the values in.</param>
+        /// <param name="args">The values to write.</param>
+        public void WriteLine(string format, params object[] args)
+        {
+            _CheckClosed();
+            _ConditionalWriteHeaders();
+
+            _nsw.WriteLine(format, args);
+        }
+
         /// <summary>
         /// Closes the connection between the server and the client.
         /// </summary>
@@ -482,5 +460,6 @@
         {
             if (!_closed) _closeCallback();
         }
+
     }
 }


'1.0.216'

--- Node.Net/Filters.cs
+++ Node.Net/Filters.cs
@@ -12,5 +12,11 @@
         public static Func<object, bool?> GetValueFilter<T>(T value, bool? default_result = false) => Collections.Filters.GetValueFilter<T>(value, default_result);
         public static Func<object, bool?> GetStringFilter(string value, string pattern = null, bool? default_result = false) => Collections.Filters.GetStringFilter(value, pattern, default_result);
         public static Func<object, bool?> GetIDictionaryFilter<T>(string key, string keyStringValue, string keyStringPattern = null, bool? default_result = false) where T : IDictionary => Collections.Filters.GetIDictionaryFilter<T>(key, keyStringValue, keyStringPattern, default_result);
+        public static Func<object, bool?> GetTypeFilter<T>(string typename,bool exact) where T : IDictionary
+        {
+            if (exact) return GetIDictionaryFilter<T>("Type", typename);
+            else return GetIDictionaryFilter<T>("Type", null, typename);
+        }
+        public static Func<object, bool?> GetTypeFilter(string typename, bool exact = true) => GetTypeFilter<IDictionary>(typename, exact);
     }
 }


Fixed "Arithmetic operation resulted in an overflow." error

During normal operation I saw this error come up when running read
scans. The variable was an int and can overflow if incremented past max.
We start with a random value so it will be arbitrarily close to this max
at init time. The value is now a uint so that it will go to 0 and not
overflow when incremented past max.

--- Microsoft.HBase.Client/LoadBalancing/LoadBalancerRoundRobin.cs
+++ Microsoft.HBase.Client/LoadBalancing/LoadBalancerRoundRobin.cs
@@ -38,7 +38,7 @@

         internal Uri[] _allEndpoints;
         internal IEndpointIgnorePolicy _endpointIgnorePolicy;
-        internal int _endpointIndex;
+        internal uint _endpointIndex;
         internal object lockObj;

         public LoadBalancerRoundRobin(int numRegionServers = 1, string clusterDomain = null)
@@ -92,6 +92,7 @@
         {
             Uri chosenEndpoint;
             int attemptCounter = 0;
+
             do
             {
                 chosenEndpoint = _allEndpoints[_endpointIndex++ % _allEndpoints.Length];
@@ -115,7 +116,7 @@
             lockObj = new object();

             var endpointsList = new List<Uri>();
-            _endpointIndex = rnd.Next();
+            _endpointIndex = (uint) rnd.Next();

             foreach (var server in regionServerHostNames)
             {


[Mono.Debugging] Implemented support for ",nq" in DebuggerDisplayAttribute

Fixes bug #13056

--- Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs
+++ Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs
@@ -1132,25 +1132,39 @@
 			return null;
 		}

-		public string EvaluateDisplayString (EvaluationContext ctx, object obj, string exp)
+		static bool IsQuoted (string str)
+		{
+			return str.Length >= 2 && str[0] == '"' && str[str.Length - 1] == '"';
+		}
+
+		public string EvaluateDisplayString (EvaluationContext ctx, object obj, string expr)
 		{
 			StringBuilder sb = new StringBuilder ();
-			int i = exp.IndexOf ("{");
+			int i = expr.IndexOf ('{');
 			int last = 0;

-			while (i != -1 && i < exp.Length) {
-				sb.Append (exp.Substring (last, i - last));
+			while (i != -1 && i < expr.Length) {
+				sb.Append (expr.Substring (last, i - last));
 				i++;

-				int j = exp.IndexOf ("}", i);
+				int j = expr.IndexOf ('}', i);
 				if (j == -1)
-					return exp;
-
-				string mem = exp.Substring (i, j - i).Trim ();
-				if (mem.Length == 0)
-					return exp;
-
-				string[] props = mem.Split (new char[] { '.' });
+					return expr;
+
+				string memberExpr = expr.Substring (i, j - i).Trim ();
+				if (memberExpr.Length == 0)
+					return expr;
+
+				int comma = memberExpr.LastIndexOf (',');
+				bool noquotes = false;
+				if (comma != -1) {
+					var option = memberExpr.Substring (comma + 1).Trim ();
+					memberExpr = memberExpr.Substring (0, comma).Trim ();
+					if (option == "nq")
+						noquotes = true;
+				}
+
+				string[] props = memberExpr.Split (new char[] { '.' });
 				ValueReference member = null;
 				object val = obj;

@@ -1166,17 +1180,19 @@
 					var str = ctx.Evaluator.TargetObjectToString (ctx, val);
 					if (str == null)
 						sb.Append ("null");
+					else if (noquotes && IsQuoted (str))
+						sb.Append (str.Substring (1, str.Length - 2));
 					else
 						sb.Append (str);
 				} else {
-					sb.Append ("{Unknown member '" + mem + "'}");
+					sb.Append ("{Unknown member '" + memberExpr + "'}");
 				}

 				last = j + 1;
-				i = exp.IndexOf ('{', last);
-			}
-
-			sb.Append (exp.Substring (last));
+				i = expr.IndexOf ('{', last);
+			}
+
+			sb.Append (expr.Substring (last));

 			return sb.ToString ();
 		}


[Debugger] If ToString() times out, fall back to default behavior

Fixes bug #11302

--- Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs
+++ Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs
@@ -979,6 +979,7 @@
 						}
 					}
 				}
+
 				if (IsFlagsEnumType (ctx, type) && rest == 0 && composed.Length > 0)
 					return new EvaluationResult (composed, composedDisplay);

@@ -999,8 +1000,13 @@
 					return new EvaluationResult (EvaluateDisplayString (ctx, obj, tdata.ValueDisplayString));

 				// Return the type name
-				if (ctx.Options.AllowToStringCalls)
-					return new EvaluationResult ("{" + CallToString (ctx, obj) + "}");
+				if (ctx.Options.AllowToStringCalls) {
+					try {
+						return new EvaluationResult ("{" + CallToString (ctx, obj) + "}");
+					} catch (TimeOutException) {
+						// ToString() timed out, fall back to default behavior.
+					}
+				}

 				if (!string.IsNullOrEmpty (tdata.TypeDisplayString) && ctx.Options.AllowDisplayStringEvaluation)
 					return new EvaluationResult ("{" + EvaluateDisplayString (ctx, obj, tdata.TypeDisplayString) + "}");


revert back to requiring TS version 1.6 so that we don't mess with people's settings unnecessarily.

--- Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs
+++ Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs
@@ -34,7 +34,7 @@
         private bool _showCompletionListAfterCharacterTyped;
         private string _toolsVersion;
         private readonly bool _enableES6Preview;
-        private readonly Version _typeScriptMinVersionForES6Preview = new Version("1.8");
+        private readonly Version _typeScriptMinVersionForES6Preview = new Version("1.6");

         public NodejsIntellisenseOptionsPage()
             : base("IntelliSense") {


cache types at call-time, not in constructor

--- OBeautifulCode.AutoFakeItEasy/AutoFixtureBackedDummyFactory.cs
+++ OBeautifulCode.AutoFakeItEasy/AutoFixtureBackedDummyFactory.cs
@@ -59,8 +59,6 @@
             AddCustomizations(FixtureWithoutCreators);

             RegisterCustomTypes(FixtureWithCreators);
-
-            CacheLoadedAssemblyTypes();
         }

         /// <inheritdoc />
@@ -193,6 +191,7 @@

             var type = typeof(T);

+            CacheLoadedAssemblyTypes();
             CacheAssemblyTypes(type.Assembly);
             CacheAssemblyTypes(typesToInclude);
             CacheAssemblyTypes(typesToExclude);
@@ -255,6 +254,7 @@
         {
             var type = typeof(T);

+            CacheLoadedAssemblyTypes();
             CacheAssemblyTypes(type.Assembly);

             var interfaceImplementations = CachedAssemblyToTypesMap


Enable undocumented methods but mark them Obsolete

--- src/DBus.cs
+++ src/DBus.cs
@@ -105,12 +105,14 @@
 		void AddMatch (string rule);
 		void RemoveMatch (string rule);

-#if UNDOCUMENTED_IN_SPEC
 		//undocumented in spec
+		[Obsolete ("Undocumented in spec")]
 		string[] ListQueuedOwners (string name);
+		[Obsolete ("Undocumented in spec")]
 		uint GetConnectionUnixProcessID (string connection_name);
+		[Obsolete ("Undocumented in spec")]
 		byte[] GetConnectionSELinuxSecurityContext (string connection_name);
+		[Obsolete ("Undocumented in spec")]
 		void ReloadConfig ();
-#endif
 	}
 }


Versionnumber ++

Versionnumber ++

--- Src/Simple.Data.Mysql/Properties/AssemblyInfo.cs
+++ Src/Simple.Data.Mysql/Properties/AssemblyInfo.cs
@@ -13,5 +13,5 @@
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("eb41e7d5-70b2-4d9c-bf03-5266688d3701")]

-[assembly: AssemblyVersionAttribute("0.19.0.4")]
+[assembly: AssemblyVersionAttribute("0.19.0.5")]
 [assembly: ComVisibleAttribute(false)]


Force a new writing system id when duplicating

Duplicating an existing writing system in the UI, then deleting the
duplicate would result in deleting the original writing system since
the duplicate has the same id with a simple Clone based duplication.

--- PalasoUIWindowsForms/WritingSystems/WritingSystemSetupModel.cs
+++ PalasoUIWindowsForms/WritingSystems/WritingSystemSetupModel.cs
@@ -1251,7 +1251,16 @@
 			{
 				throw new InvalidOperationException("Unable to duplicate current selection when there is no current selection.");
 			}
-			var ws = _writingSystemRepository.MakeDuplicate(CurrentDefinition);
+			// Doing a true clone type duplication is too dangerous -- it's easy for a user to delete
+			// existing writing systems unknowingly, thus deleting data in those writing systems.
+			// Get list of existing known ids, both permanent and temporary so that we don't risk
+			// replacing/deleting them unknowingly.
+			var wsIds = new List<string>();
+			foreach (var wsT in _writingSystemRepository.AllWritingSystems)
+				wsIds.Add(wsT.Id);
+			foreach (var wsT in WritingSystemDefinitions)
+				wsIds.Add(wsT.Id);
+			var ws = WritingSystemDefinition.CreateCopyWithUniqueId(CurrentDefinition, wsIds);
 			WritingSystemDefinitions.Insert(CurrentIndex+1, ws);
 			OnAddOrDelete();
 			CurrentDefinition = ws;


Simplify

Simplify

--- PartPreviewWindow/View3D/Actions/SubtractAndReplaceObject3D.cs
+++ PartPreviewWindow/View3D/Actions/SubtractAndReplaceObject3D.cs
@@ -42,7 +42,7 @@

 namespace MatterHackers.MatterControl.PartPreviewWindow.View3D
 {
-	[ShowUpdateButtonAttribute]
+	[ShowUpdateButton]
 	public class SubtractAndReplaceObject3D : MeshWrapperObject3D
 	{
 		public SubtractAndReplaceObject3D()


git thinks all the *.meta files have changed ???

--- Cat/PostProcessing/PostProcessingManager.cs
+++ Cat/PostProcessing/PostProcessingManager.cs
@@ -41,7 +41,7 @@
 					//			effect.setRenderTextureDirty();
 					//		}
 					//	}
-					//}
+					// }
 				}
 			}
 		}
@@ -305,7 +305,7 @@
 			//var size = this.cameraSize;
 			//foreach (var postRenderFunc in m_postRenderChain) {
 			//	postRenderFunc(cam, size);
-			//}
+			// }
 		}

 		private void OnEnable(){


Part 2 of previous commit

Part 2 of previous commit

--- RemotePeer.cs
+++ RemotePeer.cs
@@ -39,7 +39,11 @@
             this.Id                         = peerId;
             this.localPeer                  = localPeer;
             this.endPoint                   = endPoint;
+#if DEBUG
             this.PeerName                   = endPoint.ToString();
+#else
+            this.PeerName                   = String.Empty;
+#endif
             this.unreadPacketCount          = 0;
             this.sentDatagramsAwaitingACK   = new List<Datagram>();
             this.roundTripTimes             = new float[localPeer.LatencySampleLength];


Fix #123

Fix #123

[EmployeeDirectory] Education and Trainig columns show same content

--- R7.University.EmployeeDirectory/ViewModels/TeacherViewModel.cs
+++ R7.University.EmployeeDirectory/ViewModels/TeacherViewModel.cs
@@ -305,7 +305,7 @@
         {
             get {
                 return TextUtils.FormatList ("; ", Model.Achievements
-                    .Where (ach => ach.AchievementType == AchievementType.Education)
+                    .Where (ach => ach.AchievementType == AchievementType.Training)
                     .Select (ach => TextUtils.FormatList (" - ",
                         FormatHelper.FormatShortTitle (ach.ShortTitle, ach.Title, ach.TitleSuffix), ach.YearBegin))
                 );


Tiny fix

Tiny fix

--- TeamVesper/TeamVesper.ExportToPdf/PdfExporter.cs
+++ TeamVesper/TeamVesper.ExportToPdf/PdfExporter.cs
@@ -21,7 +21,7 @@
         private const string BugDesriptionColumnHeader = "Bug Desription";
         private const string BugPriorityColumnHeader = "Bug Priority";
         private const string BugSpecialtyColumnHeader = "Bug Specialty";
-        private const string BugSolvedOnColumnHeader = "Bug SolvedOn";
+        private const string BugSolvedOnColumnHeader = "Bug Solved On";
         private const string BugAttachedToDeveloperColumnHeader = "Bug Attached To";
         private const string BugAttachedToTeamColumnHeader = "Developer team";
         private const int PdfTableSize = 7;
@@ -54,6 +54,7 @@
                 this.folderPath = value;
             }
         }
+
         public void ReportMany(IEnumerable<TEntity> entities)
         {
             foreach (var entity in entities)
@@ -65,8 +66,8 @@
         public void ReportSingle(TEntity entity)
         {
             throw new NotImplementedException();
+        }

-        }
         public void GeneratePdfReport(SqlServerDbContext dbContext)
         {
             var document = new Document(PageSize.A4);
@@ -76,7 +77,7 @@

             document.Open();

-            PdfPTable table = this.FormatingReportTable();
+            var table = this.FormatingReportTable();
             this.AddReportTableTitle(table);
             this.AddReportTableColumns(table);
             this.AddDataInReportTable(table, dbContext);
@@ -104,7 +105,6 @@

         private PdfPTable FormatingReportTable()
         {
-
             PdfPTable table = new PdfPTable(PdfTableSize);
             table.WidthPercentage = 100;
             table.LockedWidth = false;
@@ -115,7 +115,6 @@

         private void AddDataInReportTable(PdfPTable table, SqlServerDbContext dbContext)
         {
-
             var report = dbContext.Bugs
                                         .Select(x =>
                                         new
@@ -129,6 +128,7 @@
                                             BugAttachedToTeamColumnHeader = x.AttachedTo.Team.Name
                                         })
                                         .ToList();
+
             foreach (var bug in report)
             {
                 table.AddCell(bug.BugIdColumnHeader);
@@ -138,7 +138,6 @@
                 table.AddCell(bug.BugSolvedOnColumnHeader);
                 table.AddCell(bug.BugAttachedToDeveloperColumnHeader);
                 table.AddCell(bug.BugAttachedToTeamColumnHeader);
-
             }
         }

@@ -151,7 +150,6 @@
             table.AddCell(SetColorToCell(BugSolvedOnColumnHeader));
             table.AddCell(SetColorToCell(BugAttachedToDeveloperColumnHeader));
             table.AddCell(SetColorToCell(BugAttachedToTeamColumnHeader));
-
         }

         private PdfPCell SetColorToCell(string cellTitle)
@@ -159,6 +157,7 @@
             var phrase = new Phrase(cellTitle);
             var cell = new PdfPCell(phrase);
             cell.BackgroundColor = BaseColor.GREEN;
+
             return cell;
         }


Added null checks to make sure those who don't have the Microsoft.DotNet.Core.Sdk dependency don't cause a null pointer exception

--- Test/Microsoft.DotNet.TestFramework/TestAsset.cs
+++ Test/Microsoft.DotNet.TestFramework/TestAsset.cs
@@ -60,9 +60,10 @@
                 if (srcFile.EndsWith("project.json"))
                 {
                     var projectJson = JObject.Parse(File.ReadAllText(srcFile));
-                    var dependencies = (JObject)projectJson.Property("dependencies").Value;
-                    var coreSdkDependency = dependencies.Property("Microsoft.DotNet.Core.Sdk");
-                    coreSdkDependency.Value = _buildVersion;
+                    var dependencies = projectJson.Property("dependencies")?.Value as JObject;
+                    var coreSdkDependency = dependencies?.Property("Microsoft.DotNet.Core.Sdk");
+                    if (coreSdkDependency != null)
+                        coreSdkDependency.Value = _buildVersion;
                     File.WriteAllText(destFile, projectJson.ToString());
                 }
                 else


add more logging to info from debug

add more logging to info from debug

--- RelhaxModpack/RelhaxModpack/Automation/Tasks/EndCompareTask.cs
+++ RelhaxModpack/RelhaxModpack/Automation/Tasks/EndCompareTask.cs
@@ -34,7 +34,7 @@

             foreach (AutomationCompare automationCompare in AutomationCompareTracker.AutomationCompares)
             {
-                Logging.Debug("Compare {0}", automationCompare.AutomationTask.ID);
+                Logging.Info("Compare {0}", automationCompare.AutomationTask.ID);
                 Logging.Debug("File a: {0}, Hash: {1}", automationCompare.CompareAFilepath, automationCompare.CompareAHash);
                 Logging.Debug("File b: {0}, Hash: {1}", automationCompare.CompareBFilepath, automationCompare.CompareBHash);
                 Logging.Debug("Compare mode: {0}", automationCompare.CompareMode.ToString());
@@ -55,7 +55,7 @@
             if (ProcessTaskResultTrue(AutomationCompareTracker.NumDifferencesContinue + AutomationCompareTracker.NumMatches == 0, "The number of total compares is 0"))
                 return;

-            if (ValidateForExitTrue(AutomationCompareTracker.NumDifferencesStop != 0, AutomationExitCode.ComparisonManualFilesToUpdate, string.Format("There are {0} files that require manual updating, cannon continue execution", AutomationCompareTracker.NumDifferencesStop)))
+            if (ValidateForExitTrue(AutomationCompareTracker.NumDifferencesStop != 0, AutomationExitCode.ComparisonManualFilesToUpdate, string.Format("There are {0} files that require manual updating, cannot continue execution", AutomationCompareTracker.NumDifferencesStop)))
                 return;

             if (ValidateForExitTrue(AutomationCompareTracker.NumDifferencesContinue == 0, AutomationExitCode.ComparisonNoFilesToUpdate, string.Format("There are no differences in files that need to be updated, no need to continue execution")))


additional test for query with inline list

--- test/Remote.Linq.Tests/RemoteQueryable/When_running_query.cs
+++ test/Remote.Linq.Tests/RemoteQueryable/When_running_query.cs
@@ -148,7 +148,7 @@
         }

         [Fact]
-        public void Should_return_orders_joined_with_chars_array()
+        public void Should_return_orders_joined_with_chars_array_closure()
         {
             char[] array = { 'h', 'e', 'l', 'l', 'o' };
             var joinLocalVariable = (
@@ -161,7 +161,7 @@
         }

         [Fact]
-        public void Should_return_orders_joined_with_chars_new_array_init()
+        public void Should_return_orders_joined_with_chars_new_array_inline()
         {
             var joinNewArrayInit = (
                 from i in _orderItemQueriable
@@ -173,7 +173,7 @@
         }

         [Fact]
-        public void Should_return_orders_joined_with_string()
+        public void Should_return_orders_joined_with_string_variable_closure()
         {
             var hello = "hello";
             var joinLocalVariable = (
@@ -186,7 +186,7 @@
         }

         [Fact]
-        public void Should_return_orders_joined_with_const_string()
+        public void Should_return_orders_joined_with_const_string_inline()
         {
             var joinConst = (
                 from i in _orderItemQueriable
@@ -198,7 +198,7 @@
         }

         [Fact]
-        public void Should_return_orders_joined_with_const_string2()
+        public void Should_return_orders_joined_with_const_string_closure()
         {
             const string hello = "hello";
             var joinConst = (
@@ -211,7 +211,7 @@
         }

         [Fact]
-        public void Should_query_categories_filterd_using_constant_array_variable()
+        public void Should_query_categories_filterd_using_local_array_inline()
         {
             System.Linq.Expressions.Expression<Func<Category, bool>> lambdaNewArrayInit =
                 c => new[] { "Vehicles" }.Contains(c.Name);
@@ -225,25 +225,66 @@
                     mc.Arguments[1]),
                 lambdaNewArrayInit.Parameters);

+            _categoryQueriable.Where(c => new[] { "Vehicles" }.Contains(c.Name)).Single().Name.ShouldBe("Vehicles");
             _categoryQueriable.Where(lambdaNewArrayInit).Single().Name.ShouldBe("Vehicles");
             _categoryQueriable.Where(lambdaConst).Single().Name.ShouldBe("Vehicles");
         }

         [Fact]
-        public void Should_query_products_filterd_using_local_variables()
+        public void Should_query_categories_filterd_using_local_list_inline()
+        {
+            System.Linq.Expressions.Expression<Func<Category, bool>> lambdaNewArrayInit =
+                c => new List<string> { "Vehicles" }.Contains(c.Name);
+
+            var mc = (System.Linq.Expressions.MethodCallExpression)lambdaNewArrayInit.Body;
+
+            var lambdaConst = System.Linq.Expressions.Expression.Lambda<Func<Category, bool>>(
+                System.Linq.Expressions.Expression.Call(
+                    System.Linq.Expressions.Expression.Constant(new List<string> { "Vehicles" }),
+                    mc.Method,
+                    mc.Arguments[0]),
+                lambdaNewArrayInit.Parameters);
+
+            _categoryQueriable.Where(c => new List<string> { "Vehicles" }.Contains(c.Name)).Single().Name.ShouldBe("Vehicles");
+            _categoryQueriable.Where(lambdaNewArrayInit).Single().Name.ShouldBe("Vehicles");
+            _categoryQueriable.Where(lambdaConst).Single().Name.ShouldBe("Vehicles");
+        }
+
+        [Fact]
+        public void Should_query_categories_filterd_using_local_list_inline_with_enumerable_method()
+        {
+            System.Linq.Expressions.Expression<Func<Category, bool>> lambdaNewArrayInit =
+                c => Enumerable.Contains(new List<string> { "Vehicles" }, c.Name);
+
+            var mc = (System.Linq.Expressions.MethodCallExpression)lambdaNewArrayInit.Body;
+
+            var lambdaConst = System.Linq.Expressions.Expression.Lambda<Func<Category, bool>>(
+                System.Linq.Expressions.Expression.Call(
+                    mc.Method,
+                    System.Linq.Expressions.Expression.Constant(new List<string> { "Vehicles" }),
+                    mc.Arguments[1]),
+                lambdaNewArrayInit.Parameters);
+
+            _categoryQueriable.Where(c => Enumerable.Contains(new List<string> { "Vehicles" }, c.Name)).Single().Name.ShouldBe("Vehicles");
+            _categoryQueriable.Where(lambdaNewArrayInit).Single().Name.ShouldBe("Vehicles");
+            _categoryQueriable.Where(lambdaConst).Single().Name.ShouldBe("Vehicles");
+        }
+
+        [Fact]
+        public void Should_query_products_filterd_using_local_variables_closure_inline_mix()
         {
             IEnumerable<int?> listOfIds = new List<int?>() { null, 1, 11, 111 };
             int oneId = 10;
             var query =
                 from p in _productQueriable
-                where listOfIds.Contains(p.Id) || p.Id % 3 == 0 || p.Id == oneId
+                where listOfIds.Contains(p.Id) || new List<string> { "Truck", "Bicycle" }.Contains(p.Name) || p.Id % 3 == 0 || p.Id == oneId
                 select p;
             var result = query.ToArray();
-            result.Count().ShouldBe(3);
-        }
-
-        [Fact]
-        public void Should_query_products_filterd_using_const_integer()
+            result.Count().ShouldBe(4);
+        }
+
+        [Fact]
+        public void Should_query_products_filterd_using_const_integer_closure()
         {
             const int oneId = 10;
             var query =
@@ -255,7 +296,7 @@
         }

         [Fact]
-        public void Should_query_products_filterd_using_anonymous_argument()
+        public void Should_query_products_filterd_using_anonymous_argument_closure()
         {
             var arg = new { Id = 10.0 };
             var query =


Fix errors during import, GIO streams don't know their length.

Might break on some broken files. Will be solved by moving to Taglib#.

--- src/Imaging/JpegHeader.cs
+++ src/Imaging/JpegHeader.cs
@@ -191,9 +191,6 @@
 			byte [] raw = new byte [2];
 			ushort length;

-			if (stream.Length - stream.Position < 2)
-				return null;
-
 			// FIXME there is a potential loop here.

 			int read = Read (stream, raw, 0, 2);


Events and Posts now more generic IEnumerable and return a list of strings instead of ObjectId objects

--- web/clublife/src/skeleton/Models/Organization.cs
+++ web/clublife/src/skeleton/Models/Organization.cs
@@ -66,10 +66,21 @@
     public string[] Officers { get; set; }
     [BsonElement("members")]
     public string[] Members { get; set; }
+
     [BsonElement("events")]
-    public List<ObjectId> Events { get; set; }
+    private IEnumerable<ObjectId> events { get; set; }
+    public IEnumerable<string> Events {
+      get {
+        return events.Select(x => x.ToString());
+      }
+    }
     [BsonElement("posts")]
-    public List<ObjectId> Posts { get; set; }
+    private IEnumerable<ObjectId> posts { get; set; }
+    public IEnumerable<string> Posts {
+      get {
+        return posts.Select(x => x.ToString());
+      }
+    }
     [BsonElement("pendingRequests")]
     public List<ObjectId> PendingRequests { get; set; }


#468 switch bouncy castle as default until fix is found

--- Titanium.Web.Proxy/Network/CertificateManager.cs
+++ Titanium.Web.Proxy/Network/CertificateManager.cs
@@ -19,14 +19,17 @@
     public enum CertificateEngine
     {
         /// <summary>
+        ///     Uses BouncyCastle 3rd party library.
+        ///     Default.
+        /// </summary>
+        BouncyCastle = 0,
+
+        /// <summary>
         ///     Uses Windows Certification Generation API.
-        /// </summary>
-        DefaultWindows = 0,
-
-        /// <summary>
-        ///     Uses BouncyCastle 3rd party library.
-        /// </summary>
-        BouncyCastle = 1
+        ///     Bug #468 Reported.
+        /// </summary>
+        DefaultWindows = 1
+
     }

     /// <summary>
@@ -93,7 +96,7 @@
                 RootCertificateIssuerName = rootCertificateIssuerName;
             }

-            CertificateEngine = RunTime.IsWindows ? CertificateEngine.DefaultWindows : CertificateEngine.BouncyCastle;
+            CertificateEngine = CertificateEngine.BouncyCastle;

             certificateCache = new ConcurrentDictionary<string, CachedCertificate>();
             pendingCertificateCreationTasks = new ConcurrentDictionary<string, Task<X509Certificate2>>();


log error message for corrupt bars

log error message for corrupt bars

--- ToolBox/GoogleDownloader/GoogleDataDownloader.cs
+++ ToolBox/GoogleDownloader/GoogleDataDownloader.cs
@@ -95,12 +95,19 @@
                     columns[4] != "-" ? (Decimal?)columns[4].ToDecimal() : null
                 };

-                // let's try hard to fix any issues as good as we can
-                // this code assumes that there is at least 1 good value
-                if (ohlc[1] == null) ohlc[1] = ohlc.Where(val => val != null).Max();
-                if (ohlc[2] == null) ohlc[2] = ohlc.Where(val => val != null).Min();
-                if (ohlc[0] == null) ohlc[0] = ohlc.Where(val => val != null).Average();
-                if (ohlc[3] == null) ohlc[3] = ohlc.Where(val => val != null).Average();
+                if (ohlc.Where(val => val == null).Count() > 0)
+                {
+                    // let's try hard to fix any issues as good as we can
+                    // this code assumes that there is at least 1 good value
+                    if (ohlc[1] == null) ohlc[1] = ohlc.Where(val => val != null).Max();
+                    if (ohlc[2] == null) ohlc[2] = ohlc.Where(val => val != null).Min();
+                    if (ohlc[0] == null) ohlc[0] = ohlc.Where(val => val != null).Average();
+                    if (ohlc[3] == null) ohlc[3] = ohlc.Where(val => val != null).Average();
+
+                    Log.Error(string.Format("Corrupt bar on {0}: {1},{2},{3},{4}. Saved as {5},{6},{7},{8}.",
+                        columns[0], columns[1], columns[2], columns[3], columns[4],
+                        ohlc[0], ohlc[1], ohlc[2], ohlc[3]));
+                }

                 long volume = columns[5].ToInt64();


Redirecting cases for localization amended

--- TravelAlbum.Web/Controllers/CultureController.cs
+++ TravelAlbum.Web/Controllers/CultureController.cs
@@ -10,19 +10,26 @@
         {
             var urlParts = query.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);

-            if (urlParts.Length > 1 && (query.Contains("/bg/") || query.Contains("/en/")))
+            if (urlParts.Length == 2 && !(query.Contains("/bg/") || query.Contains("/en/")))
+            {
+                return this.RedirectToRoute(new { lang = language, controller = urlParts[0], action = urlParts[1] });
+            }
+            else if (urlParts.Length == 3 && (query.Contains("/bg/") || query.Contains("/en/")))
             {
                 return this.RedirectToRoute(new { lang = language, controller = urlParts[1], action = urlParts[2] });
             }
-            else if (urlParts.Length > 1 && !(query.Contains("/bg/") || query.Contains("/en/")))
+            else if (urlParts.Length == 3 && !(query.Contains("/bg/") || query.Contains("/en/")))
             {
-                return this.RedirectToRoute(new { lang = language, controller = urlParts[0], action = urlParts[1] });
+                return this.RedirectToRoute(new { lang = language, controller = urlParts[0], action = urlParts[1], id = urlParts[2] });
+            }
+            else if (urlParts.Length == 4 && (query.Contains("/bg/") || query.Contains("/en/")))
+            {
+                return this.RedirectToRoute(new { lang = language, controller = urlParts[1], action = urlParts[2], id = urlParts[3] });
             }
             else
             {
                 return this.RedirectToRoute(new { lang = language, controller = "Home", action = "Index" });
             }
-
         }
     }
 }


调整下排版格式。

调整下排版格式。

--- Global.asax.cs
+++ Global.asax.cs
@@ -1,6 +1,5 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using System.Web;
 using System.Web.Mvc;
 using System.Web.Routing;


kernel: removed some unneeded fields

kernel: removed some unneeded fields

--- Unity/Assets/GameFramework/Core/Kernel/Kernel.cs
+++ Unity/Assets/GameFramework/Core/Kernel/Kernel.cs
@@ -21,31 +21,12 @@
     public static string overrideSceneName = null;

     protected bool KernelReady { get; private set; }
-
-    /// <summary>
-    /// Flag to call(or not to call) the kernel's update-method
-    /// </summary>
-    public bool KernelCallUpdate { get; set; }
+    public bool KernelCallUpdate { get; set; } = true;

     public static bool applicationQuitting = false;

     public ReactivePriorityExecutionList rxStartup = new ReactivePriorityExecutionList();
     public ReactivePriorityExecutionList rxShutDown = new ReactivePriorityExecutionList();
-
-    /// <summary>
-    /// Flag if the mainThreadAction-queue should be processed. automatically set when actions are added to the queue
-    /// </summary>
-    private bool executeMainThreadActions = false;
-    /// <summary>
-    /// Concurrent queue to keep the actions that should be executed on the main-thread
-    /// </summary>
-    private ConcurrentQueue<Action> mainThreadActions = new ConcurrentQueue<Action>();
-
-    private float maxMsForMainThreadActions = 200;
-    /// <summary>
-    /// Stopwatch to make sure the main-thread-actions do not block the thread too much
-    /// </summary>
-    private System.Diagnostics.Stopwatch mainThreadWatch = new System.Diagnostics.Stopwatch();

     public static ReactiveProperty<Kernel> InstanceProperty = new ReactiveProperty<Kernel>();
     public static Kernel Instance {


ECS-System: remove debugging call

ECS-System: remove debugging call

--- Unity/Assets/GameFramework/Modules/ECS/System.cs
+++ Unity/Assets/GameFramework/Modules/ECS/System.cs
@@ -639,12 +639,7 @@
             }
             componentsToProcess[componentCount] = components;
             componentCount++;
-#if UNITY_EDITOR
-            if (componentsToProcessLUT.ContainsKey(entity.ID)) {
-                var newcomps = entityManager.GetAllComponents(entity);
-                var current = GetSystemComponentsForEntity(entity);
-            }
-#endif
+
             try {
                 componentsToProcessLUT.Add(entity.ID, components);
             }


弾は画面外にいくと消える（不完全）

弾は画面外にいくと消える（不完全）

--- UnityProject/Assets/Scripts/Battle/BulletBase.cs
+++ UnityProject/Assets/Scripts/Battle/BulletBase.cs
@@ -37,4 +37,9 @@
 		trans = transform;
 		ShotSE.Play();
 	}
+
+	void OnBecameInvisible()
+	{
+		Destroy (this.gameObject);
+	}
 }


Tweak

Tweak

--- UnityProject/Assets/Scripts/GameModes/Traitor.cs
+++ UnityProject/Assets/Scripts/GameModes/Traitor.cs
@@ -70,7 +70,7 @@
 	protected override bool ShouldSpawnAntag(PlayerSpawnRequest spawnRequest)
 	{

-		for (int i = 0; i < TraitorAmount; i++) {
+		for (int i = 0; i < TraitorAmount - 1; i++) {
 			return !LoyalImplanted.Contains(spawnRequest.RequestedOccupation.JobType)
 					&& AntagManager.Instance.AntagCount == 0
 					&& PlayerList.Instance.InGamePlayers.Count > 0;


Currently only C# to VB is supported, disable addtl labels that were not intended for production yet

--- CodeConverterWebApp/Views/Home/Index.cshtml
+++ CodeConverterWebApp/Views/Home/Index.cshtml
@@ -18,10 +18,10 @@
                     <input type="radio" ng-model="requestedConversion" value="cs2vbnet">
                     C# to VB.NET
                 </label>
-                <label>
+                @*<label>
                     <input type="radio" ng-model="requestedConversion" value="vb2csnet">
                     VB.NET to C#
-                </label>
+                </label>*@

                 <button class="btn btn-default" ng-click="convert()">Convert Code</button>
             </div>


Updates data import to populate default user id

--- Common/src/HetsImport/Import/BCBidImport.cs
+++ Common/src/HetsImport/Import/BCBidImport.cs
@@ -31,7 +31,8 @@
         /// <param name="fileLocation"></param>
         public static void ImportJob(PerformContext context, string seniorityScoringRules, string connectionString, string fileLocation)
         {
-            DbAppContext dbContext = new DbAppContext(connectionString);
+            DbAppContext dbContext = new DbAppContext(connectionString) {SmUserId = SystemId};
+
             context.WriteLine("Starting Data Import Job");

             // adding system Account if not there in the database
@@ -113,7 +114,8 @@
         public static void ObfuscationJob(PerformContext context, string connectionString, string sourceFileLocation, string destinationFileLocation)
         {
             // open a connection to the database.
-            DbAppContext dbContext = new DbAppContext(connectionString);
+            DbAppContext dbContext = new DbAppContext(connectionString) { SmUserId = SystemId };
+
             context.WriteLine("Starting Data Import Job");

             // adding system Account if not there in the database


Added line comment support, BOM stripping, empty key support

Added support for // line comments at the end of a line. This can be disabled by the static "allowLineComments" setting.

Explicitly stripping the BOM (Byte Order Mark) character

Allowing the empty string "" as key.

--- SimpleJSON.cs
+++ SimpleJSON.cs
@@ -88,10 +88,20 @@
  *
  * [2018-04-25 Update]
  *  - Added support for parsing single values (JSONBool, JSONString, JSONNumber, JSONNull) as top level value.
- *
+ *
  * [2019-02-18 Update]
  *  - Added HasKey(key) and GetValueOrDefault(key, default) to the JSONNode class to provide way to read
  *    values conditionally without creating a LazyCreator
+ *
+ * [2019-03-25 Update]
+ *  - Added static setting "allowLineComments" to the JSONNode class which is true by default. This allows
+ *    "//" line comments when parsing json text as long as it's not within quoted text. All text after // up
+ *    to the end of the line is completely ignored / skipped. This makes it easier to create human readable
+ *    and editable files. Note that stripped comments are not read, processed or preserved in any way. So
+ *    this feature is only relevant for human created files.
+ *  - Explicitly strip BOM (Byte Order Mark) when parsing to avoid getting it leaked into a single primitive
+ *    value. That's a rare case but better safe than sorry.
+ *  - Allowing adding the empty string as key
  *
  * The MIT License (MIT)
  *
@@ -247,6 +257,7 @@

         public static bool forceASCII = false; // Use Unicode by default
         public static bool longAsString = false; // lazy creator creates a JSONString instead of JSONNumber
+        public static bool allowLineComments = true; // allow "//"-style comments at the end of a line

         public abstract JSONNodeType Tag { get; }

@@ -727,6 +738,16 @@
                             }
                         }
                         break;
+                    case '/':
+                        if (allowLineComments && !QuoteMode && i + 1 < aJSON.Length && aJSON[i+1] == '/')
+                        {
+                            while (++i < aJSON.Length && aJSON[i] != '\n' && aJSON[i] != '\r') ;
+                            break;
+                        }
+                        Token.Append(aJSON[i]);
+                        break;
+                    case '\uFEFF': // remove / ignore BOM (Byte Order Mark)
+                        break;

                     default:
                         Token.Append(aJSON[i]);
@@ -917,7 +938,7 @@
             if (aItem == null)
                 aItem = JSONNull.CreateOrGet();

-            if (!string.IsNullOrEmpty(aKey))
+            if (aKey != null)
             {
                 if (m_Dict.ContainsKey(aKey))
                     m_Dict[aKey] = aItem;


OperationVisiblityExtension fix

OperationVisiblityExtension fix

--- Signum.Windows.Extensions/Authorization/OperationAuthClient.cs
+++ Signum.Windows.Extensions/Authorization/OperationAuthClient.cs
@@ -64,7 +64,7 @@
         OperationSymbol operationKey;
         public OperationVisiblityExtension(object value)
         {
-            this.operationKey = (OperationSymbol)value;
+            this.operationKey = (value is IOperationSymbolContainer) ? ((IOperationSymbolContainer)value).Operation : (OperationSymbol)value;
         }

         public override object ProvideValue(IServiceProvider serviceProvider)


Remove the TypeDefId 'hint' in ExportedType

Seems the runtime is so gullible that would blindly use the wrong provided hint.

--- Confuser.Protections/Compress/Compressor.cs
+++ Confuser.Protections/Compress/Compressor.cs
@@ -313,7 +313,7 @@
 					foreach (var type in ctx.OriginModuleDef.GetTypes()) {
 						if (!type.IsVisibleOutside())
 							continue;
-						exTbl.Add(new RawExportedTypeRow((uint)type.Attributes, type.Rid,
+						exTbl.Add(new RawExportedTypeRow((uint)type.Attributes, 0,
 						                                 writer.MetaData.StringsHeap.Add(type.Name),
 						                                 writer.MetaData.StringsHeap.Add(type.Namespace), impl));
 					}


Fix ordering of mouse effect enum

Fix ordering of mouse effect enum

--- Corale.Colore/Razer/Mouse/Effects/Effect.cs
+++ Corale.Colore/Razer/Mouse/Effects/Effect.cs
@@ -62,12 +62,6 @@
         Custom,

         /// <summary>
-        /// Custom grid effect.
-        /// </summary>
-        [PublicAPI]
-        CustomGrid,
-
-        /// <summary>
         /// Reactive effect.
         /// </summary>
         [PublicAPI]
@@ -92,6 +86,12 @@
         Wave,

         /// <summary>
+        /// Custom grid effect.
+        /// </summary>
+        [PublicAPI]
+        CustomGrid,
+
+        /// <summary>
         /// Invalid effect.
         /// </summary>
         [PublicAPI]


Update WebAPIModels.cs

Update WebAPIModels.cs

--- Cryptolens.Licensing/Models/WebAPIModels.cs
+++ Cryptolens.Licensing/Models/WebAPIModels.cs
@@ -648,6 +648,11 @@
         /// An int value (int32) to store.
         /// </summary>
         public int IntValue { get; set; }
+
+        /// <summary>
+        /// Make sure data objects with the same name are not added.
+        /// </summary>
+        public bool CheckForDuplicates { get; set; }
     }

@@ -773,6 +778,11 @@
         /// </summary>
         public int ReferencerId { get; set; }

+        /// <summary>
+        /// Make sure data objects with the same name are not added.
+        /// </summary>
+        public bool CheckForDuplicates { get; set; }
+
     }

     /// <summary>


Check CredGuard group policy

Check CredGuard group policy


Updated statistics engine to use a weak reference to statistic source object.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/gsf/Main;C97241

--- Source/Libraries/GSF.TimeSeries/Statistics/StatisticsEngine.cs
+++ Source/Libraries/GSF.TimeSeries/Statistics/StatisticsEngine.cs
@@ -57,7 +57,7 @@
         // Represents a source for a statistics
         private class StatisticSource
         {
-            public object Source;
+            public WeakReference<object> SourceReference;
             public string SourceName;
             public string SourceCategory;
             public string SourceAcronym;
@@ -452,6 +452,7 @@
         private readonly LongSynchronizedOperation m_updateStatisticMeasurementsOperation;
         private readonly LongSynchronizedOperation m_loadStatisticsOperation;
         private readonly LongSynchronizedOperation m_calculateStatisticsOperation;
+        private readonly ShortSynchronizedOperation m_validateSourceReferencesOperation;

         private readonly PerformanceMonitor m_performanceMonitor;

@@ -497,6 +498,12 @@
             m_calculateStatisticsOperation = new LongSynchronizedOperation(CalculateStatistics, ex =>
             {
                 string message = "An error occurred while attempting to calculate statistics: " + ex.Message;
+                OnProcessException(new InvalidOperationException(message, ex));
+            });
+
+            m_validateSourceReferencesOperation = new ShortSynchronizedOperation(ValidateSourceReferences, ex =>
+            {
+                string message = "An error occurred while attempting to validate statistic source references: " + ex.Message;
                 OnProcessException(new InvalidOperationException(message, ex));
             });

@@ -1019,40 +1026,49 @@

         private IMeasurement CalculateStatistic(Statistic[] statistics, DateTime serverTime, StatisticSource source, DataRow measurement)
         {
-            Guid signalID;
-            string signalReference;
-            int signalIndex;
-
-            Statistic statistic;
-
-            try
-            {
-                // Get the signal ID and signal reference of the current measurement
-                signalID = Guid.Parse(measurement["SignalID"].ToString());
-                signalReference = measurement["SignalReference"].ToString();
-                signalIndex = Convert.ToInt32(signalReference.Substring(signalReference.LastIndexOf("-ST", StringComparison.Ordinal) + 3));
-
-                // Find the statistic corresponding to the current measurement
-                statistic = statistics.FirstOrDefault(stat => (source.SourceCategory == stat.Source) && (signalIndex == stat.Index));
-
-                if ((object)statistic != null)
-                {
-                    // Calculate the current value of the statistic measurement
-                    return new Measurement()
+            object target;
+
+            if (source.SourceReference.TryGetTarget(out target))
+            {
+                Guid signalID;
+                string signalReference;
+                int signalIndex;
+
+                Statistic statistic;
+
+                try
+                {
+                    // Get the signal ID and signal reference of the current measurement
+                    signalID = Guid.Parse(measurement["SignalID"].ToString());
+                    signalReference = measurement["SignalReference"].ToString();
+                    signalIndex = Convert.ToInt32(signalReference.Substring(signalReference.LastIndexOf("-ST", StringComparison.Ordinal) + 3));
+
+                    // Find the statistic corresponding to the current measurement
+                    statistic = statistics.FirstOrDefault(stat => (source.SourceCategory == stat.Source) && (signalIndex == stat.Index));
+
+                    if ((object)statistic != null)
                     {
-                        Key = MeasurementKey.LookUpOrCreate(signalID, measurement["ID"].ToString()),
-                        TagName = measurement["PointTag"].ToNonNullString(),
-                        Adder = double.Parse(measurement["Adder"].ToNonNullString("0.0")),
-                        Multiplier = double.Parse(measurement["Multiplier"].ToNonNullString("1.0")),
-                        Value = statistic.Method(source.Source, statistic.Arguments),
-                        Timestamp = serverTime
-                    };
-                }
-            }
-            catch (Exception ex)
-            {
-                string errorMessage = string.Format("Error calculating statistic for {0}: {1}", measurement["SignalReference"], ex.Message);
-                OnProcessException(new Exception(errorMessage, ex));
+                        // Calculate the current value of the statistic measurement
+                        return new Measurement()
+                        {
+                            Key = MeasurementKey.LookUpOrCreate(signalID, measurement["ID"].ToString()),
+                            TagName = measurement["PointTag"].ToNonNullString(),
+                            Adder = double.Parse(measurement["Adder"].ToNonNullString("0.0")),
+                            Multiplier = double.Parse(measurement["Multiplier"].ToNonNullString("1.0")),
+                            Value = statistic.Method(target, statistic.Arguments),
+                            Timestamp = serverTime
+                        };
+                    }
+                }
+                catch (Exception ex)
+                {
+                    string errorMessage = string.Format("Error calculating statistic for {0}: {1}", measurement["SignalReference"], ex.Message);
+                    OnProcessException(new Exception(errorMessage, ex));
+                }
+            }
+            else
+            {
+                m_validateSourceReferencesOperation.RunOnceAsync();
             }

             return null;
@@ -1164,7 +1180,7 @@

             sourceInfo = new StatisticSource()
             {
-                Source = source,
+                SourceReference = new WeakReference<object>(source),
                 SourceName = sourceName,
                 SourceCategory = sourceCategory,
                 SourceAcronym = sourceAcronym,
@@ -1173,7 +1189,9 @@

             lock (StatisticSources)
             {
-                if (StatisticSources.Any(registeredSource => registeredSource.Source == source))
+                object target;
+
+                if (StatisticSources.Any(registeredSource => registeredSource.SourceReference.TryGetTarget(out target) && target == source))
                     throw new InvalidOperationException(string.Format("Unable to register {0} as statistic source because it is already registered.", sourceName));

                 StatisticSources.Add(sourceInfo);
@@ -1200,13 +1218,15 @@
         /// </remarks>
         public static void Unregister(object source)
         {
+            object target;
+
             if (source != null)
             {
                 lock (StatisticSources)
                 {
                     for (int i = 0; i < StatisticSources.Count; i++)
                     {
-                        if (StatisticSources[i].Source == source)
+                        if (StatisticSources[i].SourceReference.TryGetTarget(out target) && target == source)
                         {
                             StatisticSources.RemoveAt(i);
                             break;
@@ -1270,6 +1290,24 @@
                 sourceRegistered(null, EventArgs.Empty);
         }

+        private static void ValidateSourceReferences()
+        {
+            List<int> expiredSources = new List<int>();
+            object target;
+
+            lock (StatisticSources)
+            {
+                for (int i = 0; i < StatisticSources.Count; i++)
+                {
+                    if (!StatisticSources[i].SourceReference.TryGetTarget(out target))
+                        expiredSources.Add(i);
+                }
+
+                for (int i = expiredSources.Count - 1; i >= 0; i--)
+                    StatisticSources.RemoveAt(expiredSources[i]);
+            }
+        }
+
         #endregion
     }
 }


Fixed saving on close

Fixed saving on close

--- SqlServerValidationToolkit.Configurator/MainWindowViewModel.cs
+++ SqlServerValidationToolkit.Configurator/MainWindowViewModel.cs
@@ -11,6 +11,7 @@
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
+using System.Data.Entity.Validation;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -252,7 +253,7 @@
                 switch (result)
                 {
                     case MessageBoxResult.Yes:
-                        Save();
+                        cancel = SaveOnClose();
                         break;
                     case MessageBoxResult.Cancel:
                         cancel = true;
@@ -262,6 +263,24 @@
             return cancel;
         }

+        private bool SaveOnClose()
+        {
+            try
+            {
+
+                _validator.Save(this.SourcesViewViewModel.Sources.Select(s => s.Source).ToList());
+                return false;
+            }
+            catch (DbEntityValidationException e)
+            {
+                Messenger.Default.Send<ValidationErrorMessage>(new ValidationErrorMessage()
+                {
+                    Exception = e
+                });
+                return true;
+            }
+        }
+
         public string Database
         {
             get


db.DbMaintenance BUG

db.DbMaintenance BUG

--- Src/Asp.Net/SqlSugar/Abstract/DbMaintenanceProvider/Methods.cs
+++ Src/Asp.Net/SqlSugar/Abstract/DbMaintenanceProvider/Methods.cs
@@ -82,8 +82,8 @@
         }
         public virtual bool IsAnyColumn(string tableName, string columnName)
         {
-            columnName = this.SqlBuilder.GetTranslationColumnName(columnName);
-            tableName = this.SqlBuilder.GetTranslationTableName(tableName);
+            columnName = this.SqlBuilder.GetNoTranslationColumnName(columnName);
+            tableName = this.SqlBuilder.GetNoTranslationColumnName(tableName);
             var isAny = IsAnyTable(tableName);
             Check.Exception(!isAny, string.Format("Table {0} does not exist", tableName));
             var columns = GetColumnInfosByTableName(tableName);
@@ -92,7 +92,7 @@
         }
         public virtual bool IsPrimaryKey(string tableName, string columnName)
         {
-            columnName = this.SqlBuilder.GetTranslationColumnName(columnName);
+            columnName = this.SqlBuilder.GetNoTranslationColumnName(columnName);
             var isAny = IsAnyTable(tableName);
             Check.Exception(!isAny, string.Format("Table {0} does not exist", tableName));
             var columns = GetColumnInfosByTableName(tableName);
@@ -101,7 +101,7 @@
         }
         public virtual bool IsIdentity(string tableName, string columnName)
         {
-            columnName = this.SqlBuilder.GetTranslationColumnName(columnName);
+            columnName = this.SqlBuilder.GetNoTranslationColumnName(columnName);
             var isAny = IsAnyTable(tableName);
             Check.Exception(!isAny, string.Format("Table {0} does not exist", tableName));
             var columns = GetColumnInfosByTableName(tableName);


Set content / media links to use content cache and pass the previewing flag through

--- Src/Our.Umbraco.Mortar/ValueConverters/MortarValueConverter.cs
+++ Src/Our.Umbraco.Mortar/ValueConverters/MortarValueConverter.cs
@@ -17,7 +17,7 @@
 using Umbraco.Web.Models;

 namespace Our.Umbraco.Mortar.ValueConverters
-{
+{
 	[PropertyValueType(typeof(MortarValue))]
 	[PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
 	public class MortarValueConverter : PropertyValueConverterBase
@@ -137,7 +137,7 @@
 		{
 			int nodeId;
 			return int.TryParse(value.ToString(), out nodeId)
-				? Umbraco.TypedContent(nodeId)
+				? UmbracoContext.Current.ContentCache.GetById(preview, nodeId)
 				: null;
 		}

@@ -145,7 +145,7 @@
 		{
 			int nodeId;
 			return int.TryParse(value.ToString(), out nodeId)
-				? Umbraco.TypedMedia(nodeId)
+				? UmbracoContext.Current.MediaCache.GetById(preview, nodeId)
 				: null;
 		}


SLProxy now prints stacktraces for exceptions in app delegates.

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

--- applications/SLProxy/SLProxy.cs
+++ applications/SLProxy/SLProxy.cs
@@ -332,6 +332,7 @@
 					loginDelegate(session);
 				} catch (Exception e) {
 					Log("exception in login delegate: " + e.Message);
+					Log(e.StackTrace);
 				}
 			}

@@ -434,6 +435,7 @@
 								}
 							} catch (Exception e) {
 								Log("exception in incoming delegate: " + e.Message);
+								Log(e.StackTrace);
 							}
 						}

@@ -488,6 +490,7 @@
 						}
 					} catch (Exception e) {
 						Log("exception in outgoing delegate: " + e.Message);
+						Log(e.StackTrace);
 					}
 				}


improved performance of ChecksForCircularDependencies

--- UnityProject/Assets/Plugins/Zenject/Source/Main/DiContainer.cs
+++ UnityProject/Assets/Plugins/Zenject/Source/Main/DiContainer.cs
@@ -29,7 +29,9 @@
         readonly Dictionary<BindingId, List<ProviderInfo>> _providers = new Dictionary<BindingId, List<ProviderInfo>>();
         readonly List<DiContainer> _parentContainers = new List<DiContainer>();
         readonly List<DiContainer> _ancestorContainers = new List<DiContainer>();
-        readonly Stack<LookupId> _resolvesInProgress = new Stack<LookupId>();
+
+        readonly HashSet<LookupId> _resolvesInProgress = new HashSet<LookupId>();
+        readonly HashSet<LookupId> _resolvesTwiceInProgress = new HashSet<LookupId>();

         readonly LazyInstanceInjector _lazyInjector;

@@ -961,24 +963,38 @@
                 // transient) and the process continues indefinitely

                 var providerContainer = providerPair.Container;
-
-                //TODO: optimize
-                if (providerContainer._resolvesInProgress.Where(x => x.Equals(lookupId)).HasAtLeast(2))
+
+                if (providerContainer._resolvesTwiceInProgress.Contains(lookupId))
                 {
                     // Allow one before giving up so that you can do circular dependencies via postinject or fields
                     throw Assert.CreateException(
                         "Circular dependency detected! \nObject graph:\n {0}", context.GetObjectGraphString());
                 }

-                providerContainer._resolvesInProgress.Push(lookupId);
+
+                bool twice = false;
+                if (!providerContainer._resolvesInProgress.Add(lookupId))
+                {
+                    bool added = providerContainer._resolvesTwiceInProgress.Add(lookupId);
+                    Assert.That(added);
+                    twice = true;
+                }
                 try
                 {
                     return provider.GetAllInstances(context);
                 }
                 finally
                 {
-                    Assert.That(providerContainer._resolvesInProgress.Peek().Equals(lookupId));
-                    providerContainer._resolvesInProgress.Pop();
+                    if (twice)
+                    {
+                        bool removed = providerContainer._resolvesTwiceInProgress.Remove(lookupId);
+                        Assert.That(removed);
+                    }
+                    else
+                    {
+                        bool removed = providerContainer._resolvesInProgress.Remove(lookupId);
+                        Assert.That(removed);
+                    }
                 }
             }
             else
@@ -3092,17 +3108,9 @@

         struct ProviderPair
         {
-            public ProviderInfo ProviderInfo
-            {
-                get;
-                private set;
-            }
-
-            public DiContainer Container
-            {
-                get;
-                private set;
-            }
+            public readonly ProviderInfo ProviderInfo;
+
+            public readonly DiContainer Container;

             public ProviderPair(ProviderInfo info, DiContainer container)
             {
@@ -3113,20 +3121,24 @@

         struct LookupId
         {
-            public IProvider Provider
-            {
-                get; private set;
-            }
-
-            public BindingId BindingId
-            {
-                get; private set;
-            }
+            public readonly IProvider Provider;
+            public readonly BindingId BindingId;

             public LookupId(IProvider provider, BindingId bindingId)
             {
+                Assert.IsNotNull(provider);
+                Assert.IsNotNull(bindingId);
+
                 Provider = provider;
                 BindingId = bindingId;
+            }
+
+            public override int GetHashCode()
+            {
+                int hash = 17;
+                hash = hash * 23 + Provider.GetHashCode();
+                hash = hash * 23 + BindingId.GetHashCode();
+                return hash;
             }
         }

@@ -3139,23 +3151,11 @@
                 NonLazy = nonLazy;
             }

-            public bool NonLazy
-            {
-                get;
-                private set;
-            }
-
-            public IProvider Provider
-            {
-                get;
-                private set;
-            }
-
-            public BindingCondition Condition
-            {
-                get;
-                private set;
-            }
+            public readonly bool NonLazy;
+
+            public readonly IProvider Provider;
+
+            public readonly BindingCondition Condition;
         }
     }
 }


refactor: clean up char customization a bit


move to AddWallet namespace

move to AddWallet namespace

--- WalletWasabi.Fluent/Views/AddWallet/RecoverWalletView.axaml.cs
+++ WalletWasabi.Fluent/Views/AddWallet/RecoverWalletView.axaml.cs
@@ -3,7 +3,7 @@
 using WalletWasabi.Fluent.ViewModels;
 using WalletWasabi.Fluent.ViewModels.AddWallet;

-namespace WalletWasabi.Fluent.Views.RecoverWallet
+namespace WalletWasabi.Fluent.Views.AddWallet
 {
 	public class RecoverWalletView : ReactiveUserControl<RecoverWalletViewModel>
 	{


stylecop

stylecop

--- WebAnchor.Tests/Wiki/ParameterAttributes/ExamplePrefixTests.cs
+++ WebAnchor.Tests/Wiki/ParameterAttributes/ExamplePrefixTests.cs
@@ -1,6 +1,5 @@
 using System.Net.Http;
 using System.Threading.Tasks;
-using WebAnchor.Attributes.Parameters;
 using WebAnchor.Attributes.URL;
 using WebAnchor.RequestFactory;
 using WebAnchor.RequestFactory.Transformation;
@@ -11,24 +10,7 @@
 {
     public class ExamplePrefixTests : WebAnchorTest
     {
-        #region the attribute
-        public class PrefixAttribute : ParameterTransformerAttribute
-        {
-            private readonly string _prefix;
-
-            public PrefixAttribute(string prefix)
-            {
-                _prefix = prefix;
-            }
-
-            public override void Apply(Parameter parameter)
-            {
-                parameter.Name = _prefix + parameter.SourceParameterInfo.Name;
-            }
-        }
-        #endregion
-
-        #region usage on parameter
+        #region usages
         [BaseLocation("api/customer")]
         public interface ICustomerApi
         {
@@ -36,6 +18,28 @@
             Task<HttpResponseMessage> GetCustomers([Prefix("p_")]string filter = null);
         }

+        [BaseLocation("api/customer")]
+        public interface ICustomerApi2
+        {
+            [Get("")]
+            [Prefix("p_")]
+            Task<HttpResponseMessage> GetCustomers(string filter = null, int? age = null);
+
+            [Get("")]
+            Task<HttpResponseMessage> GetCustomersNoPrefixes(string filter = null, int? age = null);
+        }
+
+        [BaseLocation("api/customer")]
+        [Prefix("p_")]
+        public interface ICustomerApi3
+        {
+            [Get("")]
+            Task<HttpResponseMessage> GetCustomers(string filter = null, int? age = null);
+        }
+        #endregion
+
+        #region usage on parameter
+
         [Fact]
         public void TestExplicitPrefixAttribute()
         {
@@ -51,16 +55,6 @@
         #endregion

         #region usage on method
-        [BaseLocation("api/customer")]
-        public interface ICustomerApi2
-        {
-            [Get("")]
-            [Prefix("p_")]
-            Task<HttpResponseMessage> GetCustomers(string filter = null, int? age = null);
-
-            [Get("")]
-            Task<HttpResponseMessage> GetCustomersNoPrefixes(string filter = null, int? age = null);
-        }

         [Fact]
         public void TestImplicitPrefixAttribute()
@@ -88,14 +82,6 @@
         #endregion

         #region usage on interface
-        [BaseLocation("api/customer")]
-        [Prefix("p_")]
-        public interface ICustomerApi3
-        {
-            [Get("")]
-            Task<HttpResponseMessage> GetCustomers(string filter = null, int? age = null);
-        }
-
         [Fact]
         public void TestImplicitPrefixAttributeOnInterface()
         {
@@ -108,5 +94,22 @@
                });
         }
         #endregion
+
+        #region the attribute
+        public class PrefixAttribute : ParameterTransformerAttribute
+        {
+            private readonly string _prefix;
+
+            public PrefixAttribute(string prefix)
+            {
+                _prefix = prefix;
+            }
+
+            public override void Apply(Parameter parameter)
+            {
+                parameter.Name = _prefix + parameter.SourceParameterInfo.Name;
+            }
+        }
+        #endregion
     }
 }


Added documentation comments.

Added documentation comments.

--- WmcSoft.Business.Primitives/Time/DateInterval.cs
+++ WmcSoft.Business.Primitives/Time/DateInterval.cs
@@ -35,13 +35,29 @@

 namespace WmcSoft.Time
 {
+    /// <summary>
+    /// Defines the extension methods to the <see cref="Interval<Date>"/> class.
+    /// This is a static class.
+    /// </summary>
     public static class DateInterval
     {
+        /// <summary>
+        /// Creates an interval including both <paramref name="start"/> and <paramref name="end"/>.
+        /// </summary>
+        /// <param name="start">The start date.</param>
+        /// <param name="end">The end date.</param>
+        /// <returns>The interval between <paramref name="start"/> and <paramref name="end"/>, included.</returns>
         public static Interval<Date> Inclusive(Date start, Date end)
         {
             return Interval.Closed(start, end);
         }

+        /// <summary>
+        /// Creates an interval for the given <paramref name="month"/> of the <paramref name="year"/>. All days of the <paramref name="month"/> are included.
+        /// </summary>
+        /// <param name="year">The year.</param>
+        /// <param name="month">The month</param>
+        /// <returns>The interval containing all days of the month.</returns>
         public static Interval<Date> Month(int year, int month)
         {
             var start = new Date(year, month, 1);
@@ -49,6 +65,11 @@
             return Inclusive(start, end);
         }

+        /// <summary>
+        /// Creates an interval for the given <paramref name="year"/>. All days of the <paramref name="year"/> are included.
+        /// </summary>
+        /// <param name="year">The year.</param>
+        /// <returns>The interval containing all days of the year.</returns>
         public static Interval<Date> Year(int year)
         {
             var start = new Date(year, 1, 1);
@@ -56,6 +77,11 @@
             return Inclusive(start, end);
         }

+        /// <summary>
+        /// Enumerates all days in the interval in chronological order.
+        /// </summary>
+        /// <param name="interval">The date interval.</param>
+        /// <returns>A lazy enumeration of all days in the interval, in chronological order.</returns>
         public static IEnumerable<Date> Days(this Interval<Date> interval)
         {
             var start = interval.Lower.Value;
@@ -70,6 +96,11 @@
                 yield return end;
         }

+        /// <summary>
+        /// Enumerates all days in the interval in reverse chronological order.
+        /// </summary>
+        /// <param name="interval">The date interval.</param>
+        /// <returns>A lazy enumeration of all days in the interval, in reverse chronological order.</returns>
         public static IEnumerable<Date> DaysBackwards(this Interval<Date> interval)
         {
             var start = interval.Lower.Value;


Truncate TreeView at ComponentObject3D

Truncate TreeView at ComponentObject3D

- Issue MatterHackers/MCCentral#3610
ComponentObject3D should hide details from selection TreeView

--- DesignTools/Primitives/ComponentObject3D.cs
+++ DesignTools/Primitives/ComponentObject3D.cs
@@ -29,10 +29,11 @@

 using System.Collections.Generic;
 using MatterHackers.DataConverters3D;
+using MatterHackers.MatterControl.CustomWidgets;

 namespace MatterHackers.MatterControl.DesignTools
 {
-	public class ComponentObject3D : Object3D
+	public class ComponentObject3D : Object3D, IVisualLeafNode
 	{
 		public ComponentObject3D()
 		{


Use Encoding.UTF8.GetString()

Use Encoding.UTF8.GetString()

--- EDDiscovery/EliteDangerous/LogReaderBase.cs
+++ EDDiscovery/EliteDangerous/LogReaderBase.cs
@@ -81,7 +81,7 @@
                         Buffer.BlockCopy(buffer, bufferpos, buf, 0, endlinepos);
                         bufferpos += linelen;
                         TravelLogUnit.Size += linelen;
-                        line = new String(buf.Select(c => (char)c).ToArray());
+                        line = System.Text.Encoding.UTF8.GetString(buf);

                         return true;
                     }


- Removing unused constant

- Removing unused constant

--- YouTube/YouTube.Base/Services/LiveChatService.cs
+++ YouTube/YouTube.Base/Services/LiveChatService.cs
@@ -13,8 +13,6 @@
     /// </summary>
     public class LiveChatService : YouTubeServiceBase
     {
-        private const string ChatIsNotLive = "The live chat is no longer live";
-
         /// <summary>
         /// Creates an instance of the LiveChatService.
         /// </summary>
@@ -194,7 +192,7 @@
         /// <summary>
         /// Removes moderator privileges from the specified user.
         /// </summary>
-        /// <param name="moderator">The user to unmode</param>
+        /// <param name="moderator">The user to unmod</param>
         /// <returns>An awaitable Task</returns>
         public async Task UnmodUser(LiveChatModerator moderator)
         {


Create options on av scanner for iOS if null

Fixes #966

--- ZXing.Net.Mobile/iOS/AVCaptureScannerView.ios.cs
+++ ZXing.Net.Mobile/iOS/AVCaptureScannerView.ios.cs
@@ -376,7 +376,7 @@

 			Setup();

-			ScanningOptions = options;
+			ScanningOptions = options ?? new MobileBarcodeScanningOptions();
 			resultCallback = scanResultHandler;

 			InvokeOnMainThread(() =>


changed test to watch StartNext instead of StartUpTo, since StartUpTo is nearly impossible to test w/out perhaps a custom scheduler implementation

--- EPS.Concurrency.Tests.Unit/IJobQueueTest.cs
+++ EPS.Concurrency.Tests.Unit/IJobQueueTest.cs
@@ -522,7 +522,7 @@
 		}

 		[Fact]
-		public void StartUpTo_ExecutesJobsInOrder()
+		public void StartNext_ExecutesJobsInOrder()
 		{
 			//easy to compare object references for ordering, impossible for value types i'm afraid
 			if (typeof(TJobInput).IsValueType)
@@ -548,7 +548,12 @@

 			queue.WhenQueueEmpty.ObserveOn(Scheduler.Immediate)
 				.Subscribe(r => emptied.Set());
-			queue.StartUpTo(jobCount);
+
+			for (int i = 0; i < jobCount; i++)
+			{
+				queue.StartNext();
+			}
+
 			emptied.Wait(TimeSpan.FromSeconds(10));

 			Assert.True(inputs.SequenceEqual(inputsExecuted, new GenericEqualityComparer<TJobInput>((a, b) => object.ReferenceEquals(a, b))));


wrong testson

wrong testson

--- Emcon.FMXTests/03_Dashboard_JobsbyStatus.cs
+++ Emcon.FMXTests/03_Dashboard_JobsbyStatus.cs
@@ -14,7 +14,7 @@
     {
         private string envUrl = Config.GetConfigValue("EnvironmentUrl", "http://demo.fmx.bz/");
         [Test(Order = 3)]
-        [TestsOn("2 - Charts")]
+        [TestsOn("3- Quick Search")]
         public void DashboardTest()
         {
             FmXwelcomePage.OpenFMX(envUrl)


Save an allocation when applying None() on an anonymous traversal.

--- ExRam.Gremlinq.Core/Queries/GremlinQuery.cs
+++ ExRam.Gremlinq.Core/Queries/GremlinQuery.cs
@@ -16,6 +16,8 @@
     public abstract class GremlinQuery
     {
         protected static readonly IImmutableList<Step> AnonymousIdentifierSteps = ImmutableList<Step>.Empty.Add(IdentifierStep.Create("__"));
+        protected static readonly IImmutableList<Step> AnonymousNoneSteps = AnonymousIdentifierSteps.Add(NoneStep.Instance);
+
         private static readonly ConcurrentDictionary<Type, Func<IImmutableList<Step>, IGremlinQueryEnvironment, IGremlinQuery>> QueryTypes = new ConcurrentDictionary<Type, Func<IImmutableList<Step>, IGremlinQueryEnvironment, IGremlinQuery>>();

         private static readonly Type[] SupportedInterfaceDefinitions = typeof(GremlinQuery<,,,,,>)
@@ -486,7 +488,12 @@

         private GremlinQuery<TElement, TOutVertex, TInVertex, TPropertyValue, TMeta, TFoldedQuery> Match(Func<GremlinQuery<TElement, TOutVertex, TInVertex, TPropertyValue, TMeta, TFoldedQuery>, IGremlinQuery>[] matchTraversals) => AddStep(new MatchStep(matchTraversals.Select(traversal => traversal(Anonymize()))));

-        private GremlinQuery<TElement, TOutVertex, TInVertex, TPropertyValue, TMeta, TFoldedQuery> None() => AddStep(NoneStep.Instance);
+        private GremlinQuery<TElement, TOutVertex, TInVertex, TPropertyValue, TMeta, TFoldedQuery> None()
+        {
+            return ReferenceEquals(Steps, AnonymousIdentifierSteps)
+                ? new GremlinQuery<TElement, TOutVertex, TInVertex, TPropertyValue, TMeta, TFoldedQuery>(AnonymousNoneSteps, Environment)
+                : AddStep(NoneStep.Instance);
+        }

         private GremlinQuery<TElement, TOutVertex, TInVertex, TPropertyValue, TMeta, TFoldedQuery> Not(Func<GremlinQuery<TElement, TOutVertex, TInVertex, TPropertyValue, TMeta, TFoldedQuery>, IGremlinQuery> notTraversal) => AddStep(new NotStep(notTraversal(Anonymize())));