Remove start position and window state to avoid odd window state

--- Mamesaver/BackgroundForm.Designer.cs
+++ Mamesaver/BackgroundForm.Designer.cs
@@ -103,9 +103,7 @@
             this.ShowIcon = false;
             this.ShowInTaskbar = false;
             this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.TopMost = true;
-            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
             ((System.ComponentModel.ISupportInitialize)(this.mameLogo)).EndInit();
             this.ResumeLayout(false);


Hide the size gripper and ditch title text

--- Mamesaver/BackgroundForm.Designer.cs
+++ Mamesaver/BackgroundForm.Designer.cs
@@ -102,8 +102,8 @@
             this.Name = "BackgroundForm";
             this.ShowIcon = false;
             this.ShowInTaskbar = false;
+            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "BackgroundForm";
             this.TopMost = true;
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
             ((System.ComponentModel.ISupportInitialize)(this.mameLogo)).EndInit();


start edit test

start edit test

--- Spa2/NakedObjects.Spa.Selenium.Test/tests/ObjectEditTests.cs
+++ Spa2/NakedObjects.Spa.Selenium.Test/tests/ObjectEditTests.cs
@@ -337,7 +337,7 @@
     public abstract class MegaObjectEditTestsRoot : ObjectEditTestsRoot {
         [TestMethod] //Mega
         public void MegaObjectEditTest() {
-            //ObjectEditChangeScalar();
+            ObjectEditChangeScalar();
             //LocalValidationOfMandatoryFields();
             //LocalValidationOfMaxLength();
             //LocalValidationOfRegex();


log4net catch

log4net catch

Former-commit-id: 6e758a06aeffbb68fcfb29e4e8b31c8e2e66f1d7

--- MassTransit.ServiceBus/ServiceBus.cs
+++ MassTransit.ServiceBus/ServiceBus.cs
@@ -27,7 +27,7 @@
 		IServiceBus,
 		IEnvelopeConsumer
 	{
-		private static readonly ILog _log = LogManager.GetLogger(typeof (ServiceBus));
+		private static readonly ILog _log;

 		private readonly AsyncReplyDispatcher _asyncReplyDispatcher = new AsyncReplyDispatcher();

@@ -39,6 +39,18 @@
 		private readonly IEndpoint _endpointToListenOn;
 		private IEndpoint _poisonEndpoint;
 		private ISubscriptionCache _subscriptionCache = new LocalSubscriptionCache();
+
+        static ServiceBus()
+        {
+            try
+            {
+                _log = LogManager.GetLogger(typeof (ServiceBus));
+            }
+            catch(Exception ex)
+            {
+                throw new Exception("log4net isn't referenced", ex);
+            }
+        }

 		public ServiceBus(IEndpoint endpointToListenOn)
 		{


Use the synchronous tracer, since it seems to cause a deadlock somehow?

--- Src/Common/Source/Common/Diagnostics/Tracer/TracerManager.cs
+++ Src/Common/Source/Common/Diagnostics/Tracer/TracerManager.cs
@@ -1,4 +1,4 @@
-#region BSD License
+#region BSD License
 /*
 Copyright (c) 2011, Clarius Consulting
 All rights reserved.
@@ -33,23 +33,14 @@
 namespace NuPattern.Diagnostics
 {
     using System;
-    using System.Collections.Concurrent;
     using System.Collections.Generic;
     using System.Diagnostics;
     using System.Linq;
     using System.Reflection;
-    using System.Threading;
-    using System.Threading.Tasks;
-    using System.Configuration;
-    using System.Xml.Linq;
-    using System.IO;

     /// <summary>
     /// Implements the common tracer interface using <see cref="TraceSource"/> instances.
     /// </summary>
-    /// <remarks>
-    /// All tracing is performed asynchronously transparently for faster speed.
-    /// </remarks>
     ///	<nuget id="Tracer.SystemDiagnostics" />
     partial class TracerManager : ITracerManager, IDisposable
     {
@@ -59,61 +50,17 @@
         /// </summary>
         public const string DefaultSourceName = "*";

-        // To handle concurrency for the async tracing.
-        private BlockingCollection<Tuple<ExecutionContext, Action>> traceQueue = new BlockingCollection<Tuple<ExecutionContext, Action>>();
-        private CancellationTokenSource cancellation = new CancellationTokenSource();
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="TracerManager"/> class.
-        /// </summary>
-        public TracerManager()
-        {
-            // Note we have only one async task to perform all tracing. This
-            // is an optimization, so that we don't consume too much resources
-            // from the running app for this.
-            Task.Factory.StartNew(DoTrace, cancellation.Token, TaskCreationOptions.LongRunning, TaskScheduler.Current);
-
-            InitializeConfiguredSources();
-        }
-
-        private void InitializeConfiguredSources()
-        {
-            var configFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
-            if (!File.Exists(configFile))
-                return;
-
-            var sourceNames = from diagnostics in XDocument.Load(configFile).Root.Elements("system.diagnostics")
-                              from sources in diagnostics.Elements("sources")
-                              from source in sources.Elements("source")
-                              select source.Attribute("name").Value;
-
-            foreach (var sourceName in sourceNames)
-            {
-                // Cause eager initialization, which is needed for the trace source configuration
-                // to be properly read.
-                GetSource(sourceName);
-            }
-        }
-
         /// <summary>
         /// Gets a tracer instance with the specified name.
         /// </summary>
         public ITracer Get(string name)
         {
-            return new AggregateTracer(this, name, CompositeFor(name)
+            return new AggregateTracer(name, CompositeFor(name)
                 .Select(tracerName => new DiagnosticsTracer(
                     this.GetOrAdd(tracerName, sourceName => CreateSource(sourceName)))));
         }

         /// <summary>
-        /// Gets the underlying <see cref="TraceSource"/> for the given name.
-        /// </summary>
-        public TraceSource GetSource(string name)
-        {
-            return this.GetOrAdd(name, sourceName => CreateSource(sourceName));
-        }
-
-        /// <summary>
         /// Adds a listener to the source with the given <paramref name="sourceName"/>.
         /// </summary>
         public void AddListener(string sourceName, TraceListener listener)
@@ -146,46 +93,17 @@
         }

         /// <summary>
-        /// Cleans up the manager, cancelling any pending tracing
-        /// messages.
+        /// Cleans up the manager.
         /// </summary>
         public void Dispose()
         {
-            cancellation.Cancel();
-            traceQueue.Dispose();
-        }
-
-        /// <summary>
-        /// Enqueues the specified trace action to be executed by the trace
-        /// async task.
-        /// </summary>
-        internal void Enqueue(Action traceAction)
-        {
-            traceQueue.Add(Tuple.Create(ExecutionContext.Capture(), traceAction));
         }

         private TraceSource CreateSource(string name)
         {
             var source = new TraceSource(name);
-            source.TraceInformation("Initialized with initial level {0}", source.Switch.Level);
+            source.TraceInformation("Initialized trace source {0} with initial level {1}", name, source.Switch.Level);
             return source;
-        }
-
-        private void DoTrace()
-        {
-            foreach (var action in traceQueue.GetConsumingEnumerable())
-            {
-                if (cancellation.IsCancellationRequested)
-                    break;
-
-                // Tracing should never cause the app to fail.
-                // Since this is async, it might if we don't catch.
-                try
-                {
-                    ExecutionContext.Run(action.Item1, state => action.Item2(), null);
-                }
-                catch { }
-            }
         }

         /// <summary>
@@ -257,13 +175,11 @@
         /// </summary>
         private class AggregateTracer : ITracer
         {
-            private TracerManager manager;
             private List<DiagnosticsTracer> tracers;
             private string name;

-            public AggregateTracer(TracerManager manager, string name, IEnumerable<DiagnosticsTracer> tracers)
-            {
-                this.manager = manager;
+            public AggregateTracer(string name, IEnumerable<DiagnosticsTracer> tracers)
+            {
                 this.name = name;
                 this.tracers = tracers.ToList();
             }
@@ -273,7 +189,7 @@
             /// </summary>
             public void Trace(TraceEventType type, object message)
             {
-                manager.Enqueue(() => tracers.ForEach(tracer => tracer.Trace(name, type, message)));
+                tracers.ForEach(tracer => tracer.Trace(name, type, message));
             }

             /// <summary>
@@ -281,7 +197,7 @@
             /// </summary>
             public void Trace(TraceEventType type, string format, params object[] args)
             {
-                manager.Enqueue(() => tracers.ForEach(tracer => tracer.Trace(name, type, format, args)));
+                tracers.ForEach(tracer => tracer.Trace(name, type, format, args));
             }

             /// <summary>
@@ -289,7 +205,7 @@
             /// </summary>
             public void Trace(TraceEventType type, Exception exception, object message)
             {
-                manager.Enqueue(() => tracers.ForEach(tracer => tracer.Trace(name, type, exception, message)));
+                tracers.ForEach(tracer => tracer.Trace(name, type, exception, message));
             }

             /// <summary>
@@ -297,16 +213,20 @@
             /// </summary>
             public void Trace(TraceEventType type, Exception exception, string format, params object[] args)
             {
-                manager.Enqueue(() => tracers.ForEach(tracer => tracer.Trace(name, type, exception, format, args)));
+                tracers.ForEach(tracer => tracer.Trace(name, type, exception, format, args));
             }

             public override string ToString()
             {
-                return "Aggregate for " + this.name;
-            }
-        }
-
-        partial class DiagnosticsTracer
+                return "Aggregate sources for " + this.name;
+            }
+        }
+
+        /// <summary>
+        /// Implements the <see cref="ITracer"/> interface on top of
+        /// <see cref="TraceSource"/>.
+        /// </summary>
+        private class DiagnosticsTracer
         {
             private TraceSource source;

@@ -317,35 +237,65 @@

             public void Trace(string sourceName, TraceEventType type, object message)
             {
-                // Because we know there is a single tracer thread executing these,
-                // we know it's safe to replace the name without locking.
-                using (new SourceNameReplacer(source, sourceName))
-                {
-                    source.TraceEvent(type, 0, message.ToString());
+                lock (source)
+                {
+                    using (new SourceNameReplacer(source, sourceName))
+                    {
+                        // This is the only overload where we expect to get Transfer type.
+                        if (type == TraceEventType.Transfer)
+                        {
+                            if (!(message is Guid))
+                                throw new ArgumentException("message must be a Guid for the transfered activity.");
+
+                            source.TraceTransfer(0, " > " + message, (Guid)message);
+                        }
+                        else
+                        {
+                            source.TraceEvent(type, 0, message.ToString());
+                        }
+                    }
                 }
             }

             public void Trace(string sourceName, TraceEventType type, string format, params object[] args)
             {
-                using (new SourceNameReplacer(source, sourceName))
-                {
-                    source.TraceEvent(type, 0, format, args);
+                if (type == TraceEventType.Transfer)
+                    throw new NotSupportedException("For Transfer event types, use the overload receiving just an object message, which must be the new activity ID to transfer to.");
+
+                lock (source)
+                {
+                    using (new SourceNameReplacer(source, sourceName))
+                    {
+                        source.TraceEvent(type, 0, format, args);
+                    }
                 }
             }

             public void Trace(string sourceName, TraceEventType type, Exception exception, object message)
             {
-                using (new SourceNameReplacer(source, sourceName))
-                {
-                    source.TraceEvent(type, 0, message.ToString() + Environment.NewLine + exception);
+                if (type == TraceEventType.Transfer)
+                    throw new NotSupportedException("For Transfer event types, use the overload receiving just an object message, which must be the new activity ID to transfer to.");
+
+                lock (source)
+                {
+                    using (new SourceNameReplacer(source, sourceName))
+                    {
+                        source.TraceEvent(type, 0, message.ToString() + Environment.NewLine + exception);
+                    }
                 }
             }

             public void Trace(string sourceName, TraceEventType type, Exception exception, string format, params object[] args)
             {
-                using (new SourceNameReplacer(source, sourceName))
-                {
-                    source.TraceEvent(type, 0, string.Format(format, args) + Environment.NewLine + exception);
+                if (type == TraceEventType.Transfer)
+                    throw new NotSupportedException("For Transfer event types, use the overload receiving just an object message, which must be the new activity ID to transfer to.");
+
+                lock (source)
+                {
+                    using (new SourceNameReplacer(source, sourceName))
+                    {
+                        source.TraceEvent(type, 0, string.Format(format, args) + Environment.NewLine + exception);
+                    }
                 }
             }

@@ -364,8 +314,7 @@
             /// we need to fix the source name right before tracing, so that a configured
             /// listener at "*" still receives as the source name the original (aggregate) one,
             /// and not "*". This requires some private reflection, and a lock to guarantee
-            /// proper logging, but this decreases its performance. However, since we log
-            /// asynchronously, it's fine.
+            /// proper logging, but this decreases its performance.
             /// </summary>
             private class SourceNameReplacer : IDisposable
             {


implement meetup PUT API

implement meetup PUT API

--- MeetU/MeetU/API/MeetupsController.cs
+++ MeetU/MeetU/API/MeetupsController.cs
@@ -86,34 +86,40 @@

         // PUT: api/Meetups/5
         [ResponseType(typeof(void))]
-        public async Task<IHttpActionResult> PutMeetup(int id, Meetup meetup)
+        public async Task<IHttpActionResult> PutMeetup(Meetup meetup)
         {
+            // Ensure it's post by sponser
+            if (meetup.Sponsor != User.Identity.GetUserId())
+            {
+                return StatusCode(HttpStatusCode.Forbidden);
+            }
+            // Ensure valid
             if (!ModelState.IsValid)
             {
                 return BadRequest(ModelState);
             }

-            if (id != meetup.Id)
+            // Ensure existing
+            var old = await db.Meetups.FirstOrDefaultAsync(m => m.Id == meetup.Id);
+            if (old == null)
             {
-                return BadRequest();
+                return NotFound();
             }

-            db.Entry(meetup).State = EntityState.Modified;
-
+            // Update and save
+            old.Description = meetup.Description;
+            old.Title = meetup.Title;
+            old.When = meetup.When;
+            old.Where = meetup.Where;
+            meetup.UpdatedAt = DateTime.Now;
+            db.Entry(old).State = EntityState.Modified;
             try
             {
                 await db.SaveChangesAsync();
             }
             catch (DbUpdateConcurrencyException)
             {
-                if (!MeetupExists(id))
-                {
-                    return NotFound();
-                }
-                else
-                {
-                    throw;
-                }
+                throw;
             }

             return StatusCode(HttpStatusCode.NoContent);


Add block helper test

Add block helper test

--- source/Handlebars.Test/ComplexIntegrationTests.cs
+++ source/Handlebars.Test/ComplexIntegrationTests.cs
@@ -76,12 +76,10 @@
             Assert.AreEqual("GoogleYahoo!", result);
         }

-        //[Test]
+        [Test]
         public void BlockHelperHelper()
         {
             var source = "{{#block_helper foo}}{{link_to url text}}{{/block_helper}}";
-
-            var template = Handlebars.Compile(source);

             var data = new {
                 foo = new []
@@ -101,6 +99,8 @@
                     blockTemplate(writer, item);
                 }
             });
+
+			var template = Handlebars.Compile(source);

             var result = template(data);
             Assert.AreEqual("GoogleYahoo!", result);


Fixed some custom application install folders not being detected automatically

--- source/UninstallTools/Factory/DirectoryFactory.cs
+++ source/UninstallTools/Factory/DirectoryFactory.cs
@@ -83,8 +83,7 @@

             var extraPfDirectories = FindExtraPfDirectories(existingUninstallers)
                 .Where(extraDir => !extraDir.Key.FullName.Contains(@"\Common Files", StringComparison.InvariantCultureIgnoreCase))
-                .Where(extraDir => !pfDirectories.Any(pfDir => pfDir.Key.FullName.Contains(extraDir.Key.FullName,
-                StringComparison.InvariantCultureIgnoreCase)));
+                .Where(extraDir => pfDirectories.All(pfDir => !PathTools.PathsEqual(pfDir.Key.FullName, extraDir.Key.FullName)));

             pfDirectories.AddRange(extraPfDirectories);


Towers now target

Towers now target

--- ld36Game/ld36Game/Managers/TowerManager.cs
+++ ld36Game/ld36Game/Managers/TowerManager.cs
@@ -131,9 +131,14 @@
                     if (t.cooldown <= 0)
                     {
                         //get target, and fire
-                        Bullet b = new Bullet(t.position + new Vector2(16, 16), new Vector2(10.0f, 0), 1);
-                        bullets.Add(b);
-                        towers[i].cooldown = t.fireRate;
+
+                        Vector2 vel = getTargetFromEnemies(t.range, t.position);
+                        if(vel != Vector2.Zero)
+                        {
+                            Bullet b = new Bullet(t.position + new Vector2(16, 16), vel * 10.0f, 1);
+                            bullets.Add(b);
+                            towers[i].cooldown = t.fireRate;
+                        }
                     }
                     towers[i].cooldown -= time.ElapsedGameTime.Milliseconds;

@@ -167,6 +172,24 @@
             }
         }

+        private Vector2 getTargetFromEnemies(float range, Vector2 position)
+        {
+            for(int i = 0; i < parent.eManager.getCount(); ++i)
+            {
+                Entity e = parent.eManager.getEntity(i);
+                if (e == null) continue;
+                Vector2 distanceVec = e.position - position;
+                float distance = distanceVec.Length();
+
+                if(distance <= range) //this is our target
+                {
+                    distanceVec.Normalize();
+                    return distanceVec;
+                }
+            }
+            return Vector2.Zero;
+        }
+
         private Vector2 tilePosFromMouse(MouseState ms)
         {
             Vector2 result = new Vector2();


DataType.Immutable

DataType.Immutable

--- Algo/DataType.cs
+++ Algo/DataType.cs
@@ -42,52 +42,60 @@
 			};
 		}

+		private bool _immutable;
+
+		private DataType Immutable()
+		{
+			_immutable = true;
+			return this;
+		}
+
 		/// <summary>
 		/// Level1.
 		/// </summary>
-		public static DataType Level1 { get; } = Create(typeof(Level1ChangeMessage), null);
+		public static DataType Level1 { get; } = Create(typeof(Level1ChangeMessage), null).Immutable();

 		/// <summary>
 		/// Market depth.
 		/// </summary>
-		public static DataType MarketDepth { get; } = Create(typeof(QuoteChangeMessage), null);
+		public static DataType MarketDepth { get; } = Create(typeof(QuoteChangeMessage), null).Immutable();

 		/// <summary>
 		/// Position changes.
 		/// </summary>
-		public static DataType PositionChanges { get; } = Create(typeof(PositionChangeMessage), null);
+		public static DataType PositionChanges { get; } = Create(typeof(PositionChangeMessage), null).Immutable();

 		/// <summary>
 		/// News.
 		/// </summary>
-		public static DataType News { get; } = Create(typeof(NewsMessage), null);
+		public static DataType News { get; } = Create(typeof(NewsMessage), null).Immutable();

 		/// <summary>
 		/// Securities.
 		/// </summary>
-		public static DataType Securities { get; } = Create(typeof(SecurityMessage), null);
+		public static DataType Securities { get; } = Create(typeof(SecurityMessage), null).Immutable();

 		/// <summary>
 		/// Ticks.
 		/// </summary>
-		public static DataType Ticks { get; } = Create(typeof(ExecutionMessage), ExecutionTypes.Tick);
+		public static DataType Ticks { get; } = Create(typeof(ExecutionMessage), ExecutionTypes.Tick).Immutable();

 		/// <summary>
 		/// Order log.
 		/// </summary>
-		public static DataType OrderLog { get; } = Create(typeof(ExecutionMessage), ExecutionTypes.OrderLog);
+		public static DataType OrderLog { get; } = Create(typeof(ExecutionMessage), ExecutionTypes.OrderLog).Immutable();

 		/// <summary>
 		/// Transactions.
 		/// </summary>
-		public static DataType Transactions { get; } = Create(typeof(ExecutionMessage), ExecutionTypes.Transaction);
+		public static DataType Transactions { get; } = Create(typeof(ExecutionMessage), ExecutionTypes.Transaction).Immutable();

 		/// <summary>
 		/// Create data type info for <see cref="TimeFrameCandleMessage"/>.
 		/// </summary>
 		/// <param name="tf">Candle arg.</param>
 		/// <returns>Data type info.</returns>
-		public static DataType TimeFrame(TimeSpan tf) => Create(typeof(TimeFrameCandleMessage), tf);
+		public static DataType TimeFrame(TimeSpan tf) => Create(typeof(TimeFrameCandleMessage), tf).Immutable();

 		private Type _messageType;

@@ -99,6 +107,9 @@
 			get => _messageType;
 			set
 			{
+				if (_immutable)
+					throw new InvalidOperationException();
+
 				_messageType = value;
 				ReInitHashCode();
 			}
@@ -114,6 +125,9 @@
 			get => _arg;
 			set
 			{
+				if (_immutable)
+					throw new InvalidOperationException();
+
 				_arg = value;
 				ReInitHashCode();
 			}


Create PathReset event

Create PathReset event

--- AnimationPath.cs
+++ AnimationPath.cs
@@ -47,6 +47,7 @@
         #region FIELDS

         public event EventHandler PathChanged;
+        public event EventHandler PathReset;

         /// <summary>
         /// Animation curves that make the animation path.
@@ -183,14 +184,20 @@
         }

         #endregion Unity Messages
-
-        #region PUBLIC METHODS
+        #region EVENT INVOCATORS
+        public virtual void OnPathReset() {
+            var handler = PathReset;
+            if (handler != null) handler(this, EventArgs.Empty);
+        }
+
         public virtual void OnPathChanged() {
             var handler = PathChanged;
             if (handler != null) handler(this, EventArgs.Empty);
         }

-
+        #endregion
+
+        #region PUBLIC METHODS
         public float CalculatePathCurvedLength(int samplingFrequency) {
             float pathLength = 0;

@@ -565,6 +572,5 @@
         }

         #endregion PRIVATE METHODS
-
     }
 }


bump version

bump version

--- CommonAssemblyInfo.cs
+++ CommonAssemblyInfo.cs
@@ -4,5 +4,5 @@
 [assembly: AssemblyTitle("Validar")]
 [assembly: AssemblyProduct("Validar")]
 [assembly: ComVisible(false)]
-[assembly: AssemblyVersion("0.5.0.0")]
-[assembly: AssemblyFileVersion("0.5.0.0")]
+[assembly: AssemblyVersion("0.6.0.0")]
+[assembly: AssemblyFileVersion("0.6.0.0")]


stack paths as they arrive instead of all at once

--- Assets/SimEvt.cs
+++ Assets/SimEvt.cs
@@ -283,7 +283,6 @@
 	public override void apply (Sim g)
 	{
 		List<int> movedPaths = new List<int>();
-		long timeArrive = long.MinValue;
 		base.apply (g);
 		// move paths to final location of stackPath
 		// STACK TODO: if stackPathVal < 0 (pressing stack button will do that) then move all paths to their average location
@@ -292,13 +291,14 @@
 				movedPaths.Add (g.paths[path.Key].moveTo (timeCmd, new List<int>(path.Value), g.paths[stackPath].moves[g.paths[stackPath].moves.Count - 1].vecEnd));
 			}
 		}
-		// if able to move any of the paths, add an event to stack them when they arrive
+		// if able to move any of the paths, add events to stack them as they arrive
 		if (movedPaths.Count > 0) {
 			if (!movedPaths.Contains (stackPath)) movedPaths.Add (stackPath);
 			foreach (int path in movedPaths) {
-				timeArrive = Math.Max (timeArrive, g.paths[path].moves[g.paths[path].moves.Count - 1].timeEnd);
-			}
-			g.events.add (new StackEvt(timeArrive, movedPaths.ToArray ()));
+				// in most cases only 1 path will stack onto stackPath,
+				// but request to stack all moved paths anyway in case the path they're stacking onto moves away
+				g.events.add (new StackEvt(g.paths[path].moves[g.paths[path].moves.Count - 1].timeEnd, movedPaths.ToArray ()));
+			}
 		}
 	}
 }


resharper code and add test of int max value to avoid exception

--- PaperBoy/Program.cs
+++ PaperBoy/Program.cs
@@ -6,9 +6,9 @@

 namespace PaperBoy
 {
-  class Program
+  internal static class Program
   {
-    static void Main(string[] arguments)
+    private static void Main(string[] arguments)
     {
       Action<string> display = Console.WriteLine;
       string saveFilePath = string.Empty;
@@ -80,6 +80,7 @@
         else
         {
           display("Waiting for Internet connexion ...");
+          numberOfLoop  = numberOfLoop >= int.MaxValue ? 1 : numberOfLoop++;
           Thread.Sleep(numberOfLoop++ * 1000);
         }
       }
@@ -221,7 +222,7 @@
       return result;
     }

-    private void DisplayMessageOk(string message)
+    private static void DisplayMessageOk(string message)
     {
       Console.WriteLine(message);
     }


Temporary fix. This allows us to post now. Need to consider refactoring dependencies so that the XhtmlConverter class doesn't need the Inject attribute.

--- SubtextSolution/Subtext.Framework/Services/XhtmlConverter.cs
+++ SubtextSolution/Subtext.Framework/Services/XhtmlConverter.cs
@@ -29,10 +29,14 @@
         private SgmlReader _reader;

         [Inject]
-        public XhtmlConverter() : this(null, new SgmlReader()) {
+        public XhtmlConverter()
+            : this(null, new SgmlReader())
+        {
         }

-        public XhtmlConverter(Converter<string, string> innerTextConverter) : this(innerTextConverter, new SgmlReader()) {
+        public XhtmlConverter(Converter<string, string> innerTextConverter)
+            : this(innerTextConverter, new SgmlReader())
+        {
         }

         public XhtmlConverter(Converter<string, string> innerTextConverter, SgmlReader sgmlReader)
@@ -43,7 +47,8 @@

         public string Transform(string original)
         {
-            if (string.IsNullOrEmpty(original)) {
+            if (string.IsNullOrEmpty(original))
+            {
                 return string.Empty;
             }
             return ConvertHtmlToXHtml(original, _innerTextConverter);
@@ -140,7 +145,8 @@
         // This to make sure the Xhtml is well formatted before processing it
         private static string RemoveNewLineBeforeCDATA(string text)
         {
-            if (String.IsNullOrEmpty(text)) {
+            if (String.IsNullOrEmpty(text))
+            {
                 return string.Empty;
             }
             return _newLineStripperRegex.Replace(text, "><![CDATA[");


Test3 'Red'

Test3 'Red'

--- TDD-Katas-project/TDD-Katas-project/FizzBuzzKata/FizzBuzz.cs
+++ TDD-Katas-project/TDD-Katas-project/FizzBuzzKata/FizzBuzz.cs
@@ -21,6 +21,7 @@
             {
                 var printNumber = string.Empty;
                 if (IsFizz(i)) printNumber += "Fizz";
+                if (i % 5 == 0) printNumber += "Buzz";
                 if (String.IsNullOrEmpty(printNumber))
                     printNumber = (i).ToString();
                 ResultFizzBuzz +=" "+ printNumber;


Return null for autoresolves with no usable constructor.

--- MonoCross.Navigation/NamedTypeMap.cs
+++ MonoCross.Navigation/NamedTypeMap.cs
@@ -353,6 +353,9 @@
             var initer = GetTypeLoader(type, name);
             if (initer.Type == null)
             {
+                // If the type can't be initialized, return null
+                if (!type.GetTypeInfo().DeclaredConstructors.Any()) return null;
+
                 // If the type is not registered at all, provide an initializer anyways
                 initer = new TypeLoader(type);
                 return initer.Load(parameters);


Added Guid ordering test

Added Guid ordering test


Add unit test

Add unit test


added samples

added samples

--- NUnit_v2_samples/NUnitSampleTests.cs
+++ NUnit_v2_samples/NUnitSampleTests.cs
@@ -31,8 +31,17 @@
         }

         [Test]
+        [ExpectedException]
+        public void TestShortExpectedException()
+        {
+            foo1();
+            foo2();
+            foo1();
+        }
+
+        [Test]
         [NUnit.Framework.ExpectedException]
-        public void TestException()
+        public void TestFullExpectedException()
         {
             foo1();
             foo2();


Green: Can subtract scores

Green: Can subtract scores

--- PlayerRank/Score.cs
+++ PlayerRank/Score.cs
@@ -1,6 +1,4 @@
-using System;
-
-namespace PlayerRank
+namespace PlayerRank
 {
     public class Score
     {
@@ -35,7 +33,7 @@

         public static Score operator -(Score scoreA, Score scoreB)
         {
-            throw new NotImplementedException();
+            return new Score(scoreA.m_Score - scoreB.m_Score);
         }
     }
 }


Added quotes around the log path in the arguments list

--- Plex/MediaServer.cs
+++ Plex/MediaServer.cs
@@ -570,7 +570,7 @@

             ProcessStartInfo startInfo = new ProcessStartInfo(
                 LatestInstallPackage.FilePath,
-                PlexInstallParameters + logFile);
+                $"{PlexInstallParameters.Trim()} \"{logFile}\"");

             OnMessageChanged($"Run Plex installation - '{startInfo.FileName} {startInfo.Arguments}'.");
             using (Process install = Process.Start(startInfo))


use native logging in singleton-initializations

--- Pluton/Singleton.cs
+++ Pluton/Singleton.cs
@@ -17,7 +17,7 @@
             if (Singleton<T>.Instance.CheckDependencies())
                 Singleton<T>.Instance.Initialize();
             else
-                Logger.LogWarning(String.Format("Couldn't initialite Singleton<{0}>, is one of it's dependencies missing?", Instance.GetType()));
+                UnityEngine.Debug.LogWarning(String.Format("Couldn't initialite Singleton<{0}>, is one of it's dependencies missing?", Instance.GetType()));
         }
     }
 }


Added message for force start.

Added message for force start.

--- UnityProject/Assets/Scripts/Managers/AdminCommandsManager.cs
+++ UnityProject/Assets/Scripts/Managers/AdminCommandsManager.cs
@@ -96,6 +96,8 @@
 			if (GameManager.Instance.CurrentRoundState == RoundState.PreRound && GameManager.Instance.waitForStart)
 			{
 				GameManager.Instance.StartRound();
+
+				Chat.AddGameWideSystemMsgToChat("<color=blue>An Admin started the round early.</color>");

 				var msg = $"{PlayerList.Instance.GetByUserID(adminId).Username}: Force STARTED the round.";


Added more unit-tests for linq support

Added more unit-tests for linq support

--- VirtualObjects.Tests/Queries/QueryAggregateFunctionsTests.cs
+++ VirtualObjects.Tests/Queries/QueryAggregateFunctionsTests.cs
@@ -398,25 +398,12 @@
                          };

             /* Select Count(*) From (
-             *  Select
-             *      [T2].[CustomerId],
-             *      [T2].[CompanyName],
-             *      [T2].[ContactName],
-             *      [T2].[ContactTitle],
-             *      [T2].[Address],
-             *      [T2].[City],
-             *      [T2].[Region],
-             *      [T2].[PostalCode],
-             *      [T2].[Country],
-             *      [T2].[Phone],
-             *      [T2].[Fax],
-             *      Sum([T1].[Discount]) [Discount]
-             *
-             * From [Orders] [T0]
-             * Inner Join [Order Details] [T1] On ([T0].[OrderId] = [T1].[OrderId])
-             * Inner Join [Customers] [T2] On ([T0].[CustomerId] = [T2].[CustomerId])
+             *  Select 1 [Stub]
+             *  From [Orders] [T0]
+             *  Inner Join [Order Details] [T1] On ([T0].[OrderId] = [T1].[OrderId])
+             *  Inner Join [Customers] [T2] On ([T0].[CustomerId] = [T2].[CustomerId])
              *
-             * Group By
+             *  Group By
              *      [T2].[CustomerId],
              *      [T2].[CompanyName],
              *      [T2].[ContactName],
@@ -434,6 +421,85 @@
             Diagnostic.Timed(() => orders.Count())
                 .Should().Be(89);
         }
+
+        [Test, Repeat(Repeat)]
+        public void Aggregate_Query_Joined_And_GroupBy_With_A_Full_Entity_Sum()
+        {
+            var orders = from O in Query<Orders>()
+                         join OD in Query<OrderDetails>() on O equals OD.Order
+                         join C in Query<Customers>() on O.Customer equals C
+                         group OD by new { C } into OG
+                         select new
+                         {
+                             Customer = OG.Key.C,
+                             Discount = OG.Sum(e => e.Discount)
+                         };
+
+            /* Select Sum([Discount]) From (
+             *  Select
+             *      Sum([T1].[Discount]) [Discount]
+             *  From [Orders] [T0]
+             *  Inner Join [Order Details] [T1] On ([T0].[OrderId] = [T1].[OrderId])
+             *  Inner Join [Customers] [T2] On ([T0].[CustomerId] = [T2].[CustomerId])
+             *
+             *  Group By
+             *      [T2].[CustomerId],
+             *      [T2].[CompanyName],
+             *      [T2].[ContactName],
+             *      [T2].[ContactTitle],
+             *      [T2].[Address],
+             *      [T2].[City],
+             *      [T2].[Region],
+             *      [T2].[PostalCode],
+             *      [T2].[Country],
+             *      [T2].[Phone],
+             *      [T2].[Fax]
+             * ) Result
+             */
+
+            Diagnostic.Timed(() => orders.Sum(e => e.Discount))
+                .Should().Be(89);
+        }
+
+        [Test, Repeat(Repeat)]
+        public void Aggregate_Query_Joined_And_GroupBy_With_A_Full_Entity_Max()
+        {
+            var orders = from O in Query<Orders>()
+                         join OD in Query<OrderDetails>() on O equals OD.Order
+                         join C in Query<Customers>() on O.Customer equals C
+                         group OD by new { C } into OG
+                         select new
+                         {
+                             Customer = OG.Key.C,
+                             Discount = OG.Sum(e => e.Discount)
+                         };
+
+            /* Select Max([Discount]) From (
+             *  Select
+             *      Sum([T1].[Discount]) [Discount]
+             *  From [Orders] [T0]
+             *  Inner Join [Order Details] [T1] On ([T0].[OrderId] = [T1].[OrderId])
+             *  Inner Join [Customers] [T2] On ([T0].[CustomerId] = [T2].[CustomerId])
+             *
+             *  Group By
+             *      [T2].[CustomerId],
+             *      [T2].[CompanyName],
+             *      [T2].[ContactName],
+             *      [T2].[ContactTitle],
+             *      [T2].[Address],
+             *      [T2].[City],
+             *      [T2].[Region],
+             *      [T2].[PostalCode],
+             *      [T2].[Country],
+             *      [T2].[Phone],
+             *      [T2].[Fax]
+             * ) Result
+             */
+
+            Diagnostic.Timed(() => orders.Max(e => e.Discount))
+                .Should().Be(89);
+        }
+

         [Test, Repeat(Repeat)]


The new Payjoin spec is not guaranteed to work with BIP79 so I would remove its BIP21 key as a signal for payjoin.

--- WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -101,7 +101,7 @@
 		{
 			base.OnAddressPaste(url);

-			if (url.UnknowParameters.TryGetValue("bpu", out var endPoint) || url.UnknowParameters.TryGetValue("pj", out endPoint))
+			if (url.UnknowParameters.TryGetValue("pj", out var endPoint))
 			{
 				if (!Wallet.KeyManager.IsWatchOnly)
 				{


Fixed one added ignore

Fixed one added ignore

--- Nodejs/Tests/Core/ReplWindowTests.cs
+++ Nodejs/Tests/Core/ReplWindowTests.cs
@@ -493,8 +493,7 @@
         }

         // https://nodejstools.codeplex.com/workitem/1575
-        [Ignore]
-        [TestMethod, Priority(0), Timeout(180000)]
+        [TestMethod, Priority(0), Timeout(180000), TestCategory("Ignore")]
         public async Task TestNpmReplCommandProcessExitSucceeds() {
             var npmPath = Nodejs.GetPathToNodeExecutableFromEnvironment("npm.cmd");
             using (var eval = ProjectlessEvaluator()) {


Added WASD direction keys to Gaia.

Added WASD direction keys to Gaia.

--- Nu/Nu.Gaia.Design/SelectablePanel.cs
+++ Nu/Nu.Gaia.Design/SelectablePanel.cs
@@ -21,6 +21,8 @@
         {
             if (keyData == Keys.Up || keyData == Keys.Down) return true;
             if (keyData == Keys.Left || keyData == Keys.Right) return true;
+            if (keyData == Keys.W || keyData == Keys.S) return true;
+            if (keyData == Keys.A || keyData == Keys.D) return true;
             return base.IsInputKey(keyData);
         }


Fill episode number tag with leading zeros

--- PreviewListModel.cs
+++ PreviewListModel.cs
@@ -420,7 +420,7 @@
                     String keyField = cardInfo.GetKey();
                     String audioField = audioFields[i];
                     String imageField = snapshotFields[i];
-                    String tags = String.Format("{0} ep{1}", settings.DeckNameModified, cardInfo.episodeInfo.Number);
+                    String tags = String.Format("{0} ep{1:000}", settings.DeckNameModified, cardInfo.episodeInfo.Number);
                     outputStream.WriteLine(UtilsCommon.HTMLify(keyField) + "\t" +
                                            UtilsCommon.HTMLify(imageField) + "\t"+
                                            UtilsCommon.HTMLify(audioField) + "\t" +
@@ -429,7 +429,7 @@
                                            UtilsCommon.HTMLify(previousCardsTargetLanguage) + "\t" +
                                            UtilsCommon.HTMLify(previousCardsNativeLanguage) + "\t" +
                                            UtilsCommon.HTMLify(nextCardsTargetLanguage) + "\t" +
-                                           UtilsCommon.HTMLify(nextCardsNativeLanguage) + "\t" +
+                                           UtilsCommon.HTMLify(nextCardsNativeLanguage) + "\t" +
                                            UtilsCommon.HTMLify(tags)
                                            );
                 }


no need to gather system info if it's not going to be sent

--- Data/BasicTeraData.cs
+++ Data/BasicTeraData.cs
@@ -102,6 +102,7 @@
             {
                 try
                 {
+                    if (!Instance.WindowData.Debug || local) { return; }
                     var name = (from x in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem").Get().Cast<ManagementObject>()
                                    select x.GetPropertyValue("Version") + " Memory Total:" + x.GetPropertyValue("TotalVisibleMemorySize") + " Virtual:" +
                                           x.GetPropertyValue("TotalVirtualMemorySize") + " PhFree:" + x.GetPropertyValue("FreePhysicalMemory") + " VFree:" +
@@ -110,7 +111,6 @@
                                                  select x.GetPropertyValue("Name") + " load:" + x.GetPropertyValue("LoadPercentage") + "%").FirstOrDefault() ??
                                              "processor unknown");
                     error = $"##### (version={UpdateManager.Version} Region={_region}) running on {name}:\r\n" + (debug ? "##### Debug: " : "") + error;
-                    if (!Instance.WindowData.Debug || local) { return; }

                     using (var client = new HttpClient())
                     {


added constructor to allow pre-determined label position (which may be outside the stream)

--- DataTypes/X86Label.cs
+++ DataTypes/X86Label.cs
@@ -20,6 +20,10 @@

 		internal X86Label(X86Writer writer) {
 			this.writer = writer;
+		}
+		internal X86Label(X86Writer writer, IntPtr position)
+			: this(writer) {
+			mark = position;
 		}

 		public void Mark() {


AV: fix

AV: fix

--- AddOns/AngelicVerifierNull/AngelicVerifierNull/Program.cs
+++ AddOns/AngelicVerifierNull/AngelicVerifierNull/Program.cs
@@ -1465,7 +1465,7 @@
                     Utils.Print(String.Format("The output of ExplainError => Status = {0} Exprs = ({1})",
                         eeStatus, explain != null ? String.Join(", ", explain) : ""));
                     //Remove this flag as we may repeatEEWithControlFlow
-                    eeflags.Add("/eliminateMapUpdates-");
+                    eeflags.Remove("/eliminateMapUpdates-");
                 }

                 if (eeStatus == ExplainError.STATUS.SUCCESS)


added spells to deathsinger

added spells to deathsinger

--- Assets/Scripts/Game/Defined/Characters/Areas/OceanNPCs.cs
+++ Assets/Scripts/Game/Defined/Characters/Areas/OceanNPCs.cs
@@ -122,7 +122,8 @@
                 )
                 .AddStats(new Mana())
                 .AddSpells(new WaterboltSingle(), new WaterboltMulti())
-                .AddBuff(new Insight());
+                .AddBuff(new Insight())
+                .AddItem(new Cleanse(), Util.IsChance(.25f));
         }

         public static Character DreadSinger() {
@@ -134,7 +135,9 @@
                         "Singer of the voices of dread.",
                         Breed.FISH
                         ),
-                    new DreadSinger());
+                    new DreadSinger())
+                    .AddSpells(new CastDelayedDeath())
+                    .AddItem(new Cleanse(), 1);
         }

         public static Character Swarm() {


Fix broken group analysis.

Fix broken group analysis.

--- AudioWorks/AudioWorks.Commands/MeasureAudioFileCommand.cs
+++ AudioWorks/AudioWorks.Commands/MeasureAudioFileCommand.cs
@@ -3,6 +3,7 @@
 using System.Collections.Generic;
 using System.Management.Automation;
 using System.Threading;
+using System.Threading.Tasks;

 namespace AudioWorks.Commands
 {
@@ -46,10 +47,16 @@
         protected override void EndProcessing()
         {
             using (var groupToken = new GroupToken(_audioFiles.Count))
-                AudioFile.Analyze(Analyzer, groupToken, CancellationToken.None);
+                AnalyzeParallel(groupToken);

             if (PassThru)
                 WriteObject(AudioFile);
         }
+
+        void AnalyzeParallel([NotNull] GroupToken groupToken)
+        {
+            Parallel.ForEach(_audioFiles, audioFile =>
+                audioFile.Analyze(Analyzer, groupToken, CancellationToken.None));
+        }
     }
 }


format code

format code

--- BinbinDotNetOpenAuth.AspNet/Clients/OAuth2/WeiboClient.cs
+++ BinbinDotNetOpenAuth.AspNet/Clients/OAuth2/WeiboClient.cs
@@ -56,7 +56,11 @@
         /// </summary>
         /// <param name="clientId">The Google Client Id</param>
         /// <param name="clientSecret">The Google Client Secret</param>
-        public WeiboClient(string clientId, string clientSecret) : this(clientId, clientSecret, new[] {"email"})
+        public WeiboClient(string clientId, string clientSecret)
+            : this(clientId, clientSecret, new[]
+                                           {
+                                               "email"
+                                           })
         {
         }

@@ -66,52 +70,81 @@
         /// <param name="clientId">The Google Client Id</param>
         /// <param name="clientSecret">The Google Client Secret</param>
         /// <param name="requestedScopes">One or more requested scopes, passed without the base URI.</param>
-        public WeiboClient(string clientId, string clientSecret, params string[] requestedScopes) : base("weibo")
+        public WeiboClient(string clientId, string clientSecret, params string[] requestedScopes)
+            : base("weibo")
         {
             if (string.IsNullOrWhiteSpace(clientId))
+            {
                 throw new ArgumentNullException("clientId");
+            }

             if (string.IsNullOrWhiteSpace(clientSecret))
+            {
                 throw new ArgumentNullException("clientSecret");
+            }

             if (requestedScopes == null)
+            {
                 throw new ArgumentNullException("requestedScopes");
+            }

             if (requestedScopes.Length == 0)
+            {
                 throw new ArgumentException("One or more scopes must be requested.", "requestedScopes");
+            }

-            _clientId = clientId;
-            _clientSecret = clientSecret;
-            _requestedScopes = requestedScopes;
+            this._clientId = clientId;
+            this._clientSecret = clientSecret;
+            this._requestedScopes = requestedScopes;
         }

         protected override Uri GetServiceLoginUrl(Uri returnUrl)
         {
-            IEnumerable<string> scopes = _requestedScopes;
+            IEnumerable<string> scopes = this._requestedScopes;
             string state = string.IsNullOrEmpty(returnUrl.Query) ? string.Empty : returnUrl.Query.Substring(1);

-            return UriHelper.BuildUri(AuthorizationEndpoint, new NameValueCollection {{"response_type", "code"}, {"client_id", _clientId}, {"scope", string.Join(" ", scopes)}, {"redirect_uri", returnUrl.GetLeftPart(UriPartial.Path)}, {"state", state},});
+            return UriHelper.BuildUri(AuthorizationEndpoint, new NameValueCollection
+                                                             {
+                                                                 {"response_type", "code"},
+                                                                 {"client_id", this._clientId},
+                                                                 {"scope", string.Join(" ", scopes)},
+                                                                 {"redirect_uri", returnUrl.GetLeftPart(UriPartial.Path)},
+                                                                 {"state", state},
+                                                             });
         }

         protected override IDictionary<string, string> GetUserData(string accessToken)
         {
             var uid = (string) HttpContext.Current.Session["uid"];
-            Uri uri = UriHelper.BuildUri(UserInfoEndpoint, new NameValueCollection {{"access_token", accessToken}, {"uid", uid}});
+            Uri uri = UriHelper.BuildUri(UserInfoEndpoint, new NameValueCollection
+                                                           {
+                                                               {"access_token", accessToken},
+                                                               {"uid", uid}
+                                                           });

             var webRequest = (HttpWebRequest) WebRequest.Create(uri);

             using (WebResponse webResponse = webRequest.GetResponse())
-            using (Stream stream = webResponse.GetResponseStream())
             {
-                if (stream == null)
-                    return null;
+                using (Stream stream = webResponse.GetResponseStream())
+                {
+                    if (stream == null)
+                    {
+                        return null;
+                    }

-                using (var textReader = new StreamReader(stream))
-                {
-                    string json = textReader.ReadToEnd();
-                    var user = JsonConvert.DeserializeObject<WeiboUserData>(json);
-                    var extraData = new Dictionary<string, string> {{"id", user.id}, {"name", user.name}, {"screen_name", user.screen_name}};
-                    return extraData;
+                    using (var textReader = new StreamReader(stream))
+                    {
+                        string json = textReader.ReadToEnd();
+                        var user = JsonConvert.DeserializeObject<WeiboUserData>(json);
+                        var extraData = new Dictionary<string, string>
+                                        {
+                                            {"id", user.id},
+                                            {"name", user.name},
+                                            {"screen_name", user.screen_name}
+                                        };
+                        return extraData;
+                    }
                 }
             }
         }
@@ -119,7 +152,14 @@
         protected override string QueryAccessToken(Uri returnUrl, string authorizationCode)
         {
             NameValueCollection postData = HttpUtility.ParseQueryString(string.Empty);
-            postData.Add(new NameValueCollection {{"grant_type", "authorization_code"}, {"code", authorizationCode}, {"client_id", _clientId}, {"client_secret", _clientSecret}, {"redirect_uri", returnUrl.GetLeftPart(UriPartial.Path)},});
+            postData.Add(new NameValueCollection
+                         {
+                             {"grant_type", "authorization_code"},
+                             {"code", authorizationCode},
+                             {"client_id", this._clientId},
+                             {"client_secret", this._clientSecret},
+                             {"redirect_uri", returnUrl.GetLeftPart(UriPartial.Path)},
+                         });

             var webRequest = (HttpWebRequest) WebRequest.Create(TokenEndpoint);

@@ -127,14 +167,20 @@
             webRequest.ContentType = "application/x-www-form-urlencoded";

             using (Stream s = webRequest.GetRequestStream())
-            using (var sw = new StreamWriter(s))
-                sw.Write(postData.ToString());
+            {
+                using (var sw = new StreamWriter(s))
+                {
+                    sw.Write(postData.ToString());
+                }
+            }

             using (WebResponse webResponse = webRequest.GetResponse())
             {
                 Stream responseStream = webResponse.GetResponseStream();
                 if (responseStream == null)
+                {
                     return null;
+                }

                 using (var reader = new StreamReader(responseStream))
                 {


sum change, sum duznt

sum change, sum duznt

--- BlackJackSolution/BlackJackSolution/Control/Controller.cs
+++ BlackJackSolution/BlackJackSolution/Control/Controller.cs
@@ -155,7 +155,7 @@
         }
         public void GetUser(string uname, string pw)
         {
-            string[] dbData = db.GetAccount(uname);
+            string[] dbData = db.GetAccount(uname, pw);
             if (Crypt(pw ).Equals(dbData[3]))
             {

@@ -168,7 +168,7 @@
         //Behöver commit på nya procedures för test
         public bool Login(string accname, string pwd)
         {
-            string[] dbData = db.GetAccount(accname);
+            string[] dbData = db.GetAccount(accname, pwd);
             if (dbData == null)
             {
                 return false;


Categories are most likely not used in typical project.

--- CLR/Source/CommonBuildTools/GenerateNuGetBuildFileTask.cs
+++ CLR/Source/CommonBuildTools/GenerateNuGetBuildFileTask.cs
@@ -58,7 +58,6 @@
 "    <!-- Call NUnit task -->\n" +
 "    <CommonBuildTools.NUnitTask\n" +
 "      Assemblies=\"{5}\"\n" +
-"      IncludeCategories=\"{0}\"\n" +
 "      NoShadowAssemblies=\"True\"\n" +
 "      WorkingDirectory=\"$({0}BaseDir)/{4}\"\n" +
 "      />\n" +


Fix flashlight item status not updating on insert/eject of cell. (#8388)

--- Content.Server/Light/EntitySystems/HandheldLightSystem.cs
+++ Content.Server/Light/EntitySystems/HandheldLightSystem.cs
@@ -13,6 +13,7 @@
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
+using Robust.Shared.Containers;
 using Robust.Shared.GameStates;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
@@ -47,6 +48,27 @@

             SubscribeLocalEvent<HandheldLightComponent, GetItemActionsEvent>(OnGetActions);
             SubscribeLocalEvent<HandheldLightComponent, ToggleActionEvent>(OnToggleAction);
+
+            SubscribeLocalEvent<HandheldLightComponent, EntInsertedIntoContainerMessage>(OnEntInserted);
+            SubscribeLocalEvent<HandheldLightComponent, EntRemovedFromContainerMessage>(OnEntRemoved);
+        }
+
+        private void OnEntInserted(
+            EntityUid uid,
+            HandheldLightComponent component,
+            EntInsertedIntoContainerMessage args)
+        {
+            // Not guaranteed to be the correct container for our slot, I don't care.
+            UpdateLevel(component);
+        }
+
+        private void OnEntRemoved(
+            EntityUid uid,
+            HandheldLightComponent component,
+            EntRemovedFromContainerMessage args)
+        {
+            // Ditto above
+            UpdateLevel(component);
         }

         private void OnGetActions(EntityUid uid, HandheldLightComponent component, GetItemActionsEvent args)
@@ -256,13 +278,18 @@
             if (component.Activated && !battery.TryUseCharge(component.Wattage * frameTime))
                 TurnOff(component, false);

-            var level = GetLevel(component);
-
-            if (level != component.LastLevel)
-            {
-                component.LastLevel = level;
-                component.Dirty(EntityManager);
-            }
+            UpdateLevel(component);
+        }
+
+        private void UpdateLevel(HandheldLightComponent comp)
+        {
+            var level = GetLevel(comp);
+
+            if (level == comp.LastLevel)
+                return;
+
+            comp.LastLevel = level;
+            Dirty(comp);
         }
     }
 }


Use ConcurrentDictionary as backing cache for DefaultMetadataResolver

--- src/AsmResolver.DotNet/DefaultMetadataResolver.cs
+++ src/AsmResolver.DotNet/DefaultMetadataResolver.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
 using AsmResolver.DotNet.Signatures;
 using AsmResolver.DotNet.Signatures.Types;
@@ -24,7 +25,7 @@
         public DefaultMetadataResolver(IAssemblyResolver assemblyResolver)
         {
             AssemblyResolver = assemblyResolver ?? throw new ArgumentNullException(nameof(assemblyResolver));
-            _typeCache = new Dictionary<ITypeDescriptor, TypeDefinition>();
+            _typeCache = new ConcurrentDictionary<ITypeDescriptor, TypeDefinition>();
         }

         /// <inheritdoc />


cosmetic

cosmetic

--- src/AutoMapper/Configuration/MappingExpression.cs
+++ src/AutoMapper/Configuration/MappingExpression.cs
@@ -181,16 +181,14 @@
                                                                    Action<IMemberConfigurationExpression<TSource, TDestination, TMember>> memberOptions)
         {
             var memberInfo = ReflectionHelper.FindProperty(destinationMember);
-            ForDestinationMember(memberInfo, memberOptions);
-            return this;
+            return ForDestinationMember(memberInfo, memberOptions);
         }

         public IMappingExpression<TSource, TDestination> ForMember(string name,
                                                                    Action<IMemberConfigurationExpression<TSource, TDestination, object>> memberOptions)
         {
             var member = DestinationType.GetFieldOrProperty(name);
-            ForDestinationMember(member, memberOptions);
-            return this;
+            return ForDestinationMember(member, memberOptions);
         }

         public void ForAllOtherMembers(Action<IMemberConfigurationExpression<TSource, TDestination, object>> memberOptions)
@@ -456,9 +454,10 @@
             return this;
         }

-        private void ForDestinationMember<TMember>(MemberInfo destinationProperty, Action<IMemberConfigurationExpression<TSource, TDestination, TMember>> memberOptions)
+        private IMappingExpression<TSource, TDestination> ForDestinationMember<TMember>(MemberInfo destinationProperty, Action<IMemberConfigurationExpression<TSource, TDestination, TMember>> memberOptions)
         {
             ForDestinationMember(destinationProperty.ToMemberAccessor(), memberOptions);
+            return this;
         }

         private void ForDestinationMember<TMember>(IMemberAccessor destinationProperty, Action<IMemberConfigurationExpression<TSource, TDestination, TMember>> memberOptions)


navigation circle for alien scene completed

--- Documents/Unity3D/Catcheep/Assets/Scripts/AlienManager.cs
+++ Documents/Unity3D/Catcheep/Assets/Scripts/AlienManager.cs
@@ -7,18 +7,16 @@

 public class AlienManager : MonoBehaviour
 {
-    [Header("In game objects")]
-    public Sprite[] SheepSprites;
+    [Header("In game objects")] public Sprite[] SheepSprites;
     public GameObject[] alienShip;
     public GameObject maskHolder;

-    [Header("UI components")]
-    public GameObject rightButton;
+    [Header("UI components")] public GameObject rightButton;
     public GameObject leftButton;
     public GameObject timeText;
-
-    [Header("indication elements")]
-    public GameObject sheepHolder;
+    public GameObject SheepMapGameObject;
+
+    [Header("indication elements")] public GameObject sheepHolder;
     public GameObject sheepNumberText;
     public GameObject moneyAmountText;

@@ -66,7 +64,7 @@
             case 3:
                 return 59;
             case 4:
-                return 59;
+                return 59;
             case 5:
                 return 59;
             case 6:
@@ -154,7 +152,7 @@
                 Vector3.Lerp(spaceShipForScript.transform.localPosition, destination, 4f * Time.deltaTime);
             yield return new WaitForSeconds(0.02f);
         } while ((int) spaceShipForScript.transform.localPosition.y > -100f);
-
+
         spaceShipForScript.transform.SetParent(maskHolder.transform, true);
         maskHolder.GetComponent<ScrollRect>().content = spaceShipForScript.GetComponent<RectTransform>();
         activatingButtons();
@@ -227,17 +225,31 @@
                 edgeOfScreen.x + alienShip[shipType].GetComponentInChildren<Image>().sprite.bounds.size.x,
                 spaceShipForScript.transform.localPosition.y,
                 spaceShipForScript.transform.localPosition.z);
+            /*if (timer[currentSheepShowed-1] > 0)
+            {
+                //setting the timer's position (for pretty animation purpose)
+                timeText.transform.localPosition = new Vector3(-destination.x,
+                    timeText.transform.localPosition.y, timeText.transform.localPosition.z);
+                timeText.SetActive(true);
+            }*/
+
             do
             {
+                /*if (timer[currentSheepShowed] > 0)
+                {
+                    timeText.transform.localPosition = new Vector3(timeText.transform.localPosition.x + 20,
+                        timeText.transform.localPosition.y, timeText.transform.localPosition.z);
+                }*/
+
                 spaceShipForScript.transform.localPosition = new Vector3(
                     spaceShipForScript.transform.localPosition.x + 20,
-                    spaceShipForScript.transform.localPosition.y, spaceShipForScript.transform.localPosition.z);
+                spaceShipForScript.transform.localPosition.y, spaceShipForScript.transform.localPosition.z);
                 yield return new WaitForSeconds(0.01f);
             } while ((int) spaceShipForScript.transform.position.x < (int) destination.x * 1.3f);
             Destroy(spaceShipForScript.gameObject);
         }
         changingSheepPic(1);
-        if(timer[currentSheepShowed] <= 0) StartCoroutine(alienSpawner());
+        if (timer[currentSheepShowed] <= 0) StartCoroutine(alienSpawner());
         else
         {
             activatingButtons();
@@ -273,7 +285,6 @@
         if (timer[currentSheepShowed] <= 0)
         {
             StartCoroutine(alienSpawner());
-
         }
         else
         {
@@ -309,7 +320,6 @@
         {
             timeText.SetActive(false);
         }
-
     }

     void activatingButtons()
@@ -328,4 +338,81 @@
     {
         SceneManager.LoadScene(1);
     }
+
+    //sheep map functions
+    public void sheepMapClick()
+    {
+        if (SheepMapGameObject.gameObject.activeInHierarchy)
+        {
+            StartCoroutine(sheepMapClosed());
+        }
+        else
+        {
+            SheepMapGameObject.SetActive(true);
+            StartCoroutine(sheepMapOpened());
+        }
+    }
+    IEnumerator sheepMapOpened()
+    {
+        for (int i = 0; i < 10; i++)
+        {
+            float a = (float)i / 10;
+            SheepMapGameObject.transform.localScale = new Vector3(a, a, 1);
+            yield return new WaitForSeconds(0.01f);
+        }
+    }
+    IEnumerator sheepMapClosed()
+    {
+        for (int i = 10; i > 0; i--)
+        {
+            float a = (float)i / 10;
+            SheepMapGameObject.transform.localScale = new Vector3(a, a, 1);
+            yield return new WaitForSeconds(0.01f);
+        }
+        SheepMapGameObject.SetActive(false);
+    }
+
+    public void sheepyClicked()
+    {
+        print("sheep clicked");
+        StartCoroutine(sheepMapClosed());
+        currentSheepShowed = -1;
+        shipGoingRightButtonClicked();
+    }
+    public void blackyClicked()
+    {
+        StartCoroutine(sheepMapClosed());
+        currentSheepShowed = 0;
+        shipGoingRightButtonClicked();
+    }
+    public void flashClicked()
+    {
+        StartCoroutine(sheepMapClosed());
+        currentSheepShowed = 1;
+        shipGoingRightButtonClicked();
+    }
+    public void sheepySnowClicked()
+    {
+        StartCoroutine(sheepMapClosed());
+        currentSheepShowed = 2;
+        shipGoingRightButtonClicked();
+    }
+    public void blackySnowClicked()
+    {
+        StartCoroutine(sheepMapClosed());
+        currentSheepShowed = 3;
+        shipGoingRightButtonClicked();
+    }
+    public void sheepyCityClicked()
+    {
+        StartCoroutine(sheepMapClosed());
+        currentSheepShowed = 4;
+        shipGoingRightButtonClicked();
+    }
+    public void blackyCityClicked()
+    {
+        StartCoroutine(sheepMapClosed());
+        currentSheepShowed = 5;
+        shipGoingRightButtonClicked();
+    }
 }


increasing money on wheel spinner

increasing money on wheel spinner

--- Documents/Unity3D/Catcheep/Assets/Scripts/WheelSpinner.cs
+++ Documents/Unity3D/Catcheep/Assets/Scripts/WheelSpinner.cs
@@ -144,15 +144,15 @@
                 PlayerPrefs.SetInt("loveStock", PlayerPrefs.GetInt("loveStock") + 1);
                 break;
             case 3:
-                PlayerPrefs.SetInt("money", PlayerPrefs.GetInt("money") + 10000);
-                PlayerPrefs.SetInt("mostMoney", PlayerPrefs.GetInt("mostMoney") + 10000);
+                PlayerPrefs.SetInt("money", PlayerPrefs.GetInt("money") + 100000);
+                PlayerPrefs.SetInt("mostMoney", PlayerPrefs.GetInt("mostMoney") + 100000);
                 break;
             case 4:
                 PlayerPrefs.SetInt("hayStackStock", PlayerPrefs.GetInt("hayStackStock") + 1);
                 break;
             case 5:
-                PlayerPrefs.SetInt("money", PlayerPrefs.GetInt("money") + 5000);
-                PlayerPrefs.SetInt("mostMoney", PlayerPrefs.GetInt("mostMoney") + 5000);
+                PlayerPrefs.SetInt("money", PlayerPrefs.GetInt("money") + 50000);
+                PlayerPrefs.SetInt("mostMoney", PlayerPrefs.GetInt("mostMoney") + 50000);
                 break;
         }
         GameObject.Find("Cash text").GetComponent<TextMeshProUGUI>().text = "$" + PlayerPrefs.GetInt("money");


Fixed chords search ignores channel of notes

--- DryWetMidi/Smf.Interaction/ChordsManager/ChordsManager.cs
+++ DryWetMidi/Smf.Interaction/ChordsManager/ChordsManager.cs
@@ -1,6 +1,7 @@
 using Melanchall.DryWetMidi.Common;
 using System;
 using System.Collections.Generic;
+using System.Linq;

 namespace Melanchall.DryWetMidi.Smf.Interaction
 {
@@ -142,23 +143,29 @@
         {
             ThrowIfArgument.IsNull(nameof(notes), notes);

-            var lastNoteEndTime = long.MinValue;
-            Chord chord = null;
+            var channelsCount = FourBitNumber.MaxValue - FourBitNumber.MinValue + 1;
+            var lastNoteEndTimes = Enumerable.Range(0, channelsCount).Select(i => long.MinValue).ToArray();
+            var chords = new Chord[channelsCount];

             foreach (var note in notes)
             {
+                var channel = note.Channel;
+
+                var lastNoteEndTime = lastNoteEndTimes[channel];
+                var chord = chords[channel];
+
                 var noteTime = note.Time;
                 if (noteTime >= lastNoteEndTime || noteTime - chord.Time > notesTolerance)
                 {
                     if (chord != null)
                         yield return chord;

-                    chord = new Chord();
+                    chords[channel] = chord = new Chord();
                 }

                 chord.Notes.Add(note);

-                lastNoteEndTime = noteTime + note.Length;
+                lastNoteEndTimes[channel] = noteTime + note.Length;
             }
         }


fix: ошибка в случае если позиция курсора оказалась вне отображаемой строки

LERSU-8355

--- VKT5_RemoteConsole/Vkt5ConsoleControl.cs
+++ VKT5_RemoteConsole/Vkt5ConsoleControl.cs
@@ -337,10 +337,11 @@

 			string showLine = this.displayLine;

-			if (this.displayCursor)
-			{
-				showLine = showLine.Remove(this.cursorPos, 1);
-				showLine = showLine.Insert(this.cursorPos, cursorChar);
+			if (showLine.Length > 0 && cursorPos < showLine.Length && this.displayCursor)
+			{
+				showLine = showLine
+					.Remove(this.cursorPos, 1)
+					.Insert(this.cursorPos, cursorChar);
 			}

 			this.txtLine1.Text = showLine.Substring(0, 16);
@@ -379,4 +380,4 @@
 		private bool isMenuBtnDown = false;
 		private DateTime menuBtnPressTime = DateTime.MinValue;
 	}
-}
+}


bad attempt at new fallback lighting

bad attempt at new fallback lighting

--- Voxalia/ClientGame/WorldSystem/Region.cs
+++ Voxalia/ClientGame/WorldSystem/Region.cs
@@ -514,5 +514,54 @@
             }
             return false;
         }
+
+        public Location GetSkyLight(Location pos, Location norm)
+        {
+            // TODO: Make this usable!
+            double XP = Math.Floor(pos.X / Chunk.CHUNK_SIZE);
+            double YP = Math.Floor(pos.Y / Chunk.CHUNK_SIZE);
+            double ZP = Math.Floor(pos.Z / Chunk.CHUNK_SIZE);
+            double x = pos.X - (XP * Chunk.CHUNK_SIZE);
+            double y = pos.Y - (YP * Chunk.CHUNK_SIZE);
+            double z = pos.Z - (ZP * Chunk.CHUNK_SIZE);
+            while (true)
+            {
+                Chunk ch = GetChunk(new Location(XP, YP, ZP));
+                if (ch == null)
+                {
+                    return new Location(1, 1, 1);
+                }
+                while (z < Chunk.CHUNK_SIZE)
+                {
+                    if (ch.GetBlockAt((int)x, (int)y, (int)z).IsOpaque())
+                    {
+                        return new Location(0, 0, 0);
+                    }
+                    z++;
+                }
+                z = 0;
+            }
+        }
+
+        public Location GetAmbient(Location pos)
+        {
+            return TheClient.BaseAmbient;
+        }
+
+        public Location Regularize(Location col)
+        {
+            if (col.X < 1.0 && col.Y < 1.0 && col.Z < 1.0)
+            {
+                return col;
+            }
+            return col / Math.Max(col.X, Math.Max(col.Y, col.Z));
+        }
+
+        public Location GetLightAmount(Location pos, Location norm)
+        {
+            Location amb = GetAmbient(pos);
+            Location sky = GetSkyLight(pos, norm);
+            return Regularize(amb + sky);
+        }
     }
 }


Int wasn't being displayed inline, minor error

--- WPFSKillTree/SkillTreeFiles/SkillTree.cs
+++ WPFSKillTree/SkillTreeFiles/SkillTree.cs
@@ -597,7 +597,7 @@
             {
                 attribs["+# to Intelligence"][0] / IntPerMana + _level * ManaPerLevel
             };
-            retval["+#% increased maximum Energy Shield"] = new List<float> { attribs["+# to Intelligence"][0] / IntPerES };
+            retval["#% increased maximum Energy Shield"] = new List<float> { attribs["+# to Intelligence"][0] / IntPerES };

             retval["+# to maximum Life"] = new List<float>
             {


Do logging.

Do logging.

--- WalletWasabi/KeyManagement/KeyManager.cs
+++ WalletWasabi/KeyManagement/KeyManager.cs
@@ -686,6 +686,7 @@
 				if (toRemove.Any())
 				{
 					ToFileNoBlockchainStateLock();
+					Logger.LogInfo<KeyManager>($"Corrected {toRemove.Count} heights.");
 				}
 			}
 		}


Refactor: show more status when running performance tests

--- Watsonia.Data.TestPerformance/Program.cs
+++ Watsonia.Data.TestPerformance/Program.cs
@@ -46,7 +46,7 @@
 				{
 					Console.SetCursorPosition(0, Console.CursorTop);
 				}
-				Console.Write("{0}/{1}", i + 1, RunCount);
+				Console.Write($"Run {i + 1}/{Config.RunCount}, test 1/5");

 				GC.Collect();
 				GC.WaitForPendingFinalizers();
@@ -54,6 +54,9 @@
 				var adoTests = new AdoNetTests();
 				var adoResults = RunTests(i, TestFramework.AdoNet, adoTests);
 				testResults.Add(adoResults);
+
+				Console.SetCursorPosition(0, Console.CursorTop);
+				Console.Write($"Run {i + 1}/{Config.RunCount}, test 2/5");

 				GC.Collect();
 				GC.WaitForPendingFinalizers();
@@ -63,6 +66,9 @@
 				var dapperResults = RunTests(i, TestFramework.Dapper, dapperTests);
 				testResults.Add(dapperResults);

+				Console.SetCursorPosition(0, Console.CursorTop);
+				Console.Write($"Run {i + 1}/{Config.RunCount}, test 3/5");
+
 				GC.Collect();
 				GC.WaitForPendingFinalizers();

@@ -73,6 +79,9 @@

 				// TODO: Should we test an "optimised" EF? No change tracking etc?

+				Console.SetCursorPosition(0, Console.CursorTop);
+				Console.Write($"Run {i + 1}/{Config.RunCount}, test 4/5");
+
 				GC.Collect();
 				GC.WaitForPendingFinalizers();

@@ -81,6 +90,9 @@
 				var wlinqTests = new WatsoniaLinqTests();
 				var wlinqResults = RunTests(i, TestFramework.WatsoniaLinq, wlinqTests);
 				testResults.Add(wlinqResults);
+
+				Console.SetCursorPosition(0, Console.CursorTop);
+				Console.Write($"Run {i + 1}/{Config.RunCount}, test 5/5");

 				GC.Collect();
 				GC.WaitForPendingFinalizers();


fixed bug on guid comparation

fixed bug on guid comparation

--- Wlog.Library/BLL/DataBase/UnitOfMongo.cs
+++ Wlog.Library/BLL/DataBase/UnitOfMongo.cs
@@ -41,7 +41,7 @@
         {

             collection = GetCollection(entity);
-            if (entity.Id == null || entity.Id==(new Guid("{00000000-0000-0000-0000-000000000000}")))
+            if (entity.Id == null || (new Guid("{00000000-0000-0000-0000-000000000000}").CompareTo(entity.Id)==0))
             {
                 collection.InsertOne(entity);
             }


[Mac] Add implementation for TransformPoint(s) and TransformDistance(s)

TransformPoints has been tested by [knocte] (thanks, Andres!)
TransformDistance(s) needs compile-checking before committing to master

--- Xwt.Mac/Xwt.Mac/ContextBackendHandler.cs
+++ Xwt.Mac/Xwt.Mac/ContextBackendHandler.cs
@@ -30,6 +30,7 @@
 using MonoMac.AppKit;
 using Xwt.Drawing;
 using MonoMac.Foundation;
+using MonoMac.CoreGraphics;
 using System.Drawing;

 namespace Xwt.Mac
@@ -286,22 +287,56 @@

 		public void TransformPoint (object backend, ref double x, ref double y)
 		{
-			throw new NotImplementedException ();
+			GetContext (backend);
+			CGContext gp = NSGraphicsContext.CurrentContext.GraphicsPort;
+			CGAffineTransform t = gp.GetCTM();
+
+			PointF p = t.TransformPoint (new PointF ((float)x, (float)y));
+			x = p.X;
+			y = p.Y;
 		}

 		public void TransformDistance (object backend, ref double dx, ref double dy)
 		{
-			throw new NotImplementedException ();
+			GetContext (backend);
+			CGContext gp = NSGraphicsContext.CurrentContext.GraphicsPort;
+			CGAffineTransform t = gp.GetCTM();
+			// remove translational elements from CTM
+			t.x0 = 0;
+			t.y0 = 0;
+
+			PointF p = t.TransformPoint (new PointF ((float)dx, (float)dy));
+			dx = p.X;
+			dy = p.Y;
 		}

 		public void TransformPoints (object backend, Point[] points)
 		{
-			throw new NotImplementedException ();
+			GetContext (backend);
+			CGContext gp = NSGraphicsContext.CurrentContext.GraphicsPort;
+			CGAffineTransform t = gp.GetCTM();
+
+			PointF p;
+			for (int i = 0; i < points.Length; ++i) {
+				p = t.TransformPoint (new PointF ((float)points[i].X, (float)points[i].Y));
+				points[i].X = p.X;
+				points[i].Y = p.Y;
+			}
 		}

 		public void TransformDistances (object backend, Distance[] vectors)
 		{
-			throw new NotImplementedException ();
+			GetContext (backend);
+			CGContext gp = NSGraphicsContext.CurrentContext.GraphicsPort;
+			CGAffineTransform t = gp.GetCTM();
+			t.x0 = 0;
+			t.y0 = 0;
+			PointF p;
+			for (int i = 0; i < points.Length; ++i) {
+				p = t.TransformPoint (new PointF ((float)vectors[i].Dx, (float)vectors[i].Dy));
+				vectors[i].Dx = p.X;
+				vectors[i].Dy = p.Y;
+			}
 		}

 		public void Dispose (object backend)


MouseUp 時に再描画されるように修正

MouseUp 時に再描画されるように修正

--- ButtonPainter.cs
+++ ButtonPainter.cs
@@ -242,6 +242,7 @@
         protected virtual void OnMouseUp(MouseEventArgs e)
         {
             IsMouseDown = false;
+            View.Refresh();
         }

         #endregion


Added configuration of EventLogInstaller

--- HelloSvc/HelloSvc/Install/HelloServiceProcessInstaller.cs
+++ HelloSvc/HelloSvc/Install/HelloServiceProcessInstaller.cs
@@ -21,7 +21,14 @@
 				Installers
 					.OfType<EventLogInstaller>()
 					.FirstOrDefault();
-
+
+			if (eventLogInstaller == null)
+			{
+				eventLogInstaller = new EventLogInstaller();
+				Installers.Add(eventLogInstaller);
+			}
+
+			eventLogInstaller.UninstallAction = UninstallAction.Remove;
 			eventLogInstaller.Log = eventLogConfig.LogName;
 			eventLogInstaller.Source = eventLogConfig.SourceName;
 		}


Patch from Brandon Perry fixing warning that mono svn raises (BGO #561392)

2008-11-18  Gabriel Burt  <gabriel.burt@gmail.com>

	* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs:
	Patch from Brandon Perry fixing warning that mono svn raises (BGO #561392)

svn path=/trunk/banshee/; revision=4844

--- Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
+++ Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Interaction.cs
@@ -299,8 +299,7 @@
             }
         }

-        #pragma warning disable 0169
-        private bool GetEventCell<T> (int x, int y, out T icell, out Column column, out int row_index) where T : class
+        private bool GetEventCell<G> (int x, int y, out G icell, out Column column, out int row_index) where G : class
         {
             icell = null;
             column = null;
@@ -324,7 +323,7 @@
             }

             ColumnCell cell = column.GetCell (0);
-            icell = cell as T;
+            icell = cell as G;
             if (icell == null) {
                 return false;
             }
@@ -333,7 +332,6 @@
             cell.BindListItem (model[row_index]);
             return true;
         }
-        #pragma warning restore 0169

 #endregion


build fix

build fix

--- Kitbag.HackManchester/Kitbag.Database/PersonRepository.cs
+++ Kitbag.HackManchester/Kitbag.Database/PersonRepository.cs
@@ -9,7 +9,7 @@
     {
         public PersonRepository(CwonData dbContext) : base(dbContext) { }

-        public IEnumerable<Person> GetByGroup(int groupId) { return _dbContext.People.Where(x => x.Id == groupId).ToList(); }
+        //public IEnumerable<Person> GetByGroup(int groupId) { return _dbContext.People.Where(x => x == groupId).ToList(); }

         public Person GetByEmail(string email)
         {
@@ -17,8 +17,8 @@
         }
         public IList<Person> GetByGroup(int groupId)
         {
-
-            var people = base._dbContext.Groups.FirstOrDefault(x => x.Id == groupId).People1.ToList();
+
+            var people = base._dbContext.Groups.Include("People1").FirstOrDefault(x => x.Id == groupId).People1.ToList();

             return people;


Got rid of exception for generic type specifications.  Hopefully fixed it correctly.

--- src/ByrneLabs.Commons.MetadataDom/TypeProvider.cs
+++ src/ByrneLabs.Commons.MetadataDom/TypeProvider.cs
@@ -20,7 +20,7 @@

         public TypeBase GetByReferenceType(TypeBase elementType) => (TypeBase)_metadataState.GetCodeElement(elementType.GetType(), elementType, TypeElementModifiers.ByRef);

-        public TypeBase GetGenericInstantiation(TypeBase genericType, ImmutableArray<TypeBase> typeArguments) => typeArguments.All(typeArgument => typeArgument == null) ? genericType : (TypeBase)_metadataState.GetCodeElement(new CodeElementKey(genericType.GetType(), genericType, typeArguments));
+        public TypeBase GetGenericInstantiation(TypeBase genericType, ImmutableArray<TypeBase> typeArguments) => typeArguments.Any(typeArgument => typeArgument == null) ? genericType : (TypeBase)_metadataState.GetCodeElement(new CodeElementKey(genericType.GetType(), genericType, typeArguments));

         public TypeBase GetPointerType(TypeBase elementType) => (TypeBase)_metadataState.GetCodeElement(elementType.GetType(), elementType, TypeElementModifiers.Pointer);

@@ -48,13 +48,13 @@
             throw new NotImplementedException();
         }

-        public TypeBase GetTypeFromSpecification(MetadataReader reader, GenericContext genericContext, TypeSpecificationHandle handle, byte rawTypeKind) => _metadataState.GetCodeElement<TypeSpecification>(handle, genericContext);
+        public TypeBase GetTypeFromSpecification(MetadataReader reader, GenericContext genericContext, TypeSpecificationHandle handle, byte rawTypeKind) => rawTypeKind != 18 && rawTypeKind != 17 ? throw new ArgumentException() : _metadataState.GetCodeElement<TypeSpecification>(handle, genericContext);

         public TypeBase GetPrimitiveType(PrimitiveTypeCode typeCode) => _metadataState.GetCodeElement<PrimitiveType>(new CodeElementKey<PrimitiveType>(typeCode));

-        public TypeBase GetTypeFromDefinition(MetadataReader reader, TypeDefinitionHandle handle, byte rawTypeKind) => _metadataState.GetCodeElement<TypeDefinition>(handle);
+        public TypeBase GetTypeFromDefinition(MetadataReader reader, TypeDefinitionHandle handle, byte rawTypeKind) => rawTypeKind != 18 && rawTypeKind != 17 ? throw new ArgumentException() : _metadataState.GetCodeElement<TypeDefinition>(handle);

-        public TypeBase GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => _metadataState.GetCodeElement<TypeReference>(handle);
+        public TypeBase GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => rawTypeKind != 18 && rawTypeKind != 17 ? throw new ArgumentException() : _metadataState.GetCodeElement<TypeReference>(handle);

         public TypeBase GetSZArrayType(TypeBase elementType) => (TypeBase)_metadataState.GetCodeElement(elementType.GetType(), elementType, TypeElementModifiers.Array);
     }


fixing issue #264

fixing issue #264

--- src/CacheCow.Client.RedisCacheStore/RedisStore.cs
+++ src/CacheCow.Client.RedisCacheStore/RedisStore.cs
@@ -131,6 +131,12 @@
                 return null;

             byte[] value = await _database.StringGetAsync(entryKey).ConfigureAwait(false);
+
+            // possibility of a race condition, where the object expires between checking if it exists and retrieving it
+            // issue #264 - hard to write a test for it
+            if (value == null)
+                return null;
+
             var memoryStream = new MemoryStream(value);
             var r = await _serializer.DeserializeToResponseAsync(memoryStream).ConfigureAwait(false);


Linkify variant names on homepage

Linkify variant names on homepage

--- src/ChessVariantsTraining/Views/Home/Index.cshtml
+++ src/ChessVariantsTraining/Views/Home/Index.cshtml
@@ -1,7 +1,7 @@
 @section Title {Homepage}
 @section Description{Chess Variants Training is a website where you can improve at chess variants.}

Chess Variants Training

-
Welcome to Chess Variants Training! Here you can improve at chess variants. We support these variants: Antichess, Atomic chess, King of the Hill, Three-check, Horde chess and Racing Kings.

+
Welcome to Chess Variants Training! Here you can improve at chess variants. We support these variants: Antichess, Atomic chess, King of the Hill, Three-check, Horde chess and Racing Kings.

@Html.ActionLink("Puzzles", "Index", "Puzzle")

You can improve your tactics by doing tactics puzzles, created by the users of Chess Variants Training.

@Html.ActionLink("Timed training", "Index", "TimedTraining")


Update src/Compilers/Core/Portable/Syntax/SyntaxToken.cs

Co-authored-by: Fred Silberberg <31017a722665e4afce586950f42944a6d331dabf@silberberg.xyz>

--- src/Compilers/Core/Portable/Syntax/SyntaxToken.cs
+++ src/Compilers/Core/Portable/Syntax/SyntaxToken.cs
@@ -692,7 +692,7 @@
         /// occurs when a <see cref="SyntaxTree"/> is incrementally parsed using <see cref="SyntaxTree.WithChangedText"/>
         /// and the incremental parser is able to take the token from the original tree and use it in its entirety in the
         /// new tree.  In this case, the <see cref="SyntaxToken.ToFullString()"/> of each token will be the same, though
-        /// will have different parents, and may occur at different positions in the respective trees.  If two tokens are
+        /// they could have different parents, and may occur at different positions in the respective trees.  If two tokens are
         /// incrementally identical, all trivial of each node will be incrementally identical as well.
         /// </summary>
         /// <remarks>


Dap: refactoring (extract method)

Dap: refactoring (extract method)

Extract method to have two small methods
instead of a much larger one, increasing
readibility and levels of abstraction.

--- src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs
+++ src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs
@@ -217,39 +217,44 @@
                 sync.Dap.AddAllTracks (to_add);

                 if (library.SupportsPlaylists && sync.Dap.SupportsPlaylists) {
-                    // Now create the playlists, taking snapshots of smart playlists and saving them
-                    // as normal playlists
-                    IList<AbstractPlaylistSource> playlists = GetSyncPlaylists ();
-                    foreach (AbstractPlaylistSource from in playlists) {
-                        if (from.Count == 0) {
-                            continue;
-                        }
-                        var to = new SyncPlaylist (from.Name, sync.Dap, this);
-                        to.Save ();
-
-                        ServiceManager.DbConnection.Execute (
-                            String.Format (
-                                @"INSERT INTO CorePlaylistEntries (PlaylistID, TrackID)
-                                    SELECT ?, TrackID FROM CoreTracks WHERE PrimarySourceID = ? AND MetadataHash IN
-                                        (SELECT MetadataHash FROM {0} WHERE {1})",
-                                from.DatabaseTrackModel.ConditionFromFragment, from.DatabaseTrackModel.Condition),
-                            to.DbId, sync.Dap.DbId
-                        );
-                        to.UpdateCounts ();
-
-                        if (to.Count == 0) {
-                            // If it's empty, don't leave it on the device
-                            to.Unmap ();
-                        } else {
-                            sync.Dap.AddChildSource (to);
-                        }
-                    }
+                    SyncPlaylists ();
                 }

                 Hyena.Log.Debug ("Ending DAP sync");

                 CalculateSync ();
                 sync.OnUpdated ();
+            }
+        }
+
+        private void SyncPlaylists ()
+        {
+            // Now create the playlists, taking snapshots of smart playlists and saving them
+            // as normal playlists
+            IList<AbstractPlaylistSource> playlists = GetSyncPlaylists ();
+            foreach (AbstractPlaylistSource from in playlists) {
+                if (from.Count == 0) {
+                    continue;
+                }
+                var to = new SyncPlaylist (from.Name, sync.Dap, this);
+                to.Save ();
+
+                ServiceManager.DbConnection.Execute (
+                    String.Format (
+                        @"INSERT INTO CorePlaylistEntries (PlaylistID, TrackID)
+                            SELECT ?, TrackID FROM CoreTracks WHERE PrimarySourceID = ? AND MetadataHash IN
+                                (SELECT MetadataHash FROM {0} WHERE {1})",
+                        from.DatabaseTrackModel.ConditionFromFragment, from.DatabaseTrackModel.Condition),
+                    to.DbId, sync.Dap.DbId
+                );
+                to.UpdateCounts ();
+
+                if (to.Count == 0) {
+                    // If it's empty, don't leave it on the device
+                    to.Unmap ();
+                } else {
+                    sync.Dap.AddChildSource (to);
+                }
             }
         }


Clean the code a bit

Clean the code a bit

--- src/Dbus/OrgFreedesktopDbusObjectManager_Proxy.cs
+++ src/Dbus/OrgFreedesktopDbusObjectManager_Proxy.cs
@@ -33,9 +33,6 @@

         public object Target => target;

-        public void Encode(Encoder encoder)
-            => encoder.Add(0); // empty array
-
         public Task HandleMethodCallAsync(
             MethodCallOptions methodCallOptions,
             ReceivedMessage message,
@@ -62,9 +59,9 @@
         {
             message.AssertSignature("");
             var managedObjects = await target.GetManagedObjectsAsync(cancellationToken).ConfigureAwait(false);
-            var sendBody = new Encoder();
             if (!methodCallOptions.ShouldSendReply)
                 return;
+            var sendBody = new Encoder();
             sendBody.AddArray(() =>
             {
                 foreach (var managedObject in managedObjects)
@@ -73,11 +70,11 @@
                     sendBody.Add(managedObject.Key);
                     sendBody.AddArray(() =>
                     {
-                        foreach (var interfaceInstance in managedObject.Value)
+                        foreach (var proxy in managedObject.Value)
                         {
                             sendBody.StartCompoundValue();
-                            sendBody.Add(interfaceInstance.InterfaceName);
-                            interfaceInstance.EncodeProperties(sendBody);
+                            sendBody.Add(proxy.InterfaceName);
+                            proxy.EncodeProperties(sendBody);
                         }
                         sendBody.StartCompoundValue();
                         sendBody.Add("org.freedesktop.DBus.Properties");


Fixed DiscordShardedClient CurrentUser and RecipientRemoved

--- src/Discord.Net.WebSocket/DiscordShardedClient.cs
+++ src/Discord.Net.WebSocket/DiscordShardedClient.cs
@@ -65,7 +65,7 @@
                     var newConfig = config.Clone();
                     newConfig.ShardId = _shardIds[i];
                     _shards[i] = new DiscordSocketClient(newConfig, _connectionGroupLock, i != 0 ? _shards[0] : null);
-                    RegisterEvents(_shards[i]);
+                    RegisterEvents(_shards[i], i == 0);
                 }
             }
         }
@@ -87,7 +87,7 @@
                     newConfig.ShardId = _shardIds[i];
                     newConfig.TotalShards = _totalShards;
                     _shards[i] = new DiscordSocketClient(newConfig, _connectionGroupLock, i != 0 ? _shards[0] : null);
-                    RegisterEvents(_shards[i]);
+                    RegisterEvents(_shards[i], i == 0);
                 }
             }

@@ -256,7 +256,7 @@
                 await _shards[i].SetGameAsync(name, streamUrl, streamType).ConfigureAwait(false);
         }

-        private void RegisterEvents(DiscordSocketClient client)
+        private void RegisterEvents(DiscordSocketClient client, bool isPrimary)
         {
             client.Log += (msg) => _logEvent.InvokeAsync(msg);
             client.LoggedOut += () =>
@@ -269,6 +269,14 @@
                 }
                 return Task.Delay(0);
             };
+            if (isPrimary)
+            {
+                client.Ready += () =>
+                {
+                    CurrentUser = client.CurrentUser;
+                    return Task.Delay(0);
+                };
+            }

             client.ChannelCreated += (channel) => _channelCreatedEvent.InvokeAsync(channel);
             client.ChannelDestroyed += (channel) => _channelDestroyedEvent.InvokeAsync(channel);
@@ -302,7 +310,7 @@
             client.CurrentUserUpdated += (oldUser, newUser) => _selfUpdatedEvent.InvokeAsync(oldUser, newUser);
             client.UserIsTyping += (oldUser, newUser) => _userIsTypingEvent.InvokeAsync(oldUser, newUser);
             client.RecipientAdded += (user) => _recipientAddedEvent.InvokeAsync(user);
-            client.RecipientAdded += (user) => _recipientRemovedEvent.InvokeAsync(user);
+            client.RecipientRemoved += (user) => _recipientRemovedEvent.InvokeAsync(user);
         }

         //IDiscordClient


Fixed ImportRaw bug

Fixed ImportRaw bug

--- src/FindSmiley.API/Models/Import/ImportService.cs
+++ src/FindSmiley.API/Models/Import/ImportService.cs
@@ -34,7 +34,7 @@

         public void ImportDate(DateTime date)
         {
-            ImportRaw(string.Format("http://www.findsmiley.dk/da-DK/Searching/TableSearch.htm?searchstring=%25&vtype=detail&searchtype=all&mode=adv&display=table&branche=0&region=0&Kaede=0&dato1={0}&dato2={0}&pagesz=1000&sort=0&SearchExact=false&mapNElng=&mapNElat=&mapSWlng=&mapSWlat=", date.ToString("dd-MM-yyyy")));
+            Import(string.Format("http://www.findsmiley.dk/da-DK/Searching/TableSearch.htm?searchstring=%25&vtype=detail&searchtype=all&mode=adv&display=table&branche=0&region=0&Kaede=0&dato1={0}&dato2={0}&pagesz=1000&sort=0&SearchExact=false&mapNElng=&mapNElat=&mapSWlng=&mapSWlat=", date.ToString("dd-MM-yyyy")));
         }

         public string HttpGet(string url)
@@ -84,10 +84,8 @@

                 foreach (var kontrolrapportData in doc.FindKontrolrapporter())
                 {
-                    var kontrolrapport = context.Kontrolrapporter
-                        .Where(o => o.VirksomhedId == kontrolrapportData.VirksomhedId)
-                        .Where(o => o.Kontroldato == kontrolrapportData.Kontroldato)
-                        .FirstOrDefault();
+                    var kontrolrapport = context.Kontrolrapporter.
+                        FirstOrDefault(o => o.VirksomhedId == kontrolrapportData.VirksomhedId && o.Kontroldato == kontrolrapportData.Kontroldato);

                     if (kontrolrapport == null)
                     {


Improve object?.ShouldBe(object?) catch-all assertion by having it throw MatchException.

--- src/Fixie.Tests/Assertions/AssertionExtensions.cs
+++ src/Fixie.Tests/Assertions/AssertionExtensions.cs
@@ -5,7 +5,6 @@
     using System.Linq;
     using System.Text.Json;
     using System.Text.Json.Serialization;
-    using static System.Environment;

     public static class AssertionExtensions
     {
@@ -50,7 +49,7 @@
         public static void ShouldBe(this object? actual, object? expected)
         {
             if (!Equals(actual, expected))
-                throw new AssertException(expected, actual);
+                throw new MatchException(expected?.ToString(), actual?.ToString());
         }

         public static void ShouldBe<T>(this IEnumerable<T> actual, params T[] expected)


assert not null in StringExtension.cs

assert not null in StringExtension.cs

--- src/GeekyTool.Core/Extensions/StringExtensions.cs
+++ src/GeekyTool.Core/Extensions/StringExtensions.cs
@@ -8,6 +8,9 @@
     {
         public static string Clean(this string originalString)
         {
+            if (originalString == null)
+                return string.Empty;
+
             var removeCharSet = new HashSet<char>("?&^$#@!()+-,:;<>’\'\\/-_*\"".ToCharArray());
             var sb = new StringBuilder(originalString.Length);


Made Unload private since we do not call it directly.

--- src/Main/Hadouken.Sandbox/SandboxedEnvironment.cs
+++ src/Main/Hadouken.Sandbox/SandboxedEnvironment.cs
@@ -47,7 +47,7 @@
             _plugin.Load();
         }

-        public void Unload()
+        private void Unload()
         {
             _plugin.Unload();
         }


Small position fix - #11

Small position fix - #11

--- src/MindstormR.Client.Web/Views/Home/Index.cshtml
+++ src/MindstormR.Client.Web/Views/Home/Index.cshtml
@@ -20,6 +20,7 @@

+