Fix mapping of intermediate inherited classes

When determining a parent entity for a mapped class in hierarchy consider
only mapped classes.

Fixes #1358

--- src/NHibernate/Mapping/ByCode/ModelMapper.cs
+++ src/NHibernate/Mapping/ByCode/ModelMapper.cs
@@ -549,29 +549,32 @@
 				throw new ArgumentNullException("types");
 			}

-			var typeToMap = OrderTypesByHierarchy(types);
+			var entitiesToMap = GetEntitiesToMapOrderedByHierarchy(types);

 			string defaultAssemblyName = null;
 			string defaultNamespace = null;
-			System.Type firstType = typeToMap.FirstOrDefault();
-			if (firstType != null && typeToMap.All(t => t.Assembly.Equals(firstType.Assembly)))
+			System.Type firstType = entitiesToMap.FirstOrDefault();
+			if (firstType != null && entitiesToMap.All(t => t.Assembly.Equals(firstType.Assembly)))
 			{
 				//NH-2831: always use the full name of the assembly because it may come from GAC
 				defaultAssemblyName = firstType.Assembly.GetName().FullName;
 			}
-			if (firstType != null && typeToMap.All(t => t.Namespace == firstType.Namespace))
+			if (firstType != null && entitiesToMap.All(t => t.Namespace == firstType.Namespace))
 			{
 				defaultNamespace = firstType.Namespace;
 			}
 			var mapping = NewHbmMapping(defaultAssemblyName, defaultNamespace);
-			foreach (var type in RootClasses(typeToMap))
+			foreach (var type in RootClasses(entitiesToMap))
 			{
 				MapRootClass(type, mapping);
 			}
-			foreach (var type in Subclasses(typeToMap))
-			{
-				AddSubclassMapping(mapping, type);
-			}
+
+			var entitiesSet = new HashSet<System.Type>(entitiesToMap);
+			foreach (var type in Subclasses(entitiesToMap))
+			{
+				AddSubclassMapping(mapping, type, entitiesSet);
+			}
+
 			return mapping;
 		}

@@ -581,21 +584,27 @@
 			{
 				throw new ArgumentNullException("types");
 			}
-			var typeToMap = OrderTypesByHierarchy(types);
+
+			var entitiesToMap = GetEntitiesToMapOrderedByHierarchy(types);

 			//NH-2831: always use the full name of the assembly because it may come from GAC
-			foreach (var type in RootClasses(typeToMap))
+			var mappings = new List<HbmMapping>();
+			foreach (var type in RootClasses(entitiesToMap))
 			{
 				var mapping = NewHbmMapping(type.Assembly.GetName().FullName, type.Namespace);
 				MapRootClass(type, mapping);
-				yield return mapping;
-			}
-			foreach (var type in Subclasses(typeToMap))
+				mappings.Add(mapping);
+			}
+
+			var entitiesSet = new HashSet<System.Type>(entitiesToMap);
+			foreach (var type in Subclasses(entitiesToMap))
 			{
 				var mapping = NewHbmMapping(type.Assembly.GetName().FullName, type.Namespace);
-				AddSubclassMapping(mapping, type);
-				yield return mapping;
-			}
+				AddSubclassMapping(mapping, type, entitiesSet);
+				mappings.Add(mapping);
+			}
+
+			return mappings;
 		}

 		private HbmMapping NewHbmMapping(string defaultAssemblyName, string defaultNamespace)
@@ -608,40 +617,40 @@
 			return hbmMapping;
 		}

-		private IEnumerable<System.Type> Subclasses(IEnumerable<System.Type> types)
-		{
-			return types.Where(type => modelInspector.IsEntity(type) && !modelInspector.IsRootEntity(type));
-		}
-
-		private IEnumerable<System.Type> RootClasses(IEnumerable<System.Type> types)
-		{
-			return types.Where(type => modelInspector.IsEntity(type) && modelInspector.IsRootEntity(type));
-		}
-
-		private void AddSubclassMapping(HbmMapping mapping, System.Type type)
+		private IEnumerable<System.Type> Subclasses(IEnumerable<System.Type> entities)
+		{
+			return entities.Where(type => !modelInspector.IsRootEntity(type));
+		}
+
+		private IEnumerable<System.Type> RootClasses(IEnumerable<System.Type> entities)
+		{
+			return entities.Where(type => modelInspector.IsRootEntity(type));
+		}
+
+		private void AddSubclassMapping(HbmMapping mapping, System.Type type, ICollection<System.Type> mappedEntities)
 		{
 			if (modelInspector.IsTablePerClassHierarchy(type))
 			{
-				MapSubclass(type, mapping);
+				MapSubclass(type, mapping, mappedEntities);
 			}
 			else if (modelInspector.IsTablePerClass(type))
 			{
-				MapJoinedSubclass(type, mapping);
+				MapJoinedSubclass(type, mapping, mappedEntities);
 			}
 			else if (modelInspector.IsTablePerConcreteClass(type))
 			{
-				MapUnionSubclass(type, mapping);
-			}
-		}
-
-		private void MapUnionSubclass(System.Type type, HbmMapping mapping)
+				MapUnionSubclass(type, mapping, mappedEntities);
+			}
+		}
+
+		private void MapUnionSubclass(System.Type type, HbmMapping mapping, ICollection<System.Type> mappedEntities)
 		{
 			var classMapper = new UnionSubclassMapper(type, mapping);

 			IEnumerable<MemberInfo> candidateProperties = null;
-			if (!modelInspector.IsEntity(type.BaseType))
-			{
-				System.Type baseType = GetEntityBaseType(type);
+			if (!mappedEntities.Contains(type.BaseType))
+			{
+				var baseType = GetEntityBaseType(type, mappedEntities);
 				if (baseType != null)
 				{
 					classMapper.Extends(baseType);
@@ -659,13 +668,13 @@
 			MapProperties(type, propertiesToMap, classMapper);
 		}

-		private void MapSubclass(System.Type type, HbmMapping mapping)
+		private void MapSubclass(System.Type type, HbmMapping mapping, ICollection<System.Type> mappedEntities)
 		{
 			var classMapper = new SubclassMapper(type, mapping);
 			IEnumerable<MemberInfo> candidateProperties = null;
-			if (!modelInspector.IsEntity(type.BaseType))
-			{
-				System.Type baseType = GetEntityBaseType(type);
+			if (!mappedEntities.Contains(type.BaseType))
+			{
+				var baseType = GetEntityBaseType(type, mappedEntities);
 				if (baseType != null)
 				{
 					classMapper.Extends(baseType);
@@ -701,13 +710,13 @@
 			InvokeAfterMapSubclass(type, classMapper);
 		}

-		private void MapJoinedSubclass(System.Type type, HbmMapping mapping)
+		private void MapJoinedSubclass(System.Type type, HbmMapping mapping, ICollection<System.Type> mappedEntities)
 		{
 			var classMapper = new JoinedSubclassMapper(type, mapping);
 			IEnumerable<MemberInfo> candidateProperties = null;
-			if (!modelInspector.IsEntity(type.BaseType))
-			{
-				System.Type baseType = GetEntityBaseType(type);
+			if (!mappedEntities.Contains(type.BaseType))
+			{
+				var baseType = GetEntityBaseType(type, mappedEntities);
 				if (baseType != null)
 				{
 					classMapper.Extends(baseType);
@@ -715,6 +724,7 @@
 					candidateProperties = membersProvider.GetSubEntityMembers(type, baseType);
 				}
 			}
+
 			candidateProperties = candidateProperties ?? membersProvider.GetSubEntityMembers(type, type.BaseType);
 			IEnumerable<MemberInfo> propertiesToMap =
 				candidateProperties.Where(p => modelInspector.IsPersistentProperty(p) && !modelInspector.IsPersistentId(p));
@@ -726,18 +736,19 @@
 			MapProperties(type, propertiesToMap, classMapper);
 		}

-		private System.Type GetEntityBaseType(System.Type type)
+		private static System.Type GetEntityBaseType(System.Type type, ICollection<System.Type> mappedEntities)
 		{
 			System.Type analyzingType = type;
 			while (analyzingType != null && analyzingType != typeof (object))
 			{
 				analyzingType = analyzingType.BaseType;
-				if (modelInspector.IsEntity(analyzingType))
+				if (mappedEntities.Contains(analyzingType))
 				{
 					return analyzingType;
 				}
 			}
-			return type.GetInterfaces().FirstOrDefault(i => modelInspector.IsEntity(i));
+
+			return type.GetInterfaces().FirstOrDefault(i => mappedEntities.Contains(i));
 		}

 		private void MapRootClass(System.Type type, HbmMapping mapping)
@@ -1805,7 +1816,7 @@
 			return CompileMappingForEach(customizerHolder.GetAllCustomizedEntities());
 		}

-		private static List<System.Type> OrderTypesByHierarchy(IEnumerable<System.Type> types)
+		private List<System.Type> GetEntitiesToMapOrderedByHierarchy(IEnumerable<System.Type> types)
 		{
 			var typesCache = new HashSet<System.Type>(types);

@@ -1815,6 +1826,9 @@
 				var type = typesCache.First();
 				result.AddRange(type.GetHierarchyFromBase().Where(baseType => typesCache.Remove(baseType)));
 			}
+
+			result.RemoveAll(type => !modelInspector.IsEntity(type));
+
 			return result;
 		}
 	}


Add new IsSupported flag

Add new IsSupported flag

--- src/Plugin.InAppBilling/CrossInAppBilling.cs
+++ src/Plugin.InAppBilling/CrossInAppBilling.cs
@@ -8,16 +8,22 @@
     /// </summary>
     public class CrossInAppBilling
     {
-        static Lazy<IInAppBilling> Implementation = new Lazy<IInAppBilling>(() => CreateInAppBilling(), System.Threading.LazyThreadSafetyMode.PublicationOnly);
+        static Lazy<IInAppBilling> implementation = new Lazy<IInAppBilling>(() => CreateInAppBilling(), System.Threading.LazyThreadSafetyMode.PublicationOnly);

-        /// <summary>
-        /// Current settings to use
-        /// </summary>
-        public static IInAppBilling Current
+
+		/// <summary>
+		/// Gets if the plugin is supported on the current platform.
+		/// </summary>
+		public static bool IsSupported => implementation.Value == null ? false : true;
+
+		/// <summary>
+		/// Current plugin implementation to use
+		/// </summary>
+		public static IInAppBilling Current
         {
             get
             {
-                var ret = Implementation.Value;
+                var ret = implementation.Value;
                 if (ret == null)
                 {
                     throw NotImplementedInReferenceAssembly();
@@ -31,25 +37,26 @@
 #if NETSTANDARD1_0
             return null;
 #else
-            return new InAppBillingImplementation();
+#pragma warning disable IDE0022 // Use expression body for methods
+			return new InAppBillingImplementation();
+#pragma warning restore IDE0022 // Use expression body for methods
 #endif
-        }
+		}

-        internal static Exception NotImplementedInReferenceAssembly()
-        {
-            return new NotImplementedException("This functionality is not implemented in the portable version of this assembly.  You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.");
-        }
+        internal static Exception NotImplementedInReferenceAssembly() =>
+			new NotImplementedException("This functionality is not implemented in the portable version of this assembly.  You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.");
+

         /// <summary>
         /// Dispose of everything
         /// </summary>
         public static void Dispose()
         {
-            if (Implementation != null && Implementation.IsValueCreated)
+            if (implementation != null && implementation.IsValueCreated)
             {
-                Implementation.Value.Dispose();
+                implementation.Value.Dispose();

-                Implementation = new Lazy<IInAppBilling>(() => CreateInAppBilling(), System.Threading.LazyThreadSafetyMode.PublicationOnly);
+                implementation = new Lazy<IInAppBilling>(() => CreateInAppBilling(), System.Threading.LazyThreadSafetyMode.PublicationOnly);
             }
         }
     }


make Resolve the fallback for base.Request/Response

--- src/ServiceStack.ServiceInterface/Service.cs
+++ src/ServiceStack.ServiceInterface/Service.cs
@@ -56,13 +56,13 @@
         private IHttpRequest request;
         protected virtual IHttpRequest Request
         {
-            get { return request ?? (request = TryResolve<IHttpRequest>() ?? (RequestContext != null ? RequestContext.Get<IHttpRequest>() : null)); }
+            get { return request ?? (request = RequestContext != null ? RequestContext.Get<IHttpRequest>() : TryResolve<IHttpRequest>()); }
         }

         private IHttpResponse response;
         protected virtual IHttpResponse Response
         {
-            get { return response ?? (response = TryResolve<IHttpResponse>() ?? (RequestContext != null ? RequestContext.Get<IHttpResponse>() : null)); }
+            get { return response ?? (response = RequestContext != null ? RequestContext.Get<IHttpResponse>() : TryResolve<IHttpResponse>()); }
         }

         private ICacheClient cache;


Implemented Glenn's CR comment - HttpClientHandler moved to separate class.

--- src/Splunk.Logging.Common/HttpInputSender.cs
+++ src/Splunk.Logging.Common/HttpInputSender.cs
@@ -55,7 +55,7 @@
     /// Middleware components can apply additional logic before and after posting
     /// the data to Splunk server. See HttpInputResendMiddleware.
     /// </remarks>
-    public class HttpInputSender : HttpClientHandler
+    public class HttpInputSender : IDisposable
     {
         /// <summary>
         /// Post request delegate.
@@ -139,7 +139,7 @@
             // setup HTTP client
             httpClient = middleware == null ?
                 new HttpClient() :
-                new HttpClient(this);
+                new HttpClient(new HttpMiddlewareClientHandler(middleware));
             httpClient.DefaultRequestHeaders.Authorization =
                 new AuthenticationHeaderValue(AuthorizationHeaderScheme, token);
         }
@@ -248,16 +248,6 @@
             }
         }

-        protected override Task<HttpResponseMessage> SendAsync(
-            HttpRequestMessage request, CancellationToken cancellationToken)
-        {
-             // plug middleware into HTTP call
-            return middleware(request, async (HttpRequestMessage) =>
-            {
-                return await base.SendAsync(request, cancellationToken);
-            });
-        }
-
         private void OnTimer(object state)
         {
             Flush();
@@ -267,7 +257,12 @@

         private bool disposed = false;

-        override protected void Dispose(bool disposing)
+        public void Dispose()
+        {
+            Dispose(true);
+        }
+
+        protected void Dispose(bool disposing)
         {
             if (disposed)
                 return;
@@ -276,12 +271,36 @@
                 httpClient.Dispose();
             }
             disposed = true;
-            base.Dispose(disposing);
         }

         ~HttpInputSender()
         {
             Dispose(false);
+        }
+
+        #endregion
+
+        #region HTTP middleware handler
+
+        private class HttpMiddlewareClientHandler : HttpClientHandler
+        {
+            private HttpInputMiddleware middleware = null;
+
+            public HttpMiddlewareClientHandler(HttpInputMiddleware middleware)
+            {
+                this.middleware = middleware;
+            }
+
+            protected override Task<HttpResponseMessage> SendAsync(
+                HttpRequestMessage request, CancellationToken cancellationToken)
+            {
+                // plug middleware into HTTP call
+                return middleware(request, async (HttpRequestMessage) =>
+                {
+                    return await base.SendAsync(request, cancellationToken);
+                });
+            }
+
         }

         #endregion


Changing default sharing access mode in FileUtility.WriteAsync

--- src/WebJobs.Script/Extensions/FileUtility.cs
+++ src/WebJobs.Script/Extensions/FileUtility.cs
@@ -66,7 +66,7 @@
             }

             encoding = encoding ?? Encoding.UTF8;
-            using (Stream fileStream = OpenFile(path, FileMode.Create, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete))
+            using (Stream fileStream = OpenFile(path, FileMode.Create, FileAccess.Write, FileShare.Read))
             using (var writer = new StreamWriter(fileStream, encoding, 4096))
             {
                 await writer.WriteAsync(contents);


Fix charts submitting

Fix charts submitting

--- server/Controllers/ApiController.cs
+++ server/Controllers/ApiController.cs
@@ -1,6 +1,8 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
+using System.Net.Http;
 using System.Threading.Tasks;
 using hutel.Filters;
 using hutel.Logic;
@@ -232,8 +234,9 @@
         }

         [HttpPut("/api/charts")]
-        public async Task<IActionResult> PutAllCharts([FromBody] string chartsString)
-        {
+        public async Task<IActionResult> PutAllCharts()
+        {
+            var chartsString = await new StreamReader(this.Request.Body).ReadToEndAsync();
             await _storageClient.WriteChartsAsStringAsync(chartsString);
             return Ok();
         }


Support AWS Signature Version 4 authorization header: removing unused code Commented code been removed.

--- src/log4stash/ElasticClient/ElasticClient.cs
+++ src/log4stash/ElasticClient/ElasticClient.cs
@@ -238,10 +238,9 @@
                 foreach (var header in headers.Keys)
                 {
                     if (header.Equals("host", StringComparison.OrdinalIgnoreCase))
-                    {
-                        //webRequest.Host = headers[header];
-                    }
-                    else if (header.Equals("content-length", StringComparison.OrdinalIgnoreCase))
+                        continue;
+
+                    if (header.Equals("content-length", StringComparison.OrdinalIgnoreCase))
                         webRequest.ContentLength = long.Parse(headers[header]);
                     else if (header.Equals("content-type", StringComparison.OrdinalIgnoreCase))
                         webRequest.ContentType = headers[header];


cond when unless

cond when unless

--- Keel/Library.cs
+++ Keel/Library.cs
@@ -24,6 +24,15 @@

 (defun caar (x) (car (car x)))
 (defun cadr (x) (car (cdr x)))
+(defun cdar (x) (cdr (car x)))
+(defun caaar (x) (car (car (car x))))
+(defun cdaar (x) (cdr (car (car x))))
+
+(defmacro cond args
+  (when (car args)
+    (list 'if (caaar args)
+          (cons 'progn (cdaar args))
+          (cons 'cond (list (cdar args))))))

 (defun reverse (lst)
   (defun recur (acc lst)
@@ -59,6 +68,15 @@
       (cons (apply fn (cars))
             (apply map fn (cdrs)))))

+(defmacro when (test body)
+  (list 'if test
+        body
+        nil))
+
+(defmacro unless (test body)
+  (list 'when (list 'not test)
+        body))
+
 ";
     }
 }


updated proper document category

updated proper document category

--- AIMS_BD_IATI.DAL/AimsDAL.cs
+++ AIMS_BD_IATI.DAL/AimsDAL.cs
@@ -324,8 +324,9 @@
                         }

                         var docCategory = dbContext.tblDocumentCategories.FirstOrDefault(f => f.IATICode == document.category.n(0).code);
-                        var docCategoryId = docCategory != null ? docCategory.Id : dbContext.tblDocumentCategories.FirstOrDefault().Id;
-                        attachment.DocumentCategoryId = docCategoryId;
+
+                        attachment.DocumentCategoryId = docCategory != null ? docCategory.Id : dbContext.tblDocumentCategories.OrderBy(o=>o.Id).FirstOrDefault().Id;
+
                         attachment.AttachmentTitle = docTitle;
                         attachment.AttachmentFileURL = document.url;
                         attachment.IUser = Iuser;


bugfix

bugfix

--- AppMetrics/LogEvent.ashx.cs
+++ AppMetrics/LogEvent.ashx.cs
@@ -139,21 +139,11 @@
 				throw new ApplicationException("No session ID");

 			var filePath = GetDataFilePath(applicationKey, sessionId);
-
-			using (var stream = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read))
-			{
-				using (var writer = new StreamWriter(stream)) // by default, encoding is Encoding.UTF8 without BOM
-				{
-					WriteData(writer, context);
-				}
-			}
-		}
-
-		private static void WriteData(StreamWriter writer, HttpContext context)
-		{
-			var fileExisted = writer.BaseStream.Length > 0;
-			writer.BaseStream.Seek(0, SeekOrigin.End);
-
+			WriteData(filePath, context);
+		}
+
+		private static void WriteData(string filePath, HttpContext context)
+		{
 			var name = context.Request.Params["MessageName"];
 			var data = context.Request.Params["MessageData"];
 			if (string.IsNullOrEmpty(data))
@@ -161,17 +151,26 @@

 			var clientTime = context.Request.Params["MessageTime"];

-			if (!fileExisted)
-			{
-				writer.BaseStream.Write(Const.Utf8Bom, 0, Const.Utf8Bom.Length);
-
-				writer.WriteLine("{0}\t{1}\t{2}", clientTime, "ClientIP", context.Request.UserHostAddress);
-				writer.WriteLine("{0}\t{1}\t{2}", clientTime, "ClientHostName", context.Request.UserHostName);
-				writer.WriteLine("{0}\t{1}\t{2}", clientTime, "ClientUserAgent", context.Request.UserAgent);
-			}
-
-			data = Shared.Util.Escape(data);
-			writer.WriteLine("{0}\t{1}\t{2}", clientTime, name, data);
+			using (var stream = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read))
+			{
+				using (var writer = new StreamWriter(stream)) // by default, encoding is Encoding.UTF8 without BOM
+				{
+					var fileExisted = writer.BaseStream.Length > 0;
+					writer.BaseStream.Seek(0, SeekOrigin.End);
+
+					if (!fileExisted)
+					{
+						writer.BaseStream.Write(Const.Utf8Bom, 0, Const.Utf8Bom.Length);
+
+						writer.WriteLine("{0}\t{1}\t{2}", clientTime, "ClientIP", context.Request.UserHostAddress);
+						writer.WriteLine("{0}\t{1}\t{2}", clientTime, "ClientHostName", context.Request.UserHostName);
+						writer.WriteLine("{0}\t{1}\t{2}", clientTime, "ClientUserAgent", context.Request.UserAgent);
+					}
+
+					data = Shared.Util.Escape(data);
+					writer.WriteLine("{0}\t{1}\t{2}", clientTime, name, data);
+				}
+			}
 		}

 		#endregion


(#8) Implement backwards paging in Twitter wrapper by caching all results

--- ArtSourceWrapper/Twitter.cs
+++ ArtSourceWrapper/Twitter.cs
@@ -10,74 +10,112 @@
 using Tweetinvi.Parameters;

 namespace ArtSourceWrapper {
+    public class TwitterWrapperException : Exception {
+        public TwitterWrapperException(string message) : base(message) { }
+    }
+
     public class TwitterWrapper : IWrapper {
-        private TwitterCredentials _credentials;
-        private long _lastMinId;
+        private readonly TwitterCredentials _credentials;
+
         private UpdateGalleryParameters _lastUpdateGalleryParameters;
+        private List<Task<UpdateGalleryResult>> _cache;
+        private int _currentPage;

         public TwitterWrapper(TwitterCredentials credentials) {
             _credentials = credentials;
+            _cache = new List<Task<UpdateGalleryResult>>();
         }

         public string SiteName => "Twitter";

-        private Task<UpdateGalleryResult> UpdateGalleryInternalAsync() {
+        private Task<UpdateGalleryResult> CreatePage(int page) {
             return Auth.ExecuteOperationWithCredentials(_credentials, async () => {
+                // Find the oldest tweet that exists in the already obtained page.
+                long minObtainedTweetId = 0;
+                if (page > 0) {
+                    var lastPage = await GetPage(page - 1);
+                    minObtainedTweetId = lastPage.Submissions.Select(w => (w as TwitterSubmissionWrapper)?.Tweet?.Id ?? 0).Min();
+                }
+
                 var user = await UserAsync.GetAuthenticatedUser();
-                _lastUpdateGalleryParameters.Progress?.Report(0.5f);
+                if (user == null) throw new TwitterWrapperException("No user information returned from Twitter (rate limit reached or credentials no longer valid?)");

                 List<TwitterSubmissionWrapper> wrappers = new List<TwitterSubmissionWrapper>();
                 bool hasMore = true;

+                // Keep track of progress (1/2, 3/4, 7/8, ...)
+                // Multiple calls may be needed (because retweets are skipped).
+                float progress = 0;
                 while (wrappers.Count < _lastUpdateGalleryParameters.Count) {
+                    progress = (1 + progress) / 2;
+                    _lastUpdateGalleryParameters.Progress?.Report(progress);
+
                     var ps = new UserTimelineParameters {
                         ExcludeReplies = false,
                         IncludeEntities = true,
                         IncludeRTS = true,
                         MaximumNumberOfTweetsToRetrieve = _lastUpdateGalleryParameters.Count - wrappers.Count
                     };
-                    ps.MaxId = _lastMinId - 1;
+                    ps.MaxId = minObtainedTweetId - 1;
                     var tweets = await TimelineAsync.GetUserTimeline(user, ps);

+                    // If no tweets were returned, then there are no more tweets
                     if (!tweets.Any()) {
                         hasMore = false;
                         break;
                     }

-                    _lastUpdateGalleryParameters.Progress?.Report(0.9f);
-
+                    // Wrap tweets
+                    // Take no more than the size of the consumer's page (_lastUpdateGalleryParameters.Count)
+                    // Skip retweets
+                    // Include tweets without photos (at least for now)
                     foreach (var t in tweets.OrderByDescending(t => t.CreatedAt)) {
                         if (t.IsRetweet) continue;

                         var firstPhoto = t.Media.Where(m => m.MediaType == "photo").FirstOrDefault();
                         wrappers.Add(new TwitterSubmissionWrapper(t, firstPhoto));
+
+                        if (wrappers.Count == _lastUpdateGalleryParameters.Count) break;
                     }

-                    _lastMinId = wrappers.Select(w => w.Tweet.Id).DefaultIfEmpty(0).Min();
+                    minObtainedTweetId = wrappers.Select(w => (w as TwitterSubmissionWrapper)?.Tweet?.Id ?? 0).DefaultIfEmpty(minObtainedTweetId).Min();
                 }

+                // Progress is done
                 _lastUpdateGalleryParameters.Progress?.Report(1);

                 return new UpdateGalleryResult {
-                    HasLess = false,
+                    HasLess = page > 0,
                     HasMore = hasMore,
                     Submissions = wrappers.Select(w => (ISubmissionWrapper)w).ToList()
                 };
             });
         }

+        private Task<UpdateGalleryResult> GetPage(int page) {
+            if (page < 0) page = 0;
+            _currentPage = page;
+
+            // Get all pages up to and including this one
+            while (_cache.Count <= page) {
+                _cache.Add(CreatePage(_cache.Count));
+            }
+
+            return _cache[page];
+        }
+
         public Task<UpdateGalleryResult> NextPageAsync() {
-            return UpdateGalleryInternalAsync();
+            return GetPage(_currentPage + 1);
         }

         public Task<UpdateGalleryResult> PreviousPageAsync() {
-            throw new NotSupportedException();
+            return GetPage(_currentPage - 1);
         }

         public Task<UpdateGalleryResult> UpdateGalleryAsync(UpdateGalleryParameters p) {
             _lastUpdateGalleryParameters = p;
-            _lastMinId = 0;
-            return UpdateGalleryInternalAsync();
+            _cache.Clear();
+            return GetPage(0);
         }

         public Task<string> WhoamiAsync() {


removed unnecessary reference

removed unnecessary reference

--- Assets/Scripts/Game/Deck.cs
+++ Assets/Scripts/Game/Deck.cs
@@ -6,7 +6,6 @@

     public List<GenericCard> Cards;

-    public Hand _Hand;
     public Player _Player;

     private readonly Vector2 DECK_POSITION_OFFSET = new Vector2(-355f, -124f);
@@ -75,7 +74,7 @@
            return;
        }

-       _Hand.Add(card, true, true, animDelay);
+       _Player._Hand.Add(card, true, true, animDelay);
     }

     public void Shuffle()


1.0.3.72 版本号变动

1.0.3.72 版本号变动

--- Assets/ToLua/Core/LuaDLL.cs
+++ Assets/ToLua/Core/LuaDLL.cs
@@ -131,7 +131,7 @@

     public class LuaDLL
     {
-        public static string version = "1.0.3.59";
+        public static string version = "1.0.3.72";
         public static int LUA_MULTRET = -1;
         public static string[] LuaTypeName = { "none", "nil", "boolean", "lightuserdata", "number", "string", "table", "function", "userdata", "thread" };


Don't stop following the avatar if there are raycasted entities between the bot and the avatar.

--- Aurora/BotManager/RexBot.cs
+++ Aurora/BotManager/RexBot.cs
@@ -955,6 +955,7 @@

             resolution = 3;
             double distance = Util.GetDistanceTo (targetPos, currentPos);
+            List<ISceneChildEntity> raycastEntities = llCastRay (m_scenePresence.AbsolutePosition, FollowSP.AbsolutePosition);
             if (distance > 10) //Greater than 10 meters, give up
             {
                 m_log.Warn ("Target is out of range");
@@ -966,7 +967,7 @@
                 }
                 return;
             }
-            else if (distance < m_followCloseToPoint)
+            else if (distance < m_followCloseToPoint && raycastEntities.Count == 0)//If the raycastEntities isn't zero, there is something between us and the avatar, don't stop on the other side of walls, etc
             {
                 if (jumpTry > 0)
                 {
@@ -981,8 +982,7 @@
                 return;
             }

-            List<ISceneChildEntity> raycastEntities = llCastRay (m_scenePresence.AbsolutePosition, FollowSP.AbsolutePosition);
-
+
             if (raycastEntities.Count == 0)
             {
                 //Nothing between us and the target, go for it!


APILegality: Use ReflectUtil instead of ReflectFrameworkUtil

Fixes compile issue

--- AutoLegality/APILegality.cs
+++ AutoLegality/APILegality.cs
@@ -1,4 +1,5 @@
 using System.Windows.Forms;
+using System.Reflection;
 using static PKHeX.Core.LegalityCheckStrings;

 using PKHeX.Core;
@@ -417,7 +418,7 @@
         {
             if(pkm.Version == 15)
             {
-                var RibbonNames = ReflectFrameworkUtil.GetPropertiesStartWithPrefix(pkm.GetType(), "Ribbon");
+                var RibbonNames = ReflectUtil.GetPropertiesStartWithPrefix(pkm.GetType(), "Ribbon").Distinct();
                 foreach (var RibbonName in RibbonNames)
                 {
                     ReflectUtil.SetValue(pkm, RibbonName, 0);
@@ -439,7 +440,7 @@
             if (Report.Contains(String.Format(V600, "")))
             {
                 string[] ribbonList = Report.Split(new string[] { String.Format(V600, "") }, StringSplitOptions.None)[1].Split(new string[] { ", " }, StringSplitOptions.None);
-                var RibbonNames = ReflectFrameworkUtil.GetPropertiesStartWithPrefix(pk.GetType(), "Ribbon");
+                var RibbonNames = ReflectUtil.GetPropertiesStartWithPrefix(pk.GetType(), "Ribbon").Distinct();
                 List<string> missingRibbons = new List<string>();
                 foreach (var RibbonName in RibbonNames)
                 {
@@ -454,7 +455,7 @@
             if (Report.Contains(String.Format(V601, "")))
             {
                 string[] ribbonList = Report.Split(new string[] { String.Format(V601, "") }, StringSplitOptions.None)[1].Split(new string[] { ", " }, StringSplitOptions.None);
-                var RibbonNames = ReflectFrameworkUtil.GetPropertiesStartWithPrefix(pk.GetType(), "Ribbon");
+                var RibbonNames = ReflectUtil.GetPropertiesStartWithPrefix(pk.GetType(), "Ribbon").Distinct();
                 List<string> invalidRibbons = new List<string>();
                 foreach (var RibbonName in RibbonNames)
                 {


Removed some debugging options

Removed some debugging options

--- LockAndSleep.cs
+++ LockAndSleep.cs
@@ -266,8 +266,7 @@
 			// DEBUG
 			//retry = true;
 			//retrywait = 5000;
-			//powermode = 1;
-			PowerModeIntent = PowerMode.Standby;
+			//PowerModeIntent = PowerMode.Standby; // For debugging

 			if (!Quiet)
 			{
@@ -370,7 +369,6 @@

 			if (!Quiet) WriteLine("Powering down...");
 			PowerManager.SleepDisplays(PowerModeIntent);
-			Console.WriteLine("Erm?");

 			if (Retry)
 			{


Fix win screen being incorrectly displayed after switching matches

--- osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs
+++ osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs
@@ -120,7 +120,12 @@
             State.BindTo(ipc.State);
             State.BindValueChanged(stateChanged, true);

-            currentMatch.BindValueChanged(m => warmup.Value = m.NewValue.Team1Score.Value + m.NewValue.Team2Score.Value == 0);
+            currentMatch.BindValueChanged(m =>
+            {
+                warmup.Value = m.NewValue.Team1Score.Value + m.NewValue.Team2Score.Value == 0;
+                scheduledOperation?.Cancel();
+            });
+
             currentMatch.BindTo(ladder.CurrentMatch);

             warmup.BindValueChanged(w => warmupButton.Alpha = !w.NewValue ? 0.5f : 1, true);
@@ -172,12 +177,16 @@
                     case TourneyState.Idle:
                         contract();

+                        const float delay_before_progression = 4000;
+
+                        // if we've returned to idle and the last screen was ranking
+                        // we should automatically proceed after a short delay
                         if (lastState == TourneyState.Ranking && !warmup.Value)
                         {
                             if (currentMatch.Value?.Completed.Value == true)
-                                scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(TeamWinScreen)); }, 4000);
+                                scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(TeamWinScreen)); }, delay_before_progression);
                             else if (currentMatch.Value?.Completed.Value == false)
-                                scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, 4000);
+                                scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, delay_before_progression);
                         }

                         break;


Fix beatmap info scores container not hiding when there's no leaderboard

--- osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs
+++ osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs
@@ -253,7 +253,7 @@

             noScoresPlaceholder.Hide();

-            if (Beatmap.Value == null || Beatmap.Value.OnlineID <= 0 || (Beatmap.Value.BeatmapSet as IBeatmapSetOnlineInfo)?.Status <= BeatmapOnlineStatus.Pending)
+            if (Beatmap.Value == null || Beatmap.Value.OnlineID <= 0 || (Beatmap.Value.Status <= BeatmapOnlineStatus.Pending))
             {
                 Scores = null;
                 Hide();


Remove useless null checks

Remove useless null checks

--- osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs
+++ osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs
@@ -110,9 +110,9 @@
                 {
                     var columnsToDisplay = hitEventsAvailable
                         ? row.Columns
-                        : row.Columns?.Where(c => !c.RequiresHitEvents).ToArray();
-
-                    if (columnsToDisplay?.Any() ?? false)
+                        : row.Columns.Where(c => !c.RequiresHitEvents).ToArray();
+
+                    if (columnsToDisplay.Any())
                         panelIsEmpty = false;
                     else
                         continue;
@@ -132,8 +132,8 @@
                                 Origin = Anchor.Centre,
                             }).Cast<Drawable>().ToArray()
                         },
-                        ColumnDimensions = Enumerable.Range(0, columnsToDisplay?.Length ?? 0)
-                                                     .Select(i => columnsToDisplay?[i].Dimension ?? new Dimension()).ToArray(),
+                        ColumnDimensions = Enumerable.Range(0, columnsToDisplay.Length)
+                                                     .Select(i => columnsToDisplay[i].Dimension ?? new Dimension()).ToArray(),
                         RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) }
                     });
                 }


Comments for basicPage.cs

Comments for basicPage.cs

--- wallabag/wallabag.Shared/Common/basicPage.cs
+++ wallabag/wallabag.Shared/Common/basicPage.cs
@@ -5,6 +5,9 @@

 namespace wallabag.Common
 {
+    /// <summary>
+    /// To avoid duplicate code across all the pages, this class is a base class for all pages.
+    /// </summary>
     public class basicPage : Page
     {
         public NavigationHelper navigationHelper;
@@ -27,13 +30,23 @@
             ChangedSize(e.Size.Width, e.Size.Height);
         }

+        /// <summary>
+        /// Could be easily overrided, but is not required.
+        /// </summary>
         protected virtual void ChangedSize(double width, double height) { }

+        /// <summary>
+        /// When navigating away from the page, save the regarding ViewModel.
+        /// </summary>
         void navigationHelper_SaveState(object sender, SaveStateEventArgs e)
         {
             e.PageState.Add(ViewModelPageKey, this.DataContext);
             SaveState(e);
         }
+
+        /// <summary>
+        /// When navigating away from the page, load the regarding ViewModel.
+        /// </summary>
         void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
         {
             if (e.PageState != null && e.PageState.ContainsKey(ViewModelPageKey))


Update YafBoardSettings.cs

Update YafBoardSettings.cs

--- yafsrc/YAF.Configuration/YafBoardSettings.cs
+++ yafsrc/YAF.Configuration/YafBoardSettings.cs
@@ -1964,6 +1964,16 @@
         }

         /// <summary>
+        /// Gets or sets a value indicating whether enable activity stream.
+        /// </summary>
+        public bool EnableActivityStream
+        {
+            get => this._reg.GetValue("EnableActivityStream", true);
+
+            set => this._reg.SetValue("EnableActivityStream", value);
+        }
+
+        /// <summary>
         /// Gets or sets a value indicating whether EnableActiveLocationErrorsLog. A temporary debug setting.
         /// </summary>
         public bool EnableActiveLocationErrorsLog


Optimizing the forbidden BBCode & html Tag Detectors.

--- yafsrc/YAF.Core/Services/YafFormatMessage.cs
+++ yafsrc/YAF.Core/Services/YafFormatMessage.cs
@@ -24,7 +24,6 @@
     using System;
     using System.Collections.Generic;
     using System.Linq;
-    using System.Text;
     using System.Text.RegularExpressions;
     using System.Web;

@@ -45,20 +44,35 @@
     ///
     public class YafFormatMessage : IFormatMessage, IHaveServiceLocator
     {
-        ///
-        /// Gets or sets ServiceLocator.
-        ///
-        public IServiceLocator ServiceLocator { get; set; }
-
-        ///
-        /// Gets or sets HttpServer.
-        ///
-        public HttpServerUtilityBase HttpServer { get; set; }
-
-        ///
-        /// Gets or sets ProcessReplaceRuleFactory.
-        ///
-        public Func<IEnumerable<bool>, IProcessReplaceRules> ProcessReplaceRuleFactory { get; set; }
+
+        #region Constants and Fields
+
+        ///
+        ///   format message regex
+        ///
+        private const RegexOptions _Options = RegexOptions.IgnoreCase | RegexOptions.Multiline;
+
+        private static readonly Regex _rgxEmail =
+            new Regex(
+                @"(?<before>^|[ ]|\>|\[[A-Za-z0-9]\])(?<inner>(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6})",
+                _Options | RegexOptions.Compiled);
+
+        private static readonly Regex _rgxUrl1 =
+            new Regex(
+                @"(?<before>^|[ ]|\[[A-Za-z0-9]\]|\[\*\]|[A-Za-z0-9])(?<!href="")(?<!src="")(?<inner>(http://|https://|ftp://)(?:[\w-]+\.)+[\w-]+(?:/[\w-./?+%#&=;:,]*)?)",
+                _Options | RegexOptions.Compiled);
+
+        private static readonly Regex _rgxUrl2 =
+            new Regex(
+                @"(?<before>^|[ ]|\[[A-Za-z0-9]\]|\[\*\]|[A-Za-z0-9])(?<!href="")(?<!src="")(?<inner>(http://|https://|ftp://)(?:[\w-]+\.)+[\w-]+(?:/[\w-./?%&=+;,:#~$]*[^.<|^.\[])?)",
+                _Options | RegexOptions.Compiled);
+
+        private static readonly Regex _rgxUrl3 =
+            new Regex(
+                @"(?<before>^|[ ]|\[[A-Za-z0-9]\]|\[\*\]|[A-Za-z0-9])(?<!http://)(?<inner>www\.(?:[\w-]+\.)+[\w-]+(?:/[\w-./?%+#&=;,]*)?)",
+                _Options | RegexOptions.Compiled);
+
+        #endregion

         ///
         /// Initializes a new instance of the <see cref="YafFormatMessage"/> class.
@@ -82,16 +96,20 @@
             this.ProcessReplaceRuleFactory = processReplaceRuleFactory;
         }

-        /* Ederon : 6/16/2007 - conventions */
-
-        #region Constants and Fields
-
-        ///
-        ///   format message regex
-        ///
-        private static RegexOptions _options = RegexOptions.IgnoreCase | RegexOptions.Multiline;
-
-        #endregion
+        ///
+        /// Gets or sets ServiceLocator.
+        ///
+        public IServiceLocator ServiceLocator { get; set; }
+
+        ///
+        /// Gets or sets HttpServer.
+        ///
+        public HttpServerUtilityBase HttpServer { get; set; }
+
+        ///
+        /// Gets or sets ProcessReplaceRuleFactory.
+        ///
+        public Func<IEnumerable<bool>, IProcessReplaceRules> ProcessReplaceRuleFactory { get; set; }

         #region Public Methods

@@ -117,7 +135,7 @@
         {
             string[] codes = stringToMatch.Split(delim);

-            var forbiddenTagList = new StringBuilder();
+            var forbiddenTagList = new List<string>();

             MatchAndPerformAction(
                 @"\[.*?\]",
@@ -126,13 +144,22 @@
                     {
                         var bbCode = tag.Replace("/", string.Empty).Replace("]", string.Empty);

+                        // If tag contains attributes kill them for cecking
+                        if (bbCode.Contains("="))
+                        {
+                            bbCode = bbCode.Remove(bbCode.IndexOf("="));
+                        }
+
                         if (!codes.Any(allowedTag => bbCode.ToLower() == allowedTag.ToLower()))
                         {
-                            forbiddenTagList.AppendFormat("[{0} ", tag);
+                            if (!forbiddenTagList.Contains(bbCode))
+                            {
+                                forbiddenTagList.Add(bbCode);
+                            }
                         }
                     });

-            return forbiddenTagList.ToString();
+            return forbiddenTagList.ToDelimitedString(",");

             /*bool checker = string.IsNullOrEmpty(stringToMatch);

@@ -250,27 +277,7 @@
             return detectedHtmlTag == "ALL"
                        ? YafContext.Current.Get<ILocalization>().GetText("HTMLTAG_FORBIDDEN")
                        : string.Empty;
-        }
-
-        private static readonly Regex _rgxEmail =
-            new Regex(
-                @"(?<before>^|[ ]|\>|\[[A-Za-z0-9]\])(?<inner>(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6})",
-                _options | RegexOptions.Compiled);
-
-        private static readonly Regex _rgxUrl1 =
-            new Regex(
-                @"(?<before>^|[ ]|\[[A-Za-z0-9]\]|\[\*\]|[A-Za-z0-9])(?<!href="")(?<!src="")(?<inner>(http://|https://|ftp://)(?:[\w-]+\.)+[\w-]+(?:/[\w-./?+%#&=;:,]*)?)",
-                _options | RegexOptions.Compiled);
-
-        private static readonly Regex _rgxUrl2 =
-            new Regex(
-                @"(?<before>^|[ ]|\[[A-Za-z0-9]\]|\[\*\]|[A-Za-z0-9])(?<!href="")(?<!src="")(?<inner>(http://|https://|ftp://)(?:[\w-]+\.)+[\w-]+(?:/[\w-./?%&=+;,:#~$]*[^.<|^.\[])?)",
-                _options | RegexOptions.Compiled);
-
-        private static readonly Regex _rgxUrl3 =
-            new Regex(
-                @"(?<before>^|[ ]|\[[A-Za-z0-9]\]|\[\*\]|[A-Za-z0-9])(?<!http://)(?<inner>www\.(?:[\w-]+\.)+[\w-]+(?:/[\w-./?%+#&=;,]*)?)",
-                _options | RegexOptions.Compiled);
+        }

         ///
         /// The format message.
@@ -335,7 +342,9 @@
                 // the fix provided by community
                 var email = new VariableRegexReplaceRule(
                     _rgxEmail, "${before}${inner}", new[] { "before" })
-                    { RuleRank = 10 };
+                    {
+                        RuleRank = 10
+                    };

                 ruleEngine.AddRule(email);

@@ -346,10 +355,13 @@

                 var url = new VariableRegexReplaceRule(
                     _rgxUrl1,
-                    "${before}${innertrunc}".Replace("{0}", target).Replace("{1}", nofollow),
+                    "${before}${innertrunc}".Replace("{0}", target).
+                        Replace("{1}", nofollow),
                     new[] { "before" },
                     new[] { string.Empty },
-                    50) { RuleRank = 10 };
+                    50) {
+                            RuleRank = 10
+                        };

                 ruleEngine.AddRule(url);

@@ -361,19 +373,25 @@
                 // (?<inner>(http://|https://|ftp://)(?:[\w-]+\.)+[\w-]+(?:/[\w-./?%&=+;,:#~$]*[^.<])?)
                 url = new VariableRegexReplaceRule(
                     _rgxUrl2,
-                    "${before}${innertrunc}".Replace("{0}", target).Replace("{1}", nofollow),
+                    "${before}${innertrunc}".Replace("{0}", target).
+                        Replace("{1}", nofollow),
                     new[] { "before" },
                     new[] { string.Empty },
-                    50) { RuleRank = 10 };
+                    50) {
+                            RuleRank = 10
+                        };

                 ruleEngine.AddRule(url);

                 url = new VariableRegexReplaceRule(
                     _rgxUrl3,
-                    "${before}${innertrunc}".Replace("{0}", target).Replace("{1}", nofollow),
+                    "${before}${innertrunc}".Replace(
+                        "{0}", target).Replace("{1}", nofollow),
                     new[] { "before" },
                     new[] { string.Empty },
-                    50) { RuleRank = 10 };
+                    50) {
+                            RuleRank = 10
+                        };

                 ruleEngine.AddRule(url);
             }
@@ -483,7 +501,7 @@

                                         // clean up the list a bit...
                                         keywordList =
-                                            keywordList.GetNewNoEmptyStrings().GetNewNoSmallStrings(5).Where(x => !Char.IsNumber(x[0])).Distinct().ToList();
+                                            keywordList.GetNewNoEmptyStrings().GetNewNoSmallStrings(5).Where(x => !char.IsNumber(x[0])).Distinct().ToList();

                                         // sort...
                                         keywordList.Sort();
@@ -526,7 +544,7 @@
         {
             string[] codes = stringToMatch.Split(delim);

-            var forbiddenTagList = new StringBuilder();
+            var forbiddenTagList = new List<string>();

             MatchAndPerformAction(
                 "<.*?>",
@@ -543,11 +561,14 @@

                         if (!codes.Any(allowedTag => code.ToLower() == allowedTag.ToLower()))
                         {
-                            forbiddenTagList.AppendFormat("<{0} ", tag);
+                            if (!forbiddenTagList.Contains(code))
+                            {
+                                forbiddenTagList.Add(code);
+                            }
                         }
                     });

-            return forbiddenTagList.ToString();
+            return forbiddenTagList.ToDelimitedString(",");

             /*bool checker = string.IsNullOrEmpty(stringToMatch);

@@ -841,7 +862,7 @@
             CodeContracts.ArgumentNotNull(prefix, "prefix");
             CodeContracts.ArgumentNotNull(postfix, "postfix");

-            const RegexOptions regexOptions = RegexOptions.IgnoreCase;
+            //// const RegexOptions regexOptions = RegexOptions.IgnoreCase;

             foreach (string word in wordList.Where(w => w.Length > 3))
             {
@@ -914,9 +935,9 @@
             CodeContracts.ArgumentNotNull(text, "text");
             CodeContracts.ArgumentNotNull(matchAction, "MatchAction");

-            const RegexOptions options = RegexOptions.IgnoreCase;
-
-            var matches = Regex.Matches(text, matchRegEx, options).Cast<Match>().OrderByDescending(x => x.Index);
+            const RegexOptions Options = RegexOptions.IgnoreCase;
+
+            var matches = Regex.Matches(text, matchRegEx, Options).Cast<Match>().OrderByDescending(x => x.Index);

             foreach (var match in matches)
             {


Minor improvements to algorithm.

Minor improvements to algorithm.

--- MapGenerator.cs
+++ MapGenerator.cs
@@ -140,8 +140,26 @@
         {
             var topTropic = grid.TopBorder / 4;
             var bottomTropic = grid.BottomBorder / 4;
-            var topArctic = grid.TopBorder * 3 / 4;
-            var bottomArctic = grid.BottomBorder * 3 / 4;
+            var topArctic = grid.TopBorder * 5 / 6;
+            var bottomArctic = grid.BottomBorder * 5 / 6;
+
+            void SpreadToNeighbors(Hex hex, double gate, TileTypes type)
+            {
+                var chanceForNeigbors = _random.NextDouble();
+                if (chanceForNeigbors < 1.0 - gate) return;
+                var neigbors = grid.GetNeighbors(hex);
+                foreach (var neigbor in neigbors.Values)
+                {
+                    if (neigbor == null ||
+                        neigbor.Tile.Type == TileTypes.Hill ||
+                        neigbor.Tile.Type == TileTypes.Mountain ||
+                        neigbor.Tile.Type == TileTypes.Ocean ||
+                        neigbor.Tile.Type == type) continue;
+                    neigbor.Tile.ChangeTile(type);
+                    SpreadToNeighbors(neigbor, gate / 3.0, type);
+                }
+
+            }

             void FillLatitudes(int top, int bottom, TileTypes type)
             {
@@ -153,18 +171,7 @@
                         var hex = grid.GetHexAt(x, y);
                         if (hex.Tile.Type != TileTypes.Desert) continue;
                         hex.Tile.ChangeTile(type);
-                        var chanceForNeigbors = _random.NextDouble();
-                        if (chanceForNeigbors < 0.7) continue;
-                        var neigbors = grid.GetNeighbors(hex);
-                        foreach (var neigbor in neigbors.Values)
-                        {
-                            if (neigbor == null ||
-                                neigbor.Tile.Type == TileTypes.Hill ||
-                                neigbor.Tile.Type == TileTypes.Mountain ||
-                                neigbor.Tile.Type == TileTypes.Ocean ||
-                                neigbor.Tile.Type == type) continue;
-                            neigbor.Tile.ChangeTile(type);
-                        }
+                        SpreadToNeighbors(hex, 0.3, type);
                     }
                 }
             }


More help args

More help args

--- recycle/Program.cs
+++ recycle/Program.cs
@@ -20,7 +20,7 @@

         static int Main(string[] args)
         {
-            if (args.Length == 0 || args[0] == "/?" || args[0] == "-?")
+            if (args.Length == 0 || args[0] == "/?" || args[0] == "-?" || args[0] == "-h" || args[0] == "--help")
             {
                 Usage();
                 return (int)ExitStatus.Success;
@@ -31,8 +31,7 @@

         static void Usage()
         {
-            string exe = Process.GetCurrentProcess().ProcessName;
-            Console.WriteLine(String.Format("Usage: {0} file", exe));
+            Console.WriteLine(String.Format("Usage: {0} file", Process.GetCurrentProcess().ProcessName));
             Console.WriteLine("Author: Wei Kin Huang <wei@closedinterval.com>");
             Console.WriteLine("Report bugs to: https://github.com/weikinhuang/cygwin-recycle-proxy/issues");
         }


Clean this shit up a bit using funcs

Clean this shit up a bit using funcs

--- CareerCup/unique_numbers.cs
+++ CareerCup/unique_numbers.cs
@@ -11,17 +11,19 @@
 static class Program
 {

-    static int[] FindMissing(this int[] array)
+    static void ProcessRange(List<int> result,
+                             int[] array,
+                             int offset,
+                             Func<int, int, bool> mismatch,
+                             Func<int, int, bool> indexMismatch,
+                             Func<int, int> selector)
     {
-        var result = new List<int>();
-        var n = array.Length;
-
-        for (int i = 0; i < n;)
+        for (int i = 0; i < array.Length;)
         {
-            if (array[i] < n && array[i] != i)
+            if (mismatch(array[i], i))
             {
-                var aux = array[array[i]];
-                array[array[i]] = array[i];
+                var aux = array[array[i] - offset];
+                array[array[i] - offset] = array[i];
                 array[i] = aux;
             }
             else
@@ -32,28 +34,41 @@

         result.AddRange(array.Select( (v, i) =>
                                       new { val = v, index = i }).
-                              Where(x => x.val != x.index).
-                              Select(y => y.index));
+                              Where(x => indexMismatch(x.val, x.index)).
+                              Select(y => selector(y.index)));
+    }
+
+    static int[] FindMissing(this int[] array)
+    {
+        var result = new List<int>();
+        var n = array.Length;
+
+        ProcessRange(result,
+                     array,
+                     0,
+                     (element, index) => {
+                        return element < n && element != index;
+                     },
+                     (element, index) => {
+                        return element != index;
+                     },
+                     (element) => {
+                        return element;
+                     });
+
+        ProcessRange(result,
+                     array,
+                     n,
+                     (element, index) => {
+                        return element >= n && element != index + n;
+                     },
+                     (element, index) => {
+                        return element != index + n;
+                     },
+                     (element) => {
+                        return element + n;
+                     });

-        for (int i = 0; i < n;)
-        {
-            if (array[i] >=n && array[i] != i + n)
-            {
-                var aux = array[array[i] - n];
-                array[array[i] - n] = array[i];
-                array[i] = aux;
-            }
-            else
-            {
-                i++;
-            }
-        }
-
-        result.AddRange(array.Select( (v, i) =>
-                                      new { val = v, index = i }).
-                              Where(x => x.val != x.index + n).
-                              Select(y => y.index + n));
-
         return result.ToArray();
     }


Method for obtaining online users.

Method for obtaining online users.

--- ChatroServer/src/ChatHub.cs
+++ ChatroServer/src/ChatHub.cs
@@ -148,6 +148,13 @@
             }
         }

+        public User[] GetOnlineUsers()
+        {
+            if (!IsLogged())
+                return new User[0];
+            User[] valueCollection = ConnectionIdsUsers.Values.ToArray();
+            return valueCollection;
+        }
         private bool IsLogged()
         {
             return ConnectionIdsUsers[this.Context.ConnectionId] != null;


Make methods in ScriptObject from IScriptObject virtual

--- src/Scriban/Runtime/ScriptObject.cs
+++ src/Scriban/Runtime/ScriptObject.cs
@@ -60,7 +60,7 @@
         /// <param name="member">The member.</param>
         /// <returns><c>true</c> if this object contains the specified member; <c>false</c> otherwise</returns>
         /// <exception cref="System.ArgumentNullException">If member is null</exception>
-        public bool Contains(string member)
+        public virtual bool Contains(string member)
         {
             if (member == null) throw new ArgumentNullException(nameof(member));
             return Store.ContainsKey(member);
@@ -72,7 +72,7 @@
         /// <param name="member">The member.</param>
         /// <param name="value">The value.</param>
         /// <returns><c>true</c> if the value was retrieved</returns>
-        public bool TryGetValue(string member, out object value)
+        public virtual bool TryGetValue(string member, out object value)
         {
             InternalValue internalValue;
             var result = Store.TryGetValue(member, out internalValue);
@@ -104,7 +104,7 @@
             return (T)obj;
         }

-        public object this[string key]
+        public virtual object this[string key]
         {
             get
             {
@@ -132,7 +132,7 @@
         /// </summary>
         /// <param name="member">The member.</param>
         /// <returns><c>true</c> if the specified member is read-only</returns>
-        public bool IsReadOnly(string member)
+        public virtual bool IsReadOnly(string member)
         {
             InternalValue internalValue;
             Store.TryGetValue(member, out internalValue);
@@ -145,7 +145,7 @@
         /// <param name="member">The member.</param>
         /// <param name="value">The value.</param>
         /// <param name="readOnly">if set to <c>true</c> the value will be read only.</param>
-        public void SetValue(string member, object value, bool readOnly)
+        public virtual void SetValue(string member, object value, bool readOnly)
         {
             Store[member] = new InternalValue(value, readOnly);
         }
@@ -165,7 +165,7 @@
         /// </summary>
         /// <param name="member">The member.</param>
         /// <returns><c>true</c> if it was removed</returns>
-        public bool Remove(string member)
+        public virtual bool Remove(string member)
         {
             return Store.Remove(member);
         }


Update assembly loader to account for version numbers

When the default `AssemblyLoadContext` cannot find a dependency of a task assembly (because it does not know where to look) it fires the `Resolving` event, and uses whatever `Assembly` object is returned. Our implementation of the handler simply looks next to each known task assembly and loads and returns the first assembly with a matching short name.

This generally works fine but can be a problem if there are two or more task assemblies that depend on assemblies with the same short name but different versions--the task may ask for version 2.0.0.0, but end up with 1.0.0.0 instead. If it then tries to access an API that does not exist in 1.0.0.0 you'll get an exception.

The fix for this issue is to check the version of a candidate assembly before loading it. If it doesn't match, we simply continue the search until we find one that does (or we run out of candidates).

Related to this is the problem of tasks that were built against an older version of MSBuild. Even if a task was built against 14.0, for example, we want it to use the current version of the MSBuild binaries that ship with msbuild.exe. Since .NET Core does not support binding redirects via config files, we need to handle this ourselves in our `Resolve` handler. If the short name matches one of a well-known set, we update the `AssemblyName` of the requested assembly to use the current version number, and then call back to the default `AssemblyLoadContext` to find it.

--- src/Shared/CoreCLRAssemblyLoader.cs
+++ src/Shared/CoreCLRAssemblyLoader.cs
@@ -22,6 +22,15 @@
         private bool _resolvingHandlerHookedUp = false;

         private static readonly string[] _extensions = new[] { "ni.dll", "ni.exe", "dll", "exe" };
+        private static readonly Version _currentAssemblyVersion = new Version(Microsoft.Build.Shared.MSBuildConstants.CurrentAssemblyVersion);
+        private static readonly HashSet<string> _wellKnownAssemblyNames = new HashSet<string>(
+            new[]
+            {
+                "Microsoft.Build",
+                "Microsoft.Build.Framework",
+                "Microsoft.Build.Tasks.Core",
+                "Microsoft.Build.Utilities.Core"
+            });

         public void AddDependencyLocation(string fullPath)
         {
@@ -63,11 +72,29 @@
             }
         }

+        private Assembly TryGetWellKnownAssembly(AssemblyLoadContext context, AssemblyName assemblyName)
+        {
+            if (!_wellKnownAssemblyNames.Contains(assemblyName.Name))
+            {
+                return null;
+            }
+
+            assemblyName.Version = _currentAssemblyVersion;
+
+            return AssemblyLoadContext.Default.LoadFromAssemblyName(assemblyName);
+        }
+
         private Assembly TryResolveAssembly(AssemblyLoadContext context, AssemblyName assemblyName)
         {
             lock (_guard)
             {
-                Assembly assembly;
+                Assembly assembly = TryGetWellKnownAssembly(context, assemblyName);
+
+                if (assembly != null)
+                {
+                    return assembly;
+                }
+
                 if (_namesToAssemblies.TryGetValue(assemblyName.FullName, out assembly))
                 {
                     return assembly;
@@ -80,6 +107,12 @@
                         var candidatePath = Path.Combine(dependencyPath, $"{assemblyName.Name}.{extension}");
                         if (IsAssemblyAlreadyLoaded(candidatePath) ||
                             !File.Exists(candidatePath))
+                        {
+                            continue;
+                        }
+
+                        AssemblyName candidateAssemblyName = AssemblyLoadContext.GetAssemblyName(candidatePath);
+                        if (candidateAssemblyName.Version != assemblyName.Version)
                         {
                             continue;
                         }


use a base class inside CopyFileToLocation

--- src/Shimmer.Client/UpdateManager.cs
+++ src/Shimmer.Client/UpdateManager.cs
@@ -420,7 +420,7 @@
             return runPostInstallAndCleanup(newCurrentVersion, updateInfo.IsBootstrapping);
         }

-        void CopyFileToLocation(DirectoryInfoBase target, IPackageFile x)
+        void CopyFileToLocation(FileSystemInfoBase target, IPackageFile x)
         {
             var targetPath = Path.Combine(target.FullName, x.EffectivePath);


These should be string as well.

These should be string as well.

--- src/SparkPost/MessageEventsQuery.cs
+++ src/SparkPost/MessageEventsQuery.cs
@@ -10,7 +10,7 @@

         public MessageEventsQuery()
         {
-            this.Events = new List<MessageEventType>();
+            this.Events = new List<string>();
             this.BounceClasses = new List<string>();
             this.CampaignIds = new List<string>();
             this.FriendlyFroms = new List<string>();
@@ -49,7 +49,7 @@
         /// events : List : Comma-delimited list of event types to search. Defaults to all event types.
         /// Example: delivery, injection, bounce, delay, policy_rejection, out_of_band, open, click, generation_failure, generation_rejection, spam_complaint, list_unsubscribe, link_unsubscribe.
         /// </summary>
-        public IList<MessageEventType> Events { get; set; }
+        public IList<string> Events { get; set; }

         /// <summary>
         /// friendly_froms : ? : (optional, list, `sender@mail.example.com`) ... Comma-delimited list of friendly_froms to search.


Update IrrRecord.cs

Update IrrRecord.cs

--- source/ADAPT/Documents/IrrRecord.cs
+++ source/ADAPT/Documents/IrrRecord.cs
@@ -13,6 +13,7 @@
 using AgGateway.ADAPT.ApplicationDataModel.Common;
 using AgGateway.ADAPT.ApplicationDataModel.Equipment;
 using AgGateway.ADAPT.ApplicationDataModel.Notes;
+using AgGateway.ADAPT.ApplicationDataModel.Products;
 using AgGateway.ADAPT.ApplicationDataModel.Representations;

 namespace AgGateway.ADAPT.ApplicationDataModel.Documents
@@ -85,4 +86,4 @@

         public List<ContextItem> ContextItems { get; set; }
     }
-}+}


Handle error BuildManager.GetReferencedAssemblies

Unittests fail on the call to BuildManager.GetReferencedAssemblies,
since the BuildManager is supposed to run in the context of an ASP.NET
runtime. So a try catch has been added to logs succes or failure of the
called method.

--- source/Glimpse.AspNet/HttpModule.cs
+++ source/Glimpse.AspNet/HttpModule.cs
@@ -18,7 +18,16 @@
             var serviceLocator = new AspNetServiceLocator();
             Factory = new Factory(serviceLocator);
             serviceLocator.Logger = Factory.InstantiateLogger();
-            BuildManager.GetReferencedAssemblies();
+
+            try
+            {
+                BuildManager.GetReferencedAssemblies();
+                serviceLocator.Logger.Debug("Preloaded all referenced assemblies with System.Web.Compilation.BuildManager.GetReferencedAssemblies()");
+            }
+            catch (Exception exception)
+            {
+                serviceLocator.Logger.Error("Call to System.Web.Compilation.BuildManager.GetReferencedAssemblies() failed.", exception);
+            }
         }

         public void Init(HttpApplication httpApplication)


Remove debugging value...

Remove debugging value...

--- source/Graphite.System/Scheduler.cs
+++ source/Graphite.System/Scheduler.cs
@@ -23,7 +23,7 @@

             // Initialize timer with interval of 1 second.
             this.timer = new Timer(this.TimerAction, null, 0, 1000);
-            this.counter = uint.MaxValue;
+            this.counter = 0;
         }

         public void Stop()


バージョン取得のバグ修正

バージョン取得のバグ修正

--- wpfsrc/SDBR-WPF/SDBR-WPF/UpdateCheck.cs
+++ wpfsrc/SDBR-WPF/SDBR-WPF/UpdateCheck.cs
@@ -72,7 +72,9 @@
             var LinkLabel2 = tuple.Item2;
             var tooltip = tuple.Item3;
             var Result = tuple.Item4;
-            System.Diagnostics.FileVersionInfo ver =System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);
+            var fullname = typeof(App).Assembly.Location;
+            var info = System.Diagnostics.FileVersionInfo.GetVersionInfo(fullname);
+            var ver = info.FileVersion;
             var nowversion = ver.ToString();
             ////e.Result = workのほうから受け取った値
             string[] version = Result.ToString().Split(',');//[,]で配列区切りにする


Added 4558 specialization

Added 4558 specialization

--- Circuit/Components/OpAmp.cs
+++ Circuit/Components/OpAmp.cs
@@ -45,6 +45,11 @@
         [Description("Open-loop gain.")]
         [Serialize]
         public Quantity Aol { get { return gain; } set { if (gain.Set(value)) NotifyChanged("Aol"); } }
+
+        protected string partName = "";
+        [Description("Part name/number. This property only affects the schematic symbol, it does not affect the simulation.")]
+        [Serialize]
+        public string PartName { get { return partName; } set { partName = value; NotifyChanged("PartName"); } }

         private static readonly Constant Pi = Constant.New(Math.PI);
         private static readonly Constant Epsilon = Constant.New(1e-6);
@@ -104,6 +109,11 @@
             Sym.DrawText(Name, new Coord(12, -4), Alignment.Near, Alignment.Far);
         }

-        public override void LayoutSymbol(SymbolLayout Sym) { LayoutSymbol(Sym, Positive, Negative, Out, vpp, vnn, () => Name, null); }
+        public override void LayoutSymbol(SymbolLayout Sym) { LayoutSymbol(Sym, Positive, Negative, Out, vpp, vnn, () => Name, () => PartName); }
+
+        public static IEnumerable<Component> Parts = new Component[]
+        {
+            new ModelSpecialization(new OpAmp() { PartName = "4558", Aol = 200e3m, Rin = 50e6m }) { DisplayName = "4558", Description = "http://www.fairchildsemi.com/ds/KA/KA4558.pdf" },
+        };
     }
 }


minor refactor

minor refactor

--- CmcLibNet.Services/Field.cs
+++ CmcLibNet.Services/Field.cs
@@ -3,57 +3,23 @@
     // POCO class to hold info on Commence fields
     internal class Field
     {
-        private string _name = string.Empty;
-        private string _label = string.Empty;
-        private string _value = string.Empty;
-
-        #region Conctructors
+        #region Constructors
         internal Field() { }

         internal Field(string fieldName, string fieldLabel, string fieldValue)
         {
-            _name = fieldName;
-            _label = fieldLabel;
-            _value = fieldValue;
+            Name = fieldName;
+            Label = fieldLabel;
+            Value = fieldValue;
         }
         #endregion

         #region Properties
-        public string Value
-        {
-            get
-            {
-                return _value;
-            }
-            set
-            {
-                _value = value;
-            }
-        }
+        public string Value { get; set; } = string.Empty;

-        public string Name
-        {
-            get
-            {
-                return _name;
-            }
-            set
-            {
-                _name = value;
-            }
-        }
+        public string Name { get; set; } = string.Empty;

-        public string Label
-        {
-            get
-            {
-                return _label;
-            }
-            set
-            {
-                _label = value;
-            }
-        }
+        public string Label { get; set; } = string.Empty;
         #endregion
     }
 }


Added note to add test case later

Added note to add test case later

git-svn-id: 95472bb50cfb75dbf91fed26dc933cae36d5c45c@122 1ca100b6-b014-4248-a4f8-5dbb9f49130a

--- DDay.iCal.Test/Serialize.cs
+++ DDay.iCal.Test/Serialize.cs
@@ -28,6 +28,8 @@

         static public void DoTests()
         {
+            // FIXME: add test case for merging calendars and then serializing/deserializing, vs. simply merging
+
             Serialization s = new Serialization();
             s.InitAll();
             s.SERIALIZE1();


Fix Type

Fix Type

--- Devices/ADBRemoteControl.cs
+++ Devices/ADBRemoteControl.cs
@@ -467,7 +467,6 @@
                 }

                 using (CancellationTokenSource timedCancel = new CancellationTokenSource())
-                using (CancellationTokenSource timedCancel = new CancellationTokenSource())
                 {
                     timedCancel.CancelAfter(TimeSpan.FromSeconds(30));
                     await adbClient.ExecuteRemoteCommandAsync(commandData, device, receiver, timedCancel.Token, 1000).ConfigureAwait(false);


updated flock update methods

updated flock update methods

--- Source/Flock.cs
+++ Source/Flock.cs
@@ -125,7 +125,7 @@
 		/// This assumes that you have already updated all the external entities (enemies, targets, etc.)
 		/// </summary>
 		/// <param name="curTime"></param>
-		public void Update(GameTime curTime)
+		public virtual void Update(GameTime curTime)
 		{
 			//update the time
 			FlockTimer.Update(curTime);
@@ -133,13 +133,22 @@
 			//Update all the flock dudes
 			for (int i = 0; i < Dudes.Count; i++)
 			{
-				Dudes[i].Update(FlockTimer);
-
-				//update the vehicle's current cell if space partitioning is turned on
-				if (UseCellSpace)
-				{
-					CellSpace.Update(Dudes[i]);
-				}
+				UpdateBoid(Dudes[i]);
+			}
+		}
+
+		/// <summary>
+		/// update a single item being managed by this flock
+		/// </summary>
+		/// <param name="dude"></param>
+		public virtual void UpdateBoid(Boid dude)
+		{
+			dude.Update(FlockTimer);
+
+			//update the vehicle's current cell if space partitioning is turned on
+			if (UseCellSpace)
+			{
+				CellSpace.Update(Boid);
 			}
 		}


インデクサ追加

インデクサ追加

--- ExcelWrapper/Excel/Range.cs
+++ ExcelWrapper/Excel/Range.cs
@@ -29,6 +29,16 @@
         public Range this[Range cell1, Range cell2]
         {
             get { return new Range(Parent, ComObject[cell1.ComObject, cell2.ComObject]); }
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="str"></param>
+        /// <returns></returns>
+        public Range this[string str]
+        {
+            get { return new Range(Parent, ComObject[str]); }
         }

         /// <summary>


don't know how to reload scene...

don't know how to reload scene...

--- 2D-Platformer/Assets/Scripts/PlayerManager.cs
+++ 2D-Platformer/Assets/Scripts/PlayerManager.cs
@@ -47,8 +47,8 @@
 			IncreaseSize ();
 		}

-		if (controller.transform.position.y <= lowestPlatformPos - 8) {
-
+		if (controller.transform.position.y <= lowestPlatformPos - 10) {
+			//RELOAD SCENE
 		}
 	}


QuoteBinarySerializer. Fix empty depths handling.

--- Algo/Storages/Binary/QuoteBinarySerializer.cs
+++ Algo/Storages/Binary/QuoteBinarySerializer.cs
@@ -99,15 +99,9 @@
 			{
 				var firstDepth = messages.FirstOrDefault(d => !d.Bids.IsEmpty() || !d.Asks.IsEmpty());

-				if (firstDepth == null)
-					throw new ArgumentException(LocalizedStrings.Str931, nameof(messages));
-
-				metaInfo.LastPrice = metaInfo.FirstPrice = GetDepthPrice(firstDepth);
-
-				//pyh: будет баг если первый стакан пустой и с другим временем.
-				//metaInfo.FirstTime = firstDepth.LastChangeTime;
-
-				metaInfo.ServerOffset = firstDepth.ServerTime.Offset;
+				metaInfo.LastPrice = metaInfo.FirstPrice = firstDepth != null ? GetDepthPrice(firstDepth) : 0;
+
+				metaInfo.ServerOffset = (firstDepth ?? messages.First()).ServerTime.Offset;
 			}

 			writer.WriteInt(messages.Count());


Fix tests.

Fix tests.

--- Applications/Rss/Tests/Models/RssEntryTest.cs
+++ Applications/Rss/Tests/Models/RssEntryTest.cs
@@ -52,7 +52,7 @@
             src.Load(Example("Feeds.json"));

             Assert.That(src.Categories.Count(), Is.EqualTo(3));
-            Assert.That(count, Is.EqualTo(3), nameof(src.CollectionChanged));
+            Assert.That(count, Is.EqualTo(1), nameof(src.CollectionChanged));

             var item = src.Categories.First(e => string.IsNullOrEmpty(e.Title));
             Assert.That(item.Categories.Count, Is.EqualTo(0));
@@ -69,7 +69,7 @@
             Assert.That(src.Lookup(uri), Is.Null);

             Assert.That(src.Categories.Count(), Is.EqualTo(0));
-            Assert.That(count, Is.EqualTo(4));
+            Assert.That(count, Is.EqualTo(2));
         }
     }
 }


Fix a problem with simconsole.

Fix a problem with simconsole.

--- Aurora/Modules/World/SimConsole/SimConsole.cs
+++ Aurora/Modules/World/SimConsole/SimConsole.cs
@@ -299,7 +299,8 @@
             {
                 if (kvp.Value == Access.ReadWrite || kvp.Value == Access.Read)
                 {
-                    if (m_userLogLevel[kvp.Key] <= level)
+                    if(m_userLogLevel.ContainsKey(kvp.Key) &&
+                        m_userLogLevel[kvp.Key] <= level)
                     {
                         //Send the EQM with the message to all people who have read access
                         SendConsoleEventEQM (kvp.Key, text);


The language flags are now showing the opposite of the current language

--- Babel/Assets/Core/MainMenu/MainMenuManager.cs
+++ Babel/Assets/Core/MainMenu/MainMenuManager.cs
@@ -138,12 +138,12 @@
         if (!PlayerPrefs.HasKey("Language"))
         {
             PlayerPrefs.SetString("Language", Constants.Languages.Danish);
-            SettingsLanguage.sprite = DanishFlag;
+            SettingsLanguage.sprite = EnglishFlag;
             LanguageManager.Instance.LoadLanguage(PlayerPrefs.GetString("Language"));
         }
         else
         {
-            SettingsLanguage.sprite = PlayerPrefs.GetString("Language").Equals(Constants.Languages.Danish) ? DanishFlag : EnglishFlag;
+            SettingsLanguage.sprite = PlayerPrefs.GetString("Language").Equals(Constants.Languages.Danish) ? EnglishFlag : DanishFlag;
             LanguageManager.Instance.LoadLanguage(PlayerPrefs.GetString("Language"));
         }
     }
@@ -217,13 +217,13 @@
          if (PlayerPrefs.GetString("Language").Equals(Constants.Languages.Danish))
         {
             LanguageChange(Constants.Languages.English);
+            SettingsLanguage.sprite = DanishFlag;
+        }
+        else
+        {
+            LanguageChange(Constants.Languages.Danish);
             SettingsLanguage.sprite = EnglishFlag;
         }
-        else
-        {
-            LanguageChange(Constants.Languages.Danish);
-            SettingsLanguage.sprite = DanishFlag;
-        }
     }


Fix null players in player list.

Fix null players in player list.

--- Battlezeppelins/Controllers/BaseController.cs
+++ Battlezeppelins/Controllers/BaseController.cs
@@ -27,7 +27,7 @@
                     if (player != null) return player;

                     Player newPlayer = Player.GetInstance(id);
-                    playerList.Add(newPlayer);
+                    if (newPlayer != null) playerList.Add(newPlayer);
                     return newPlayer;
                 }
             }


cleanup unused variable

cleanup unused variable

--- BitSharp.Core/Builders/WorkQueueDictionary.cs
+++ BitSharp.Core/Builders/WorkQueueDictionary.cs
@@ -18,8 +18,6 @@
         private readonly BufferBlock<WorkItem> workQueue;
         private readonly Dictionary<TKey, WorkItem> workByKey;

-        private bool disposed;
-
         public WorkQueueDictionary(Func<TKey, Tuple<bool, TValue>> parentTryGetValue, Func<IEnumerable<KeyValuePair<TKey, TValue>>> parentEnumerator = null)
         {
             this.parentDictionary = new DeferredDictionary<TKey, TValue>(parentTryGetValue, parentEnumerator);


don't link github issues when someone mention a non-existent member

--- CompatBot/EventHandlers/GithubLinksHandler.cs
+++ CompatBot/EventHandlers/GithubLinksHandler.cs
@@ -14,7 +14,7 @@
     internal static class GithubLinksHandler
     {
         private const RegexOptions DefaultOptions = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.ExplicitCapture;
-        public static readonly Regex IssueMention = new(@"(?<issue_mention>\b(issue|pr|pull[ \-]request|bug)\s*#?\s*(?<number>\d+)|(?=\W|^)#(?<also_number>\d{4})|(https?://)github.com/RPCS3/rpcs3/(issues|pull)/(?<another_number>\d+))\b", DefaultOptions);
+        public static readonly Regex IssueMention = new(@"(?<issue_mention>\b(issue|pr|pull[ \-]request|bug)\s*#?\s*(?<number>\d+)|\B#(?<also_number>\d{4})|(https?://)github.com/RPCS3/rpcs3/(issues|pull)/(?<another_number>\d+))\b", DefaultOptions);
         public static readonly Regex CommitMention = new(@"(?<commit_mention>(https?://)github.com/RPCS3/rpcs3/commit/(?<commit_hash>[0-9a-f]+))\b", DefaultOptions);
         public static readonly Regex ImageMarkup = new(@"(?<img_markup>!\[(?<img_caption>[^\]]+)\]\((?<img_link>\w+://[^\)]+)\))", DefaultOptions);
         private static readonly Regex IssueLink = new(@"github.com/RPCS3/rpcs3/issues/(?<number>\d+)", DefaultOptions);


InitSkinInfo

InitSkinInfo

--- Demos/FirstSightOfAssimpNet/AnimationModel.cs
+++ Demos/FirstSightOfAssimpNet/AnimationModel.cs
@@ -18,19 +18,18 @@
         {
             this.mesh = mesh;
             this.container = container;
-            InitBoneInfo(mesh, container);
+            InitSkinInfo(mesh, container);
         }

-        private void InitBoneInfo(Assimp.Mesh mesh, AssimpSceneContainer container)
+        private void InitSkinInfo(Assimp.Mesh mesh, AssimpSceneContainer container)
         {
             var boneIDs = new uvec4[mesh.VertexCount];
             var boneWeights = new vec4[mesh.VertexCount];
-            List<BoneInfo> bones = new List<BoneInfo>();
             AllBones allBones = container.GetAllBones();
             Dictionary<string, uint> nameIndexDict = allBones.nameIndexDict;
             for (int i = 0; i < mesh.BoneCount; i++)
             {
-                Assimp.Bone bone = mesh.Bones[i];
+                Assimp.Bone bone = mesh.Bones[i]; // bones that influence this mesh.
                 uint boneIndex = nameIndexDict[bone.Name];

                 for (int j = 0; j < bone.VertexWeightCount; j++)
@@ -39,7 +38,7 @@
                     uint vertexID = vertexWeight.VertexID;
                     for (int t = 0; t < 4; t++)
                     {
-                        if (boneWeights[vertexID][t] == 0.0f)
+                        if (boneWeights[vertexID][t] == 0.0f) // fill in x y z w.
                         {
                             boneIDs[vertexID][t] = boneIndex;
                             boneWeights[vertexID][t] = vertexWeight.Weight;


Disable warning about unused class.

Disable warning about unused class.

--- Duplicati/Library/Backend/Mega/MegaBackend.cs
+++ Duplicati/Library/Backend/Mega/MegaBackend.cs
@@ -15,7 +15,7 @@
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 using CG.Web.MegaApiClient;
-using Duplicati.Library.Common.IO;
+using Duplicati.Library.Common.IO;
 using Duplicati.Library.Interface;
 using System;
 using System.Collections.Generic;
@@ -25,6 +25,8 @@

 namespace Duplicati.Library.Backend.Mega
 {
+    // ReSharper disable once UnusedMember.Global
+    // This class is instantiated dynamically in the BackendLoader.
     public class MegaBackend: IBackend, IStreamingBackend
     {
         private readonly string m_username = null;


Fix #125

Fix #125

--- Extensions/InvalidValueFieldValueValidator.cs
+++ Extensions/InvalidValueFieldValueValidator.cs
@@ -37,7 +37,7 @@
                 }
 #endif

-                if (valid)
+                if (!valid)
                 {
                     this.Logger.FieldValidationFailedValueNotAllowed(
                         field.WorkItem.Id,


fixed unit test

fixed unit test

--- Famoser.SyncApi.NUnitTests/RepositoryTests.cs
+++ Famoser.SyncApi.NUnitTests/RepositoryTests.cs
@@ -46,7 +46,7 @@
             Assert.IsTrue(saveRes);
             Assert.IsTrue(repo.GetAllLazy().Contains(model));
             Assert.IsTrue(model2.Count == 1);
-            Assert.IsTrue(model2[0].Content == "Hallo Welt");
+            Assert.IsTrue(model2[0].Content == "Hallo Welt!");
         }
     }
 }


ADD: MessageOriginal to ConvertException with the info without line, column and field. (Useful to show it to the users)

git-svn-id: cdbd3c3453b226d8644b39c93ea790e37ea3ca1b@568 fafefce7-770d-0410-b8bf-a6f642d37c66

--- FileHelpers/ErrorHandling/ConvertException.cs
+++ FileHelpers/ErrorHandling/ConvertException.cs
@@ -12,8 +12,10 @@
 	///
 	/// Indicates that a string value can't be converted to a dest type.
 	///
-	public sealed class ConvertException : FileHelpersException
-	{
+    public sealed class ConvertException : FileHelpersException
+    {
+        #region "  Fields & Property  "
+
 #if NET_2_0
         [DebuggerBrowsable(DebuggerBrowsableState.Never)]
 #endif
@@ -39,19 +41,24 @@
 #if NET_2_0
         [DebuggerBrowsable(DebuggerBrowsableState.Never)]
 #endif
+        private string mMessageOriginal = string.Empty;
+
+#if NET_2_0
+        [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+#endif
         private Type mFieldType;

-		/// The destination type.
-		public Type FieldType
-		{
-			get { return mFieldType; }
-		}
+        /// The destination type.
+        public Type FieldType
+        {
+            get { return mFieldType; }
+        }

-		/// The value that cant be converterd. (null for unknown)
-		public string FieldStringValue
-		{
-			get { return mFieldStringValue; }
-		}
+        /// The value that cant be converterd. (null for unknown)
+        public string FieldStringValue
+        {
+            get { return mFieldStringValue; }
+        }

         /// Extra info about the error.
         public string MessageExtra
@@ -59,10 +66,17 @@
             get { return mMessageExtra; }
         }

+        /// The message without the Line, Column and FieldName.
+        public string MessageOriginal
+        {
+            get { return mMessageOriginal; }
+        }
+
+
         /// The name of the field related to the exception. (null for unknown)
-		public string FieldName
-		{
-			get { return mFieldName; }
+        public string FieldName
+        {
+            get { return mFieldName; }
         }

         /// The line where the error was found. (-1 is unknown)
@@ -77,49 +91,57 @@
             get { return mColumnNumber; }
         }

-
-		///
-		/// Create a new ConvertException object
-		///
-		/// <param name="origValue">The value to convert.</param>
-		/// <param name="destType">The destination Type.</param>
-		public ConvertException(string origValue, Type destType)
+
+        #endregion
+
+        #region "  Constructors  "
+
+        ///
+        /// Create a new ConvertException object
+        ///
+        /// <param name="origValue">The value to convert.</param>
+        /// <param name="destType">The destination Type.</param>
+        public ConvertException(string origValue, Type destType)
             : this(origValue, destType, string.Empty)
-		{
-		}
+        {
+        }

         ///
-		/// Create a new ConvertException object
-		///
-		/// <param name="origValue">The value to convert.</param>
-		/// <param name="destType">The destination Type.</param>
-		/// <param name="extraInfo">Aditional info of the error.</param>
+        /// Create a new ConvertException object
+        ///
+        /// <param name="origValue">The value to convert.</param>
+        /// <param name="destType">The destination Type.</param>
+        /// <param name="extraInfo">Aditional info of the error.</param>
         public ConvertException(string origValue, Type destType, string extraInfo)
             : this(origValue, destType, string.Empty, -1, -1, extraInfo, null)
-        {
+        {
         }

-		///
-		/// Create a new ConvertException object
-		///
-		/// <param name="origValue">The value to convert.</param>
-		/// <param name="destType">The destination Type.</param>
-		/// <param name="extraInfo">Aditional info of the error.</param>
+        ///
+        /// Create a new ConvertException object
+        ///
+        /// <param name="origValue">The value to convert.</param>
+        /// <param name="destType">The destination Type.</param>
+        /// <param name="extraInfo">Aditional info of the error.</param>
         /// <param name="columnNumber">The estimated column number.</param>
         /// <param name="lineNumber">The line where the error was found.</param>
         /// <param name="fieldName">The name of the field with the error</param>
         /// <param name="innerEx">The Inner Exception</param>
         public ConvertException(string origValue, Type destType, string fieldName, int lineNumber, int columnNumber, string extraInfo, Exception innerEx)
             : base(MessageBuilder(origValue, destType, fieldName, lineNumber, columnNumber, extraInfo), innerEx)
-		{
-			mFieldStringValue = origValue;
-			mFieldType = destType;
+        {
+            mFieldStringValue = origValue;
+            mFieldType = destType;
             mLineNumber = lineNumber;
             mColumnNumber = columnNumber;
             mFieldName = fieldName;
             mMessageExtra = extraInfo;
-		}
+
+            if (origValue != null && destType != null)
+                mMessageOriginal = "Error Converting '" + origValue + "' to type: '" + destType.Name + "'. ";
+
+        }

         private static string MessageBuilder(string origValue, Type destType, string fieldName, int lineNumber, int columnNumber, string extraInfo)
         {
@@ -135,7 +157,7 @@

             if (origValue != null && destType != null)
                 res += "Error Converting '" + origValue + "' to type: '" + destType.Name + "'. ";
-
+
             res += extraInfo;

             return res;
@@ -147,5 +169,7 @@
         {
             return new ConvertException(ex.FieldStringValue, ex.mFieldType, fieldName, line, column, ex.mMessageExtra, ex.InnerException);
         }
+
+        #endregion
     }
 }


Fix ordering of teams to match colours

Fix ordering of teams to match colours

--- osu.Game/Screens/Play/HUD/MultiplayerGameplayLeaderboard.cs
+++ osu.Game/Screens/Play/HUD/MultiplayerGameplayLeaderboard.cs
@@ -26,7 +26,7 @@
     {
         protected readonly Dictionary<int, TrackedUserData> UserScores = new Dictionary<int, TrackedUserData>();

-        public readonly Dictionary<int, BindableInt> TeamScores = new Dictionary<int, BindableInt>();
+        public readonly SortedDictionary<int, BindableInt> TeamScores = new SortedDictionary<int, BindableInt>();

         [Resolved]
         private OsuColour colours { get; set; }


Version 2.12.0

Version 2.12.0

--- HeroesMatchTracker/Properties/AssemblyInfo.cs
+++ HeroesMatchTracker/Properties/AssemblyInfo.cs
@@ -24,5 +24,5 @@
     ResourceDictionaryLocation.SourceAssembly)]

 // by using the '*' as shown below:
-[assembly: AssemblyVersion("2.11.0")]
-[assembly: AssemblyFileVersion("2.11.0")]+[assembly: AssemblyVersion("2.12.0")]
+[assembly: AssemblyFileVersion("2.12.0")]


simplify SettingDescription default definition

--- osu.Game/Rulesets/Mods/Mod.cs
+++ osu.Game/Rulesets/Mods/Mod.cs
@@ -1,4 +1,4 @@
-// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
+// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
 // See the LICENCE file in the repository root for full licence text.

 using System;
@@ -86,10 +86,8 @@
                     tooltipTexts.Add(tooltipText);
                 }

-                // filter out empty strings so we don't have orphaned commas
-                //tooltipTexts = tooltipTexts.Where(s => !string.IsNullOrEmpty(s)).ToList();
-                string joinedTooltipText = string.Join(", ", tooltipTexts);
-                return $"{Name}{joinedTooltipText}";
+                string joinedTooltipText = string.Join(", ", tooltipTexts.Where(s => !string.IsNullOrEmpty(s)));
+                return $"{joinedTooltipText}";
             }
         }


[Core] Remove IDisposable from AwsClient

--- src/Amazon.Core/Models/AwsClient.cs
+++ src/Amazon.Core/Models/AwsClient.cs
@@ -7,13 +7,13 @@

 namespace Amazon
 {
-    public abstract class AwsClient : IDisposable
+    public abstract class AwsClient
     {
         protected readonly HttpClient httpClient = new HttpClient(
             new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip }
         ) {
             DefaultRequestHeaders = {
-                {  "User-Agent", "Carbon/2.1" }
+                { "User-Agent", "Carbon/2.2" }
             }
         };

@@ -78,12 +78,12 @@

         private CredentialScope GetCredentialScope(HttpRequestMessage httpRequest)
         {
+            if (httpRequest.Headers.Date is null)
+            {
+                throw new Exception("Headers.Date must be set");
+            }
+
             return new CredentialScope(httpRequest.Headers.Date.Value.UtcDateTime, Region, service);
-        }
-
-        public void Dispose()
-        {
-            httpClient.Dispose();
         }
     }
 }


Use FullName instead of ToString()

Use FullName instead of ToString()

--- src/Buildalyzer/AssemblyResolver.cs
+++ src/Buildalyzer/AssemblyResolver.cs
@@ -50,7 +50,7 @@

             // Get all candidate paths
             string[] candidatePaths = Directory.GetFiles(Path.GetDirectoryName(_buildEnvironment.MsBuildExePath), simpleName + ".dll", SearchOption.AllDirectories)
-                .Concat(Directory.GetFiles(Path.GetFullPath(Directory.GetParent(_buildEnvironment.SDKsPath).ToString()), simpleName + ".dll", SearchOption.AllDirectories))
+                .Concat(Directory.GetFiles(Path.GetFullPath(Directory.GetParent(_buildEnvironment.SDKsPath).FullName), simpleName + ".dll", SearchOption.AllDirectories))
                 .Concat(Directory.GetFiles(_buildEnvironment.ExtensionsPath, simpleName + ".dll", SearchOption.AllDirectories))
                 .Distinct()
                 .Where(x => File.Exists(x))


code clean up

code clean up

--- src/ChannelAdvisorAccess/Misc/AP.cs
+++ src/ChannelAdvisorAccess/Misc/AP.cs
@@ -10,13 +10,32 @@
 {
 	public static class AP
 	{
+		private static readonly ActionPolicy _query = CreateQuery();
+		private static readonly ActionPolicyAsync _queryAsync = CreateQueryAsync();
+		private static readonly ActionPolicy _sumbit = CreateSubmit();
+		private static readonly ActionPolicyAsync _sumbitAsync = CreateSubmitAsync();
+
 		public static ActionPolicy Query
 		{
 			get { return _query; }
 		}

-		private static readonly ActionPolicy _query = CreateQuery();
+		public static ActionPolicyAsync QueryAsync
+		{
+			get { return _queryAsync; }
+		}

+		public static ActionPolicy Submit
+		{
+			get { return _sumbit; }
+		}
+
+		public static ActionPolicyAsync SubmitAsync
+		{
+			get { return _sumbitAsync; }
+		}
+
+		#region ActionPolicyCreator
 		public static ActionPolicy CreateQuery( Func< string > additionalLogInfo = null )
 		{
 			return ActionPolicy.Handle< Exception >().Retry( 10, ( ex, i ) =>
@@ -27,13 +46,6 @@
 				SystemUtil.Sleep( delay );
 			} );
 		}
-
-		public static ActionPolicyAsync QueryAsync
-		{
-			get { return _queryAsync; }
-		}
-
-		private static readonly ActionPolicyAsync _queryAsync = CreateQueryAsync();

 		public static ActionPolicyAsync CreateQueryAsync( Func< string > additionalLogInfo = null )
 		{
@@ -46,13 +58,6 @@
 			} );
 		}

-		public static ActionPolicy Submit
-		{
-			get { return _sumbit; }
-		}
-
-		private static readonly ActionPolicy _sumbit = CreateSubmit();
-
 		public static ActionPolicy CreateSubmit( Func< string > additionalLogInfo = null )
 		{
 			return ActionPolicy.Handle< Exception >().Retry( 10, ( ex, i ) =>
@@ -64,13 +69,6 @@
 			} );
 		}

-		public static ActionPolicyAsync SubmitAsync
-		{
-			get { return _sumbitAsync; }
-		}
-
-		private static readonly ActionPolicyAsync _sumbitAsync = CreateSubmitAsync();
-
 		public static ActionPolicyAsync CreateSubmitAsync( Func< string > additionalLogInfo = null )
 		{
 			return ActionPolicyAsync.Handle< Exception >().RetryAsync( 10, async ( ex, i ) =>
@@ -81,7 +79,9 @@
 				await Task.Delay( delay );
 			} );
 		}
+		#endregion

+		#region Misc
 		private static TimeSpan GetDelay( Exception ex, int retryNumber )
 		{
 			var webException = ex as WebException;
@@ -126,7 +126,7 @@
 			return null;
 		}

-		public static string CollestMessages( Exception exc )
+		private static string CollestMessages( Exception exc )
 		{
 			try
 			{
@@ -145,5 +145,6 @@
 		{
 			return "Retrying CA API get call for the {0} time, delay:{1}, Additional info: {2}, ExceptionSummary {3}".FormatWith( i, delay, ( additionalLogInfo ?? ( () => string.Empty ) )(), CollestMessages( ex ) );
 		}
+		#endregion
 	}
 }


Minor fixup.

Minor fixup.

--- src/ConfigurationExample/Program.cs
+++ src/ConfigurationExample/Program.cs
@@ -1,19 +1,18 @@
-using Autofac;
-using Autofac.Configuration;
-using ConfigurationExampleInterface;
-using Microsoft.Extensions.Configuration;
-using System;
+using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
 using System.Reflection;
 using System.Runtime.Loader;
+using Autofac;
+using Autofac.Configuration;
+using ConfigurationExampleInterface;
+using Microsoft.Extensions.Configuration;

 namespace ConfigurationExample
 {
     public class Program
     {
-        private static readonly string ExecutionFolder = Path.GetDirectoryName(typeof(Program).Assembly.Location);
         /* Plugins and configuration can be challenging to figure out in .NET Core since assembly
          * loading and type handling has slightly changed. This example shows how to use configuration
          * to selectively load things. Additional examples and resources:
@@ -36,12 +35,13 @@
             // https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/corehost.md
             //
             // To verify, try commenting this out and you'll see that the config system can't load the external plugin type.
+            var executionFolder = Path.GetDirectoryName(typeof(Program).Assembly.Location);
             AssemblyLoadContext.Default.Resolving += (AssemblyLoadContext context, AssemblyName assembly) =>
             {
                 // DISCLAIMER: NO PROMISES THIS IS SECURE. You may or may not want this strategy. It's up to
                 // you to determine if allowing any assembly in the directory to be loaded is acceptable. This
                 // is for demo purposes only.
-                return context.LoadFromAssemblyPath(Path.Combine(ExecutionFolder, $"{assembly.Name}.dll"));
+                return context.LoadFromAssemblyPath(Path.Combine(executionFolder, $"{assembly.Name}.dll"));
             };

             var config = new ConfigurationBuilder()


Fixing merge error

Fixing merge error

--- src/ControlzEx.Showcase/App.xaml.cs
+++ src/ControlzEx.Showcase/App.xaml.cs
@@ -1,15 +1,10 @@
-using System.Windows;
-
 namespace ControlzEx.Showcase
 {
-    using System.Diagnostics;
-    using System.Windows.Media;
+    using System.Windows;
     using ControlzEx.Theming;

-    public partial class App : Application
+    public partial class App
     {
-        public App()
-        {
         protected override void OnStartup(StartupEventArgs e)
         {
             base.OnStartup(e);
@@ -18,7 +13,5 @@

             ThemeManager.SyncThemeColorSchemeWithWindowsAccentColor();
         }
-
-        }
     }
 }


Adding argument and resource existence checks to ManifestResourceHelper

--- src/Elmah/ManifestResourceHelper.cs
+++ src/Elmah/ManifestResourceHelper.cs
@@ -36,14 +36,25 @@
     {
         public static void WriteResourceToStream(Stream outputStream, string resourceName)
         {
+            if (outputStream == null) throw new ArgumentNullException("outputStream");
+            if (resourceName == null) throw new ArgumentNullException("resourceName");
+            if (resourceName.Length == 0) throw new ArgumentException(null, "resourceName");
+
             //
             // Grab the resource stream from the manifest.
             //

             var thisType = typeof(ManifestResourceHelper);
+            var thisAssembly = thisType.Assembly;

-            using (var inputStream = thisType.Assembly.GetManifestResourceStream(thisType, resourceName))
+            using (var inputStream = thisAssembly.GetManifestResourceStream(thisType, resourceName))
             {
+                if (inputStream == null)
+                {
+                    throw new Exception(string.Format(
+                        @"Resource named {0}.{1} not found in assembly {2}.",
+                        thisType.Namespace, resourceName, thisAssembly));
+                }

                 //
                 // Allocate a buffer for reading the stream. The maximum size


Don't need this anymore

Don't need this anymore

--- src/GitHub.VisualStudio/Settings.cs
+++ src/GitHub.VisualStudio/Settings.cs
@@ -15,7 +15,6 @@
         public static readonly Guid guidGitHubCmdSet = new Guid(guidGitHubCmdSetString);
         public static readonly Guid guidGitHubToolbarCmdSet = new Guid(guidGitHubToolbarCmdSetString);

-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Already used in https://github.com/github/VisualStudio/pull/156")]
         public static readonly Guid guidContextMenuSet = new Guid(guidContextMenuSetString);
     }