Updated the source downloader to get zing from github.

--- Bld/PlangBuild/PlangBuild/SourceDownloader.cs
+++ Bld/PlangBuild/PlangBuild/SourceDownloader.cs
@@ -37,7 +37,7 @@

         private static readonly Tuple<string, string, string, string>[] Versions = new Tuple<string, string, string, string>[]
         {
-            new Tuple<string, string, string, string>("zing", "ea61714c044f008dd27af28aae905ecb6c379680", "..\\..\\..\\..\\..\\Ext\\Zing\\Zing_.zip", "..\\..\\..\\..\\..\\Ext\\Zing\\Zing_\\"),
+            new Tuple<string, string, string, string>("zing", "https://github.com/ZingModelChecker/Zing/archive/master.zip", "..\\..\\..\\..\\..\\Ext\\Zing\\Zing_.zip", "..\\..\\..\\..\\..\\Ext\\Zing\\Zing-master\\"),
             new Tuple<string, string, string, string>("formula", "fae5147888eab4c520839e1a5f89ece364a6eb63", "..\\..\\..\\..\\..\\Ext\\Formula\\Formula_.zip", "..\\..\\..\\..\\..\\Ext\\Formula\\Formula_\\"),
         };

@@ -168,21 +168,38 @@
                 {
                     outputDir.Delete(true);
                 }
-
                 // Create a New HttpClient object.
                 Program.WriteInfo("Downloading dependency {0} to {1}...", projVersion.Item1, outputFile.FullName);
                 HttpClient client = new HttpClient();
-                client.DefaultRequestHeaders.Referrer = new Uri(string.Format(ReferrerString, projVersion.Item1));
-                using (var strm = client.GetStreamAsync(string.Format(DownloadString, projVersion.Item1, projVersion.Item2)).Result)
-                {
-                    using (var sw = new System.IO.StreamWriter(outputFile.FullName))
-                    {
-                        strm.CopyTo(sw.BaseStream);
-                    }
-                }
-
-                Program.WriteInfo("Extracting dependency {0} to {1}...", projVersion.Item1, outputDir.FullName);
-                ZipFile.ExtractToDirectory(outputFile.FullName, outputDir.FullName);
+                client.DefaultRequestHeaders.Referrer = new Uri(projVersion.Item2);
+
+                if (dep == DependencyKind.ZING)
+                {
+
+                    using (var strm = client.GetStreamAsync(projVersion.Item2).Result)
+                    {
+                        using (var sw = new System.IO.StreamWriter(outputFile.FullName))
+                        {
+                            strm.CopyTo(sw.BaseStream);
+                        }
+                    }
+
+                    Program.WriteInfo("Extracting dependency {0} to {1}...", projVersion.Item1, outputDir.FullName);
+                    ZipFile.ExtractToDirectory(outputFile.FullName, outputDir.FullName + "..\\");
+                }
+                else
+                {
+                    using (var strm = client.GetStreamAsync(string.Format(DownloadString, projVersion.Item1, projVersion.Item2)).Result)
+                    {
+                        using (var sw = new System.IO.StreamWriter(outputFile.FullName))
+                        {
+                            strm.CopyTo(sw.BaseStream);
+                        }
+                    }
+
+                    Program.WriteInfo("Extracting dependency {0} to {1}...", projVersion.Item1, outputDir.FullName);
+                    ZipFile.ExtractToDirectory(outputFile.FullName, outputDir.FullName);
+                }
             }
             catch (Exception e)
             {


minifix til HideNSteal

minifix til HideNSteal

--- BurglarsVsGuards/Assets/Scripts/HideNSteal.cs
+++ BurglarsVsGuards/Assets/Scripts/HideNSteal.cs
@@ -385,7 +385,7 @@
             return;

         // close enough?
-        if (Vector2.Distance(transform.position, currentProp.transform.position) < 2)
+        if (Vector2.Distance(transform.position, currentProp.transform.position) < (currentProp.transform.localScale.x+currentProp.transform.localScale.y)/2)
         {
             //ActionButton.transform.renderer.enabled = true;
             // start hiding


Fixes tests

Fixes tests

--- CallMeMaybe.UnitTests/MaybeExtensionsTests.cs
+++ CallMeMaybe.UnitTests/MaybeExtensionsTests.cs
@@ -18,8 +18,7 @@
                     from v in dict.GetMaybe(k)
                     select new {k, v})
                     .ToList();
-            //values2.Count.Should().Be(2);
-            values2.Count.Should().Be(1);
+            values2.Count.Should().Be(2);
             values2[0].v.Should().Be(1);
             values2[0].k.Should().Be("1");
             values2[1].v.Should().Be(2);


New clientlib ver

New clientlib ver

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

 		KalturaAccessControlProfileService _AccessControlProfileService;


New clientlib ver

New clientlib ver

--- KalturaClient/KalturaClient.cs
+++ KalturaClient/KalturaClient.cs
@@ -34,7 +34,7 @@
 		public KalturaClient(KalturaConfiguration config) : base(config)
 		{
 				ApiVersion = "3.3.0";
-				ClientTag = "dotnet:15-09-14";
+				ClientTag = "dotnet:15-09-15";
 		}

 		KalturaAccessControlProfileService _AccessControlProfileService;


New clientlib ver

New clientlib ver

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

 		KalturaAccessControlProfileService _AccessControlProfileService;


Updated simple sample

Updated simple sample

--- examples/PubSubWithSubjects/Program.cs
+++ examples/PubSubWithSubjects/Program.cs
@@ -17,27 +17,28 @@
         static void Main(string[] args)
         {
             var redis = ConnectionMultiplexer.Connect("localhost");
+
+            // Create a subject, the same way standard one would be created.
+            // Provided name should be unique for single subject (publisher)
+            // but can be used by multiple observables.
             var sbj = new RedisSubject<long>("s1", redis);

+            // Subcribe an observable to a subject, this
+            // could be done from different process.
             var obs = RedisObservable.Create<long>("s1", redis);

-            obs.Subscribe(x =>
-            {
-                Console.WriteLine(x);
-            },
-            exn =>
-            {
-                Console.WriteLine(exn.Message);
-            },
-            () =>
-            {
-                Console.WriteLine("Done");
-            });
+            // RedisObservable implements IObservable<T> and therefore
+            // can be used with Reactive Extensions methods like
+            // .Where operator
+            obs.Where(x => x % 2 == 0)
+               .Subscribe(Console.WriteLine,
+                    exn => Console.WriteLine("Error: " + exn.Message),
+                    () => Console.WriteLine("Done"));

+            sbj.OnNext(4);
             sbj.OnNext(5);
             sbj.OnNext(6);
             sbj.OnNext(7);
-
             sbj.OnNext(8);
             sbj.OnNext(9);
             sbj.OnCompleted();


Unpause fix

Unpause fix

--- LanguageExt.Process/Prelude.cs
+++ LanguageExt.Process/Prelude.cs
@@ -297,7 +297,7 @@
         /// </summary>
         /// <param name="pid">Process to un-pause</param>
         public static Unit unpause(ProcessId pid) =>
-            ActorContext.TellSystem(pid, SystemMessage.Pause);
+            ActorContext.TellSystem(pid, SystemMessage.Unpause);

         /// <summary>
         /// Return True if the message sent is a Tell and not an Ask


Fixed up bad English in LoadLibraryExFlags enum from the Win32 API

--- Code/Foundation/Windows/LoadLibraryExFlags.cs
+++ Code/Foundation/Windows/LoadLibraryExFlags.cs
@@ -23,7 +23,7 @@
         /// If you are planning to access only data or resources in the DLL,
         /// use <see cref="LoadLibraryAsDatafileExclusive"/> or <see cref="LoadLibraryAsImageResource"/> or both.
         /// Otherwise, load the library as a DLL or executable module using the LoadLibrary function.</remarks>
-        DontResolveDllReferences = 0x00000001,
+        DoNotResolveDllReferences = 0x00000001,

         /// <summary>
         /// If this value is used, the system does not check AppLocker rules or apply Software Restriction Policies for the DLL


Small cleanup

Small cleanup

--- Nodejs/Product/Analysis/JavaScript/StringInternPool.cs
+++ Nodejs/Product/Analysis/JavaScript/StringInternPool.cs
@@ -63,7 +63,7 @@
         /// Interns a string.
         /// Returns the reused string if the string is already in the cache, otherwise adds the string to the cache.
         /// </summary>
-        internal string Intern(string str) {
+        internal  string Intern(string str) {
             if (string.IsNullOrEmpty(str)) {
                 return string.Empty;
             }
@@ -86,7 +86,7 @@
             // Add new value to head of list
             var newNode = new LinkedListNode<string>(str);
             _list.AddFirst(newNode);
-            _dict[str] = newNode;
+            _dict[newNode.Value] = newNode;
             return newNode.Value;
         }
     }


Added basic memory reference detection - doesn't handle branches/etc (but IDA doesn't seem to either). For now it's fine.

--- Noxa.Emulation.Psp.Player/Debugger/Model/MethodBody.cs
+++ Noxa.Emulation.Psp.Player/Debugger/Model/MethodBody.cs
@@ -55,6 +55,8 @@
 			List<Label> labels = new List<Label>();
 			List<CodeReference> codeRefs = new List<CodeReference>();
 			List<MemoryReference> memRefs = new List<MemoryReference>();
+			uint[] currentRegisters = new uint[ 32 ];
+			uint validRegisters = 0;
 			foreach( Instruction instruction in instructions )
 			{
 				if( instruction.IsBranch == true )
@@ -70,6 +72,9 @@
 					}
 					if( target > 0 )
 						this.AddLabelReference( labels, instruction, target );
+
+					// TODO: allow some to fall through the branch?
+					validRegisters = 0;
 				}
 				else if( instruction.IsJump == true )
 				{
@@ -86,12 +91,27 @@
 						this.AddLabelReference( labels, instruction, target );
 					else
 						this.AddCodeReference( codeRefs, instruction, target );
+					validRegisters = 0;
 				}
 				else if( instruction.IsLoad == true )
 				{
+					int reg1 = instruction.Operands[ 1 ].Register.Ordinal;
+					if( ( validRegisters & ( 1 << reg1 ) ) > 0 )
+					{
+						uint target = currentRegisters[ reg1 ];
+						target = ( uint )( ( int )target + instruction.Operands[ 1 ].Immediate );
+						this.AddMemoryReference( memRefs, instruction, target, true );
+					}
 				}
 				else if( instruction.IsStore == true )
 				{
+					int reg1 = instruction.Operands[ 1 ].Register.Ordinal;
+					if( ( validRegisters & ( 1 << reg1 ) ) > 0 )
+					{
+						uint target = currentRegisters[ reg1 ];
+						target = ( uint )( ( int )target + instruction.Operands[ 1 ].Immediate );
+						this.AddMemoryReference( memRefs, instruction, target, false );
+					}
 				}
 				if( ( foundSpMod == false ) && ( instruction.Opcode.InstructionEntry.Name == "addiu" ) )
 				{
@@ -99,9 +119,65 @@
 					int adjustment = instruction.Operands[ 2 ].Immediate / 4;
 					this.LocalsSize = -adjustment;
 				}
+				else
+				{
+					uint flags = instruction.Opcode.InstructionEntry.Flags;
+					if( instruction.Opcode.InstructionEntry.Name == "lui" )
+					{
+						int reg = instruction.Operands[ 0 ].Register.Ordinal;
+						validRegisters |= ( uint )( 1 << reg );
+						currentRegisters[ reg ] = ( uint )instruction.Operands[ 1 ].Immediate << 16;
+					}
+					else if( ( flags & InstructionTables.OUT_RT ) > 0 )
+					{
+						if( instruction.Opcode.InstructionEntry.Name == "addiu" )
+						{
+							int reg1 = instruction.Operands[ 1 ].Register.Ordinal;
+							if( ( validRegisters & ( 1 << reg1 ) ) > 0 )
+							{
+								int reg2 = instruction.Operands[ 0 ].Register.Ordinal;
+								validRegisters |= ( uint )( 1 << reg2 );
+								currentRegisters[ reg2 ] = ( uint )( ( int )currentRegisters[ reg1 ] + instruction.Operands[ 2 ].Immediate );
+							}
+						}
+						else if( instruction.Opcode.InstructionEntry.Name == "ori" )
+						{
+							int reg1 = instruction.Operands[ 1 ].Register.Ordinal;
+							if( ( validRegisters & ( 1 << reg1 ) ) > 0 )
+							{
+								int reg2 = instruction.Operands[ 0 ].Register.Ordinal;
+								validRegisters |= ( uint )( 1 << reg2 );
+								currentRegisters[ reg2 ] = currentRegisters[ reg1 ] | ( uint )instruction.Operands[ 2 ].Immediate;
+							}
+						}
+						else
+						{
+							// Changed - no longer valid
+							int reg = instruction.Operands[ 0 ].Register.Ordinal;
+							validRegisters &= ~( uint )( 1 << reg );
+						}
+					}
+				}
+
+				//lui $n, NNN
+				//addiu $n, $n, NNN
+
+				//lui $n, NNN
+				//ori $n, $n, NNN
+
+				//lui $n, NNN
+				//l* $m, NNN($n)
+
+				//lui $n, NNN
+				//s* $m, NNN($n)
 			}

 			// Sort all
+			this.SortAndSet( labels, codeRefs, memRefs );
+		}
+
+		private void SortAndSet( List<Label> labels, List<CodeReference> codeRefs, List<MemoryReference> memRefs )
+		{
 			labels.Sort( delegate( Label a, Label b )
 			{
 				return a.Address.CompareTo( b.Address );
@@ -157,6 +233,7 @@

 		private void AddMemoryReference( List<MemoryReference> memRefs, Instruction instruction, uint target, bool isRead )
 		{
+			//Debug.WriteLine( string.Format( "adding memory reference at {0:X8} ({1}) to {2:X8} for {3}", instruction.Address, instruction, target, isRead ? "read" : "write" ) );
 			foreach( MemoryReference memRef in memRefs )
 			{
 				if( memRef.Address == target )


BulletSim: Make BSPrimLinkable 'incomplete' if any of its children are waiting for assets to load.

--- OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
+++ OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
@@ -58,7 +58,29 @@
     {
         get
         {
-            return base.IsIncomplete || Linkset.RebuildScheduled ;
+            // A linkset is incomplete when base objects are incomplete, waiting for assets,
+            //     or being rebuilt.
+            bool ret = false;
+            if (base.IsIncomplete || Linkset.RebuildScheduled)
+            {
+                ret = true;
+            }
+            else
+            {
+                if (Linkset.IsRoot(this))
+                {
+                    Linkset.ForEachMember((member) =>
+                    {
+                        if (member.PrimAssetState == PrimAssetCondition.Waiting)
+                        {
+                            ret = true;
+                            return true;
+                        }
+                        return false;
+                    });
+                }
+            }
+            return ret;
         }
     }


Revert "Implement ability for hg logins to try fallback regions just like local logins."

This approach does not work - it is taking place too far down the login process where really the region checking
could only be done when the hg map tiles are linked on the main map (messy and probably impossible) or possibly
when the final destination is fetched at the very first stage of teleport (which couldn't be done without a protocol
change to pass the agentID as well as the requested regionID)

This reverts commit 3d9b73c47a15cf00150ac80570fea88de8cecbdf.

--- OpenSim/Services/HypergridService/GatekeeperService.cs
+++ OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -326,7 +326,7 @@
                 return false;
             }

-            m_log.DebugFormat("[GATEKEEPER SERVICE]: User {0} is ok", aCircuit.Name);
+            m_log.DebugFormat("[GATEKEEPER SERVICE]: User is OK");

             bool isFirstLogin = false;
             //
@@ -345,7 +345,7 @@
                         aCircuit.firstname, aCircuit.lastname);
                     return false;
                 }
-                m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence {0} is ok", aCircuit.Name);
+                m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok");

                 // Also login foreigners with GridUser service
                 if (m_GridUserService != null && account == null)
@@ -376,8 +376,7 @@
                 reason = "Destination region not found";
                 return false;
             }
-            m_log.DebugFormat(
-                "[GATEKEEPER SERVICE]: Destination {0} is ok for {1}", destination.RegionName, aCircuit.Name);
+            m_log.DebugFormat("[GATEKEEPER SERVICE]: destination ok: {0}", destination.RegionName);

             //
             // Adjust the visible name
@@ -411,41 +410,8 @@
             // Preserve our TeleportFlags we have gathered so-far
             loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags;

-            m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0} {1}", aCircuit.Name, loginFlag);
-
-            bool success = m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
-
-            if (!success)
-            {
-                List<GridRegion> fallbackRegions = m_GridService.GetFallbackRegions(account.ScopeID, destination.RegionLocX, destination.RegionLocY);
-                if (fallbackRegions != null)
-                {
-                    // Try the fallback regions
-                    m_log.DebugFormat(
-                        "[GATEKEEPER SERVICE]: Could not successfully log agent {0} into {1}.  Trying fallback regions.",
-                        aCircuit.Name, destination.RegionName);
-
-                    foreach (GridRegion fallbackRegion in fallbackRegions)
-                    {
-                        m_log.DebugFormat(
-                            "[GATEKEEPER SERVICE]: Trying fallback region {0} for {1}",
-                            fallbackRegion.RegionName, aCircuit.Name);
-
-                        success = m_SimulationService.CreateAgent(fallbackRegion, aCircuit, (uint)loginFlag, out reason);
-
-                        if (success)
-                            break;
-                    }
-                }
-                else
-                {
-                    m_log.DebugFormat(
-                        "[GATEKEEPER SERVICE]: Could not successfully log agent {0} into {1} and no fallback regions to try.",
-                        aCircuit.Name, destination.RegionName);
-                }
-            }
-
-            return success;
+            m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag);
+            return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
         }

         protected bool Authenticate(AgentCircuitData aCircuit)


Change base url for token endpoints

Change base url for token endpoints

--- Contentful.Core/ContentfulManagementClient.cs
+++ Contentful.Core/ContentfulManagementClient.cs
@@ -22,6 +22,7 @@
     /// </summary>
     public class ContentfulManagementClient : ContentfulClientBase, IContentfulManagementClient
     {
+        private readonly string _directApiUrl = "https://api.contentful.com/";
         private readonly string _baseUrl = "https://api.contentful.com/spaces/";
         private readonly string _baseUploadUrl = "https://upload.contentful.com/spaces/";

@@ -1883,7 +1884,7 @@
         /// <exception cref="ContentfulException">There was an error when communicating with the Contentful API.</exception>
         public async Task<ManagementToken> CreateManagementTokenAsync(ManagementToken token, CancellationToken cancellationToken = default(CancellationToken))
         {
-            var res = await PostAsync($"{_baseUrl}users/me/access_tokens",
+            var res = await PostAsync($"{_directApiUrl}users/me/access_tokens",
                 ConvertObjectToJsonStringContent(new
                 {
                     name = token.Name,
@@ -1906,7 +1907,7 @@
         /// <exception cref="ContentfulException">There was an error when communicating with the Contentful API.</exception>
         public async Task<ContentfulCollection<ManagementToken>> GetAllManagementTokensAsync(CancellationToken cancellationToken = default(CancellationToken))
         {
-            var res = await GetAsync($"{_baseUrl}users/me/access_tokens", cancellationToken).ConfigureAwait(false);
+            var res = await GetAsync($"{_directApiUrl}users/me/access_tokens", cancellationToken).ConfigureAwait(false);

             await EnsureSuccessfulResultAsync(res).ConfigureAwait(false);

@@ -1933,7 +1934,7 @@
                 throw new ArgumentException("The id of the token must be set", nameof(managementTokenId));
             }

-            var res = await GetAsync($"{_baseUrl}users/me/access_tokens/{managementTokenId}", cancellationToken).ConfigureAwait(false);
+            var res = await GetAsync($"{_directApiUrl}users/me/access_tokens/{managementTokenId}", cancellationToken).ConfigureAwait(false);

             await EnsureSuccessfulResultAsync(res).ConfigureAwait(false);

@@ -1957,7 +1958,7 @@
                 throw new ArgumentException("The id of the token must be set", nameof(managementTokenId));
             }

-            var res = await PutAsync($"{_baseUrl}users/me/access_tokens/{managementTokenId}", null, cancellationToken).ConfigureAwait(false);
+            var res = await PutAsync($"{_directApiUrl}users/me/access_tokens/{managementTokenId}", null, cancellationToken).ConfigureAwait(false);

             await EnsureSuccessfulResultAsync(res).ConfigureAwait(false);


fixed pointer path

fixed pointer path

--- OtherPlugins/MemoryReader/Listen/OSUListenerManager.cs
+++ OtherPlugins/MemoryReader/Listen/OSUListenerManager.cs
@@ -206,7 +206,7 @@
             Beatmap beatmapinfo = new Beatmap();
             try
             {
-                beatmapinfo.BeatmapID = m_memory_finder.GetMemoryInt(new List<Int32>() { -0x320, 0x6d4, 0x338, 0x218, 0x40, 0x778, 0xc0 });
+                beatmapinfo.BeatmapID = m_memory_finder.GetMemoryInt(new List<Int32>() { -0x320, 0x110, 0x248, 0x620, 0x6b4, 0x744, 0xc0 });
             }
             catch (ThreadStackNoFoundException e)
             {
@@ -221,7 +221,7 @@
             BeatmapSet beatmapsetset = new BeatmapSet();
             try
             {
-                beatmapsetset.BeatmapSetID = m_memory_finder.GetMemoryInt(new List<Int32>() { -0x320, 0x6d4, 0x338, 0x218, 0x40, 0x778 , 0xc4});
+                beatmapsetset.BeatmapSetID = m_memory_finder.GetMemoryInt(new List<Int32>() { -0x320, 0x110, 0x248, 0x620, 0x6b4, 0x744 , 0xc4});
             }
             catch (ThreadStackNoFoundException e)
             {


Fixes NRE issues found by Covertity in ObjectDatabase.cs

--- LibGit2Sharp/ObjectDatabase.cs
+++ LibGit2Sharp/ObjectDatabase.cs
@@ -365,7 +365,9 @@

             ObjectId commitId = Proxy.git_commit_create(repo.Handle, null, author, committer, message, tree, parentIds);

-            return repo.Lookup<Commit>(commitId);
+            Commit commit = repo.Lookup<Commit>(commitId);
+            Ensure.GitObjectIsNotNull(commit, commitId.Sha);
+            return commit;
         }

         /// <summary>
@@ -454,6 +456,8 @@
         /// <returns>A short string representation of the <see cref="ObjectId"/>.</returns>
         public virtual string ShortenObjectId(GitObject gitObject, int minLength)
         {
+            Ensure.ArgumentNotNull(gitObject, "gitObject");
+
             if (minLength <= 0 || minLength > ObjectId.HexSize)
             {
                 throw new ArgumentOutOfRangeException("minLength", minLength,
@@ -461,6 +465,11 @@
             }

             string shortSha = Proxy.git_object_short_id(repo.Handle, gitObject.Id);
+
+            if (shortSha == null)
+            {
+                throw new LibGit2SharpException("Unable to abbreviate SHA-1 value for GitObject " + gitObject.Id);
+            }

             if (minLength <= shortSha.Length)
             {


BGEE extra folders support added

BGEE extra folders support added

--- Core/Services/InfinityFictionConfigService.cs
+++ Core/Services/InfinityFictionConfigService.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using System.IO;
 using System.Linq;

@@ -27,6 +28,7 @@
         private readonly List<ResourceFile> _resourceFiles;
         private readonly List<string> _biffDirs;

+        private string _bgeeHomePath;
         private string _rootPath;
         private string _keyFilePath;
         private string _dialogFilePath;
@@ -40,6 +42,10 @@
             _resourceFiles = new List<ResourceFile>();
             _biffDirs = new List<string>();
             _games = new GameConfig[16];
+
+            string homePath = Environment.ExpandEnvironmentVariables("%HOMEDRIVE%%HOMEPATH%");
+            _bgeeHomePath = Path.Combine(homePath, @"Documents\Baldur's Gate - Enhanced Edition");
+
             BuildGames();
         }

@@ -192,7 +198,17 @@

             foreach (var extraDir in currentExtraDirs)
             {
-                string fullPath = Path.Combine(_rootPath, extraDir);
+                string fullPath;
+                if (extraDir.StartsWith("$HOME$"))
+                {
+                    string extraDriveHome = extraDir.Replace("$HOME$", string.Empty);
+                    fullPath = Path.Combine(_bgeeHomePath, extraDriveHome);
+                }
+                else
+                {
+                    fullPath = Path.Combine(_rootPath, extraDir);
+                }
+
                 if (Directory.Exists(fullPath))
                 {
                     _extraDirs.Add(fullPath);


Fix circle-box collision resolution

Fix circle-box collision resolution

--- Core/Simulation/Physics/Core/CollisionPair.cs
+++ Core/Simulation/Physics/Core/CollisionPair.cs
@@ -570,8 +570,14 @@
             yAbs = PenetrationY < 0 ? -PenetrationY : PenetrationY;
             if (xAbs <= circle.Radius && yAbs <= circle.Radius)
             {
-
-            } else
+                if (xAbs > yAbs)
+                {
+                    PenetrationX = 0;//FixedMath.Mul (PenetrationX, FixedMath.One * 1 / 4);
+                } else
+                {
+
+                    PenetrationY = 0;//FixedMath.Mul (PenetrationX, FixedMath.One * 1 / 4);
+                }            } else
             {
                 if (xAbs > yAbs)
                 {


Fixing exit middleware

Fixing exit middleware

--- DFWin/DFWin.Core/Middleware/ExitMiddleware.cs
+++ DFWin/DFWin.Core/Middleware/ExitMiddleware.cs
@@ -8,14 +8,9 @@
     {
         public GameState Update(GameState previousState, Func<GameState, GameState> next)
         {
-            return next(UpdateWithExit(previousState));
-        }
-
-        private static GameState UpdateWithExit(GameState previousState)
-        {
-            return previousState.GameInput.UserInput.KeyboardInput.KeyboardState.IsKeyDown(Keys.Escape) ?
-                new GameState(previousState.ScreenState, previousState.GameInput, previousState.FrameRate, true) :
-                previousState;
+            return previousState.GameInput.UserInput.KeyboardInput.KeyboardState.IsKeyDown(Keys.Escape)
+                ? new GameState(previousState.ScreenState, previousState.GameInput, previousState.FrameRate, true)
+                : next(previousState);
         }
     }
 }


switch cors to be after mvc

switch cors to be after mvc

--- DebateAppDomain/DebateAppDomainAPI/Startup.cs
+++ DebateAppDomain/DebateAppDomainAPI/Startup.cs
@@ -35,10 +35,11 @@
                 app.UseDeveloperExceptionPage();
             }

-            app.UseMvc();
+
             app.UseCors(builder =>
                 builder.WithOrigins("http://localhost:8000")
            .AllowAnyHeader().WithOrigins("http://localhost/Mansion"));
+            app.UseMvc();
         }
     }
 }


Ignore default route on "/team/details/1".

--- TeamBuilder/Clients/TeamBuilder.Clients.Web/Config/RouteConfig.cs
+++ TeamBuilder/Clients/TeamBuilder.Clients.Web/Config/RouteConfig.cs
@@ -8,7 +8,7 @@
         public static void RegisterRoutes(RouteCollection routes)
         {
             routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
-
+            routes.IgnoreRoute("Team/Details");

             routes.MapMvcAttributeRoutes();
             routes.MapRoute(


Rename status

Rename status

Rename status

--- DevelopmentInProgress.DipState/StateStatus.cs
+++ DevelopmentInProgress.DipState/StateStatus.cs
@@ -8,12 +8,12 @@
         /// <summary>
         /// Indicates the state has not been entered.
         /// </summary>
-        Uninitialised = 1,
+        Uninitialise = 1,

         /// <summary>
         /// Indicates the state has been entered and is active.
         /// </summary>
-        Initialised = 2,
+        Initialise = 2,

         /// <summary>
         /// Indicates the state is active and in progress.
@@ -23,11 +23,11 @@
         /// <summary>
         /// Indiactes the state has been successfully completed.
         /// </summary>
-        Completed = 4,
+        Complete = 4,

         /// <summary>
         /// Indiactes the state has failed.
         /// </summary>
-        Failed = 5
+        Fail = 5
     }
 }


Update Driver_Remote_WithOptions test

Update Driver_Remote_WithOptions test

--- src/Atata.Configuration.Json.Tests/DriverTests.cs
+++ src/Atata.Configuration.Json.Tests/DriverTests.cs
@@ -286,9 +286,19 @@

             var chromeCapabilities = (Dictionary<string, object>)capabilities.GetCapability(ChromeOptions.Capability);

-            chromeCapabilities["cap1"].Should().Be(true);
-            chromeCapabilities["cap2"].Should().Be(5);
-            chromeCapabilities["cap3"].Should().Be("str");
+            chromeCapabilities.Should().Equal(new Dictionary<string, object>
+            {
+                ["detach"] = true,
+                ["cap1"] = true,
+                ["cap2"] = 5,
+                ["cap3"] = "str"
+            });
+
+            //chromeCapabilities.Should().HaveCount(4);
+            //chromeCapabilities["detach"].Should().Be(true);
+            //chromeCapabilities["cap1"].Should().Be(true);
+            //chromeCapabilities["cap2"].Should().Be(5);
+            //chromeCapabilities["cap3"].Should().Be("str");
         }

         [Test]


Updated SmtpClient to use the new MailboxAddress.GetAddress(bool idnEncode) API

--- MailKit/Net/Smtp/SmtpClient.cs
+++ MailKit/Net/Smtp/SmtpClient.cs
@@ -1692,24 +1692,16 @@
 			get; set;
 		}

-		static string GetAddrspec (MailboxAddress mailbox, bool utf8)
-		{
-			if (utf8)
-				return MailboxAddress.DecodeAddrspec (mailbox.Address);
-
-			return MailboxAddress.EncodeAddrspec (mailbox.Address);
-		}
-
 		async Task MailFromAsync (FormatOptions options, MimeMessage message, MailboxAddress mailbox, SmtpExtension extensions, long size, bool doAsync, CancellationToken cancellationToken)
 		{
-			var utf8 = (extensions & SmtpExtension.UTF8) != 0;
+			var idnEncode = (extensions & SmtpExtension.UTF8) == 0;
 			var builder = new StringBuilder ("MAIL FROM:<");

-			var addrspec = GetAddrspec (mailbox, utf8);
+			var addrspec = mailbox.GetAddress (idnEncode);
 			builder.Append (addrspec);
 			builder.Append ('>');

-			if (utf8)
+			if (!idnEncode)
 				builder.Append (" SMTPUTF8");

 			if ((Capabilities & SmtpCapabilities.Size) != 0 && size != -1)
@@ -1830,7 +1822,8 @@

 		async Task<bool> RcptToAsync (FormatOptions options, MimeMessage message, MailboxAddress mailbox, bool doAsync, CancellationToken cancellationToken)
 		{
-			var command = string.Format ("RCPT TO:<{0}>", GetAddrspec (mailbox, (Capabilities & SmtpCapabilities.UTF8) != 0));
+			var idnEncode = (Capabilities & SmtpCapabilities.UTF8) == 0;
+			var command = string.Format ("RCPT TO:<{0}>", mailbox.GetAddress (idnEncode));

 			if ((capabilities & SmtpCapabilities.Dsn) != 0) {
 				var notify = GetDeliveryStatusNotifications (message, mailbox);


Global Build from CK-Env.

Global Build from CK-Env.

--- CodeCakeBuilder/Build.cs
+++ CodeCakeBuilder/Build.cs
@@ -46,20 +46,24 @@
             var projectsToPublish = projects
                                         .Where( p => !p.Path.Segments.Contains( "Tests" ) );

+            // The SimpleRepositoryInfo should be computed once and only once.
             SimpleRepositoryInfo gitInfo = Cake.GetSimpleRepositoryInfo();
-
-            // Configuration is either "Debug" or "Release".
-            string configuration = "Debug";
+            // This default global info will be replaced by Check-Repository task.
+            // It is allocated here to ease debugging and/or manual work on complex build script.
+            CheckRepositoryInfo globalInfo = new CheckRepositoryInfo { Version = gitInfo.SafeNuGetVersion };

             Task( "Check-Repository" )
                 .Does( () =>
-                 {
-                     configuration = StandardCheckRepository( projectsToPublish, gitInfo );
-                 } );
+                {
+                    globalInfo = StandardCheckRepository( projectsToPublish, gitInfo );
+                    if( globalInfo.ShouldStop )
+                    {
+                        Cake.TerminateWithSuccess( "All packages from this commit are already available. Build skipped." );
+                    }
+                } );

             Task( "Clean" )
-                .IsDependentOn( "Check-Repository" )
-                .Does( () =>
+                 .Does( () =>
                 {
                     Cake.CleanDirectories( projects.Select( p => p.Path.GetDirectory().Combine( "bin" ) ) );
                     Cake.CleanDirectories( releasesDir );
@@ -70,7 +74,7 @@
                 .IsDependentOn( "Clean" )
                 .Does( () =>
                 {
-                    StandardSolutionBuild( solutionFileName, gitInfo, configuration );
+                    StandardSolutionBuild( solutionFileName, gitInfo, globalInfo.BuildConfiguration );
                 } );

             Task( "Unit-Testing" )
@@ -85,7 +89,7 @@
                 .IsDependentOn( "Unit-Testing" )
                 .Does( () =>
                  {
-                     StandardCreateNuGetPackages( releasesDir, projectsToPublish, gitInfo, configuration );
+                     StandardCreateNuGetPackages( releasesDir, projectsToPublish, gitInfo, globalInfo.BuildConfiguration );
                  } );

             Task( "Push-NuGet-Packages" )
@@ -93,8 +97,7 @@
                 .IsDependentOn( "Create-NuGet-Packages" )
                 .Does( () =>
                  {
-                     IEnumerable<FilePath> nugetPackages = Cake.GetFiles( releasesDir.Path + "/*.nupkg" );
-                     StandardPushNuGetPackages( nugetPackages, gitInfo );
+                      StandardPushNuGetPackages( globalInfo, releasesDir );
                  } );

             // The Default task for this script can be set here.


Add TransactoinBuilder.Send(IDestination,IMoney)

--- NBitcoin/TransactionBuilder.cs
+++ NBitcoin/TransactionBuilder.cs
@@ -543,6 +543,35 @@
 			return this;
 		}

+		/// <summary>
+		/// Send a money amount to the destination
+		/// </summary>
+		/// <param name="destination">The destination</param>
+		/// <param name="amount">The amount (supported : Money, AssetMoney)</param>
+		/// <returns></returns>
+		/// <exception cref="System.NotSupportedException">The coin type is not supported</exception>
+		public TransactionBuilder Send(IDestination destination, IMoney amount)
+		{
+			return Send(destination.ScriptPubKey, amount);
+		}
+		/// <summary>
+		/// Send a money amount to the destination
+		/// </summary>
+		/// <param name="destination">The destination</param>
+		/// <param name="amount">The amount (supported : Money, AssetMoney)</param>
+		/// <returns></returns>
+		/// <exception cref="System.NotSupportedException">The coin type is not supported</exception>
+		public TransactionBuilder Send(Script scriptPubKey, IMoney amount)
+		{
+			Money coinAmount = amount as Money;
+			if(coinAmount != null)
+				return Send(scriptPubKey, coinAmount);
+			AssetMoney assetAmount = amount as AssetMoney;
+			if(assetAmount != null)
+				return SendAsset(scriptPubKey, assetAmount);
+			throw new NotSupportedException("Type of Money not supported");
+		}
+
 		public TransactionBuilder SendAsset(IDestination destination, AssetMoney asset)
 		{
 			return SendAsset(destination.ScriptPubKey, asset);


Refactored Fraction (turned some constructors into static methods; added */ operators for two fractions)

--- DryWetMidi/Smf.Interaction/Length/Fraction.cs
+++ DryWetMidi/Smf.Interaction/Length/Fraction.cs
@@ -9,33 +9,33 @@

         public static readonly Fraction NoFraction = new Fraction();

-        public static readonly Fraction Whole = new Fraction(WholeFraction);
-        public static readonly Fraction WholeDotted = new Fraction(WholeFraction, true);
-        public static readonly Fraction WholeTriplet = Triplet(WholeFraction);
-
-        public static readonly Fraction Half = new Fraction(HalfFraction);
-        public static readonly Fraction HalfDotted = new Fraction(HalfFraction, true);
-        public static readonly Fraction HalfTriplet = Triplet(HalfFraction);
-
-        public static readonly Fraction Quarter = new Fraction(QuarterFraction);
-        public static readonly Fraction QuarterDotted = new Fraction(QuarterFraction, true);
-        public static readonly Fraction QuarterTriplet = Triplet(QuarterFraction);
-
-        public static readonly Fraction Eighth = new Fraction(EighthFraction);
-        public static readonly Fraction EighthDotted = new Fraction(EighthFraction, true);
-        public static readonly Fraction EighthTriplet = Triplet(EighthFraction);
-
-        public static readonly Fraction Sixteenth = new Fraction(SixteenthFraction);
-        public static readonly Fraction SixteenthDotted = new Fraction(SixteenthFraction, true);
-        public static readonly Fraction SixteenthTriplet = Triplet(SixteenthFraction);
-
-        public static readonly Fraction ThirtySecond = new Fraction(ThirtySecondFraction);
-        public static readonly Fraction ThirtySecondDotted = new Fraction(ThirtySecondFraction, true);
-        public static readonly Fraction ThirtySecondTriplet = Triplet(ThirtySecondFraction);
-
-        public static readonly Fraction SixtyFourth = new Fraction(SixtyFourthFraction);
-        public static readonly Fraction SixtyFourthDotted = new Fraction(SixtyFourthFraction, true);
-        public static readonly Fraction SixtyFourthTriplet = Triplet(SixtyFourthFraction);
+        public static readonly Fraction Whole = Create(WholeFraction);
+        public static readonly Fraction WholeDotted = Create(WholeFraction, SingleDotCount);
+        public static readonly Fraction WholeTriplet = CreateTriplet(WholeFraction);
+
+        public static readonly Fraction Half = Create(HalfFraction);
+        public static readonly Fraction HalfDotted = Create(HalfFraction, SingleDotCount);
+        public static readonly Fraction HalfTriplet = CreateTriplet(HalfFraction);
+
+        public static readonly Fraction Quarter = Create(QuarterFraction);
+        public static readonly Fraction QuarterDotted = Create(QuarterFraction, SingleDotCount);
+        public static readonly Fraction QuarterTriplet = CreateTriplet(QuarterFraction);
+
+        public static readonly Fraction Eighth = Create(EighthFraction);
+        public static readonly Fraction EighthDotted = Create(EighthFraction, SingleDotCount);
+        public static readonly Fraction EighthTriplet = CreateTriplet(EighthFraction);
+
+        public static readonly Fraction Sixteenth = Create(SixteenthFraction);
+        public static readonly Fraction SixteenthDotted = Create(SixteenthFraction, SingleDotCount);
+        public static readonly Fraction SixteenthTriplet = CreateTriplet(SixteenthFraction);
+
+        public static readonly Fraction ThirtySecond = Create(ThirtySecondFraction);
+        public static readonly Fraction ThirtySecondDotted = Create(ThirtySecondFraction, SingleDotCount);
+        public static readonly Fraction ThirtySecondTriplet = CreateTriplet(ThirtySecondFraction);
+
+        public static readonly Fraction SixtyFourth = Create(SixtyFourthFraction);
+        public static readonly Fraction SixtyFourthDotted = Create(SixtyFourthFraction, SingleDotCount);
+        public static readonly Fraction SixtyFourthTriplet = CreateTriplet(SixtyFourthFraction);

         private const int WholeFraction = 1;
         private const int HalfFraction = 2;
@@ -51,6 +51,9 @@
         private const int DupletNotesCount = 2;
         private const int DupletSpaceSize = 3;

+        private const int NoDotsCount = 0;
+        private const int SingleDotCount = 1;
+
         private const long DefaultNumerator = 0;
         private const long DefaultDenominator = 1;

@@ -73,82 +76,67 @@
             Denominator = denominator;
         }

-        public Fraction(int fraction)
-            : this(fraction, false)
-        {
-        }
-
-        public Fraction(int fraction, bool dotted)
-            : this(fraction, dotted, 1, 1)
-        {
-        }
-
-        public Fraction(int fraction, int tupletNotesCount, int tupletSpaceSize)
-            : this(fraction, false, tupletNotesCount, tupletSpaceSize)
-        {
-        }
-
-        public Fraction(int fraction, bool dotted, int tupletNotesCount, int tupletSpaceSize)
+        #endregion
+
+        #region Properties
+
+        public long Numerator { get; } = DefaultNumerator;
+
+        public long Denominator { get; } = DefaultDenominator;
+
+        #endregion
+
+        #region Methods
+
+        public bool Equals(Fraction fraction)
+        {
+            return this == fraction;
+        }
+
+        public static Fraction Create(long fraction)
+        {
+            return Create(fraction, NoDotsCount);
+        }
+
+        public static Fraction Create(long fraction, int dotsCount)
+        {
+            return Create(fraction, dotsCount, 1, 1);
+        }
+
+        public static Fraction Create(long fraction, int tupletNotesCount, int tupletSpaceSize)
+        {
+            return Create(fraction, NoDotsCount, tupletNotesCount, tupletSpaceSize);
+        }
+
+        public static Fraction Create(long fraction, int dotsCount, int tupletNotesCount, int tupletSpaceSize)
         {
             ThrowIfArgument.IsNonpositive(nameof(fraction), fraction, "Fraction is zero or negative.");
+            ThrowIfArgument.IsNegative(nameof(dotsCount), dotsCount, "Dots count is negative.");
             ThrowIfArgument.IsNonpositive(nameof(tupletNotesCount), tupletNotesCount, "Tuplet's notes count is zero or negative.");
             ThrowIfArgument.IsNonpositive(nameof(tupletSpaceSize), tupletSpaceSize, "Tuplet's space size is zero or negative.");

-            //
-
-            long numerator = 1;
-            long denominator = fraction;
-
-            if (dotted)
-            {
-                numerator *= 3;
-                denominator *= 2;
-            }
-
-            numerator *= tupletSpaceSize;
-            denominator *= tupletNotesCount;
-
-            Simplify(ref numerator, ref denominator);
-
-            Numerator = numerator;
-            Denominator = denominator;
-        }
-
-        #endregion
-
-        #region Properties
-
-        public long Numerator { get; } = DefaultNumerator;
-
-        public long Denominator { get; } = DefaultDenominator;
-
-        #endregion
-
-        #region Methods
-
-        public bool Equals(Fraction fraction)
-        {
-            return this == fraction;
-        }
-
-        public static Fraction Triplet(int fraction, bool dotted)
-        {
-            return new Fraction(fraction, dotted, TripletNotesCount, TripletSpaceSize);
-        }
-
-        public static Fraction Triplet(int fraction)
-        {
-            return Triplet(fraction, false);
-        }
-
-        public static Fraction Duplet(int fraction, bool dotted)
-        {
-            return new Fraction(fraction, dotted, DupletNotesCount, DupletSpaceSize);
-        }
-
-        public static Fraction Duplet(int fraction)
-        {
-            return Duplet(fraction, false);
+            return new Fraction(((1 << dotsCount + 1) - 1) * tupletSpaceSize,
+                                fraction * (1 << dotsCount) * tupletNotesCount);
+        }
+
+        public static Fraction CreateTriplet(int fraction, int dotsCount)
+        {
+            return Create(fraction, dotsCount, TripletNotesCount, TripletSpaceSize);
+        }
+
+        public static Fraction CreateTriplet(int fraction)
+        {
+            return CreateTriplet(fraction, NoDotsCount);
+        }
+
+        public static Fraction CreateDuplet(int fraction, int dotsCount)
+        {
+            return Create(fraction, dotsCount, DupletNotesCount, DupletSpaceSize);
+        }
+
+        public static Fraction CreateDuplet(int fraction)
+        {
+            return CreateDuplet(fraction, NoDotsCount);
         }

         internal static Fraction FromTicks(long ticks, short ticksPerQuarterNote)
@@ -203,12 +191,22 @@
             ThrowIfArgument.IsNull(nameof(fraction), fraction);
             ThrowIfArgument.IsNegative(nameof(number), number, "Number is negative.");

-            return new Fraction(fraction.Numerator * number, fraction.Denominator);
+            return new Fraction(fraction.Numerator * number,
+                                fraction.Denominator);
         }

         public static Fraction operator *(long number, Fraction fraction)
         {
             return fraction * number;
+        }
+
+        public static Fraction operator *(Fraction fraction1, Fraction fraction2)
+        {
+            ThrowIfArgument.IsNull(nameof(fraction1), fraction1);
+            ThrowIfArgument.IsNull(nameof(fraction2), fraction2);
+
+            return new Fraction(fraction1.Numerator * fraction2.Numerator,
+                                fraction1.Denominator * fraction2.Denominator);
         }

         public static Fraction operator /(Fraction fraction, long number)
@@ -216,7 +214,17 @@
             ThrowIfArgument.IsNull(nameof(fraction), fraction);
             ThrowIfArgument.IsNegative(nameof(number), number, "Number is negative.");

-            return new Fraction(fraction.Numerator / number, fraction.Denominator);
+            return new Fraction(fraction.Numerator,
+                                fraction.Denominator * number);
+        }
+
+        public static Fraction operator /(Fraction fraction1, Fraction fraction2)
+        {
+            ThrowIfArgument.IsNull(nameof(fraction1), fraction1);
+            ThrowIfArgument.IsNull(nameof(fraction2), fraction2);
+
+            return new Fraction(fraction1.Numerator * fraction2.Denominator,
+                                fraction1.Denominator * fraction2.Numerator);
         }

         public static Fraction operator +(Fraction fraction1, Fraction fraction2)
@@ -225,7 +233,8 @@
             ThrowIfArgument.IsNull(nameof(fraction2), fraction2);

             Equalize(fraction1, fraction2, out var numerator1, out var numerator2, out var denominator);
-            return new Fraction(numerator1 + numerator2, denominator);
+            return new Fraction(numerator1 + numerator2,
+                                denominator);
         }

         public static Fraction operator -(Fraction fraction1, Fraction fraction2)
@@ -237,7 +246,8 @@
             if (numerator1 < numerator2)
                 throw new ArgumentException("First fraction is less than second one.", nameof(fraction1));

-            return new Fraction(numerator1 - numerator2, denominator);
+            return new Fraction(numerator1 - numerator2,
+                                denominator);
         }

         public static bool operator <(Fraction fraction1, Fraction fraction2)


Experiment to see if out-of-memory issues are solved by disabling the write buffer on HTTP requests. This should help with #2320 and #2432

--- Duplicati/Library/Utility/AsyncHttpRequest.cs
+++ Duplicati/Library/Utility/AsyncHttpRequest.cs
@@ -93,6 +93,10 @@
                     m_activity_timeout = ((HttpWebRequest)m_request).ReadWriteTimeout;

                 ((HttpWebRequest)m_request).ReadWriteTimeout = System.Threading.Timeout.Infinite;
+
+                // Prevent in-memory buffering causing out-of-memory issues
+                ((HttpWebRequest)m_request).AllowReadStreamBuffering = false;
+                ((HttpWebRequest)m_request).AllowWriteStreamBuffering = false;
             }
         }


Skips a known failing test. All tests should pass.

--- Dysphoria.Net.UrlRouting.Test/RoutingTests.cs
+++ Dysphoria.Net.UrlRouting.Test/RoutingTests.cs
@@ -65,7 +65,7 @@
 			Assert.Equal(expectedResult, GetStringResultOrNull(path));
 		}

-		[Fact]
+		[Fact(Skip = "Not working yet. Cannot yet match across path segments.")]
 		public void EmptyStringMatches()
 		{
 			Assert.Equal("arg=", GetStringResult("1string/"));


Allow UserControlForm to be better resized

... by undocking the top panel and adding a 2px margin.

--- EDDiscovery/Forms/UserControlForm.Designer.cs
+++ EDDiscovery/Forms/UserControlForm.Designer.cs
@@ -89,7 +89,7 @@
             this.panel_minimize.BackColor = System.Drawing.SystemColors.Control;
             this.panel_minimize.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
             this.panel_minimize.ImageSelected = ExtendedControls.DrawnPanel.ImageType.Minimize;
-            this.panel_minimize.Location = new System.Drawing.Point(586, -2);
+            this.panel_minimize.Location = new System.Drawing.Point(582, -2);
             this.panel_minimize.MarginSize = 6;
             this.panel_minimize.Name = "panel_minimize";
             this.panel_minimize.Size = new System.Drawing.Size(24, 24);
@@ -103,7 +103,7 @@
             this.panel_ontop.BackColor = System.Drawing.SystemColors.Control;
             this.panel_ontop.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
             this.panel_ontop.ImageSelected = ExtendedControls.DrawnPanel.ImageType.Floating;
-            this.panel_ontop.Location = new System.Drawing.Point(562, -2);
+            this.panel_ontop.Location = new System.Drawing.Point(558, -2);
             this.panel_ontop.MarginSize = 6;
             this.panel_ontop.Name = "panel_ontop";
             this.panel_ontop.Size = new System.Drawing.Size(24, 24);
@@ -117,7 +117,7 @@
             this.panel_transparent.BackColor = System.Drawing.SystemColors.Control;
             this.panel_transparent.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
             this.panel_transparent.ImageSelected = ExtendedControls.DrawnPanel.ImageType.Transparent;
-            this.panel_transparent.Location = new System.Drawing.Point(490, -2);
+            this.panel_transparent.Location = new System.Drawing.Point(486, -2);
             this.panel_transparent.MarginSize = 6;
             this.panel_transparent.Name = "panel_transparent";
             this.panel_transparent.Size = new System.Drawing.Size(24, 24);
@@ -130,7 +130,7 @@
             this.panel_close.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.panel_close.BackColor = System.Drawing.SystemColors.Control;
             this.panel_close.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
-            this.panel_close.Location = new System.Drawing.Point(610, -2);
+            this.panel_close.Location = new System.Drawing.Point(606, -2);
             this.panel_close.MarginSize = 6;
             this.panel_close.Name = "panel_close";
             this.panel_close.Size = new System.Drawing.Size(24, 24);
@@ -144,7 +144,7 @@
             this.panel_taskbaricon.BackColor = System.Drawing.SystemColors.Control;
             this.panel_taskbaricon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
             this.panel_taskbaricon.ImageSelected = ExtendedControls.DrawnPanel.ImageType.WindowInTaskBar;
-            this.panel_taskbaricon.Location = new System.Drawing.Point(538, -2);
+            this.panel_taskbaricon.Location = new System.Drawing.Point(534, -2);
             this.panel_taskbaricon.MarginSize = 6;
             this.panel_taskbaricon.Name = "panel_taskbaricon";
             this.panel_taskbaricon.Size = new System.Drawing.Size(24, 24);
@@ -156,7 +156,7 @@
             //
             this.panel_showtitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.panel_showtitle.ImageSelected = ExtendedControls.DrawnPanel.ImageType.Captioned;
-            this.panel_showtitle.Location = new System.Drawing.Point(514, -2);
+            this.panel_showtitle.Location = new System.Drawing.Point(510, -2);
             this.panel_showtitle.MarginSize = 6;
             this.panel_showtitle.Name = "panel_showtitle";
             this.panel_showtitle.Size = new System.Drawing.Size(24, 24);
@@ -166,6 +166,8 @@
             //
             // panelTop
             //
+            this.panelTop.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+            | System.Windows.Forms.AnchorStyles.Right)));
             this.panelTop.Controls.Add(this.panel_showtitle);
             this.panelTop.Controls.Add(this.label_index);
             this.panelTop.Controls.Add(this.labelControlText);
@@ -174,10 +176,9 @@
             this.panelTop.Controls.Add(this.panel_taskbaricon);
             this.panelTop.Controls.Add(this.panel_transparent);
             this.panelTop.Controls.Add(this.panel_close);
-            this.panelTop.Dock = System.Windows.Forms.DockStyle.Top;
-            this.panelTop.Location = new System.Drawing.Point(0, 0);
+            this.panelTop.Location = new System.Drawing.Point(2, 2);
             this.panelTop.Name = "panelTop";
-            this.panelTop.Size = new System.Drawing.Size(634, 22);
+            this.panelTop.Size = new System.Drawing.Size(630, 22);
             this.panelTop.TabIndex = 27;
             this.panelTop.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panelTop_MouseDown);
             this.panelTop.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panelTop_MouseUp);


Use new out syntax

Use new out syntax

--- Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs
+++ Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs
@@ -219,8 +219,8 @@

 		public static Emulator LaunchAndConnectToPrinterEmulator(this AutomationRunner testRunner, string make = "Airwolf 3D", string model = "HD", bool runSlow = false)
 		{
-			SystemWindow systemWindow;
-			testRunner.GetWidgetByName("Hardware Tab", out systemWindow, 10);
+			var hardwareTab = testRunner.GetWidgetByName("Hardware Tab", out SystemWindow systemWindow, 10);
+
 			// make sure we wait for MC to be up and running
 			testRunner.WaitforDraw(systemWindow);


Fix null references when game object is destroyed

--- Editor/GameObjectCommand/GameObjectCommand.cs
+++ Editor/GameObjectCommand/GameObjectCommand.cs
@@ -7,12 +7,18 @@
         // PRAGMA MARK - ICommand
         public string DisplayTitle {
             get {
+                if (!IsValid()) {
+                    return "";
+                }
                 return _obj.name;
             }
         }

         public string DisplayDetailText {
             get {
+                if (!IsValid()) {
+                    return "";
+                }
                 return _obj.FullName();
             }
         }


Fix formating

Fix formating

--- Enum.Performance.Library/PerformanceParser.cs
+++ Enum.Performance.Library/PerformanceParser.cs
@@ -52,7 +52,7 @@
             result = new Dictionary<TEnum, string>();

             TEnum[] values = (TEnum[])System.Enum.GetValues(inputType);
-            foreach(TEnum enumValue in values)
+            foreach (TEnum enumValue in values)
             {
                 result[enumValue] = enumValue.ToString();
             }
@@ -96,7 +96,7 @@
             result = new Dictionary<string, TEnum>();

             TEnum[] values = (TEnum[])System.Enum.GetValues(inputType);
-            foreach(TEnum enumValue in values)
+            foreach (TEnum enumValue in values)
             {
                 string enumText = enumValue.ToString();
                 string key = normalizer == null ? enumText : normalizer(enumText);


Added DataTable check for IsTruthy

Added DataTable check for IsTruthy

This fixes #92 with inverted blocks and if helpers using datatables.
They're considered truthy if it has greater than zero rows

--- Nustache.Core/RenderContext.cs
+++ Nustache.Core/RenderContext.cs
@@ -240,6 +240,11 @@
                 return ((IEnumerable)value).GetEnumerator().MoveNext();
             }

+            if (value is DataTable)
+            {
+                return ((DataTable)value).Rows.Count > 0;
+            }
+
             return true;
         }


fix: Adds a parameter check when resolving a tenant

--- src/Elders.Cronus/Multitenancy/ITenantResolver.cs
+++ src/Elders.Cronus/Multitenancy/ITenantResolver.cs
@@ -1,5 +1,6 @@
 using Microsoft.Extensions.DependencyInjection;
 using System;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Reflection;

@@ -28,6 +29,8 @@

         public string Resolve(object source)
         {
+            if (source is null) throw new ArgumentNullException(nameof(source));
+
             ResolverCache resolverCache;
             if (resolvers.TryGetValue(source.GetType(), out resolverCache) == false)
             {


Log total commits after projection rebuilding finishes

--- src/Elders.Cronus/Projections/ProjectionPlayer.cs
+++ src/Elders.Cronus/Projections/ProjectionPlayer.cs
@@ -215,6 +215,7 @@

                 indexBuilder.Complete();

+                log.Info(() => $"Rebuilding index progress: {eventsCounter}. Done!");
                 log.Info(() => "Completed rebuilding index");
                 isBuilding = false;


Improved logging of retention limits job.

--- src/Exceptionless.Core/Jobs/RetentionLimitsJob.cs
+++ src/Exceptionless.Core/Jobs/RetentionLimitsJob.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Threading;
 using System.Threading.Tasks;
 using Exceptionless.Core.Extensions;
@@ -60,14 +60,14 @@
         }

         private async Task EnforceEventCountLimitsAsync(Organization organization) {
-            _logger.LogInformation("Enforcing event count limits for organization {OrganizationName} with Id: {organization}", organization.Name, organization.Id);
-
             try {
                 int retentionDays = organization.RetentionDays;
                 if (_appOptions.Value.MaximumRetentionDays > 0 && retentionDays > _appOptions.Value.MaximumRetentionDays)
                     retentionDays = _appOptions.Value.MaximumRetentionDays;

                 var cutoff = SystemClock.UtcNow.Date.SubtractDays(retentionDays);
+                _logger.LogInformation("Enforcing event count limits older than {RetentionPeriod:g} for organization {OrganizationName} ({OrganizationId}).", cutoff, organization.Name, organization.Id);
+
                 await _eventRepository.RemoveAllByDateAsync(organization.Id, cutoff).AnyContext();
             } catch (Exception ex) {
                 _logger.LogError(ex, "Error enforcing limits: org={OrganizationName} id={organization} message={Message}", organization.Name, organization.Id, ex.Message);


Update StephanosConstantinou.cs

Update StephanosConstantinou.cs

--- src/Firehose.Web/Authors/StephanosConstantinou.cs
+++ src/Firehose.Web/Authors/StephanosConstantinou.cs
@@ -23,8 +23,7 @@
         public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://www.sconstantinou.com/feed/"); } }
         public bool Filter(SyndicationItem item)
         {
-            return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell scripts"));
-            return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell tutorials"));
+            return item.Categories.Any(c => c.Name.ToLowerInvariant().Contains("powershell"));
         }
     }
 }


Remove redundant ShouldBe overload.

Remove redundant ShouldBe overload.

--- src/Fixie.Tests/Assertions/AssertionExtensions.cs
+++ src/Fixie.Tests/Assertions/AssertionExtensions.cs
@@ -39,11 +39,6 @@
         {
             if (actual != expected)
                 throw new AssertException(expected, actual);
-        }
-
-        public static void ShouldBe(this string[] actual, string[] expected)
-        {
-            actual.ShouldMatch(expected);
         }

         public static void ShouldBe<T>(this IEquatable<T> actual, IEquatable<T> expected)


Test coverage for ClassDiscoverer's ability to avoid treating convention types as test classes.

--- src/Fixie.Tests/Execution/ClassDiscovererTests.cs
+++ src/Fixie.Tests/Execution/ClassDiscovererTests.cs
@@ -35,6 +35,21 @@
             var customConvention = new SampleConvention();

             DiscoveredTestClasses(customConvention)
+                .ShouldEqual(
+                    typeof(StaticClass),
+                    typeof(DefaultConstructor),
+                    typeof(NoDefaultConstructor),
+                    typeof(NameEndsWithTests),
+                    typeof(String),
+                    typeof(InheritanceSampleBase),
+                    typeof(InheritanceSample));
+        }
+
+        public void ShouldNotConsiderDiscoveryAndExecutionCustomizations()
+        {
+            var customConvention = new SampleConvention();
+
+            DiscoveredTestClasses(customConvention, typeof(SampleConvention))
                 .ShouldEqual(
                     typeof(StaticClass),
                     typeof(DefaultConstructor),


Fixed unit test

Fixed unit test

--- src/Framework/N2/Web/Mvc/ViewEnginesExtensions.cs
+++ src/Framework/N2/Web/Mvc/ViewEnginesExtensions.cs
@@ -1,7 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
+using N2.Engine;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
 using System.Web.Mvc;

 namespace N2.Web.Mvc
@@ -54,9 +55,9 @@
         public static void RegisterTokenViewEngine(this ViewEngineCollection viewEngines)
         {
             viewEngines.Add(new TokenViewEngine());
-        }
-
-        class TokenViewEngine : IViewEngine
+        }
+
+        class TokenViewEngine : IViewEngine, IDecorator<IViewEngine>
         {
             WebFormViewEngine inner;
             string[] noLocations = new string[0];
@@ -89,7 +90,12 @@
             public void ReleaseView(ControllerContext controllerContext, IView view)
             {
                 inner.ReleaseView(controllerContext, view);
-            }
+            }
+
+            public IViewEngine Component
+            {
+                get { return inner; }
+            }
         }

     }


Added check to userinfo endpoint to make sure sub claim is present

--- src/IdentityServer4/Endpoints/UserInfoEndpoint.cs
+++ src/IdentityServer4/Endpoints/UserInfoEndpoint.cs
@@ -77,6 +77,15 @@
             // pass scopes/claims to profile service
             var claims = tokenResult.Claims.Where(x => !Constants.Filters.ProtocolClaimsFilter.Contains(x.Type));
             var subject = Principal.Create("UserInfo", claims.ToArray());
+
+            if (subject.FindFirst(JwtClaimTypes.Subject) == null)
+            {
+                var error = "Token contains no sub claim";
+                _logger.LogError(error);
+                await RaiseFailureEventAsync(error);
+                return Error(OidcConstants.ProtectedResourceErrors.InvalidToken);
+            }
+
             var scopes = tokenResult.Claims.Where(c => c.Type == JwtClaimTypes.Scope).Select(c => c.Value);

             var payload = await _generator.ProcessAsync(subject, scopes, tokenResult.Client);


Revert "Add singleton CallContext.Default (#1740)" (#1745)

This reverts commit cf77cd685d7e7ff2bca37b0f8290e4a2aa7012d1.

--- src/Microsoft.IdentityModel.Tokens/CallContext.cs
+++ src/Microsoft.IdentityModel.Tokens/CallContext.cs
@@ -36,8 +36,6 @@
     /// </summary>
     public class CallContext
     {
-        private static CallContext _defaultContext = new CallContext(Guid.NewGuid()) { CaptureLogs = false };
-
         /// <summary>
         /// Instantiates a new <see cref="CallContext"/> with a default activityId.
         /// </summary>
@@ -65,11 +63,6 @@
         public bool CaptureLogs { get; set; } = false;

         /// <summary>
-        /// Instantiates a new singleton <see cref="CallContext"/> with a false <see cref="CaptureLogs"/>.
-        /// </summary>
-        public static CallContext Default { get => _defaultContext; }
-
-        /// <summary>
         /// The collection of logs associated with a request. Use <see cref="CaptureLogs"/> to control capture.
         /// </summary>
         public ICollection<string> Logs { get; private set; } = new Collection<string>();


Ensure that the generated version information has a 4 digit version number.

svn path=/trunk/bitsharp/; revision=132341

--- src/MonoTorrent/MonoTorrent.Common/VersionInfo.cs
+++ src/MonoTorrent/MonoTorrent.Common/VersionInfo.cs
@@ -52,17 +52,21 @@

 		static string CreateClientVersion ()
 		{
-			AssemblyInformationalVersionAttribute version;
+			AssemblyInformationalVersionAttribute versionAttr;
 			Assembly assembly = Assembly.GetExecutingAssembly ();
-			version = (AssemblyInformationalVersionAttribute) assembly.GetCustomAttributes (typeof (AssemblyInformationalVersionAttribute), false)[0];
-			Version v = new Version(version.InformationalVersion);
+			versionAttr = (AssemblyInformationalVersionAttribute) assembly.GetCustomAttributes (typeof (AssemblyInformationalVersionAttribute), false)[0];
+			Version v = new Version(versionAttr.InformationalVersion);

 			    // 'MO' for MonoTorrent then four digit version number
-			return string.Format ("-MO{0}{1}{2}{3}-",
-			                      Math.Max (v.Major, 0),
-			                      Math.Max (v.Minor, 0),
-			                      Math.Max (v.Build, 0),
-			                      Math.Max (v.Revision, 0));
+            string version = string.Format ("{0}{1}{2}{3}", Math.Max (v.Major, 0),
+			                                                Math.Max (v.Minor, 0),
+			                                                Math.Max (v.Build, 0),
+			                                                Math.Max (v.Revision, 0));
+            if (version.Length > 4)
+                version = version.Substring (0, 4);
+            else
+                version = version.PadRight (4, '0');
+			return string.Format ("-MO{0}-", version);
 		}
     }
 }


Linq/ByMethod/GroupByTests.cs: The SingleKeyPropertyGroupWithOrderByCount test case does work on some dialects.

--- src/NHibernate.Test/Linq/ByMethod/GroupByTests.cs
+++ src/NHibernate.Test/Linq/ByMethod/GroupByTests.cs
@@ -3,6 +3,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text.RegularExpressions;
+using NHibernate.Dialect;
 using NHibernate.DomainModel.Northwind.Entities;
 using NHibernate.Linq;
 using NUnit.Framework;
@@ -143,16 +144,38 @@
 			AssertOrderedBy.Descending(orderCounts, oc => oc.OrderCount);
 		}

-		[Test, KnownBug("NH-????"), Description("Discovered as part of NH-2560")]
+		[Test]
 		public void SingleKeyPropertyGroupWithOrderByCount()
 		{
-			var result = db.Orders
-				.GroupBy(o => o.Customer)
-				.OrderByDescending(g => g.Count()) // it seems like there we should do order on client-side
-				.Select(g => g.Key)
-				.ToList();
-
-			Assert.That(result.Count, Is.EqualTo(89));
+			// The problem with this test (as of 2014-07-25) is that the generated SQL will
+			// try to select columns that are not included in the group-by clause. But on MySQL and
+			// sqlite, it's apparently ok.
+
+			// The try-catch in this clause aim to ignore the test on dialects where it shouldn't work,
+			// but give us a warning if it does start to work.
+
+			try
+			{
+				var result = db.Orders
+					.GroupBy(o => o.Customer)
+					.OrderByDescending(g => g.Count()) // it seems like there we should do order on client-side
+					.Select(g => g.Key)
+					.ToList();
+
+				Assert.That(result.Count, Is.EqualTo(89));
+			}
+			catch (Exception)
+			{
+				if (Dialect is MySQLDialect || Dialect is SQLiteDialect)
+					throw;
+
+				Assert.Ignore("Known bug NH-????, discovered as part of NH-2560.");
+			}
+
+			if (Dialect is MySQLDialect || Dialect is SQLiteDialect)
+				return;
+
+			Assert.Fail("Unexpected success in test. Maybe something was fixed and the test needs to be updated?");
 		}

 		[Test, KnownBug("NH-3027")]


Assembly SafeGetTypes with extra diagnostic logging on ReflectionTypeLoadException (#4876)

--- src/NLog/Internal/Reflection/ReflectionHelpers.cs
+++ src/NLog/Internal/Reflection/ReflectionHelpers.cs
@@ -61,25 +61,17 @@
             }
             catch (ReflectionTypeLoadException typeLoadException)
             {
-                foreach (var ex in typeLoadException.LoaderExceptions)
+                var result = typeLoadException.Types?.Where(t => t != null)?.ToArray() ?? ArrayHelper.Empty<Type>();
+                InternalLogger.Warn(typeLoadException, "Loaded {0} valid types from Assembly: {1}", result.Length, assembly.FullName);
+                foreach (var ex in typeLoadException.LoaderExceptions ?? ArrayHelper.Empty<Exception>())
                 {
                     InternalLogger.Warn(ex, "Type load exception.");
                 }
-
-                var loadedTypes = new List<Type>();
-                foreach (var t in typeLoadException.Types)
-                {
-                    if (t != null)
-                    {
-                        loadedTypes.Add(t);
-                    }
-                }
-
-                return loadedTypes.ToArray();
+                return result;
             }
             catch (Exception ex)
             {
-                InternalLogger.Warn(ex, "Type load exception.");
+                InternalLogger.Warn(ex, "Failed to load types from Assembly: {0}", assembly.FullName);
                 return ArrayHelper.Empty<Type>();
             }
         }


Add tests for runsettings

Add tests for runsettings

--- src/NUnitTestAdapterTests/AdapterSettingsTests.cs
+++ src/NUnitTestAdapterTests/AdapterSettingsTests.cs
@@ -56,6 +56,8 @@
             Assert.Null(_settings.BasePath);
             Assert.Null(_settings.PrivateBinPath);
             Assert.NotNull(_settings.RandomSeed);
+            Assert.False(_settings.SynchronousEvents);
+            Assert.Null(_settings.DomainUsage);
         }

         [Test]
@@ -171,5 +173,22 @@
             _settings.Load("<RunSettings><NUnit><RandomSeed>12345</RandomSeed></NUnit></RunSettings>");
             Assert.That(_settings.RandomSeed, Is.EqualTo(12345));
         }
+
+        [Test]
+        public void SynchronousEventsSetting()
+        {
+            _settings.Load("<RunSettings><NUnit><SynchronousEvents>True</SynchronousEvents></NUnit></RunSettings>");
+            Assert.True(_settings.SynchronousEvents);
+        }
+
+        [Test]
+        public void DomainUsageSetting()
+        {
+            _settings.Load("<RunSettings><NUnit><DomainUsage>None</DomainUsage></NUnit></RunSettings>");
+            Assert.That(_settings.DomainUsage, Is.EqualTo("None"));
+
+            _settings.Load("<RunSettings><NUnit><DomainUsage>Single</DomainUsage></NUnit></RunSettings>");
+            Assert.That(_settings.DomainUsage, Is.EqualTo("Single"));
+        }
     }
 }


Added unit tests to confirm deserialization of lights

--- src/OneCog.Io.Philips.Hue.Tests/DtoTestFixture.cs
+++ src/OneCog.Io.Philips.Hue.Tests/DtoTestFixture.cs
@@ -18,5 +18,34 @@

             Assert.That(state, Is.Not.Null);
         }
+
+        [Test]
+        public void CanDeserializeStateLights()
+        {
+            State state = Serializer.Json.Deserialize<State>(Resources.ConfigurationResponse);
+
+            Assert.That(state, Is.Not.Null);
+            Assert.That(state.Lights, Is.Not.Null);
+            Assert.That(state.Lights.Count, Is.EqualTo(2));
+
+            Dto.Light light = state.Lights[2].Item;
+            Assert.That(light, Is.Not.Null);
+            Assert.That(light.State, Is.Not.Null);
+            Assert.That(light.State.On, Is.True);
+            Assert.That(light.State.Brightness, Is.EqualTo(254));
+            Assert.That(light.State.Hue, Is.EqualTo(33536));
+            Assert.That(light.State.Saturation, Is.EqualTo(144));
+            Assert.That(light.State.Xy, Is.EqualTo(new float[] { 0.3460F, 0.3568F }));
+            Assert.That(light.State.Ct, Is.EqualTo(201));
+            Assert.That(light.State.Alert, Is.EqualTo("none"));
+            Assert.That(light.State.Effect, Is.EqualTo("none"));
+            Assert.That(light.State.ColorMode, Is.EqualTo("hs"));
+            Assert.That(light.State.Reachable, Is.EqualTo(true));
+
+            Assert.That(light.Type, Is.EqualTo("Extended color light"));
+            Assert.That(light.Name, Is.EqualTo("Hue Lamp 2"));
+            Assert.That(light.ModelId, Is.EqualTo("LCT001"));
+            Assert.That(light.FirmwareVersion, Is.EqualTo("65003148"));
+        }
     }
 }


Throw ConcurrentMutationException in case of conflict

--- src/Openchain.SqlServer/SqlServerStorageEngine.cs
+++ src/Openchain.SqlServer/SqlServerStorageEngine.cs
@@ -69,9 +69,9 @@
                     byte[] mutationHash = MessageSerializer.ComputeHash(transaction.Mutation.ToByteArray());
                     Mutation mutation = MessageSerializer.DeserializeMutation(transaction.Mutation);

-                    await ExecuteQuery<long>(
+                    IReadOnlyList<Record> conflicts = await ExecuteQuery<Record>(
                         "EXEC [Openchain].[AddTransaction] @instance, @transactionHash, @mutationHash, @rawData, @records;",
-                        reader => (long)reader[0],
+                        reader => mutation.Records.First(record => record.Key.Equals(new ByteString((byte[])reader[0]))),
                         new Dictionary<string, object>()
                         {
                             ["instance"] = this.instanceId,
@@ -97,6 +97,9 @@
                             }).ToList()
                         },
                         context);
+
+                    if (conflicts.Count > 0)
+                        throw new ConcurrentMutationException(conflicts[0]);
                 }

                 context.Commit();


Fix multiplayer match settings overlay dropdown Z-ordering

--- osu.Game/Screens/OnlinePlay/Match/Components/RoomSettingsOverlay.cs
+++ osu.Game/Screens/OnlinePlay/Match/Components/RoomSettingsOverlay.cs
@@ -7,6 +7,7 @@
 using osu.Framework.Input.Bindings;
 using osu.Framework.Input.Events;
 using osu.Game.Graphics;
+using osu.Game.Graphics.Containers;
 using osu.Game.Graphics.Sprites;
 using osu.Game.Graphics.UserInterface;
 using osu.Game.Input.Bindings;
@@ -93,7 +94,12 @@
         {
         }

-        protected class SectionContainer : FillFlowContainer

+        /// <remarks>
+        /// <see cref="ReverseChildIDFillFlowContainer{T}"/> is used to ensure that if the nested <see cref="Section"/>s
+        /// use expanded overhanging content (like an <see cref="OsuDropdown{T}"/>'s dropdown),
+        /// then the overhanging content will be correctly Z-ordered.
+        /// </remarks>
+        protected class SectionContainer : ReverseChildIDFillFlowContainer

         {
             public SectionContainer()
             {


画像キャッシュをLRUとして保持するようにした

画像キャッシュをLRUとして保持するようにした

--- GPlusBrowser/ViewModel/DataCacheDictionary.cs
+++ GPlusBrowser/ViewModel/DataCacheDictionary.cs
@@ -12,79 +12,52 @@
 {
     public static class DataCacheDictionary
     {
-        static DataCacheDictionary() { System.Net.ServicePointManager.DefaultConnectionLimit = 8; }
+        static DataCacheDictionary() { System.Net.ServicePointManager.DefaultConnectionLimit = 16; }
         static DateTime _lastCleanupTime = DateTime.UtcNow;
         static readonly HttpClient _defaultHttpClient = new HttpClient();
-        static readonly Dictionary<Uri, WeakReference<BitmapImage>> _imgCacheDictionary = new Dictionary<Uri, WeakReference<BitmapImage>>();
-        static readonly Dictionary<Uri, Task<BitmapImage>> _imgJobDictionary = new Dictionary<Uri, Task<BitmapImage>>();
-        static readonly System.Threading.SemaphoreSlim _syncer = new System.Threading.SemaphoreSlim(1, 1);
+        static readonly CacheDictionary<Uri, ImageCache, Task<BitmapImage>> _imgCacheDictionary = new CacheDictionary<Uri, ImageCache, Task<BitmapImage>>(90, 30, false, tsk => new ImageCache() { Value = tsk });

-        public async static Task<BitmapImage> DownloadImage(Uri imageUrl, HttpClient client = null)
+        public static Task<BitmapImage> DownloadImage(Uri imageUrl, HttpClient client = null)
         {
             if (imageUrl == null)
-                return null;
-            try
-            {
-                await _syncer.WaitAsync();
+                return Task.FromResult((BitmapImage)null);
+            client = client ?? _defaultHttpClient;
+            return _imgCacheDictionary.Update(imageUrl, () => PrivateDownloadImage(imageUrl, client)).Value;
+        }
+        static Task<BitmapImage> PrivateDownloadImage(Uri imageUrl, HttpClient client = null)
+        {
+            return Task.Run(async () =>
+                {
+                    try
+                    {
+                        BitmapImage img;
+                        using (var mStrm = new System.IO.MemoryStream())
+                        {
+                            client = client ?? _defaultHttpClient;
+                            int recieveByte;
+                            byte[] buff = new byte[1024];
+                            using (var strm = await client.GetStreamAsync(imageUrl))
+                                while ((recieveByte = await strm.ReadAsync(buff, 0, buff.Length)) > 0)
+                                    mStrm.Write(buff, 0, recieveByte);
+                            mStrm.Seek(0, System.IO.SeekOrigin.Begin);

-                Task<BitmapImage> aa;
-                if (_imgJobDictionary.TryGetValue(imageUrl, out aa))
-                    return await aa;
-                else
-                    return await Task.Run(async () =>
-                    {
-                        try
-                        {
-                            WeakReference<BitmapImage> imgRef;
-                            BitmapImage img;
-                            bool isNewItem = true;
+                            img = new BitmapImage();
+                            img.BeginInit();
+                            img.CacheOption = BitmapCacheOption.OnLoad;
+                            img.CreateOptions = BitmapCreateOptions.None;
+                            img.StreamSource = mStrm;
+                            img.EndInit();
+                            img.Freeze();

-                            if (_imgCacheDictionary.TryGetValue(imageUrl, out imgRef) == false || (isNewItem = imgRef.TryGetTarget(out img)) == false)
-                                using (var mStrm = new System.IO.MemoryStream())
-                                {
-                                    client = client ?? _defaultHttpClient;
-                                    int recieveByte;
-                                    byte[] buff = new byte[1024];
-                                    using (var strm = await client.GetStreamAsync(imageUrl))
-                                        while ((recieveByte = await strm.ReadAsync(buff, 0, buff.Length)) > 0)
-                                            mStrm.Write(buff, 0, recieveByte);
-                                    mStrm.Seek(0, System.IO.SeekOrigin.Begin);
-
-                                    img = new BitmapImage();
-                                    img.BeginInit();
-                                    img.CacheOption = BitmapCacheOption.OnLoad;
-                                    img.CreateOptions = BitmapCreateOptions.None;
-                                    img.StreamSource = mStrm;
-                                    img.EndInit();
-                                    img.Freeze();
-
-                                    if (isNewItem)
-                                        _imgCacheDictionary.Add(imageUrl, new WeakReference<BitmapImage>(img));
-                                    else
-                                        imgRef.SetTarget(img);
-                                }
-                            if (DateTime.UtcNow - _lastCleanupTime > TimeSpan.FromMinutes(30))
-                            {
-                                _lastCleanupTime = DateTime.UtcNow;
-                                GC();
-                            }
                             return img;
                         }
-                        catch (System.Net.Http.HttpRequestException) { return null; }
-                        catch (NotSupportedException) { return null; }
-                    });
-            }
-            finally
-            { _syncer.Release(); }
-        }
-        public static void GC()
-        {
-            BitmapImage tmp;
-            foreach (var item in _imgCacheDictionary.ToArray())
-            {
-                if (item.Value.TryGetTarget(out tmp) == false)
-                    _imgCacheDictionary.Remove(item.Key);
-            }
+                    }
+                    catch (System.Net.Http.HttpRequestException) { return null; }
+                    catch (NotSupportedException) { return null; }
+                });
         }
     }
+    public class ImageCache : ICacheInfo<Task<BitmapImage>>
+    { public Task<BitmapImage> Value { get; set; } }
+
 }


fixed issue with SumAsync for Int64

fixed issue with SumAsync for Int64

--- src/Remote.Linq/Async/AsyncQueryableExtensions.cs
+++ src/Remote.Linq/Async/AsyncQueryableExtensions.cs
@@ -172,7 +172,7 @@
             => ExecuteAsync<int?, int?>(MethodInfos.Queryable.SumNullableInt32, source, cancellation);

         public static ValueTask<long> SumAsync(this IQueryable<long> source, CancellationToken cancellation = default)
-            => ExecuteAsync<long, long>(MethodInfos.Queryable.SumNullableInt64, source, cancellation);
+            => ExecuteAsync<long, long>(MethodInfos.Queryable.SumInt64, source, cancellation);

         public static ValueTask<long?> SumAsync(this IQueryable<long?> source, CancellationToken cancellation = default)
             => ExecuteAsync<long?, long?>(MethodInfos.Queryable.SumNullableInt64, source, cancellation);


Fixes redirect issue

Fixes redirect issue

--- src/SFA.DAS.EAS.Web/Controllers/HomeController.cs
+++ src/SFA.DAS.EAS.Web/Controllers/HomeController.cs
@@ -12,7 +12,7 @@
         [Route("Index")]
         public ActionResult Index()
         {
-            return Redirect(Url.EmployerAccountsAction("service/accounts"));
+            return Redirect(Url.EmployerAccountsAction("service/index", false));
         }

         [AuthoriseActiveUser]


Changed Response content length to number of bytes

--- src/SoapCore/MessageEncoder/SoapMessageEncoder.cs
+++ src/SoapCore/MessageEncoder/SoapMessageEncoder.cs
@@ -185,11 +185,11 @@
 				}

 				var data = stringWriter.ToString();
+				var soapMessage = _writeEncoding.GetBytes(data);

 				//Set Content-length in Response
-				httpContext.Response.ContentLength = data.Length;
-
-				var soapMessage = _writeEncoding.GetBytes(data);
+				httpContext.Response.ContentLength = soapMessage.Length;
+
 				await pipeWriter.WriteAsync(soapMessage);
 				await pipeWriter.FlushAsync();
 			}


Playtime for owned games in TimeSpan.

Playtime for owned games in TimeSpan.

--- src/Steam.Models/SteamCommunity/OwnedGameModel.cs
+++ src/Steam.Models/SteamCommunity/OwnedGameModel.cs
@@ -1,4 +1,6 @@
-namespace Steam.Models.SteamCommunity
+using System;
+
+namespace Steam.Models.SteamCommunity
 {
     public class OwnedGameModel
     {
@@ -6,7 +8,7 @@

         public string Name { get; set; }

-        public uint PlaytimeForever { get; set; }
+        public TimeSpan PlaytimeForever { get; set; }

         public string ImgIconUrl { get; set; }

@@ -14,6 +16,6 @@

         public bool HasCommunityVisibleStats { get; set; }

-        public uint? Playtime2weeks { get; set; }
+        public TimeSpan? PlaytimeLastTwoWeeks { get; set; }
     }
 }


Renamed InlineScriptParser.Transform to TransformText.

--- src/Subspace.TextTemplating/InlineScriptParser.cs
+++ src/Subspace.TextTemplating/InlineScriptParser.cs
@@ -246,9 +246,9 @@
         }

         /// <summary>
-        ///     Transforms the specified file and returns the result.
-        /// </summary>
-        /// <param name="path">The path of the file.</param>
+        ///     Transforms the specified text file and returns the result.
+        /// </summary>
+        /// <param name="path">The path of the text file.</param>
         /// <exception cref="ArgumentNullException">The specified path is <c>null</c>.</exception>
         public string TransformFile(string path)
         {
@@ -259,7 +259,7 @@

             scriptDirectory = Path.Combine(baseDirectory, Path.GetDirectoryName(path));

-            return Transform(File.ReadAllText(path), path);
+            return TransformText(File.ReadAllText(path), path);
         }

         /// <summary>
@@ -268,7 +268,7 @@
         /// <param name="text">The text to transform.</param>
         /// <param name="sourcePath">The path of the source file.</param>
         /// <exception cref="ArgumentNullException">The specified <paramref name="text"/> is <c>null</c>.</exception>
-        public string Transform(string text, string sourcePath)
+        public string TransformText(string text, string sourcePath)
         {
             Parse(text, sourcePath);


Added stub for tag settings view model.

Added stub for tag settings view model.

--- src/Tagger.Wpf/ViewModels/TagSettingsViewModel.cs
+++ src/Tagger.Wpf/ViewModels/TagSettingsViewModel.cs
@@ -1,14 +1,228 @@
 using Utils.Prism;
+using Utils.Reflection;
+using Microsoft.Practices.Prism.Commands;

 namespace Tagger.Wpf.ViewModels
 {
-    public class TagSettingsViewModel: ViewModelBase
+    public class TagSettingsViewModel : ViewModelBase
     {
+        #region Fields
+
+        private string m_Text;
+        private string m_ColorName;
+        private int m_TopOffset;
+        private int m_RightOffset;
+
+        #endregion
+
         public TagSettingsViewModel(int processId)
         {
-
-
-
-        }
+            CreateTagCommand = new DelegateCommand<object>(CreateTag, CanCreateTag);
+            HideSettingsCommand = new DelegateCommand<object>(HideSettings, CanHideSettings);
+            ShowSettingsCommand = new DelegateCommand<object>(ShowSettings, CanShowSettings);
+            DeleteTagCommand = new DelegateCommand<object>(DeleteTag, CanDeleteTag);
+            CancelSettingsCommand = new DelegateCommand<object>(CancelSettings, CanCancelSettings);
+        }
+
+        #region Command - CreateTag
+
+        /// <summary>
+        /// Create tag window for specified host
+        /// </summary>
+        public DelegateCommand<object> CreateTagCommand { get; private set; }
+
+        /// <summary>
+        /// CreateTag command handler
+        /// </summary>
+        private void CreateTag(object parameter)
+        {
+        }
+
+        /// <summary>
+        /// Test that verifies if CreateTag command can be invoked
+        /// </summary>
+        /// <returns>true if command could be invoked</returns>
+        private bool CanCreateTag(object parameter)
+        {
+            return true;
+        }
+
+        #endregion
+
+        #region Command - DeleteTag
+
+        /// <summary>
+        /// Delete tag from host window
+        /// </summary>
+        public DelegateCommand<object> DeleteTagCommand { get; private set; }
+
+        /// <summary>
+        /// DeleteTag command handler
+        /// </summary>
+        private void DeleteTag(object parameter)
+        {
+        }
+
+        /// <summary>
+        /// Test that verifies if DeleteTag command can be invoked
+        /// </summary>
+        /// <returns>true if command could be invoked</returns>
+        private bool CanDeleteTag(object parameter)
+        {
+            return true;
+        }
+
+        #endregion
+
+        #region Command - HideSettings
+
+        /// <summary>
+        /// Hide settings window command
+        /// </summary>
+        public DelegateCommand<object> HideSettingsCommand { get; private set; }
+
+        /// <summary>
+        /// HideSettings command handler
+        /// </summary>
+        private void HideSettings(object parameter)
+        {
+        }
+
+        /// <summary>
+        /// Test that verifies if HideSettings command can be invoked
+        /// </summary>
+        /// <returns>true if command could be invoked</returns>
+        private bool CanHideSettings(object parameter)
+        {
+            return true;
+        }
+
+        #endregion
+
+        #region Command - ShowSettings
+
+        /// <summary>
+        /// Show settings for a tag
+        /// </summary>
+        public DelegateCommand<object> ShowSettingsCommand { get; private set; }
+
+        /// <summary>
+        /// ShowSettings command handler
+        /// </summary>
+        private void ShowSettings(object parameter)
+        {
+        }
+
+        /// <summary>
+        /// Test that verifies if ShowSettings command can be invoked
+        /// </summary>
+        /// <returns>true if command could be invoked</returns>
+        private bool CanShowSettings(object parameter)
+        {
+            return true;
+        }
+
+        #endregion
+
+        #region Command - CancelSettings
+
+        /// <summary>
+        /// Cancel tag and settings, tagging was a mistake user whant to revert
+        /// </summary>
+        public DelegateCommand<object> CancelSettingsCommand { get; private set; }
+
+        /// <summary>
+        /// CancelSettings command handler
+        /// </summary>
+        private void CancelSettings(object parameter)
+        {
+        }
+
+        /// <summary>
+        /// Test that verifies if CancelSettings command can be invoked
+        /// </summary>
+        /// <returns>true if command could be invoked</returns>
+        private bool CanCancelSettings(object parameter)
+        {
+            return true;
+        }
+
+        #endregion
+
+        #region Validation
+
+        /// <summary>
+        /// Validation for Text property value
+        /// </summary>
+        private void Validate_Text()
+        {
+            Validate(true, "Is always valid");
+        }
+
+        /// <summary>
+        /// Validation for ColorName property value
+        /// </summary>
+        private void Validate_ColorName()
+        {
+            Validate(true, "Is always valid");
+        }
+
+        /// <summary>
+        /// Validation for TopOffset property value
+        /// </summary>
+        private void Validate_TopOffset()
+        {
+            Validate(true, "Is always valid");
+        }
+
+        /// <summary>
+        /// Validation for RightOffset property value
+        /// </summary>
+        private void Validate_RightOffset()
+        {
+            Validate(true, "Is always valid");
+        }
+
+        #endregion
+
+        #region Properties
+
+        /// <summary>
+        /// Text to render in tag
+        /// </summary>
+        public string Text
+        {
+            get { return m_Text; }
+            set { m_Text = value; OnPropertyChanged(this.Property(() => Text)); }
+        }
+
+        /// <summary>
+        /// Name of the color to use
+        /// </summary>
+        public string ColorName
+        {
+            get { return m_ColorName; }
+            set { m_ColorName = value; OnPropertyChanged(this.Property(() => ColorName)); }
+        }
+
+        /// <summary>
+        /// User specified offset from the top of the host window client area
+        /// </summary>
+        public int TopOffset
+        {
+            get { return m_TopOffset; }
+            set { m_TopOffset = value; OnPropertyChanged(this.Property(() => TopOffset)); }
+        }
+
+        /// <summary>
+        /// User specified offset from the right of the host window client area
+        /// </summary>
+        public int RightOffset
+        {
+            get { return m_RightOffset; }
+            set { m_RightOffset = value; OnPropertyChanged(this.Property(() => RightOffset)); }
+        }
+
+        #endregion
     }
 }


Fix for GetCropUrl method when mediaItem.Url has JSON data

--- src/Umbraco.Web/ImageCropperTemplateExtensions.cs
+++ src/Umbraco.Web/ImageCropperTemplateExtensions.cs
@@ -41,17 +41,21 @@
             Anchor? anchor = null,
             string propertyAlias = null,
             string cropAlias = null,
-            string furtherOptions = null,
-            bool slimmage = false)
+            string furtherOptions = null)
         {
             string imageCropperValue = null;
+
+           string mediaItemUrl = null;

             if (mediaItem.HasPropertyAndValueAndCrop(propertyAlias, cropAlias))
             {
                 imageCropperValue = mediaItem.GetPropertyValue<string>(propertyAlias);
             }

-            return mediaItem != null ? GetCropUrl(mediaItem.Url, width, height, quality, mode, anchor, imageCropperValue, cropAlias, furtherOptions, slimmage) : string.Empty;
+           //this probably shouldn't be needed but it is currently as mediaItem.Url is populated with full crop JSON
+           mediaItemUrl = mediaItem.Url.DetectIsJson() ? mediaItem.Url.SerializeToCropDataSet().Src : mediaItem.Url;
+
+           return mediaItem != null ? GetCropUrl(mediaItemUrl, width, height, quality, mode, anchor, imageCropperValue, cropAlias, furtherOptions) : string.Empty;
         }

@@ -64,8 +68,7 @@
             Anchor? anchor = null,
             string imageCropperValue = null,
             string cropAlias = null,
-            string furtherOptions = null,
-            bool slimmage = false)
+            string furtherOptions = null)
         {
             if (!string.IsNullOrEmpty(imageUrl))
             {
@@ -100,8 +103,6 @@
                         }

                     }
-
-                    //imageResizerUrl.Append(cropDataSet.Src + cropDataSet.GetCropUrl(cropAlias));
                 }
                 else
                 {
@@ -131,19 +132,6 @@
                 if (height != null)
                 {
                     imageResizerUrl.Append("&height=" + height);
-                }
-
-                if (slimmage)
-                {
-                    if (width == null)
-                    {
-                        imageResizerUrl.Append("&width=300");
-                    }
-                    if (quality == null)
-                    {
-                        imageResizerUrl.Append("&quality=90");
-                    }
-                    imageResizerUrl.Append("&slimmage=true");
                 }

                 if (furtherOptions != null)


Add autocomplete to Get-UnicornConfiguration

--- src/Unicorn/PowerShell/GetUnicornConfiguration.cs
+++ src/Unicorn/PowerShell/GetUnicornConfiguration.cs
@@ -1,6 +1,7 @@
 using System.Linq;
 using System.Management.Automation;
 using Cognifide.PowerShell.Commandlets;
+using Cognifide.PowerShell.Core.Validation;
 using Unicorn.Configuration;

 namespace Unicorn.PowerShell
@@ -13,6 +14,8 @@
 	[OutputType(typeof(IConfiguration)), Cmdlet("Get", "UnicornConfiguration")]
 	public class GetUnicornConfigurationCommand : BaseCommand
 	{
+		public static string[] Autocomplete = UnicornConfigurationManager.Configurations.Select(cfg => cfg.Name).ToArray();
+
 		protected override void ProcessRecord()
 		{
 			var configs = UnicornConfigurationManager.Configurations;
@@ -28,7 +31,7 @@
 			}
 		}

-		[Parameter(Position = 0)]
+		[Parameter(Position = 0), AutocompleteSet("Autocomplete")]
 		public string Filter { get; set; }
 	}
 }