Fixed issue where invalid removing reason was set for styles with not allowed values

--- HtmlSanitizer/HtmlSanitizer.cs
+++ HtmlSanitizer/HtmlSanitizer.cs
@@ -455,13 +455,13 @@
                 var key = DecodeCss(style.Name);
                 var val = DecodeCss(style.Value);

-                if (!AllowedCssProperties.Contains(key) || DisallowCssPropertyValue.IsMatch(val))
+                if (!AllowedCssProperties.Contains(key))
                 {
                     removeStyles.Add(new Tuple<ICssProperty, RemoveReason>(style, RemoveReason.NotAllowedStyle));
                     continue;
                 }

-                if(CssExpression.IsMatch(val))
+                if(CssExpression.IsMatch(val) || DisallowCssPropertyValue.IsMatch(val))
                 {
                     removeStyles.Add(new Tuple<ICssProperty, RemoveReason>(style, RemoveReason.NotAllowedValue));
                     continue;


Minor bug fix: link event txtvideo6_MouseDoubleClick

--- mp4box/MainForm.Designer.cs
+++ mp4box/MainForm.Designer.cs
@@ -1159,6 +1159,7 @@
             this.txtvideo6.Name = "txtvideo6";
             this.txtvideo6.ReadOnly = true;
             this.txtvideo6.TextChanged += new System.EventHandler(this.txtvideo6_TextChanged_1);
+            this.txtvideo6.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.txtvideo6_MouseDoubleClick);
             //
             // groupBox6
             //


renamed things to be more generic in coding style

--- GemsLogger/Logger.cs
+++ GemsLogger/Logger.cs
@@ -64,7 +64,7 @@
 #if DEBUG
             System.Diagnostics.Debug.WriteLine(pMsg);
 #else
-                    Console.WriteLine(pMsg);
+                    Console.WriteLine(msg);
 #endif
         }

@@ -79,17 +79,17 @@
         /// <summary>
         /// Adds a writer to the logger.
         /// </summary>
-        /// <param name="pWriter">The object that will handle writing.</param>
-        public static void Add(ILogWriter pWriter)
-        {
-            lock (_writers)
-            {
-                if (_writers.Contains(pWriter))
+        /// <param name="writer">The object that will handle writing.</param>
+        public static void Add(ILogWriter writer)
+        {
+            lock (_writers)
+            {
+                if (_writers.Contains(writer))
                 {
                     return;
                 }
-                pWriter.Open();
-                _writers.Add(pWriter);
+                writer.Open();
+                _writers.Add(writer);
             }
         }

@@ -123,70 +123,70 @@
         /// <summary>
         /// Creates a new logger the uses the given type as a description.
         /// </summary>
-        public static Logger Create(Type pType)
-        {
-            return new Logger(pType.Name);
+        public static Logger Create(Type type)
+        {
+            return new Logger(type.Name);
         }

         /// <summary>
         /// Logs an Exception to the Windows event Log.
         /// </summary>
-        public static void EventLog(Exception pEx)
-        {
-            EventLog(pEx.Message);
+        public static void EventLog(Exception ex)
+        {
+            EventLog(ex.Message);
         }

         /// <summary>
         /// Checks if the logger has an instance of the writer.
         /// </summary>
-        /// <param name="pWriter"></param>
+        /// <param name="writer"></param>
         /// <returns></returns>
-        public static bool Has(ILogWriter pWriter)
-        {
-            lock (_writers)
-            {
-                return _writers.Contains(pWriter);
+        public static bool Has(ILogWriter writer)
+        {
+            lock (_writers)
+            {
+                return _writers.Contains(writer);
             }
         }

         /// <summary>
         /// Removes a writer from the logger.
         /// </summary>
-        public static void Remove(ILogWriter pWriter)
-        {
-            lock (_writers)
-            {
-                if (!_writers.Contains(pWriter))
+        public static void Remove(ILogWriter writer)
+        {
+            lock (_writers)
+            {
+                if (!_writers.Contains(writer))
                 {
                     return;
                 }
-                pWriter.Close();
-                _writers.Remove(pWriter);
+                writer.Close();
+                _writers.Remove(writer);
             }
         }

         /// <summary>
         /// Logs debug information.
         /// </summary>
-        public void Debug(string pStr, params object[] pArgs)
-        {
-            Log(eLEVEL.DEBUG, string.Format(pStr, pArgs));
+        public void Debug(string str, params object[] args)
+        {
+            Log(eLEVEL.DEBUG, string.Format(str, args));
         }

         /// <summary>
         /// Logs an Error.
         /// </summary>
-        public void Error(string pStr, params object[] pArgs)
-        {
-            Log(eLEVEL.ERROR, string.Format(pStr, pArgs));
+        public void Error(string str, params object[] args)
+        {
+            Log(eLEVEL.ERROR, string.Format(str, args));
         }

         /// <summary>
         /// Escape a string so it can be sent to the logger without triggering formatting.
         /// </summary>
-        public static string Escape(string pStr)
-        {
-            return pStr
+        public static string Escape(string str)
+        {
+            return str
                 .Replace("{", "{{")
                 .Replace("}", "}}");
         }
@@ -194,10 +194,10 @@
         /// <summary>
         /// Logs an Exception.
         /// </summary>
-        public void Exception(Exception pExc)
+        public void Exception(Exception exc)
         {
             // show the stack trace one line at a time
-            string[] str = pExc
+            string[] str = exc
                 .ToString()
                 .Split(new[] { '\n' });
             string indent = "";
@@ -211,38 +211,38 @@
         /// <summary>
         /// Logs information.
         /// </summary>
-        public void Fine(string pStr, params object[] pArgs)
-        {
-            Log(eLEVEL.FINE, string.Format(pStr, pArgs));
+        public void Fine(string str, params object[] args)
+        {
+            Log(eLEVEL.FINE, string.Format(str, args));
         }

         /// <summary>
         /// Logs information.
         /// </summary>
-        public void Finer(string pStr, params object[] pArgs)
-        {
-            Log(eLEVEL.FINER, string.Format(pStr, pArgs));
+        public void Finer(string str, params object[] args)
+        {
+            Log(eLEVEL.FINER, string.Format(str, args));
         }

         /// <summary>
         /// Logs Finest information.
         /// </summary>
-        public void Finest(string pStr, params object[] pArgs)
-        {
-            Log(eLEVEL.FINEST, string.Format(pStr, pArgs));
+        public void Finest(string str, params object[] args)
+        {
+            Log(eLEVEL.FINEST, string.Format(str, args));
         }

         /// <summary>
         /// Logs an event.
         /// </summary>
-        public void Log(eLEVEL pLevel, string pMsg)
-        {
-            if (pLevel == eLEVEL.DEBUG && !LogDebug)
+        public void Log(eLEVEL level, string msg)
+        {
+            if (level == eLEVEL.DEBUG && !LogDebug)
             {
                 return;
             }

-            if (pLevel == eLEVEL.FINEST && !LogFinest)
+            if (level == eLEVEL.FINEST && !LogFinest)
             {
                 return;
             }
@@ -257,7 +257,7 @@
             {
                 try
                 {
-                    writer.Write(pLevel, _prefix, pMsg);
+                    writer.Write(level, _prefix, msg);
                 }
                 catch (Exception e)
                 {
@@ -273,9 +273,9 @@
         /// <summary>
         /// Logs a LogEntry.
         /// </summary>
-        public void Log(LogEntry pEntry)
-        {
-            Log(pEntry.Level, pEntry.ToString());
+        public void Log(LogEntry entry)
+        {
+            Log(entry.Level, entry.ToString());
         }
     }
 }


Adjust Log to log in background

Adjust Log to log in background

--- GitMind/Utils/Log.cs
+++ GitMind/Utils/Log.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Concurrent;
 using System.Diagnostics;
 using System.IO;
 using System.Net;
@@ -17,8 +18,8 @@
 		private static readonly int MaxLogFileSize = 2000000;

 		private static readonly UdpClient UdpClient = new UdpClient();
-		private static readonly IPEndPoint LocalLogEndPoint = new IPEndPoint(IPAddress.Loopback, 40000);
-
+		private static readonly BlockingCollection<string> logTexts = new BlockingCollection<string>();
+
 		private static readonly IPEndPoint usageLogEndPoint =
 			new IPEndPoint(IPAddress.Parse("10.85.12.4"), 41110);

@@ -32,6 +33,26 @@
 		private static readonly string LevelError = "ERROR";

+		static Log()
+		{
+			Task.Factory.StartNew(SendBufferedLogRows, TaskCreationOptions.LongRunning)
+				.RunInBackground();
+		}
+
+
+		private static void SendBufferedLogRows()
+		{
+			while (!logTexts.IsCompleted)
+			{
+				string logText = logTexts.Take();
+
+				Native.OutputDebugString(logText);
+
+				//Debugger.Log(0, Debugger.DefaultCategory, logText);
+			}
+		}
+
+
 		public static void Usage(
 			string msg,
 			[CallerMemberName] string memberName = "",
@@ -96,7 +117,7 @@
 			{
 				//byte[] bytes = System.Text.Encoding.UTF8.GetBytes(text);
 				//UdpClient.Send(bytes, bytes.Length, LocalLogEndPoint);
-				Native.OutputDebugString(text);
+				SendLog(text);
 				WriteToFile(text);

 				if (level == LevelUsage || level == LevelWarn || level == LevelError)
@@ -107,7 +128,7 @@
 			catch (Exception e) when (e.IsNotFatal())
 			{
 				//Debugger.Log(0, Debugger.DefaultCategory, "ERROR Failed to log to udp " + e);
-				Native.OutputDebugString("ERROR Failed to log to udp " + e);
+				SendLog("ERROR Failed to log to udp " + e);
 			}
 		}

@@ -159,7 +180,7 @@
 				}
 			}

-			Native.OutputDebugString("ERROR Failed to log to file: " + error);
+			SendLog("ERROR Failed to log to file: " + error);
 		}

@@ -184,16 +205,23 @@
 					}
 					catch (Exception e)
 					{
-						Native.OutputDebugString("ERROR Failed to move temp to second log file: " + e);
+						SendLog("ERROR Failed to move temp to second log file: " + e);
 					}

 				}).RunInBackground();
 			}
 			catch (Exception e)
 			{
-				Native.OutputDebugString("ERROR Failed to move large log file: " + e);
+				SendLog("ERROR Failed to move large log file: " + e);
 			}
 		}
+
+
+		private static void SendLog(string text)
+		{
+			logTexts.Add(text);
+		}
+

 		private static class Native
 		{


allow users to leave a closed room

allow users to leave a closed room

--- JabbR/Commands/LeaveCommand.cs
+++ JabbR/Commands/LeaveCommand.cs
@@ -17,7 +17,7 @@
             {
                 string roomName = HttpUtility.HtmlDecode(args[0]);

-                room = context.Repository.VerifyRoom(roomName);
+                room = context.Repository.VerifyRoom(roomName, mustBeOpen: false);
             }

             context.Service.LeaveRoom(callingUser, room);


New clientlib ver

New clientlib ver

--- KalturaClient/KalturaClient.cs
+++ KalturaClient/KalturaClient.cs
@@ -34,7 +34,7 @@
 		public KalturaClient(KalturaConfiguration config) : base(config)
 		{
 				ApiVersion = "3.3.0";
-				ClientTag = "dotnet:16-08-04";
+				ClientTag = "dotnet:16-08-05";
 		}

 		KalturaAccessControlProfileService _AccessControlProfileService;


Refactured class LabirinthMatrix

Refactured class LabirinthMatrix

- constants are added, created and exported method CreateMatrix with
used constants

--- Labyrinth-4/LabyrinthMatrix.cs
+++ Labyrinth-4/LabyrinthMatrix.cs
@@ -4,6 +4,11 @@

     public class LabyrinthMatrix
     {
+        public const int StartPositionVertical = 3;
+        public const int StartPositionHorizontal = 3;
+        public const int MatrixRows = 7;
+        public const int MatrixCols = 7;
+
         private char[][] matrix;
         private int myPostionVertical;
         private int myPostionHorizontal;
@@ -11,24 +16,9 @@

         public LabyrinthMatrix()
         {
-            this.myPostionHorizontal = 3;
-            this.myPostionVertical = 3;
-            this.matrix = new char[7][];
-
-            for (int i = 0; i < this.matrix.Length; i++)
-            {
-                this.matrix[i] = new char[7];
-            }
-
-            for (int i = 0; i < this.matrix.Length; i++)
-            {
-                for (int j = 0; j < this.matrix[i].Length; j++)
-                {
-                    this.matrix[i][j] = this.GetRandomSymbol();
-                }
-            }
-
-            this.matrix[3][3] = '-';
+            this.myPostionHorizontal = StartPositionVertical;
+            this.myPostionVertical = StartPositionHorizontal;
+            this.matrix = this.CreateMatrix();
         }

         public LabyrinthMatrix(LabyrinthMatrix labirinth)
@@ -69,6 +59,28 @@
             }
         }

+        private char[][] CreateMatrix()
+        {
+            var matrix = new char[MatrixRows][];
+
+            for (int i = 0; i < matrix.Length; i++)
+            {
+                matrix[i] = new char[MatrixCols];
+            }
+
+            for (int i = 0; i < matrix.Length; i++)
+            {
+                for (int j = 0; j < matrix[i].Length; j++)
+                {
+                    matrix[i][j] = this.GetRandomSymbol();
+                }
+            }
+
+            matrix[3][3] = '-';
+
+            return matrix;
+        }
+
         private char GetRandomSymbol()
         {
             int random1 = this.random.Next(0, 2);


Fix broken unit test in index page

Fix broken unit test in index page

--- webstats/Modules/Models/IndexPageViewModel.cs
+++ webstats/Modules/Models/IndexPageViewModel.cs
@@ -72,9 +72,9 @@

 		void MarkWinnerIfFinished(IResults actual)
 		{
-		    Better leader = _betters.OrderByDescending(b => b.Score).ToList()[0];
-		    if (actual.HasFinal())
-		        leader.RowClass = "success";
+		    List<Better> betters = _betters.OrderByDescending(b => b.Score).ToList();
+		    if (actual.HasFinal() && betters.Count > 0)
+		        betters[0].RowClass = "success";
 		}

 		private void CreateGroups()


New caching strategy for Razor module to improve render times of empty documents with the same layouts

--- src/extensions/Wyam.Razor/Razor.cs
+++ src/extensions/Wyam.Razor/Razor.cs
@@ -24,6 +24,7 @@
 using Microsoft.AspNetCore.Routing;
 using Microsoft.CodeAnalysis.CSharp;
 using Microsoft.CodeAnalysis.Text;
+using Microsoft.Extensions.Caching.Memory;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;
 using Wyam.Common;
@@ -65,6 +66,7 @@
     /// <include file='Documentation.xml' path='/Documentation/Razor/*' />
     public class Razor : IModule
     {
+        private readonly ConcurrentDictionary<string, CompilationResult> _compilationCache = new ConcurrentDictionary<string, CompilationResult>();
         private readonly Type _basePageType;
         private DocumentConfig _viewStartPath;
         private DocumentConfig _layoutPath;
@@ -294,7 +296,7 @@
                 .Select(x => x.RazorPageFactory())
                 .Reverse()
                 .ToList();
-            IRazorPage page = GetPageFromStream(relativePath, stream, rootFileProvider, razorCompilationService);
+            IRazorPage page = GetPageFromStream(relativePath, viewStartLocation, layoutLocation, stream, rootFileProvider, razorCompilationService);
             if (layoutLocation != null)
             {
                 page.Layout = layoutLocation;
@@ -307,7 +309,7 @@
         /// DefaultRazorPageFactory and CompilerCache. Note that we don't actually bother
         /// with caching the page if it's from a live stream.
         /// </summary>
-        private IRazorPage GetPageFromStream(string relativePath, Stream stream,
+        private IRazorPage GetPageFromStream(string relativePath, string viewStartLocation, string layoutLocation, Stream stream,
             IFileProvider rootFileProvider, IRazorCompilationService razorCompilationService)
         {
             if (relativePath.StartsWith("~/", StringComparison.Ordinal))
@@ -320,14 +322,27 @@
             IFileInfo fileInfo = new StreamFileInfo(rootFileProvider.GetFileInfo(relativePath), stream);
             RelativeFileInfo relativeFileInfo = new RelativeFileInfo(fileInfo, relativePath);

-            // Create the compilation
+            // Try to get the compilation from the cache, but only if the stream is empty
+            // Cache key is relative path if no explicit view start or layout OR either/both of those if specified
+            CompilationResult compilationResult = stream.Length == 0
+                ? _compilationCache.GetOrAdd(
+                    viewStartLocation == null
+                        ? (layoutLocation ?? relativePath)
+                        : (layoutLocation == null ? viewStartLocation : viewStartLocation + layoutLocation),
+                    _ => GetCompilation(relativeFileInfo, razorCompilationService))
+                : GetCompilation(relativeFileInfo, razorCompilationService);
+
+            // Create and return the page
+            // We're not actually using the ASP.NET cache, but the CompilerCacheResult ctor contains the logic to create the page factory
+            CompilerCacheResult compilerCacheResult = new CompilerCacheResult(relativePath, compilationResult, Array.Empty<IChangeToken>());
+            return compilerCacheResult.PageFactory();
+        }
+
+        private CompilationResult GetCompilation(RelativeFileInfo relativeFileInfo, IRazorCompilationService razorCompilationService)
+        {
             CompilationResult compilationResult = razorCompilationService.Compile(relativeFileInfo);
             compilationResult.EnsureSuccessful();
-
-            // Create and return the page
-            // We're not actually using the cache, but the CompilerCacheResult ctor contains the logic to create the page factory
-            CompilerCacheResult compilerCacheResult = new CompilerCacheResult(relativePath, compilationResult, Array.Empty<IChangeToken>());
-            return compilerCacheResult.PageFactory();
+            return compilationResult;
         }

         private string GetRelativePath(IDocument document, IExecutionContext context)


Fixed IMAP GetFolder() methods match LIST responses case-insensitively.

Fixes issue #803

--- MailKit/Net/Imap/ImapEngine.cs
+++ MailKit/Net/Imap/ImapEngine.cs
@@ -2221,7 +2221,7 @@
 		internal static ImapFolder GetFolder (List<ImapFolder> folders, string encodedName)
 		{
 			for (int i = 0; i < folders.Count; i++) {
-				if (folders[i].EncodedName == encodedName)
+				if (encodedName.Equals (folders[i].EncodedName, StringComparison.OrdinalIgnoreCase))
 					return folders[i];
 			}


cleaned up some code

cleaned up some code

--- MailKit/Net/Pop3/Pop3Stream.cs
+++ MailKit/Net/Pop3/Pop3Stream.cs
@@ -84,6 +84,7 @@
 		readonly IProtocolLogger logger;
 		int inputIndex = ReadAheadSize;
 		int inputEnd = ReadAheadSize;
+		Pop3StreamMode mode;
 		bool disposed;
 		bool midline;

@@ -122,7 +123,11 @@
 		/// </summary>
 		/// <value>The mode.</value>
 		public Pop3StreamMode Mode {
-			get; set;
+			get { return mode; }
+			set {
+				IsEndOfData = false;
+				mode = value;
+			}
 		}

 		/// <summary>
@@ -524,8 +529,6 @@
 		{
 			CheckDisposed ();

-			IsEndOfData = false;
-
 			unsafe {
 				fixed (byte* inbuf = input) {
 					byte* start, inptr, inend;


Give up on working around broken servers. Added a bool property to work around them instead.

Fixes issue #405

--- MailKit/Net/Smtp/SmtpClient.cs
+++ MailKit/Net/Smtp/SmtpClient.cs
@@ -71,15 +71,6 @@
 	public class SmtpClient : MailTransport
 	{
 		static readonly byte[] EndData = Encoding.ASCII.GetBytes ("\r\n.\r\n");
-		static readonly string [] BrokenSmtpServersThatResetStateAfterAuthEhlo = {
-			// Note: Some broken SMTP servers reset their state if they receive an EHLO
-			// command after authenticating even though the specifications explicitly
-			// state that clients SHOULD send EHLO again after authenticating.
-			// See https://github.com/jstedfast/MailKit/issues/162 for details.
-			//
-			// Don't you love non RFC-compliant mail servers?
-			"smtp.strato.de", "smtp.sina.com", "smtp.dm.aliyun.com", "mail.shaw.ca"
-		};
 		const int MaxLineLength = 998;

 		enum SmtpCommand {
@@ -112,6 +103,7 @@
 		/// </example>
 		public SmtpClient () : this (new NullProtocolLogger ())
 		{
+			CanQueryCapabilitiesAfterAuthenticating = true;
 		}

 		/// <summary>
@@ -133,6 +125,22 @@
 		/// </example>
 		public SmtpClient (IProtocolLogger protocolLogger) : base (protocolLogger)
 		{
+			CanQueryCapabilitiesAfterAuthenticating = true;
+		}
+
+		/// <summary>
+		/// Get or set whether or not the capabilities can be re-queried after authenticating.
+		/// </summary>
+		/// <remarks>
+		/// <para>Certain servers do not properly follow the specification and break if an <c>EHLO</c>
+		/// command is sent after authenticating, causing the sending of mail to fail with various
+		/// errors, typically suggesting an invalid state.</para>
+		/// <para>Since the SMTP SASL specifications specifically state that clients should requery
+		/// the capabilities after successfully authenticating, the default is <c>true</c>.</para>
+		/// </remarks>
+		/// <value><c>true</c> if query capabilities after authenticating is allowed; otherwise, <c>false</c>.</value>
+		public bool CanQueryCapabilitiesAfterAuthenticating {
+			get; set;
 		}

 		/// <summary>
@@ -522,16 +530,6 @@
 			}
 		}

-		static bool IsBrokenSmtpServerThatResetsStateAfterAuthEhlo (string host)
-		{
-			for (int i = 0; i < BrokenSmtpServersThatResetStateAfterAuthEhlo.Length; i++) {
-				if (host.Equals (BrokenSmtpServersThatResetStateAfterAuthEhlo [i], StringComparison.OrdinalIgnoreCase))
-					return true;
-			}
-
-			return false;
-		}
-
 		/// <summary>
 		/// Authenticates using the supplied credentials.
 		/// </summary>
@@ -651,7 +649,7 @@
 				}

 				if (response.StatusCode == SmtpStatusCode.AuthenticationSuccessful) {
-					if (!IsBrokenSmtpServerThatResetsStateAfterAuthEhlo (host))
+					if (CanQueryCapabilitiesAfterAuthenticating)
 						Ehlo (cancellationToken);
 					authenticated = true;
 					OnAuthenticated (response.Response);


Sending emails in async mode (close #4)

Sending emails in async mode (close #4)

--- Mailer/Transport/SmtpClient.cs
+++ Mailer/Transport/SmtpClient.cs
@@ -1,27 +1,47 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Net.Mail;
-using System.Text;
+using System.Threading;
 using Codestellation.Mailer.Core;
+using NLog;

 namespace Codestellation.Mailer.Transport
 {
     public class SmtpClient : ISmtpClient
     {
+        private static readonly Logger Log = LogManager.GetCurrentClassLogger();
+
         public void Send(Email email)
         {
-            using (System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient())
+            ThreadPool.QueueUserWorkItem(SendNext, email);
+        }
+
+        void SendNext(object state)
+        {
+            Email email = (Email) state;
+            try
             {
-                var mail = new MailMessage(email.From,
-                                           email.Recepients.Collect(),
-                                           email.Subject,
-                                           email.Body)
+                SendNextInternal(email);
+            }
+            catch (Exception error)
+            {
+                Log.ErrorException(string.Format("E-mail '{0}' sending failed", email.Subject), error);
+            }
+        }
+
+        void SendNextInternal(Email email)
+        {
+            using (var client = new System.Net.Mail.SmtpClient())
+            {
+                using (var mail = new MailMessage(email.From,
+                                                  email.Recepients.Collect(),
+                                                  email.Subject,
+                                                  email.Body)
+                                      {
+                                          IsBodyHtml = true
+                                      })
                 {
-                    IsBodyHtml = true
-                };
-
-                client.Send(mail);
+                    client.Send(mail);
+                }
             }
         }
     }


Fix centering in Navigator.ZoomTo

Fix centering in Navigator.ZoomTo

--- Mapsui/Navigation/Navigator.cs
+++ Mapsui/Navigation/Navigator.cs
@@ -177,6 +177,7 @@
         /// <param name="centerOfZoom">Center of zoom. This is the one point in the map that stays on the same location while zooming in.
         /// For instance, in mouse wheel zoom animation the position of the mouse pointer can be the center of zoom.</param>
         /// <param name="duration">Duration for animation in milliseconds. If less then 0, then <see cref="DefaultDuration"/> is used.</param>
+        /// <param name="easing">The easing of the animation when duration is > 0</param>
         public void ZoomTo(double resolution, Point centerOfZoom, long duration = -1, Easing easing = default)
         {
             // todo: Perhaps centerOfZoom should be passed in in world coordinates.
@@ -190,9 +191,10 @@

             if (duration == 0)
             {
+                // The order matters because SetCenter depends on the current resolution
+                _viewport.SetCenter(CalculateCenterOfMap(centerOfZoom, resolution));
                 _viewport.SetResolution(resolution);
-                _viewport.SetCenter(CalculateCenterOfMap(centerOfZoom, resolution));
-
+
                 Navigated?.Invoke(this, ChangeType.Discrete);
             }
             else
@@ -230,7 +232,7 @@

         /// <summary>
         /// Calculates the new CenterOfMap based on the CenterOfZoom and the new resolution.
-        /// The CenterOfzoom is not the same as the CenterOfmap. CenterOfZoom is the one place in
+        /// The CenterOfZoom is not the same as the CenterOfMap. CenterOfZoom is the one place in
         /// the map that stays on the same location when zooming. In Mapsui is can be equal to the
         /// CenterOfMap, for instance when using the +/- buttons. When using mouse wheel zoom the
         /// CenterOfZoom is the location of the mouse.
@@ -360,9 +362,6 @@
             StopRunningAnimation();

             duration = duration < 0 ? _defaultDuration : duration;
-
-            var halfCenter = new Point(_viewport.Center.X + (center.X - _viewport.Center.X) / 2.0, _viewport.Center.Y + (center.Y - _viewport.Center.Y) / 2.0);
-            var resolution = _viewport.Resolution;

             if (duration == 0)
             {


Remove redundant calls

Remove redundant calls

--- MatterSliceLib/fffProcessor.cs
+++ MatterSliceLib/fffProcessor.cs
@@ -1338,18 +1338,12 @@

 					if (outputDataForIsland)
 					{
-						// TODO: Why two moveToIsland calls below?
-						if (config.AvoidCrossingPerimeters)
-						{
-							// Here
-							MoveToIsland(layerGcodePlanner, layer, island);
-						}
-						else
-						{
-							if (config.RetractWhenChangingIslands) layerGcodePlanner.ForceRetract();
-						}
-
-						// And unconditionally here
+						if (!config.AvoidCrossingPerimeters
+							&& config.RetractWhenChangingIslands)
+						{
+							layerGcodePlanner.ForceRetract();
+						}
+
 						MoveToIsland(layerGcodePlanner, layer, island);

 						if (config.NumberOfPerimeters > 0


Zero stream before writing a ReadWrite module. Fix #368

--- Mono.Cecil/ModuleDefinition.cs
+++ Mono.Cecil/ModuleDefinition.cs
@@ -1143,7 +1143,7 @@
 				throw new InvalidOperationException ();

 			var image_stream = Image.Stream.value;
-			image_stream.Position = 0;
+			image_stream.ZeroStream ();
 			Write (image_stream, parameters);
 		}

@@ -1338,6 +1338,12 @@
 			return memory.ToArray ();
 		}

+		public static void ZeroStream (this Stream self)
+		{
+			self.Position = 0;
+			self.SetLength (0);
+		}
+
 		public static void Read (object o)
 		{
 		}


Ignoring the SVGTestCase attribute

Ignoring the SVGTestCase attribute

--- NGraphics/Parsers/SvgReader.cs
+++ NGraphics/Parsers/SvgReader.cs
@@ -199,6 +199,8 @@
         case "metadata":
           // Ignore
           break;
+        case "SVGTestCase":
+          break;
         default:
           throw new NotSupportedException("SVG element \"" + e.Name.LocalName + "\" is not supported");
       }


Move Thread.Sleep to helper method

Move Thread.Sleep to helper method

--- NModbus4/IO/ModbusTransport.cs
+++ NModbus4/IO/ModbusTransport.cs
@@ -131,7 +131,7 @@
                                     Debug.WriteLine(
                                         "Received ACKNOWLEDGE slave exception response, waiting {0} milliseconds and retrying to read response.",
                                         _waitToRetryMilliseconds);
-                                    Thread.Sleep(WaitToRetryMilliseconds);
+                                    Sleep(WaitToRetryMilliseconds);
                                 }
                                 else
                                 {
@@ -155,7 +155,7 @@
                     Debug.WriteLine(
                         "Received SLAVE_DEVICE_BUSY exception response, waiting {0} milliseconds and resubmitting request.",
                         _waitToRetryMilliseconds);
-                    Thread.Sleep(WaitToRetryMilliseconds);
+                    Sleep(WaitToRetryMilliseconds);
                 }
                 catch (Exception e)
                 {
@@ -241,5 +241,10 @@
             if (disposing)
                 DisposableUtility.Dispose(ref _streamResource);
         }
+
+        private static void Sleep(int millisecondsTimeout)
+        {
+            Thread.Sleep(millisecondsTimeout);
+        }
     }
 }


Fixed 2 bugs with 100 continue and sending 2 empty chunks

--- Nowin/Transport2HttpHandler.cs
+++ Nowin/Transport2HttpHandler.cs
@@ -30,7 +30,7 @@
         readonly bool _isSsl;
         readonly IIpIsLocalChecker _ipIsLocalChecker;
         readonly ReqRespStream _reqRespStream;
-        TaskCompletionSource<bool> _tcsSend;
+        volatile TaskCompletionSource<bool> _tcsSend;
         CancellationTokenSource _cancellation;
         int _responseHeaderPos;
         bool _lastPacket;
@@ -610,9 +610,22 @@
                 }
                 if (_responseIsChunked)
                 {
-                    WrapInChunk(_buffer, ref offset, ref len);
+                    if (len != 0)
+                    {
+                        WrapInChunk(_buffer, ref offset, ref len);
+                    }
                     AppendZeroChunk(_buffer, offset, ref len);
                 }
+            }
+            var tcs = _tcsSend;
+            if (tcs != null)
+            {
+                tcs.Task.ContinueWith(_ =>
+                    {
+                        _lastPacket = true;
+                        Callback.StartSend(_buffer, offset, len);
+                    });
+                return;
             }
             _lastPacket = true;
             Callback.StartSend(_buffer, offset, len);
@@ -640,6 +653,12 @@

         void SendInternalServerError()
         {
+            var tcs = _tcsSend;
+            if (tcs != null)
+            {
+                tcs.Task.ContinueWith(_ => SendInternalServerError());
+                return;
+            }
             _isKeepAlive = false;
             _lastPacket = true;
             try
@@ -706,7 +725,23 @@
                 Callback.StartDisconnect();
                 throw new ArgumentOutOfRangeException("len", "Cannot send more bytes than specified in Content-Length header");
             }
-            var tcs = new TaskCompletionSource<bool>();
+            var tcs = _tcsSend;
+            if (tcs != null)
+            {
+                return tcs.Task.ContinueWith(_ =>
+                {
+                    tcs = new TaskCompletionSource<bool>();
+                    Thread.MemoryBarrier();
+                    if (_tcsSend != null)
+                    {
+                        throw new InvalidOperationException("Want to start send but previous is still sending");
+                    }
+                    _tcsSend = tcs;
+                    Callback.StartSend(buffer, startOffset, len);
+                });
+            }
+            tcs = new TaskCompletionSource<bool>();
+            Thread.MemoryBarrier();
             _tcsSend = tcs;
             Callback.StartSend(buffer, startOffset, len);
             return tcs.Task;
@@ -749,6 +784,9 @@

         public void Send100Continue()
         {
+            var tcs = new TaskCompletionSource<bool>();
+            Thread.MemoryBarrier();
+            _tcsSend = tcs;
             Callback.StartSend(_buffer, _constantsOffset, Server.Status100Continue.Length);
         }


[#12265] Protect out of bounds access when clearing wrapped lines.

--- AntShell/Terminal/NavigableTerminalEmulator.cs
+++ AntShell/Terminal/NavigableTerminalEmulator.cs
@@ -543,7 +543,10 @@
             {
                 SendCSI((byte)'2', (byte)'K'); // clear line
                 CursorUp();
-                WrappedLines.RemoveAt(WrappedLines.Count - i);
+                if(WrappedLines.Count - i >= 0)
+                {
+                    WrappedLines.RemoveAt(WrappedLines.Count - i);
+                }
             }

             CurrentLine = 0;


Clean up build file.

Clean up build file.

--- OSVR/Source/OSVR/OSVR.Build.cs
+++ OSVR/Source/OSVR/OSVR.Build.cs
@@ -24,18 +24,18 @@
 			PublicDependencyModuleNames.AddRange(
 				new string[]
 				{
-                    "Core",
-                    "CoreUObject",      // Provides Actors and Structs
-                    "Engine",           // Used by Actor
-                    "Slate",            // Used by InputDevice to fire bespoke FKey events
-                    "InputCore",        // Provides LOCTEXT and other Input features
-                    //"InputDevice",      // Provides IInputInterface
-                    "RHI",
-            		"RenderCore",
+					"Core",
+					"CoreUObject",      // Provides Actors and Structs
+					"Engine",           // Used by Actor
+					"Slate",            // Used by InputDevice to fire bespoke FKey events
+					"InputCore",        // Provides LOCTEXT and other Input features
+					//"InputDevice",      // Provides IInputInterface
+					"RHI",
+					"RenderCore",
 					"Renderer",
-                    "ShaderCore",
-                    "HeadMountedDisplay",
-                    "Json"
+					"ShaderCore",
+					"HeadMountedDisplay",
+					"Json"
 					// ... add other public dependencies that you statically link with here ...
 				}
 				);
@@ -54,42 +54,42 @@
 				}
 				);

-            LoadOSVRLib(Target);
+				LoadOSVRLib(Target);
 		}
-        private string ModulePath
-        {
-            get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
-        }
+		private string ModulePath
+		{
+			get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
+		}

-        private string ThirdPartyPath
-        {
-            get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
-        }
+		private string ThirdPartyPath
+		{
+			get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
+		}

-        public bool LoadOSVRLib(TargetInfo Target)
-        {
-            bool isLibrarySupported = false;
+		public bool LoadOSVRLib(TargetInfo Target)
+		{
+			bool isLibrarySupported = false;

-            string LibrariesPath = Path.Combine(ThirdPartyPath, "OSVR", "lib");
-
-            if (Target.Platform == UnrealTargetPlatform.Win64)
-            {
-                isLibrarySupported = true;
-                PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "Win64", "osvrClientKit.lib"));
-            }
-            else if (Target.Platform == UnrealTargetPlatform.Win32)
-            {
-                isLibrarySupported = true;
-                PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "Win32", "osvrClientKit.lib"));
-            }
+			string LibrariesPath = Path.Combine(ThirdPartyPath, "OSVR", "lib");

-            if (isLibrarySupported)
-            {
-                // Include path
-                PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "OSVR", "include"));
-            }
-
-            return isLibrarySupported;
-        }
+			if (Target.Platform == UnrealTargetPlatform.Win64)
+			{
+				isLibrarySupported = true;
+				PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "Win64", "osvrClientKit.lib"));
+			}
+			else if (Target.Platform == UnrealTargetPlatform.Win32)
+			{
+				isLibrarySupported = true;
+				PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "Win32", "osvrClientKit.lib"));
+			}
+
+			if (isLibrarySupported)
+			{
+				// Include path
+				PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "OSVR", "include"));
+			}
+
+			return isLibrarySupported;
+		}
 	}
 }


remove unused using statements

remove unused using statements

--- Orders.com.BLL/OrderService.cs
+++ Orders.com.BLL/OrderService.cs
@@ -1,15 +1,9 @@
 using Facile.Core;
-using Orders.com.BLL.Rules;
 using Orders.com.Core.DataProxy;
 using Orders.com.Core.Domain;
-using Orders.com.Core.Extensions;
 using Orders.com.Core.QueryData;
 using System;
-using System.Collections;
 using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Linq;
-using System.Threading.Tasks;

 namespace Orders.com.BLL
 {


changed: AssetBundle hash chack is failed in editor rarely. this fix supports it.

--- Assets/Autoya/AssetBundle/AssetBundleLoader.cs
+++ Assets/Autoya/AssetBundle/AssetBundleLoader.cs
@@ -462,7 +462,10 @@
             {
                 var isCached = Caching.IsVersionCached(url, hash);

-                if (isCached)
+                // on UnityEditor, IsVersionCached resurns not valid result when on memory asset is updated by hash.
+                var isNotSameHashCached = hashCache.ContainsKey(bundleName) && hashCache[bundleName] != hash;
+
+                if (isCached && !isNotSameHashCached)
                 {
                     // if current target is dependency, dependent assetBundle is already on memory. and no need to load it.
                     if (isDependency)
@@ -709,7 +712,10 @@
             {
                 var isCached = Caching.IsVersionCached(url, hash);

-                if (isCached)
+                // on UnityEditor, IsVersionCached resurns not valid result when on memory asset is updated by hash.
+                var isNotSameHashCached = hashCache.ContainsKey(bundleName) && hashCache[bundleName] != hash;
+
+                if (isCached && !isNotSameHashCached)
                 {
                     // downloading asset to storage cache is done.
                     loadSucceeded(bundleName);
@@ -869,8 +875,12 @@

             Action<string, object> succeeded = (conId, downloadedAssetBundle) =>
             {
-                // set loaded assetBundle to on-memory cache.
-                onMemoryCache[bundleName] = (AssetBundle)downloadedAssetBundle;
+                if (!onMemoryCache.ContainsKey(bundleName))
+                {
+                    // set loaded assetBundle to on-memory cache.
+                    onMemoryCache[bundleName] = (AssetBundle)downloadedAssetBundle;
+                    hashCache[bundleName] = hash;
+                }
             };

             Action<string, int, string, AutoyaStatus> downloadFailed = (conId, code, reason, autoyaStatus) =>
@@ -1022,6 +1032,10 @@
             core dictionary of on memory cache.
          */
         private readonly Dictionary<string, AssetBundle> onMemoryCache;
+
+        // hash cache dictionary for delete if IsVersionCached is failed.
+        private Dictionary<string, Hash128> hashCache = new Dictionary<string, Hash128>();
+
         private IEnumerator LoadOnMemoryAssetAsync<T>(string bundleName, string assetName, Action<string, T> loadSucceeded, Action<string, AssetBundleLoadError, string, AutoyaStatus> loadFailed) where T : UnityEngine.Object
         {
             var assetBundle = onMemoryCache[bundleName];
@@ -1478,4 +1492,4 @@
             UnloadOnMemoryAssetBundle(bundleName);
         }
     }
-}+}


修改回一处笔误。

修改回一处笔误。

--- Assets/Game/Scripts/Base/YwLuaMonoBehaviour.cs
+++ Assets/Game/Scripts/Base/YwLuaMonoBehaviour.cs
@@ -43,7 +43,7 @@
     public string m_strLuaClassName = string.Empty;

     // All mono method we have.
-    public List<EMonoMethod> m_cMonoMethods = new List<EMonoMethod>() { EMonoMethod.Start, EMonoMethod.Update, EMonoMethod.LateUpdate };
+    public List<EMonoMethod> m_cMonoMethods = new List<EMonoMethod>();

     // The parameters used to pass to lua.
     public GameObject[] m_aParameters = null;


Forgot to query the resource bundle

Forgot to query the resource bundle

--- BeanIO/Internal/Config/Xml/XmlMappingParser.cs
+++ BeanIO/Internal/Config/Xml/XmlMappingParser.cs
@@ -479,6 +479,7 @@
                     XmlNamespace = GetOptionalAttribute(element, "xmlNamespace"),
                     XmlPrefix = GetOptionalAttribute(element, "xmlPrefix"),
                     XmlType = GetOptionalEnumAttribute<XmlNodeType>(element, "xmlType"),
+                    ResourceBundle = GetAttribute(element, "resourceBundle"),
                 };
             config.IsStrict = GetBoolAttribute(element, "strict") ?? config.IsStrict;
             config.IgnoreUnidentifiedRecords = GetBoolAttribute(element, "ignoreUnidentifiedRecords") ?? config.IgnoreUnidentifiedRecords;


Update version

Update version

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


Changed method signature for GetDataCenterBillingDetails to work with a string Id

--- CenturyLinkCloudSDK/Services/BillingService.cs
+++ CenturyLinkCloudSDK/Services/BillingService.cs
@@ -44,26 +44,25 @@
         /// <summary>
         /// Gets the billing details of a data center.
         /// </summary>
-        /// <param name="dataCenter"></param>
+        /// <param name="dataCenterId"></param>
         /// <returns></returns>
-        public async Task<BillingDetail> GetDataCenterBillingDetails(DataCenter dataCenter)
+        public async Task<BillingDetail> GetDataCenterBillingDetails(string dataCenterId)
         {
-            return await GetDataCenterBillingDetails(dataCenter, CancellationToken.None).ConfigureAwait(false);
+            return await GetDataCenterBillingDetails(dataCenterId, CancellationToken.None).ConfigureAwait(false);
         }
-

         /// <summary>
         /// Gets the billing details of a data center.
         /// </summary>
-        /// <param name="dataCenter"></param>
+        /// <param name="dataCenterId"></param>
         /// <param name="cancellationToken"></param>
         /// <returns></returns>
-        public async Task<BillingDetail> GetDataCenterBillingDetails(DataCenter dataCenter, CancellationToken cancellationToken)
+        public async Task<BillingDetail> GetDataCenterBillingDetails(string dataCenterId, CancellationToken cancellationToken)
         {
             var billingDetail = new BillingDetail();
             var dataCenterService = new DataCenterService(authentication);

-            var dataCenterGroup = await dataCenterService.GetDataCenterGroup(dataCenter.Id).ConfigureAwait(false);
+            var dataCenterGroup = await dataCenterService.GetDataCenterGroup(dataCenterId).ConfigureAwait(false);
             var rootGroup = await dataCenterGroup.GetRootHardwareGroup(cancellationToken).ConfigureAwait(false);
             var groupBillingDetail = await GetGroupBillingDetails(rootGroup.Id).ConfigureAwait(false);


comments.  there is an impedance mismatch between the sqlite3 C api and the semantics of .NET Dispose and SafeHandle.  not sure yet how much to obsess about this.  #256

--- mt/SQLitePCLRaw.core/raw.cs
+++ mt/SQLitePCLRaw.core/raw.cs
@@ -878,6 +878,7 @@
         static public int sqlite3_backup_finish(sqlite3_backup backup)
         {
 			backup.Dispose();
+			// TODO return code lost here
 			return 0;
         }

@@ -929,6 +930,7 @@
         static public int sqlite3_blob_close(sqlite3_blob blob)
         {
 			blob.Dispose();
+			// TODO return code lost here
             return 0;
         }


Fixed a small bug in ApplyProvisioningTemplate with in-memory template instance.

--- Commands/Branding/ApplyProvisioningTemplate.cs
+++ Commands/Branding/ApplyProvisioningTemplate.cs
@@ -112,7 +112,7 @@
                 }

                 // If the template has been provided through the -Path parameter
-                if (InputInstance != null)
+                if (InputInstance == null)
                 {
                     FileInfo fileInfo = new FileInfo(Path);
                     fileConnector = new FileSystemConnector(fileInfo.DirectoryName, "");


delete debugging construktion

delete debugging construktion

--- Construktion/Internal/DebuggingConstruktion.cs
+++ Construktion/Internal/DebuggingConstruktion.cs
@@ -1,32 +0,0 @@
-// ReSharper disable once CheckNamespace
-namespace Construktion.Debug
-{
-    using System;
-    using System.Collections.Generic;
-    using Internal;
-
-    public class DebuggingConstruktion
-    {
-        [Obsolete("This class will be deleted in 2.0. Please use new Construktion().DebuggingConstruct instead.")]
-        public DebuggingConstruktion() : this(new Construktion()) { }
-
-        [Obsolete("This class will be deleted in 2.0. Please use new Construktion().DebuggingConstruct instead.")]
-        public DebuggingConstruktion(Construktion construktion) { }
-
-        /// <summary>de
-        /// DO NOT use for normal operations. Should be used for ad hoc debugging ONLY.
-        /// </summary>
-        /// <returns></returns>
-        [Obsolete("This class will be deleted in 2.0. Please use new Construktion().DebuggingConstruct instead.")]
-        public object DebuggingConstruct(ConstruktionContext context, out string log)
-        {
-            var pipeline = new DebuggingConstruktionPipeline(new DefaultConstruktionSettings());
-
-            var result = pipeline.DebugSend(context, out List<string> debugLog);
-
-            log = string.Join("\n", debugLog);
-
-            return result;
-        }
-    }
-}


Fix toggle UI keybind in tutorial window (#669)

Is shift + f4, not F1

--- Content.Client/UserInterface/TutorialWindow.cs
+++ Content.Client/UserInterface/TutorialWindow.cs
@@ -31,7 +31,7 @@
 Open entity context menu: [color=#a4885c]Right click[/color]
 Toggle combat mode: [color=#a4885c]R[/color]
 Toggle console: [color=#a4885c]~ (Tilde)[/color]
-Toggle UI: [color=#a4885c]F1[/color]
+Toggle UI: [color=#a4885c]Shift + F4[/color]
 Toggle debug overlay: [color=#a4885c]F3[/color]
 Toggle entity spawner: [color=#a4885c]F5[/color]
 Toggle tile spawner: [color=#a4885c]F6[/color]


Fixed some relocation types in binary_library that were too short (and coming up with relocation trucated to fit errors if this was not the case).

--- tl/binary_library/elf/JCARelocs.cs
+++ tl/binary_library/elf/JCARelocs.cs
@@ -345,7 +345,7 @@
             }

             public int BitLength
-            { get { return 10; } }
+            { get { return 11; } }
             public bool IsSigned
             { get { return true; } }
             public int BitOffset
@@ -469,7 +469,7 @@
             }

             public int BitLength
-            { get { return 15; } }
+            { get { return 16; } }
             public bool IsSigned
             { get { return true; } }
             public int BitOffset


step 4 image-decorator - first algorithm, hardcoded.

--- QCV.Example/image_decorator.cs
+++ QCV.Example/image_decorator.cs
@@ -26,6 +26,8 @@

     public void Execute(Dictionary<string, object> bundle) {
       Image<Bgr, byte> image = bundle.GetImage("source");
+      image.Draw(new Rectangle(Point.Empty, image.Size), new Bgr(Color.Red), 10);
+
       IDataInteractor idi = bundle.GetInteractor();
       idi.Show("camera input", image);
     }


Fix for https://rdotnet.codeplex.com/discussions/586205

--- R.NET/Devices/ConsoleDevice.cs
+++ R.NET/Devices/ConsoleDevice.cs
@@ -32,7 +32,6 @@
         /// <param name="outputType">Parameter is ignored</param>
         public void WriteConsole(string output, int length, ConsoleOutputType outputType)
         {
-            output = output.Trim(' ');
             Console.Write(output);
         }


修复重复startup导致的提示错误

修复重复startup导致的提示错误

--- ElectronicObserver/Window/FormMain.Designer.cs
+++ ElectronicObserver/Window/FormMain.Designer.cs
@@ -580,7 +580,6 @@
 			this.Text = "試製七四式電子観測儀";
 			this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing);
 			this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormMain_FormClosed);
-			this.Shown += new System.EventHandler(this.FormMain_Shown);
 			this.Load += new System.EventHandler(this.FormMain_Load);
 			this.Shown += new System.EventHandler(this.FormMain_Shown);
 			this.StripMenu.ResumeLayout(false);


Added annocation and service provider access

--- FubarDev.WebDavServer.Tests/ServerTestsBase.cs
+++ FubarDev.WebDavServer.Tests/ServerTestsBase.cs
@@ -41,6 +41,7 @@
             Client = new WebDavClient(Server.CreateClient());
         }

+        [NotNull]
         protected IFileSystem FileSystem { get; }

         [NotNull]
@@ -48,6 +49,9 @@

         [NotNull]
         protected WebDavClient Client { get; }
+
+        [NotNull]
+        protected IServiceProvider ServiceProvider => Server.Host.Services;

         public void Dispose()
         {


More try-eats in UI-tests.

More try-eats in UI-tests.

--- Gu.Wpf.Reactive.UiTests/Helpers/WindowTests.cs
+++ Gu.Wpf.Reactive.UiTests/Helpers/WindowTests.cs
@@ -21,10 +21,11 @@

         public void Restart()
         {
-            for (int i = 0; i < 3; i++)
+            for (var i = 0; i < 3; i++)
             {
                 try
                 {
+                    this.application?.WaitWhileBusy();
                     this.application?.Dispose();
                     this.application = Application.AttachOrLaunch(Info.CreateStartInfo(this.WindowName));
                     this.application.WaitWhileMainHandleIsMissing();
@@ -53,13 +54,16 @@
         {
             Keyboard.ReleaseScanCode((ushort)ScanCodeShort.CONTROL, isExtendedKey: false);
             Keyboard.ReleaseScanCode((ushort)ScanCodeShort.SHIFT, isExtendedKey: false);
-            if (this.Window != null)
+
+            try
             {
-                Helpers.WaitUntilResponsive(this.Window);
+                this.application?.WaitWhileBusy();
+                this.automation?.Dispose();
+                this.application?.Dispose();
             }
-
-            this.automation?.Dispose();
-            this.application?.Dispose();
+            catch
+            {
+            }
         }

         public void Dispose()
@@ -77,8 +81,15 @@
             this.disposed = true;
             if (disposing)
             {
-                this.application?.Dispose();
-                this.automation?.Dispose();
+                try
+                {
+                    this.application?.WaitWhileBusy();
+                    this.automation?.Dispose();
+                    this.application?.Dispose();
+                }
+                catch
+                {
+                }
             }
         }


Raise events on creation of IDeploymentManager.

--- Kudu.Services.Web/App_Start/NinjectServices.cs
+++ Kudu.Services.Web/App_Start/NinjectServices.cs
@@ -119,7 +119,8 @@
                                             .InRequestScope();

             kernel.Bind<IDeploymentManager>().To<DeploymentManager>()
-                                             .InRequestScope();
+                                             .InRequestScope()
+                                             .OnActivation(SubscribeForDeploymentEvents);

             // Git server
             kernel.Bind<IDeploymentManagerFactory>().ToMethod(context => GetDeploymentManagerFactory(environment, propertyProvider, context.Kernel.Get<IProfilerFactory>()));


`AssemblyDescriptor` class structure simplified.

--- Migrant/VersionTolerance/AssemblyDescriptor.cs
+++ Migrant/VersionTolerance/AssemblyDescriptor.cs
@@ -52,14 +52,33 @@

         public void ReadFromStream(ObjectReader reader)
         {
-            ReadAssemblyStamp(reader);
+            Name = reader.PrimitiveReader.ReadString();
+            Version = reader.PrimitiveReader.ReadVersion();
+            CultureName = reader.PrimitiveReader.ReadString();
+            var tokenLength = reader.PrimitiveReader.ReadByte();
+            switch(tokenLength)
+            {
+            case 0:
+                Token = new byte[0];
+                break;
+            case 8:
+                Token = reader.PrimitiveReader.ReadBytes(8);
+                break;
+            default:
+                throw new ArgumentException("Wrong token length!");
+            }
+
             var assemblyName = new AssemblyName(FullName);
             UnderlyingAssembly = Assembly.Load(assemblyName);
         }

         public void WriteTo(ObjectWriter writer)
         {
-            WriteAssemblyStamp(writer);
+            writer.PrimitiveWriter.Write(Name);
+            writer.PrimitiveWriter.Write(Version);
+            writer.PrimitiveWriter.Write(CultureName);
+            writer.PrimitiveWriter.Write((byte)Token.Length);
+            writer.PrimitiveWriter.Write(Token);
         }

         public override bool Equals(object obj)
@@ -85,34 +104,6 @@
         public override int GetHashCode()
         {
             return FullName.GetHashCode();
-        }
-
-        private void WriteAssemblyStamp(ObjectWriter writer)
-        {
-            writer.PrimitiveWriter.Write(Name);
-            writer.PrimitiveWriter.Write(Version);
-            writer.PrimitiveWriter.Write(CultureName);
-            writer.PrimitiveWriter.Write((byte)Token.Length);
-            writer.PrimitiveWriter.Write(Token);
-        }
-
-        private void ReadAssemblyStamp(ObjectReader reader)
-        {
-            Name = reader.PrimitiveReader.ReadString();
-            Version = reader.PrimitiveReader.ReadVersion();
-            CultureName = reader.PrimitiveReader.ReadString();
-            var tokenLength = reader.PrimitiveReader.ReadByte();
-            switch(tokenLength)
-            {
-            case 0:
-                Token = new byte[0];
-                break;
-            case 8:
-                Token = reader.PrimitiveReader.ReadBytes(8);
-                break;
-            default:
-                throw new ArgumentException("Wrong token length!");
-            }
         }

         public string FullName { get { return string.Format("{0}, Version={1}, Culture={2}, PublicKeyToken={3}", Name, Version, CultureName, Token.Length == 0 ? "null" : String.Join(string.Empty, Token.Select(x => string.Format("{0:x2}", x)))); } }


probando

probando

--- MiniTrello.Infrastructure/ConfigureDatabase.cs
+++ MiniTrello.Infrastructure/ConfigureDatabase.cs
@@ -3,6 +3,7 @@
 using FluentNHibernate.Cfg.Db;
 using MiniTrello.Data;
 using NHibernate;
+

 namespace MiniTrello.Infrastructure
 {


HookGen: Fix too deeply nested types (Thanks Zandra!)

--- MonoMod.RuntimeDetour.HookGen/HookGenerator.cs
+++ MonoMod.RuntimeDetour.HookGen/HookGenerator.cs
@@ -249,7 +249,7 @@
                 // If not, use System.Object instead.
                 TypeDefinition typeParent = method.DeclaringType;
                 bool isPublic = true;
-                while (typeParent != null && (isPublic = typeParent.IsPublic))
+                while (typeParent != null && (isPublic = (typeParent.IsNestedPublic || typeParent.IsPublic)))
                     typeParent = typeParent.DeclaringType;
                 TypeReference typeSelf;
                 if (isPublic)


fixed overrun finding parameters in url (#85)

--- NTumbleBit/ClassicTumbler/TumblerUrlBuilder.cs
+++ NTumbleBit/ClassicTumbler/TumblerUrlBuilder.cs
@@ -38,7 +38,6 @@
 			else
 			{
 				address = uri.Substring(0, paramStart);
-				uri = uri.Remove(0, 1); //remove ?
 			}
 			if(address != String.Empty)
 			{
@@ -54,7 +53,7 @@
 				var host = split[0];
 				Host = host;
 			}
-			uri = uri.Remove(0, address.Length);
+			uri = uri.Remove(0, paramStart + 1);  //+1 to move past '?'

 			Dictionary<string, string> parameters;
 			try


Display all network adapters, except for loopback and tunnels (closing #3)

--- NetworkProcessAgent/NetworkInterfaceManager.cs
+++ NetworkProcessAgent/NetworkInterfaceManager.cs
@@ -23,7 +23,7 @@

         public static Network.NetworkInterface[] GetAll()
         {
-            return GetAllNetworkAdapters().ToArray();
+            return GetAllInterfaces().ToArray();
         }

         private static Dictionary<Guid, string> GetRASIdNameDictionary()
@@ -40,7 +40,7 @@
             return dictionary;
         }

-        private static List<Network.NetworkInterface> GetAllNetworkAdapters()
+        private static List<Network.NetworkInterface> GetAllRASInterfaces()
         {
             var rasDictionary = GetRASIdNameDictionary();

@@ -51,9 +51,32 @@
             }).ToList();
         }

+        private static List<Network.NetworkInterface> GetAllRegularInterfaces()
+        {
+            var networkInterfaces = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
+
+            return networkInterfaces
+                .Where(_ => _.NetworkInterfaceType != NetworkInterfaceType.Loopback)
+                .Where(_ => _.NetworkInterfaceType != NetworkInterfaceType.Tunnel)
+                .Select(_ => new Network.NetworkInterface(_.Id, _.Name)).ToList();
+        }
+
+        private static List<Network.NetworkInterface> GetAllInterfaces()
+        {
+            var rasInterfaces = GetAllRASInterfaces();
+            var regularInterfaces = GetAllRegularInterfaces();
+
+            var allInterfaces = rasInterfaces.Concat(regularInterfaces);
+
+            return allInterfaces
+                .GroupBy(_ => _.Id)
+                .Select(_ => _.First())
+                .ToList();
+        }
+
         public static Network.NetworkInterface GetById(string id)
         {
-            return GetAllNetworkAdapters().FirstOrDefault(_ => _.Id == id);
+            return GetAllInterfaces().FirstOrDefault(_ => _.Id == id);
         }

         private void NetworkStatusChanged(object sender, EventArgs e)
@@ -66,7 +89,6 @@
                 NetworkInterfaceStatusChangedEvent(new NetworkInterfaceStatusChangedEventArgs(networkInterface));
             }
         }
-

         public class NetworkInterfaceStatusChangedEventArgs : EventArgs
         {


add comment

add comment

--- RxApp.Android/RxApplication.cs
+++ RxApp.Android/RxApplication.cs
@@ -54,6 +54,7 @@
             this.activityMapping.Add(typeof(TModel), typeof(TActivity));
         }

+        // FIXME: Maybe should be a hot observable
         public IObservable<NavigationStack> Build()
         {
             var activityMapping = this.activityMapping.ToImmutableDictionary();


Added some comments.

Added some comments.

--- SPMReader/SPMReader/Program.cs
+++ SPMReader/SPMReader/Program.cs
@@ -26,6 +26,10 @@

       reader.Read();

+      /*
+       * TODO: Need to not use the DX18 here.
+       */
+
       object doc = ((SPMReader.Readers.Spektrum.DX18)(reader)).ExportXDocument();

       string output = null;


Ip address space (#1) (#39)

Ip address space (#1) (#39)

* Default to IPv4 with duel mode

* Force IPv4

--- nClam/ClamClient.cs
+++ nClam/ClamClient.cs
@@ -56,7 +56,8 @@
 #endif
             string result;

-            var clam = new TcpClient();
+            var clam = new TcpClient(AddressFamily.InterNetwork);
+
             try
             {
                 await clam.ConnectAsync(Server, Port).ConfigureAwait(false);


Recognise - as a hotkey definition.

Recognise - as a hotkey definition.

--- Scripting/Parser/Texts/Line.cs
+++ Scripting/Parser/Texts/Line.cs
@@ -52,9 +52,7 @@
                 case Subtract:
                     if (1 < code.Length && code[1] == code[0])
                         return false;
-                    if (code[0] == Add)
-                        goto case Not;
-                    return true;
+                    goto case Not;

                 case TernaryB:
                     if (code.Length > 1 && code[1] == Equal)


remove unused function from utils.cs

remove unused function from utils.cs

--- SendGrid/SendGridMail/Utils.cs
+++ SendGrid/SendGridMail/Utils.cs
@@ -27,20 +27,5 @@
         {
             return "{"+String.Join(",",dic.Select(kvp => Serialize(kvp.Key) + ":" + Serialize(kvp.Value)))+"}";
         }
-
-		public static byte[] ReadFully(Stream input)
-		{
-			byte[] buffer = new byte[16*1024];
-			using (MemoryStream ms = new MemoryStream())
-			{
-				int read;
-				while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
-				{
-					ms.Write(buffer, 0, read);
-				}
-				return ms.ToArray();
-			}
-		}
-
     }
 }


Now can load 3Ds Max .obj files

Now can load 3Ds Max .obj files

Added two little patches of code that can fix the 3Ds Max .obj file, so
the ObjLoader can load it.

--- OpenGLTutorial16/OpenGLTutorial16/ObjLoader.cs
+++ OpenGLTutorial16/OpenGLTutorial16/ObjLoader.cs
@@ -112,6 +112,14 @@
                     }
                     else if (line[0] != '#') lines.Add(line);    // ignore comments
                 }
+
+                // If the obj has just one material would not execute the ObjMaterial function up, so I added (if the there are lines still not processed, process them)
+                if (lines.Count != 0)
+                {
+                    ObjMaterial materialEnd = new ObjMaterial(lines, defaultProgram);
+                    if (!materials.ContainsKey(materialEnd.Name)) materials.Add(materialEnd.Name, materialEnd);
+                    lines.Clear();
+                }
             }
         }

@@ -198,6 +206,12 @@
             {
                 string[] split = lines[i].Split(' ');

+                // Some object exporters export the material with a tab character in front, so I am removing it
+                if (split[0].Contains("\t"))
+                {
+                    split[0] = split[0].Replace("\t", string.Empty);
+                }
+
                 switch (split[0])
                 {
                     case "Ns": this.SpecularCoefficient = float.Parse(split[1]);


Use SOP.ParentGroup in Prioritizer instead of Scene.GetGroupByPrim()

By the time a scheduled update is triggered, a sog may have been removed from the scene.  This change prevents NullReferenceExceptions in these situations.

--- OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -122,9 +122,16 @@
                 // Use group position for child prims
                 Vector3 entityPos;
                 if (entity is SceneObjectPart)
-                    entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
-                else
+                {
+                    // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene
+                    // before its scheduled update was triggered
+                    //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
+                    entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
+                }
+                else
+                {
                     entityPos = entity.AbsolutePosition;
+                }

                 return Vector3.DistanceSquared(presencePos, entityPos);
             }
@@ -144,9 +151,16 @@
                 // Use group position for child prims
                 Vector3 entityPos = entity.AbsolutePosition;
                 if (entity is SceneObjectPart)
-                    entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
-                else
+                {
+                    // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene
+                    // before its scheduled update was triggered
+                    //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
+                    entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
+                }
+                else
+                {
                     entityPos = entity.AbsolutePosition;
+                }

                 if (!presence.IsChildAgent)
                 {


BulletSim: don't recreate mesh unless it needs it when rebuilding the hull. Make sure the collisionCollection is reallocated each tick to fix race condition of it being cleared while still in use.

--- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -497,6 +497,9 @@

         BulletSimAPI.SetObjectProperties(_scene.WorldID, LocalID, IsStatic, IsSolid, SubscribedEvents(), mass);

+        // recompute any linkset parameters
+        _linkset.Refresh(this);
+
         CollisionFlags cf = BulletSimAPI.GetCollisionFlags2(Body.Ptr);
         DetailLog("{0},BSPrim.SetObjectDynamic,taint,static={1},solid={2},mass={3}, cf={4}", LocalID, IsStatic, IsSolid, mass, cf);
     }
@@ -1095,28 +1098,21 @@
         // if the hull hasn't changed, don't rebuild it
         if (newHullKey == _hullKey) return;

-        DetailLog("{0},BSPrim.CreateGeomHull,create,key={1}", LocalID, _meshKey);
+        DetailLog("{0},BSPrim.CreateGeomHull,create,oldKey={1},newKey={2}", LocalID, _hullKey, newHullKey);

         // Since we're recreating new, get rid of any previously generated shape
         if (_hullKey != 0)
         {
             // m_log.DebugFormat("{0}: CreateGeom: deleting old hull. Key={1}", LogHeader, _hullKey);
-            DetailLog("{0},BSPrim.CreateGeomHull,deleteOldHull,key={1}", LocalID, _meshKey);
+            DetailLog("{0},BSPrim.CreateGeomHull,deleteOldHull,key={1}", LocalID, _hullKey);
             BulletSimAPI.DestroyHull(_scene.WorldID, _hullKey);
             _hullKey = 0;
-            _hulls.Clear();
-            DetailLog("{0},BSPrim.CreateGeomHull,deleteOldMesh,key={1}", LocalID, _meshKey);
-            BulletSimAPI.DestroyMesh(_scene.WorldID, _meshKey);
-            _mesh = null;   // the mesh cannot match either
-            _meshKey = 0;
         }

         _hullKey = newHullKey;
-        if (_meshKey != _hullKey)
-        {
-            // if the underlying mesh has changed, rebuild it
-            CreateGeomMesh();
-        }
+
+        // Make sure the underlying mesh exists and is correct
+        CreateGeomMesh();

         int[] indices = _mesh.getIndexListAsInt();
         List<OMV.Vector3> vertices = _mesh.getVertexList();
@@ -1142,7 +1138,7 @@
         // create the hull into the _hulls variable
         convexBuilder.process(dcomp);

-        // Convert the vertices and indices for passing to unmanaged
+        // Convert the vertices and indices for passing to unmanaged.
         // The hull information is passed as a large floating point array.
         // The format is:
         //  convHulls[0] = number of hulls
@@ -1355,7 +1351,7 @@
     }

     // I've collided with something
-    CollisionEventUpdate collisionCollection = null;
+    CollisionEventUpdate collisionCollection;
     public void Collide(uint collidingWith, ActorTypes type, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth)
     {
         // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith);
@@ -1366,6 +1362,8 @@
         {
             _collidingGroundStep = _scene.SimulationStep;
         }
+
+        // DetailLog("{0},BSPrim.Collison,call,with={1}", LocalID, collidingWith);

         // if someone is subscribed to collision events....
         if (_subscribedEventsMs != 0) {
@@ -1387,7 +1385,9 @@
         if (collisionCollection != null && collisionCollection.Count > 0)
         {
             base.SendCollisionUpdate(collisionCollection);
-            collisionCollection.Clear();
+            // The collisionCollection structure is passed around in the simulator.
+            // Make sure we don't have a handle to that one and that a new one is used next time.
+            collisionCollection = null;
         }
     }


Don't re-add the assembly resolver for each script if not creating the appdomain

--- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1021,11 +1021,18 @@

                             AppDomain sandbox;
                             if (m_AppDomainLoading)
+                            {
                                 sandbox = AppDomain.CreateDomain(
                                                 m_Scene.RegionInfo.RegionID.ToString(),
                                                 evidence, appSetup);
+                                m_AppDomains[appDomain].AssemblyResolve +=
+                                    new ResolveEventHandler(
+                                        AssemblyResolver.OnAssemblyResolve);
+                            }
                             else
+                            {
                                 sandbox = AppDomain.CurrentDomain;
+                            }

                             //PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
                             //AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
@@ -1037,9 +1044,6 @@

                             m_AppDomains[appDomain] = sandbox;

-                            m_AppDomains[appDomain].AssemblyResolve +=
-                                new ResolveEventHandler(
-                                    AssemblyResolver.OnAssemblyResolve);
                             m_DomainScripts[appDomain] = new List<UUID>();
                         }
                         catch (Exception e)
@@ -1984,4 +1988,4 @@
 //                m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID);
         }
     }
-}+}


Fixed #216

Fixed #216

--- Server/Forms/FrmRemoteShell.cs
+++ Server/Forms/FrmRemoteShell.cs
@@ -45,18 +45,24 @@
                 string input = txtConsoleInput.Text;
                 txtConsoleInput.Text = string.Empty;

-                switch (input)
+                bool isExit = (input.StartsWith("exit") && input.Length > "exit".Length && input[4] == ' ') || input == "exit";
+
+                if (isExit)
                 {
-                    case "cls":
-                        txtConsoleOutput.Text = string.Empty;
-                        break;
-                    case "exit":
-                        new Core.Packets.ServerPackets.ShellCommand(input).Execute(_connectClient);
-                        this.Close();
-                        break;
-                    default:
-                        new Core.Packets.ServerPackets.ShellCommand(input).Execute(_connectClient);
-                        break;
+                    new Core.Packets.ServerPackets.ShellCommand("exit").Execute(_connectClient);
+                    this.Close();
+                }
+                else
+                {
+                    switch (input)
+                    {
+                        case "cls":
+                            txtConsoleOutput.Text = string.Empty;
+                            break;
+                        default:
+                            new Core.Packets.ServerPackets.ShellCommand(input).Execute(_connectClient);
+                            break;
+                    }
                 }

                 e.Handled = true;


Another stab at http://opensimulator.org/mantis/view.php?id=4858. Eliminated more nested locks.

--- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -701,9 +701,9 @@
                 }
             }

+            ScriptInstance instance = null;
             lock (m_Scripts)
             {
-                ScriptInstance instance = null;
                 // Create the object record

                 if ((!m_Scripts.ContainsKey(itemID)) ||
@@ -786,28 +786,29 @@

                     m_Scripts[itemID] = instance;
                 }
-
-                lock (m_PrimObjects)
-                {
-                    if (!m_PrimObjects.ContainsKey(localID))
-                        m_PrimObjects[localID] = new List<UUID>();
-
-                    if (!m_PrimObjects[localID].Contains(itemID))
-                        m_PrimObjects[localID].Add(itemID);
-
-                }
-
-                if (!m_Assemblies.ContainsKey(assetID))
-                    m_Assemblies[assetID] = assembly;
-
-                lock (m_AddingAssemblies)
-                {
-                    m_AddingAssemblies[assembly]--;
-                }
-
-                if (instance!=null)
-                    instance.Init();
-            }
+            }
+
+            lock (m_PrimObjects)
+            {
+                if (!m_PrimObjects.ContainsKey(localID))
+                    m_PrimObjects[localID] = new List<UUID>();
+
+                if (!m_PrimObjects[localID].Contains(itemID))
+                    m_PrimObjects[localID].Add(itemID);
+
+            }
+
+            if (!m_Assemblies.ContainsKey(assetID))
+                m_Assemblies[assetID] = assembly;
+
+            lock (m_AddingAssemblies)
+            {
+                m_AddingAssemblies[assembly]--;
+            }
+
+            if (instance != null)
+                instance.Init();
+
             return true;
         }

@@ -1007,26 +1008,33 @@
         public bool PostObjectEvent(uint localID, EventParams p)
         {
             bool result = false;
-
+            List<UUID> uuids = null;
+
             lock (m_PrimObjects)
             {
                 if (!m_PrimObjects.ContainsKey(localID))
                     return false;

+                uuids = m_PrimObjects[localID];
+            }
+
+            foreach (UUID itemID in uuids)
+            {
+                IScriptInstance instance = null;
+                try
+                {
+                    if (m_Scripts.ContainsKey(itemID))
+                        instance = m_Scripts[itemID];
+                }
+                catch { /* ignore race conditions */ }
+
+                if (instance != null)
+                {
+                    instance.PostEvent(p);
+                    result = true;
+                }
+            }

-                foreach (UUID itemID in m_PrimObjects[localID])
-                {
-                    if (m_Scripts.ContainsKey(itemID))
-                    {
-                        IScriptInstance instance = m_Scripts[itemID];
-                        if (instance != null)
-                        {
-                            instance.PostEvent(p);
-                            result = true;
-                        }
-                    }
-                }
-            }
             return result;
         }


Update default Mission ordering

Update default Mission ordering

--- Orlandia2015/Controllers/MissionsController.cs
+++ Orlandia2015/Controllers/MissionsController.cs
@@ -18,7 +18,7 @@
         // GET: Missions
         public async Task<ActionResult> IndexAsync()
         {
-            return View(await db.Missions.ToListAsync());
+            return View(await db.Missions.OrderBy(m => m.sMissionName).ToListAsync());
         }

         // GET: Missions/Details/5


refactoring console client Main

refactoring console client Main

--- Parser/Clients/Parser.ConsoleClient/Program.cs
+++ Parser/Clients/Parser.ConsoleClient/Program.cs
@@ -1,6 +1,4 @@
-using System.Threading;
-
-using Ninject;
+using Ninject;

 using Parser.ConsoleClient.NinjectModules;
 using Parser.LogFileReader.Contracts;
@@ -16,8 +14,6 @@
             var engine = NinjectStandardKernelProvider.Kernel.Get<ILogFileReaderEngine>();

             engine.StartAsync();
-            //Thread.Sleep(1000);
-            //engine.Stop();

             while (true)
             {


Resizable GUI

Resizable GUI

Made the GUI resizable.

--- ProcessShredder/ProcessShredderGUI.Designer.cs
+++ ProcessShredder/ProcessShredderGUI.Designer.cs
@@ -41,6 +41,9 @@
             //
             // listProcesses
             //
+            this.listProcesses.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+            | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
             this.listProcesses.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
             this.ColName,
             this.ColPID,
@@ -51,7 +54,7 @@
             this.listProcesses.Size = new System.Drawing.Size(365, 428);
             this.listProcesses.TabIndex = 0;
             this.listProcesses.UseCompatibleStateImageBehavior = false;
-            this.listProcesses.ColumnClick += new ColumnClickEventHandler(ColumnClick);
+            this.listProcesses.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.ColumnClick);
             //
             // ColName
             //
@@ -72,6 +75,7 @@
             //
             // checkIncludeChilds
             //
+            this.checkIncludeChilds.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
             this.checkIncludeChilds.AutoSize = true;
             this.checkIncludeChilds.Location = new System.Drawing.Point(12, 452);
             this.checkIncludeChilds.Name = "checkIncludeChilds";
@@ -82,6 +86,7 @@
             //
             // buttonEndProcesses
             //
+            this.buttonEndProcesses.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.buttonEndProcesses.Location = new System.Drawing.Point(264, 446);
             this.buttonEndProcesses.Name = "buttonEndProcesses";
             this.buttonEndProcesses.Size = new System.Drawing.Size(113, 23);
@@ -98,7 +103,6 @@
             this.Controls.Add(this.buttonEndProcesses);
             this.Controls.Add(this.checkIncludeChilds);
             this.Controls.Add(this.listProcesses);
-            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
             this.Name = "ProcessShredderGUI";
             this.Text = "Process Shredder";
             this.Load += new System.EventHandler(this.ProcessShredderGUI_Load);


"Add Profile" process selection window  had the wrong title

--- Project-Aurora/Project-Aurora/ConfigUI.xaml.cs
+++ Project-Aurora/Project-Aurora/ConfigUI.xaml.cs
@@ -634,7 +634,7 @@
         private void AddProfile_MouseDown(object sender, MouseButtonEventArgs e)
         {

-            Window_ProcessSelection dialog = new Window_ProcessSelection { CheckCustomPathExists = true };
+            Window_ProcessSelection dialog = new Window_ProcessSelection { CheckCustomPathExists = true, ButtonLabel = "Add Profile", Title ="Add Profile" };
             if (dialog.ShowDialog() == true && !string.IsNullOrWhiteSpace(dialog.ChosenExecutablePath)) { // do not need to check if dialog is already in excluded_programs since it is a Set and only contains unique items by definition

                 string filename = Path.GetFileName(dialog.ChosenExecutablePath.ToLowerInvariant());


Fixed ignoring new connections after an error on acceptance (fixed #5)

--- Providers/Network/NetworkConnectionProvider.cs
+++ Providers/Network/NetworkConnectionProvider.cs
@@ -312,8 +312,12 @@

 			if (!this.running || e.SocketError != SocketError.Success)
 			{
+				if (!this.running)
+					e.Dispose();
+				else
+					BeginAccepting (e);
+
 				Trace.WriteLine ("Exiting", String.Format ("NetworkConnectionProvider Accept({0},{1})", e.BytesTransferred, e.SocketError));
-				e.Dispose();
 				return;
 			}


fixes exception if user hits "Next" on add account without putting in an account

--- Purchasing.Web/Controllers/WizardController.cs
+++ Purchasing.Web/Controllers/WizardController.cs
@@ -451,6 +451,12 @@
             {
                 return redirectToAction;
             }
+            if(workgroupAccount == null || workgroupAccount.Account == null || string.IsNullOrWhiteSpace(workgroupAccount.Account.Id))
+            {
+                ModelState.AddModelError("WorkgroupAccount.Account", "Select Account or skip.");
+                var viewModel1 = WorkgroupAccountModel.Create(Repository, workgroup, workgroupAccount);
+                return View(viewModel1);
+            }

             var workgroupAccountToCreate = new WorkgroupAccount { Workgroup = workgroup };


When an order is edited, show what status it was at.

--- Purchasing.Web/Services/NotificationService.cs
+++ Purchasing.Web/Services/NotificationService.cs
@@ -319,7 +319,7 @@
                 if (IsMailRequested(preference, appr.StatusCode, order.StatusCode, EventCode.Update))
                 {
                     //var emailQueue = new EmailQueue(order, preference.NotificationType, string.Format(ChangeMessage, GenerateLink(_serverLink.Address, order.OrderRequestNumber()), order.Vendor == null ? "Unspecified Vendor" : order.Vendor.Name, actor.FullName), user);
-                    var emailQueue2 = new EmailQueueV2(order, preference.NotificationType, "Changed", string.Format("By {0}.", actor.FullName), user);
+                    var emailQueue2 = new EmailQueueV2(order, preference.NotificationType, "Changed", string.Format("By {0} at {1} review.", actor.FullName, order.StatusCode.Name), user);
                     //order.AddEmailQueue(emailQueue);
                     AddToQueue(queues, emailQueue2);
                 }


Added WithTimeToLive method

Added WithTimeToLive method

--- PushSharp.Android/Gcm/GcmFluentNotification.cs
+++ PushSharp.Android/Gcm/GcmFluentNotification.cs
@@ -26,6 +26,12 @@
 			return n;
 		}

+        public static GcmNotification WithTimeToLive(this GcmNotification n, int ttlSeconds)
+        {
+            n.TimeToLive = ttlSeconds;
+            return n;
+        }
+
 		public static GcmNotification WithJson(this GcmNotification n, string json)
 		{
 			try { var nobj = Newtonsoft.Json.Linq.JObject.Parse(json); }


Fixed the modpack exists check

Fixed the modpack exists check

Made it so that if a server doesn't have a modpack it returns true

--- RedirectLauncherMk2-WPF/Launcher/ModUpdater.cs
+++ RedirectLauncherMk2-WPF/Launcher/ModUpdater.cs
@@ -70,7 +70,10 @@

 		public bool doesModpackFileExist(int modVersion)
 		{
-			return File.Exists(client.clientDirectory + "\\modpacks\\zzz" + serverModpack + "-" + modVersion.ToString() + ".pack"); ;
+			if(modVersion > 0)
+				return File.Exists(client.clientDirectory + "\\modpacks\\zzz" + serverModpack + "-" + modVersion.ToString() + ".pack");
+			else
+				return true;
 		}

 		private void downloadFileFromWeb(String pathToFile, String pathToSave, String host)


Allow caching via `loadComponentSingleFile` with interface specification

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -825,7 +825,7 @@
             }, rightFloatingOverlayContent.Add, true);

             loadComponentSingleFile(new AccountCreationOverlay(), topMostOverlayContent.Add, true);
-            loadComponentSingleFile(new DialogOverlay(), topMostOverlayContent.Add, true);
+            loadComponentSingleFile<IDialogOverlay>(new DialogOverlay(), topMostOverlayContent.Add, true);

             loadComponentSingleFile(CreateHighPerformanceSession(), Add);

@@ -982,11 +982,14 @@
         /// <param name="component">The component to load.</param>
         /// <param name="loadCompleteAction">An action to invoke on load completion (generally to add the component to the hierarchy).</param>
         /// <param name="cache">Whether to cache the component as type <typeparamref name="T"/> into the game dependencies before any scheduling.</param>
-        private T loadComponentSingleFile<T>(T component, Action<T> loadCompleteAction, bool cache = false)
-            where T : Drawable
+        private T loadComponentSingleFile<T>(T component, Action<Drawable> loadCompleteAction, bool cache = false)
+            where T : class
         {
             if (cache)
                 dependencies.CacheAs(component);
+
+            var drawableComponent = component as Drawable;
+            Debug.Assert(drawableComponent != null);

             if (component is OsuFocusedOverlayContainer overlay)
                 focusedOverlays.Add(overlay);
@@ -1011,7 +1014,7 @@
                         // Since this is running in a separate thread, it is possible for OsuGame to be disposed after LoadComponentAsync has been called
                         // throwing an exception. To avoid this, the call is scheduled on the update thread, which does not run if IsDisposed = true
                         Task task = null;
-                        var del = new ScheduledDelegate(() => task = LoadComponentAsync(component, loadCompleteAction));
+                        var del = new ScheduledDelegate(() => task = LoadComponentAsync(drawableComponent, loadCompleteAction));
                         Scheduler.Add(del);

                         // The delegate won't complete if OsuGame has been disposed in the meantime


Catch OperationCanceledException in single file load sequence

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -504,7 +504,16 @@
             // schedule is here to ensure that all component loads are done after LoadComplete is run (and thus all dependencies are cached).
             // with some better organisation of LoadComplete to do construction and dependency caching in one step, followed by calls to loadComponentSingleFile,
             // we could avoid the need for scheduling altogether.
-            Schedule(() => { asyncLoadStream = asyncLoadStream?.ContinueWith(t => LoadComponentAsync(d, add).Wait()) ?? LoadComponentAsync(d, add); });
+            Schedule(() => { asyncLoadStream = asyncLoadStream?.ContinueWith(async t =>
+            {
+                try
+                {
+                    await LoadComponentAsync(d, add);
+                }
+                catch (OperationCanceledException)
+                {
+                }
+            }) ?? LoadComponentAsync(d, add); });
         }

         public bool OnPressed(GlobalAction action)


Listener: accept multiple clients

Listener: accept multiple clients

- show disconnected message when disconnected.

--- p2pChat/Listener.cs
+++ p2pChat/Listener.cs
@@ -63,7 +63,7 @@
                         break;
                     }
                     if (_listener.Pending()) {
-                        HandleClient();
+                        ThreadPool.QueueUserWorkItem(HandleClient);
                     }
                     Thread.Sleep(100);
                 }
@@ -81,10 +81,13 @@
         }

         private void ShowMessage(string message) {
+            if (!_worker.IsBusy) {
+                return;
+            }
             _worker.ReportProgress(0, message);
         }

-        private void HandleClient() {
+        private void HandleClient(Object state) {
             using (var client = _listener.AcceptTcpClient())
             using (var ns = client.GetStream()) {
                 if (ns.CanTimeout) {
@@ -114,10 +117,10 @@
                                 }
                                 ms.Write(receiveBuffer, 0, receiveSize);
                             } while (ns.DataAvailable);
-                            message = isDisconnected ?
-                                "Disconnected: " + clientAddress :
-                                Encoding.UTF8
+                            if (!isDisconnected) {
+                                message = Encoding.UTF8
                                     .GetString(ms.GetBuffer(), 0, (int)ms.Length);
+                            }
                         }
                         ShowMessage(message.Trim(WhiteSpaces));
                         if (!isDisconnected) {
@@ -135,6 +138,7 @@
                         ((SocketError)socketException.ErrorCode).ToString() + ": " + clientAddress;
                     ShowMessage(message);
                 }
+                ShowMessage("Disconnected: " + clientAddress);
             }
         }


copy documentation from solr wiki

copy documentation from solr wiki

git-svn-id: d6bffa57a36fe0f3c7d18ef52cc0c4d4ff653ca6@102 66c3f25c-543c-0410-ae2e-6f2ca0bd8c61

--- SolrNet/SolrFacetFieldQuery.cs
+++ SolrNet/SolrFacetFieldQuery.cs
@@ -8,12 +8,51 @@
 			this.field = field;
 		}

+		/// <summary>
+		/// Limits the terms on which to facet to those starting with the given string prefix.
+		/// </summary>
 		public string Prefix { get; set; }
+
+		/// <summary>
+		/// Set to true, this parameter indicates that constraints should be sorted by their count.
+		/// If false, facets will be in their natural index order (unicode).
+		/// For terms in the ascii range, this will be alphabetically sorted.
+		/// The default is true if Limit is greater than 0, false otherwise.
+		/// </summary>
 		public bool? Sort { get; set; }
+
+		/// <summary>
+		/// This param indicates the maximum number of constraint counts that should be returned for the facet fields.
+		/// A negative value means unlimited.
+		/// The default value is 100.
+		/// </summary>
 		public int? Limit { get; set; }
+
+		/// <summary>
+		/// This param indicates an offset into the list of constraints to allow paging.
+		/// The default value is 0.
+		/// </summary>
 		public int? Offset { get; set; }
+
+		/// <summary>
+		/// This param indicates the minimum counts for facet fields should be included in the response.
+		/// The default value is 0.
+		/// </summary>
 		public int? MinCount { get; set; }
+
+		/// <summary>
+		/// Set to true this param indicates that in addition to the Term based constraints of a facet field, a count of all matching results which have no value for the field should be computed
+		/// Default is false
+		/// </summary>
 		public bool? Missing { get; set; }
+
+		/// <summary>
+		/// This param indicates the minimum document frequency (number of documents matching a term) for which the filterCache should be used when determining the constraint count for that term.
+		/// This is only used during the term enumeration method of faceting (field type faceting on multi-valued or full-text fields).
+		/// A value greater than zero will decrease memory usage of the filterCache, but increase the query time.
+		/// When faceting on a field with a very large number of terms, and you wish to decrease memory usage, try a low value of 25 to 50 first.
+		/// The default value is 0, causing the filterCache to be used for all terms in the field.
+		/// </summary>
 		public int? EnumCacheMinDf { get; set; }

 		public IEnumerable<KeyValuePair<string, string>> Query {


Set OptimizeJoins default value to false.

--- Source/Common/Configuration.cs
+++ Source/Common/Configuration.cs
@@ -15,7 +15,7 @@
 			public static bool GenerateExpressionTest;
 			public static bool TraceMapperExpression;
 			public static bool DoNotClearOrderBys;
-			public static bool OptimizeJoins = true;
+			public static bool OptimizeJoins;

 			/// <summary>
 			/// If set to true unllable fields would be checked for IS NULL when comparasion type is NotEqual


Descriptions of referenced columns of foreign keys are now complete.

--- SqlServer/SqlServerDatabase.cs
+++ SqlServer/SqlServerDatabase.cs
@@ -211,11 +211,7 @@
                     foreignKeys.Add(foreignKey);
                 }

-                foreignKey.Columns.Add(new KeyValuePair<string, ColumnDescription>(result[1], new ColumnDescription {
-                    Name = result[2],
-                    TableName = result[5],
-                    Schema = result[6]
-                }));
+                foreignKey.Columns.Add(new KeyValuePair<string, ColumnDescription>(result[1], GetColumn(result[6], result[5], result[2])));
             }

             return foreignKeys;


Fixed NullReference bug TryRead threw NullReferenceException when called with null values. Should throw argument null exception.

--- Src/Utils/ContextExtensions.cs
+++ Src/Utils/ContextExtensions.cs
@@ -7,6 +7,11 @@
     {
         public static bool TryRead(this IBaseMessageContext ctx ,ContextProperty property, out object val)
         {
+            if (property == null)
+            {
+                throw new ArgumentNullException("property");
+            }
+
             return ((val = ctx.Read(property.PropertyName, property.PropertyNamespace)) != null);
         }


allow using .ts.html suffix in addition to .Template.html to let Visual Studio group a template under its related component, e.g. SomeDialog.ts => SomeDialog.ts.html

--- Serenity.Web/Common/TemplateScriptRegistrar.cs
+++ Serenity.Web/Common/TemplateScriptRegistrar.cs
@@ -7,7 +7,7 @@
 {
     public class TemplateScriptRegistrar
     {
-        const string TemplateSuffix = ".Template.html";
+        private static readonly string[] TemplateSuffixes = new[] { ".Template.html", ".ts.html" };

         private ConcatenatedScript bundle;
         private Dictionary<string, TemplateScript> scriptByKey = new Dictionary<string, TemplateScript>(StringComparer.OrdinalIgnoreCase);
@@ -16,10 +16,11 @@
         {
             string key = Path.GetFileName(filename);

-            if (!key.EndsWith(TemplateSuffix, StringComparison.OrdinalIgnoreCase))
-                return null;
+            foreach (var suffix in TemplateSuffixes)
+            if (key.EndsWith(suffix, StringComparison.OrdinalIgnoreCase))
+                    return key.Substring(0, key.Length - suffix.Length);

-            return key.Substring(0, key.Length - TemplateSuffix.Length);
+            return null;
         }

         private void WatchForChanges(string path)


[Branches/1.0] Fixes issue with subsequent readers of shapefiles (.sidx files). Fixes #34445

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS01]$/SharpMap/Branches/1.0;C104565

--- SharpMap/Utilities/Indexing/SpatialIndexing.cs
+++ SharpMap/Utilities/Indexing/SpatialIndexing.cs
@@ -280,18 +280,20 @@
         /// <returns></returns>
         public static QuadTree FromFile(string filename)
         {
-            using (var fs = new FileStream(filename, FileMode.Open, FileAccess.Read))
-            using (var br = new BinaryReader(fs))
-            {
-                if (br.ReadDouble() != INDEXFILEVERSION) //Check fileindex version
-                {
-                    fs.Close();
-                    fs.Dispose();
-                    throw new ObsoleteFileFormatException(
-                        "Invalid index file version. Please rebuild the spatial index by either deleting the index");
-                }
-                var node = ReadNode(0, br);
-                return node;
+            using (var fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read))
+            {
+                using (var br = new BinaryReader(fs))
+                {
+                    if (br.ReadDouble() != INDEXFILEVERSION) //Check fileindex version
+                    {
+                        fs.Close();
+                        fs.Dispose();
+                        throw new ObsoleteFileFormatException(
+                            "Invalid index file version. Please rebuild the spatial index by either deleting the index");
+                    }
+                    var node = ReadNode(0, br);
+                    return node;
+                }
             }
         }

@@ -336,10 +338,12 @@
         public void SaveIndex(string filename)
         {
             using (var fs = new FileStream(filename, FileMode.Create))
-            using (var bw = new BinaryWriter(fs))
-            {
-                bw.Write(INDEXFILEVERSION); //Save index version
-                SaveNode(this, bw);
+            {
+                using (var bw = new BinaryWriter(fs))
+                {
+                    bw.Write(INDEXFILEVERSION); //Save index version
+                    SaveNode(this, bw);
+                }
             }
         }


Local variables should be lowercase. Renamed DELTAS to deltas.

--- SharpRaven/Logging/Filters/CreditCardFilter.cs
+++ SharpRaven/Logging/Filters/CreditCardFilter.cs
@@ -28,14 +28,14 @@
             number.Replace("-", String.Empty);
             number.Replace(" ", String.Empty);

-            int[] DELTAS = new int[] { 0, 1, 2, 3, 4, -4, -3, -2, -1, 0 };
+            int[] deltas = new int[] { 0, 1, 2, 3, 4, -4, -3, -2, -1, 0 };
             int checksum = 0;
             char[] chars = number.ToCharArray();
             for (int i = chars.Length - 1; i > -1; i--) {
                 int j = ((int)chars[i]) - 48;
                 checksum += j;
                 if (((i - chars.Length) % 2) == 0)
-                    checksum += DELTAS[j];
+                    checksum += deltas[j];
             }

             return ((checksum % 10) == 0);


fix RemoveCookie

fix RemoveCookie

--- Signum.Web.Extensions/Auth/UserTicketClient.cs
+++ Signum.Web.Extensions/Auth/UserTicketClient.cs
@@ -66,7 +66,8 @@
             if (authCookie != null && authCookie.Value.HasText())
             {
                 httpContext.Response.Cookies[CookieName].Expires = DateTime.UtcNow.AddDays(-10);
-				Database.Query<UserTicketEntity>().Where(u => u.Ticket == authCookie.Value).UnsafeDelete();
+                using (AuthLogic.Disable())
+             				Database.Query<UserTicketEntity>().Where(u => u.Ticket == authCookie.Value).UnsafeDelete();
             }
         }


Userinn fyrir comments er komið

Userinn fyrir comments er komið

--- Skermstafir/Views/Subtitle/ShowSubtitle.cshtml
+++ Skermstafir/Views/Subtitle/ShowSubtitle.cshtml
@@ -1,4 +1,5 @@
 @model Skermstafir.Models.SubtitleModel
+@using Microsoft.AspNet.Identity;

 @{
 	ViewBag.Title = @Model.subtitle.Name;
@@ -97,6 +98,6 @@

-
Notandi: @Model.subtitle.Comments.FirstOrDefault().AspNetUsers.FirstOrDefault()

+
Notandi: @User.Identity.Name

     @Model.subtitle.Comments.FirstOrDefault()