fixed dll version

fixed dll version

--- unirest-net/unirest-net/Properties/AssemblyInfo.cs
+++ unirest-net/unirest-net/Properties/AssemblyInfo.cs
@@ -6,9 +6,9 @@
 [assembly: AssemblyTitle("unirest-net")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyCompany("APIMATIC")]
 [assembly: AssemblyProduct("unirest-net")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
+[assembly: AssemblyCopyright("Copyright © APIMATIC 2015")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

@@ -22,5 +22,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.4.3")]
-[assembly: AssemblyFileVersion("1.0.4.3")]
+[assembly: AssemblyVersion("1.0.0.2")]
+[assembly: AssemblyFileVersion("1.0.0.2")]


Add UnitTest for EditExpense#Location.

Add UnitTest for EditExpense#Location.

--- client/BlueMonkey/BlueMonkey.Model.Tests/EditExpenseTest.cs
+++ client/BlueMonkey/BlueMonkey.Model.Tests/EditExpenseTest.cs
@@ -54,5 +54,19 @@
             Assert.PropertyChanged(actual, "Date", () => actual.Date = DateTime.MaxValue);
             Assert.Equal(DateTime.MaxValue, actual.Date);
         }
+
+        [Fact]
+        public void LocationProperty()
+        {
+            var expenseService = new Mock<IExpenseService>();
+            var fileUploadService = new Mock<IFileUploadService>();
+            var dateTimeService = new Mock<IDateTimeService>();
+            var mediaService = new Mock<IMediaService>();
+            var actual = new EditExpense(expenseService.Object, fileUploadService.Object, dateTimeService.Object, mediaService.Object);
+
+            Assert.Null(actual.Location);
+            Assert.PropertyChanged(actual, "Location", () => actual.Location = "update");
+            Assert.Equal("update", actual.Location);
+        }
     }
 }


Fixed multi control support for XNA

Fixed multi control support for XNA

--- EvoNet/WinFormsGraphicsDevice/GraphicsDeviceControl.cs
+++ EvoNet/WinFormsGraphicsDevice/GraphicsDeviceControl.cs
@@ -65,7 +65,7 @@
             {
                 UpdateGameTime();
                 Update(gametime);
-                OnUpdate(gametime);
+                OnUpdate?.Invoke(gametime);
                 //Draw(gametime);
                 base.Refresh();
             }
@@ -275,7 +275,11 @@
         {
             try
             {
-                GraphicsDevice.Present();
+                // Present only the viewable part of the backbuffer of this control
+                Rectangle sourceRectangle = new Rectangle(0, 0, ClientSize.Width,
+                                                                ClientSize.Height);
+
+                GraphicsDevice.Present(sourceRectangle, null, this.Handle);
             }
             catch
             {


fix unit test

fix unit test

--- Facts/Library/Coverage/BlanketJsCoverageEngineFacts.cs
+++ Facts/Library/Coverage/BlanketJsCoverageEngineFacts.cs
@@ -40,7 +40,13 @@

                 Mock<IFileSystemWrapper>()
                     .Setup(x => x.GetLines(@"X:\file1.ts"))
-                    .Returns(new[] { "typescript" });
+                    .Returns(new[] { "typescript" });
+
+
+
+                Mock<IFileSystemWrapper>()
+                    .Setup(x => x.FileExists(It.IsAny<string>()))
+                    .Returns(true);
             }
         }


Added missing method to IApi interface

Added missing method to IApi interface

--- src/OneCog.Io.Spark/Api.cs
+++ src/OneCog.Io.Spark/Api.cs
@@ -16,6 +16,7 @@
     {
         Task<IEnumerable<IDevicesInfo>> GetCores();
         Task<IVariable> ReadVariable(string deviceId, string variableName);
+        IObservable<IVariable> ObserveVariable(string deviceId, string variableName, TimeSpan interval, IScheduler scheduler = null);
         Task<IFunctionResult> CallFunction(string deviceId, string functionName, string arguments);
     }


Fixed a crash caused by class template specialisations parsed just as classes.

Signed-off-by: Dimitar Dobrev <ca751a5c976abad79158718440750fc638d19ebc@protonmail.com>

--- src/Parser/ASTConverter.cs
+++ src/Parser/ASTConverter.cs
@@ -940,19 +940,19 @@
                 _ctx.Functions.Add(_decl);
             }

+            for (uint i = 0; i < ctx.TemplatesCount; ++i)
+            {
+                var decl = ctx.getTemplates(i);
+                var _decl = Visit(decl) as AST.Template;
+                _ctx.Templates.Add(_decl);
+            }
+
             for (uint i = 0; i < ctx.ClassesCount; ++i)
             {
                 var decl = ctx.getClasses(i);
                 var _decl = Visit(decl) as AST.Class;
                 if (!_decl.IsIncomplete)
                     _ctx.Classes.Add(_decl);
-            }
-
-            for (uint i = 0; i < ctx.TemplatesCount; ++i)
-            {
-                var decl = ctx.getTemplates(i);
-                var _decl = Visit(decl) as AST.Template;
-                _ctx.Templates.Add(_decl);
             }

             for (uint i = 0; i < ctx.TypedefsCount; ++i)


Testing

Testing

--- King.Azure.Imaging.Unit.Test/ImagePreprocessorTests.cs
+++ King.Azure.Imaging.Unit.Test/ImagePreprocessorTests.cs
@@ -1,5 +1,6 @@
 namespace King.Azure.Imaging.Unit.Test
 {
+    using NSubstitute;
     using NUnit.Framework;
     using System;
     using System.Collections.Generic;
@@ -44,5 +45,53 @@
             var connectionString = "UseDevelopmentStorage=true";
             new ImagePreprocessor(connectionString, null);
         }
+
+        [Test]
+        [ExpectedException(typeof(ArgumentNullException))]
+        public async Task ProcessContentNull()
+        {
+            var connectionString = "UseDevelopmentStorage=true";
+            var elements = Substitute.For<IStorageElements>();
+            elements.Container.Returns(Guid.NewGuid().ToString());
+            elements.Table.Returns(Guid.NewGuid().ToString());
+            elements.Queue.Returns(Guid.NewGuid().ToString());
+
+            var ip = new ImagePreprocessor(connectionString, elements);
+            await ip.Process(null, Guid.NewGuid().ToString(), Guid.NewGuid().ToString());
+        }
+
+        [Test]
+        [ExpectedException(typeof(ArgumentException))]
+        public async Task ProcessContentTypeNull()
+        {
+            var random = new Random();
+            var bytes = new byte[64];
+            random.NextBytes(bytes);
+            var connectionString = "UseDevelopmentStorage=true";
+            var elements = Substitute.For<IStorageElements>();
+            elements.Container.Returns(Guid.NewGuid().ToString());
+            elements.Table.Returns(Guid.NewGuid().ToString());
+            elements.Queue.Returns(Guid.NewGuid().ToString());
+
+            var ip = new ImagePreprocessor(connectionString, elements);
+            await ip.Process(bytes, null, Guid.NewGuid().ToString());
+        }
+
+        [Test]
+        [ExpectedException(typeof(ArgumentException))]
+        public async Task ProcessFileNameNull()
+        {
+            var random = new Random();
+            var bytes = new byte[64];
+            random.NextBytes(bytes);
+            var connectionString = "UseDevelopmentStorage=true";
+            var elements = Substitute.For<IStorageElements>();
+            elements.Container.Returns(Guid.NewGuid().ToString());
+            elements.Table.Returns(Guid.NewGuid().ToString());
+            elements.Queue.Returns(Guid.NewGuid().ToString());
+
+            var ip = new ImagePreprocessor(connectionString, elements);
+            await ip.Process(bytes, Guid.NewGuid().ToString(), null);
+        }
     }
 }


Remove event handler when disposed.

Remove event handler when disposed.

--- Libraries/Sources/Behaviors/Messages/NoticeBehavior.cs
+++ Libraries/Sources/Behaviors/Messages/NoticeBehavior.cs
@@ -64,7 +64,18 @@
         /// </summary>
         ///
         /* ----------------------------------------------------------------- */
-        protected override void Invoke(NoticeMessage src)
+        protected override void Invoke(NoticeMessage src) => ShowAsync(src).Forget();
+
+        /* ----------------------------------------------------------------- */
+        ///
+        /// ShowAsync
+        ///
+        /// <summary>
+        /// Shows a new window with the specified notice information.
+        /// </summary>
+        ///
+        /* ----------------------------------------------------------------- */
+        private async Task ShowAsync(NoticeMessage src)
         {
             var cts  = new CancellationTokenSource();
             var view = new NoticeWindow();
@@ -72,6 +83,7 @@
             void handler(object s, ValueEventArgs<NoticeComponent> e)
             {
                 cts.Cancel();
+                view.Selected -= handler;
                 view.Close();
                 src.Callback?.Invoke(e.Value, src.Value);
             }
@@ -82,20 +94,6 @@
             view.Set(src.Style);
             view.Set(src.Location);

-            ShowAsync(src, view, cts).Forget();
-        }
-
-        /* ----------------------------------------------------------------- */
-        ///
-        /// Invoke
-        ///
-        /// <summary>
-        /// Shows a new window with the specified notice information.
-        /// </summary>
-        ///
-        /* ----------------------------------------------------------------- */
-        private async Task ShowAsync(NoticeMessage src, NoticeWindow view, CancellationTokenSource cts)
-        {
             if (src.InitialDelay > TimeSpan.Zero) await Task.Delay(src.InitialDelay);
             view.Show();
             if (src.DisplayTime == TimeSpan.Zero) return; // Zero means infinity.
@@ -103,6 +101,7 @@
             try
             {
                 await Task.Delay(src.DisplayTime, cts.Token);
+                view.Selected -= handler;
                 view.Close();
             }
             catch (TaskCanceledException) { /* ignore user cancel */ }


Move clear line functionality to method

Move clear line functionality to method

--- src/ReadLine/KeyHandler.cs
+++ src/ReadLine/KeyHandler.cs
@@ -64,6 +64,13 @@
                 MoveCursorRight();
         }

+        private void ClearLine()
+        {
+            MoveCursorEnd();
+            while (!IsStartOfLine())
+                Backspace();
+        }
+
         private void WriteChar()
         {
             char key = _keyInfo.KeyChar;
@@ -126,6 +133,7 @@
             _keyActions["ControlE"] = MoveCursorEnd;
             _keyActions["Backspace"] = Backspace;
             _keyActions["ControlH"] = Backspace;
+            _keyActions["ControlL"] = ClearLine;
             _keyActions["ControlU"] = () =>
             {
                 while (!IsStartOfLine())
@@ -136,12 +144,6 @@
                 int pos = _cursorPos;
                 MoveCursorEnd();
                 while (_cursorPos > pos)
-                    Backspace();
-            };
-            _keyActions["ControlL"] = () =>
-            {
-                MoveCursorEnd();
-                while (!IsStartOfLine())
                     Backspace();
             };
             _keyActions["ControlW"] = () =>


Update

Update

--- media-functions-for-logic-app/return-analytics/run.csx
+++ media-functions-for-logic-app/return-analytics/run.csx
@@ -6,9 +6,8 @@
     "assetFaceRedactionId" : "nb:cid:UUID:88432c30-cb4a-4496-88c2-b2a05ce9033b", // Id of the source asset that contains media analytics (face redaction)
     "assetMotionDetectionId" : "nb:cid:UUID:88432c30-cb4a-4496-88c2-b2a05ce9033b",  // Id of the source asset that contains media analytics (motion detection)
     "timeOffset" :"00:01:00", // optional, offset to add to subtitles (used for live analytics)
-    "copyToContainer" : "jpgfaces" // Optional, to copy jpg fiels to a specific container in the same storage account
+    "copyToContainer" : "jpgfaces" // Optional, to copy jpg files to a specific container in the same storage account. Use lowercases as this is the container name and there are restrictions
     "deleteAsset" : true // Optional, delete the asset(s) once data has been read from it
-
  }

 Output:
@@ -90,6 +89,7 @@

     string copyToContainer = "";
     string prefixjpg = "";
+    string targetContainerUri = "";

     string jsonContent = await req.Content.ReadAsStringAsync();
     dynamic data = JsonConvert.DeserializeObject(jsonContent);
@@ -160,6 +160,7 @@
                 var sourceContainer = GetCloudBlobContainer(_storageAccountName, _storageAccountKey, outputAsset.Uri.Segments[1]);
                 var targetContainer = GetCloudBlobContainer(_storageAccountName, _storageAccountKey, copyToContainer);
                 CopyJPGsAsync(sourceContainer, targetContainer, prefixjpg, log);
+                targetContainerUri = targetContainer.Uri;
             }

             foreach (IAssetFile file in jpgFiles)
@@ -176,7 +177,7 @@
                     {
                         if (copyToContainer != "")
                         {
-                            entry.url = targetContainer.Uri + "/" + prefixjpg + file.Name;
+                            entry.url = targetContainerUri + "/" + prefixjpg + file.Name;
                         }
                         else
                         {
@@ -289,7 +290,7 @@
         destinationBlobContainer.SetPermissions(new BlobContainerPermissions
         {
             PublicAccess = BlobContainerPublicAccessType.Container // read-only access to container
-    });
+        });
     }

     string blobPrefix = null;


readability

readability

--- src/ResinCore/Collector.cs
+++ src/ResinCore/Collector.cs
@@ -127,54 +127,44 @@

         private void Score(QueryContext query)
         {
-            if (query.Postings == null)
+            var scores = new List<DocumentScore>(query.Postings.Count);
+
+            if (query.Postings != null)
             {
-                query.Scored = new List<DocumentScore>();
-            }
-            else
-            {
-                query.Scored = DoScore(query.Postings);
-            }
-        }
-
-        private IList<DocumentScore> DoScore(IList<DocumentPosting> postings)
-        {
-            var scores = new List<DocumentScore>(postings.Count);
-
-            if (_scorerFactory == null)
-            {
-                foreach (var posting in postings)
+                if (_scorerFactory == null)
                 {
-                    var docHash = _readSession.ReadDocHash(posting.DocumentId);
-
-                    if (!docHash.IsObsolete)
-                    {
-                        scores.Add(new DocumentScore(posting.DocumentId, docHash.Hash, 0, _readSession.Version));
-                    }
-                }
-            }
-            else
-            {
-                if (postings.Any())
-                {
-                    var docsWithTerm = postings.Count;
-
-                    var scorer = _scorerFactory.CreateScorer(_readSession.Version.DocumentCount, docsWithTerm);
-
-                    foreach (var posting in postings)
+                    foreach (var posting in query.Postings)
                     {
                         var docHash = _readSession.ReadDocHash(posting.DocumentId);

                         if (!docHash.IsObsolete)
                         {
-                            var score = scorer.Score(posting);
-
-                            scores.Add(new DocumentScore(posting.DocumentId, docHash.Hash, score, _readSession.Version));
+                            scores.Add(new DocumentScore(posting.DocumentId, docHash.Hash, 0, _readSession.Version));
                         }
                     }
                 }
+                else
+                {
+                    if (query.Postings.Any())
+                    {
+                        var docsWithTerm = query.Postings.Count;
+                        var scorer = _scorerFactory.CreateScorer(_readSession.Version.DocumentCount, docsWithTerm);
+
+                        foreach (var posting in query.Postings)
+                        {
+                            var docHash = _readSession.ReadDocHash(posting.DocumentId);
+
+                            if (!docHash.IsObsolete)
+                            {
+                                var score = scorer.Score(posting);
+
+                                scores.Add(new DocumentScore(posting.DocumentId, docHash.Hash, score, _readSession.Version));
+                            }
+                        }
+                    }
+                }
+                query.Scored = scores;
             }
-            return scores;
         }

         private ITrieReader GetTreeReader(string field)


Avoid allocation extract images

Avoid allocation extract images

--- src/SmartReader/Article.cs
+++ src/SmartReader/Article.cs
@@ -111,48 +111,52 @@
         /// <returns>
         /// A Task object with the images found
         /// </returns>
-        public async Task<IEnumerable<Image>> GetImagesAsync(long minSize = 75000)
-        {
+        public async Task<IReadOnlyList<Image>> GetImagesAsync(long minSize = 75_000)
+        {
+            var imgs = _element?.QuerySelectorAll("img");
+
+            if (imgs is null)
+            {
+                return Array.Empty<Image>();
+            }
+
             var images = new List<Image>();

-            var imgs = _element?.QuerySelectorAll("img");
-
-            if (imgs != null)
-            {
-                foreach (var img in imgs)
+            foreach (var img in imgs)
+            {
+                if (img.GetAttribute("src") is { Length: > 0 } src)
                 {
-                    if (img.GetAttribute("src") is { Length: > 0 } src)
+                    long size = 0;
+
+                    var imageUri = new Uri(src);
+
+                    try
                     {
-                        long size = 0;
-
-                        var imageUri = new Uri(src);
-
-                        try
+                        imageUri = new Uri(Uri.ToAbsoluteURI(imageUri.ToString()));
+                        size = await _reader!.GetImageSizeAsync(imageUri);
+                    }
+                    catch { }
+
+                    string description = img.GetAttribute("alt");
+                    string title = img.GetAttribute("title");
+
+                    if (size > minSize)
+                    {
+                        images.Add(new Image()
                         {
-                            imageUri = new Uri(Uri.ToAbsoluteURI(imageUri.ToString()));
-                            size = await _reader!.GetImageSizeAsync(imageUri);
-                        }
-                        catch { }
-
-                        string description = img.GetAttribute("alt");
-                        string title = img.GetAttribute("title");
-
-                        if (size > minSize)
-                        {
-                            images.Add(new Image()
-                            {
-                                Size = size,
-                                Source = imageUri,
-                                Description = description,
-                                Title = title
-                            });
-                        }
+                            Size = size,
+                            Source = imageUri,
+                            Description = description,
+                            Title = title
+                        });
                     }
                 }
-
-                // if there is no featured image, let's set the first one we found
-                if (string.IsNullOrEmpty(FeaturedImage) && images.Count > 0)
-                    FeaturedImage = images[0].Source!.ToString();
+            }
+
+            // if there is no featured image, let's set the first one we found
+            if (string.IsNullOrEmpty(FeaturedImage) && images.Count > 0)
+            {
+                FeaturedImage = images[0].Source!.ToString();
             }

             return images;


FUNCTION Added keyword 'skip' to SOQL parser

--- src/Sooda/QL/SoqlParser.cs
+++ src/Sooda/QL/SoqlParser.cs
@@ -569,6 +569,13 @@
                 tokenizer.GetNextToken();
             }

+            if (tokenizer.IsKeyword("skip"))
+            {
+                tokenizer.EatKeyword();
+                query.StartIdx = Convert.ToInt32(tokenizer.TokenValue);
+                tokenizer.GetNextToken();
+            }
+
             if (tokenizer.IsKeyword("distinct"))
             {
                 tokenizer.EatKeyword();


Add typed OpenChannel to IActorBoundGateway.

--- plugins/Akka.Interfaced.SlimServer/Interface/IActorBoundGateway.cs
+++ plugins/Akka.Interfaced.SlimServer/Interface/IActorBoundGateway.cs
@@ -5,6 +5,7 @@
 {
     public interface IActorBoundGateway : IInterfacedActor
     {
+        Task<string> OpenChannel(InterfacedActorRef actor, ActorBindingFlags bindingFlags = 0);
         Task<string> OpenChannel(IActorRef actor, TaggedType[] types, ActorBindingFlags bindingFlags = 0);
     }
 }


Remove all conditional code used to support .NET 1.x builds

--HG--
extra : convert_revision : charlie%40nunit.org-20111202204501-ovw4n4hahsf0nzw1

--- NUnitEngine/src/nunit.engine/Internal/InternalTrace.cs
+++ NUnitEngine/src/nunit.engine/Internal/InternalTrace.cs
@@ -81,11 +81,7 @@
             Writer.WriteLine("{0} {1,-5} [{2,2}] {3}: {4}",
                 DateTime.Now.ToString(TIME_FMT),
                 level == InternalTraceLevel.Verbose ? "Debug" : level.ToString(),
-#if CLR_2_0 || CLR_4_0
                 System.Threading.Thread.CurrentThread.ManagedThreadId,
-#else
-                AppDomain.GetCurrentThreadId(),
-#endif
                 category,
                 message);


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 )


Support for CORS with simple requests in BaseHttpServer

--- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -1450,6 +1450,10 @@
             if (responsedata.ContainsKey("reusecontext"))
                 response.ReuseContext = (bool) responsedata["reusecontext"];

+            // Cross-Origin Resource Sharing with simple requests
+            if (responsedata.ContainsKey("access_control_allow_origin"))
+                response.AddHeader("Access-Control-Allow-Origin", (string)responsedata["access_control_allow_origin"]);
+
             //Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this
             //and should check for NullReferenceExceptions


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

These would be specified in the [GridService] section of Robust.HG.ini, which already lists these in the example text.
Untested patch so that Neb can easily pull in for testing, though shouldn't disrupt existing hg logins since fallback processing is a bit of code stuck on the end of the login sequence.

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

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

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

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

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

-            m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag);
-            return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
+            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;
         }

         protected bool Authenticate(AgentCircuitData aCircuit)


Bugfix for cost properties not shown in editor

--- PART/Source/Core/Engine/IHasConfigurationProperties.cs
+++ PART/Source/Core/Engine/IHasConfigurationProperties.cs
@@ -23,7 +23,7 @@
             if (obj.ConfigurationProperties == null)
                 obj.ConfigurationProperties = new Dictionary<string, string>();

-            var keys = obj.ConfigurationKeys.Select(k => k.Name).ToArray();
+            var keys = obj.ToAllPropertyInfo().Select(k => k.Name).ToArray();
             foreach (var o in encryptedPropsObj.ToPropertiesDictionary(keys))
             {
                 obj.ConfigurationProperties[o.Key] = o.Value;


Remove nameof from ExchangeSource. CI builds are on MSBuild v12.0

--- src/Supa/ExchangeSource.cs
+++ src/Supa/ExchangeSource.cs
@@ -54,7 +54,7 @@
         {
             if (string.IsNullOrEmpty(folderName))
             {
-                throw new ArgumentNullException(nameof(folderName));
+                throw new ArgumentNullException("folderName");
             }

             this.folderName = folderName;


Fix whitespace

Fix whitespace

--- PartPreviewWindow/View3D/Actions/IntersectionEditor.cs
+++ PartPreviewWindow/View3D/Actions/IntersectionEditor.cs
@@ -46,6 +46,8 @@

 		public bool Unlocked { get; } = true;

+		public IEnumerable<Type> SupportedTypes() => new Type[] { typeof(MeshWrapperOperation) };
+
 		public GuiWidget Create(IObject3D group, View3DWidget view3DWidget, ThemeConfig theme)
 		{
 			this.view3DWidget = view3DWidget;
@@ -70,42 +72,36 @@
 			return mainContainer;
 		}

-		public IEnumerable<Type> SupportedTypes() => new Type[]
-		{
-			typeof(MeshWrapperOperation),
-		};
-
 		private async void ProcessBooleans(IObject3D group)
 		{
-				// spin up a task to remove holes from the objects in the group
-				await Task.Run(() =>
+			await Task.Run(() =>
+			{
+				var participants = group.Descendants().Where((obj) => obj.OwnerID == group.ID);
+
+				if (participants.Count() > 1)
 				{
-					var participants = group.Descendants().Where((obj) => obj.OwnerID == group.ID);
+					var first = participants.First();

-					if (participants.Count() > 1)
+					foreach (var remove in participants)
 					{
-						var first = participants.First();
+						if (remove != first)
+						{
+							var transformedRemove = Mesh.Copy(remove.Mesh, CancellationToken.None);
+							transformedRemove.Transform(remove.WorldMatrix());

-						foreach (var remove in participants)
-						{
-							if(remove != first)
-							{
-								var transformedRemove = Mesh.Copy(remove.Mesh, CancellationToken.None);
-								transformedRemove.Transform(remove.WorldMatrix());
+							var transformedKeep = Mesh.Copy(first.Mesh, CancellationToken.None);
+							transformedKeep.Transform(first.WorldMatrix());

-								var transformedKeep = Mesh.Copy(first.Mesh, CancellationToken.None);
-								transformedKeep.Transform(first.WorldMatrix());
-
-								transformedKeep = PolygonMesh.Csg.CsgOperations.Intersect(transformedKeep, transformedRemove);
-								var inverse = first.WorldMatrix();
-								inverse.Invert();
-								transformedKeep.Transform(inverse);
-								first.Mesh = transformedKeep;
-								remove.Visible = false;
-							}
+							transformedKeep = PolygonMesh.Csg.CsgOperations.Intersect(transformedKeep, transformedRemove);
+							var inverse = first.WorldMatrix();
+							inverse.Invert();
+							transformedKeep.Transform(inverse);
+							first.Mesh = transformedKeep;
+							remove.Visible = false;
 						}
 					}
-				});
+				}
+			});
 		}
 	}
 }


refactors dup client instantiation

refactors dup client instantiation

--- Rosie/Program.cs
+++ Rosie/Program.cs
@@ -14,13 +14,11 @@

         public async Task MainAsync()
         {
-            var client = new DiscordSocketClient();
-
-            client.Log += Logger;
+            _client.Log += Logger;

             string token = APIKeys.DiscordClientToken;
-            await client.LoginAsync(TokenType.Bot, token);
-            await client.StartAsync();
+            await _client.LoginAsync(TokenType.Bot, token);
+            await _client.StartAsync();

             // Block this task until the program is closed.
             await Task.Delay(-1);


修正会漏掉有效的table的元素节点的BUG

修正会漏掉有效的table的元素节点的BUG

--- ConfigInfo.cs
+++ ConfigInfo.cs
@@ -227,7 +227,7 @@
                 string cellType = tableCellTypeList[enumColumnIndex];
                 TableNode subNode = rowsInfo[rowIndex][enumColumnIndex];

-                if (SerializeNestDataLength(cellTag, maxNestColumnCount - 1, ref subNestEleCount) || subNestEleCount != -1)
+                if (SerializeNestDataLength(cellTag, maxNestColumnCount, ref subNestEleCount) || subNestEleCount != -1)
                 {
                     int tempEndIndex = enumColumnIndex + 1;


Async Result - throw exception if result attempt to be overwritten.  Also Fail now also invokes callback rather than calling it directly.

--- src/TiddlyCsv/TiddlyCsv.cs
+++ src/TiddlyCsv/TiddlyCsv.cs
@@ -917,6 +917,11 @@
         /// <param name="completedSynchronously"></param>
         internal void Fail(Exception failure, bool completedSynchronously)
         {
+            if (Thread.VolatileRead(ref this.completedState) != CompletePending)
+            {
+                throw new InvalidOperationException("Attempt to overwrite completed result by Fail.");
+            }
+
             // completedSynchronously field MUST be set prior calling the callback
             Thread.VolatileWrite(
                 ref this.completedState,
@@ -926,8 +931,8 @@
             // If event is being used, flag complete
             if (null != asyncWaitHandler) asyncWaitHandler.Set();

-            // If we have a call back, call it
-            if (null != callback) callback(this);
+            // If we have a call back, call it.  Do not block waiting for callback to complete.
+            if (null != callback) callback.BeginInvoke(this, (ar) => callback.EndInvoke(ar), null);
         }

         /// <summary>
@@ -937,6 +942,12 @@
         /// <param name="completedSynchronously"></param>
         internal void Success(TResult successfulResult, bool completedSynchronously)
         {
+            if (Thread.VolatileRead(ref this.completedState) != CompletePending)
+            {
+                throw new InvalidOperationException("Attempt to overwrite completed result by Success.");
+            }
+
+            // completedSynchronously field MUST be set prior calling the callback
             Thread.VolatileWrite(
                 ref this.completedState,
                 completedSynchronously ? CompletedSynchronouslyState : CompletedAsynchronouslyState);
@@ -945,7 +956,8 @@
             // If event is being used, flag complete
             if (null != asyncWaitHandler) asyncWaitHandler.Set();

-            // If we have a call back, call it.  Call async to prevent stack overflow.
+            // If we have a call back, call it.  Do not block waiting for callback to complete.
+            // NOTE: Calling syncronously was causing stack overflow in Document As Rows implementation.
             if (null != callback) callback.BeginInvoke(this, (ar) => callback.EndInvoke(ar), null);
         }


support for PATCH and HEAD methods

support for PATCH and HEAD methods

--- Server/Server.cs
+++ Server/Server.cs
@@ -23,13 +23,7 @@
     [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")]
     public class Server
     {
-        private enum HttpVerb
-        {
-            Get,
-            Post,
-            Put,
-            Delete
-        }
+

         private readonly HttpListener _listener;
         private readonly string _serverAdress;
@@ -113,6 +107,26 @@
         public void Delete(string url, Action<HttpListenerRequest, IServerResponse> act)
         {
             AddHandler(url, HttpVerb.Delete, act);
+        }
+
+        /// <summary>
+        /// Adds a listener for a patch request
+        /// </summary>
+        /// <param name="url">the full url to handle</param>
+        /// <param name="act">callback to the handler</param>
+        public void Patch(string url, Action<HttpListenerRequest, IServerResponse> act)
+        {
+            AddHandler(url, HttpVerb.Patch, act);
+        }
+
+        /// <summary>
+        /// Adds a listener for a head request
+        /// </summary>
+        /// <param name="url">the full url to handle</param>
+        /// <param name="act">callback to the handler</param>
+        public void Head(string url, Action<HttpListenerRequest, IServerResponse> act)
+        {
+            AddHandler(url, HttpVerb.Head, act);
         }

         /// <summary>
@@ -150,6 +164,12 @@
                         break;
                     case "DELETE":
                         verb = HttpVerb.Delete;
+                        break;
+                    case "HEAD":
+                        verb = HttpVerb.Head;
+                        break;
+                    case "PATCH":
+                        verb = HttpVerb.Patch;
                         break;
                 }


Update Battle Arena help files as well.

Update Battle Arena help files as well.

--- Plugins/BattleArenaManager/BattleArenaManagerPlugin.cs
+++ Plugins/BattleArenaManager/BattleArenaManagerPlugin.cs
@@ -496,7 +496,7 @@

                     // Copy data files.
                     ConsoleUtils.WriteLine("Updating data files...");
-                    foreach (string directory in new string[] { "bosses", "monsters", "npcs", "summons", "dbs", "lsts", "txts", "dungeons" }) {
+                    foreach (string directory in new string[] { "bosses", "monsters", "npcs", "summons", "dbs", "lsts", "txts", "dungeons", "help-files" }) {
                         Directory.CreateDirectory(Path.Combine(this.ArenaDirectory, directory));
                         files = Directory.GetFiles(Path.Combine(Path.GetTempPath(), baseFolderName, "battlearena", directory));
                         foreach (string file2 in files) {


added links to workgroup management pages

--- Purchasing.Web/Views/WorkgroupManagement/Manage.cshtml
+++ Purchasing.Web/Views/WorkgroupManagement/Manage.cshtml
@@ -8,17 +8,17 @@

         @name:
         @count
-        Edit
+        @Html.ActionLink("Edit", action ?? name, "WorkgroupManagement", null, null, action == null ? null : name, new { id = Model.Workgroup.Id }, null)

 }

 @section SubNav
 {

-
Accounts

-
Vendors

-
Addresses

-
People

+
@Html.ActionLink("Accounts", "Accounts", "WorkgroupManagement", new { id = Model.Workgroup.Id }, null)

+
@Html.ActionLink("Vendors", "Vendors", "WorkgroupManagement", new { id = Model.Workgroup.Id }, null)

+
@Html.ActionLink("Addresses", "Addresses", "WorkgroupManagement", new { id = Model.Workgroup.Id }, null)

+
@Html.ActionLink("People", "People", "WorkgroupManagement", new { id = Model.Workgroup.Id }, null)

 }


Longer ping interval

Longer ping interval

--- SessionPinger.cs
+++ SessionPinger.cs
@@ -81,7 +81,7 @@
 				// Wait 10 minutes or until the padlock is cancelled.
 				lock (_padlock)
 				{
-					Monitor.Wait(_padlock, TimeSpan.FromMinutes(1));
+					Monitor.Wait(_padlock, TimeSpan.FromMinutes(10));
 				}
 			}
 		}


Delete Settings.ascx.cs

Delete Settings.ascx.cs

Cleanup

--- Settings.ascx.cs
+++ Settings.ascx.cs
@@ -1,130 +0,0 @@
-//
-// Copyright (c) 2018 DNN Connect, https://www.dnn-connect.org
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy of this
-// software and associated documentation files (the "Software"), to deal in the Software
-// without restriction, including without limitation the rights to use, copy, modify, merge,
-// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
-// to whom the Software is furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all copies or
-// substantial portions of the Software.
-
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
-// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Web.UI.WebControls;
-using DotNetNuke.Services.Exceptions;
-using System;
-using DotNetNuke.Services.Localization;
-using DotNetNuke.Entities.Modules;
-
-namespace DNN.Modules.IdentitySwitcher
-{
-
-    /// -----------------------------------------------------------------------------
-    /// <summary>
-    /// The Settings class manages Module Settings
-    /// </summary>
-    /// <remarks>
-    /// </remarks>
-    /// <history>
-    /// </history>
-    /// -----------------------------------------------------------------------------
-    [DNNtc.ModuleControlProperties("Settings", "IdentitySwitcher Settings", DNNtc.ControlType.Edit, "", false, false)]
-	public partial class Settings : ModuleSettingsBase
-    {
-
-#region Base Method Implementations
-
-		/// -----------------------------------------------------------------------------
-		/// <summary>
-		/// LoadSettings loads the settings from the Database and displays them
-		/// </summary>
-		/// <remarks>
-		/// </remarks>
-		/// <history>
-		/// </history>
-		/// -----------------------------------------------------------------------------
-		public override void LoadSettings()
-		{
-			try
-			{
-				if (Page.IsPostBack == false)
-				{
-					rbSortBy.Items.Add(new ListItem(Localization.GetString("SortByDisplayName", LocalResourceFile), "DisplayName"));
-					rbSortBy.Items.Add(new ListItem(Localization.GetString("SortByUserName", LocalResourceFile), "UserName"));
-					rbSortBy.SelectedIndex = 0;
-
-
-					if (UserInfo.IsSuperUser)
-					{
-						if (TabModuleSettings.Contains("includeHost"))
-						{
-							this.cbIncludeHostUser.Checked = bool.Parse(System.Convert.ToString(TabModuleSettings["includeHost"].ToString()));
-						}
-					}
-					else
-					{
-						trHostSettings.Visible = false;
-					}
-					if (TabModuleSettings.Contains("useAjax"))
-					{
-						this.cbUseAjax.Checked = bool.Parse(System.Convert.ToString(TabModuleSettings["useAjax"].ToString()));
-					}
-					else
-					{
-						this.cbUseAjax.Checked = true;
-					}
-
-					if (TabModuleSettings.Contains("sortBy"))
-					{
-						rbSortBy.SelectedValue = Convert.ToString(TabModuleSettings["sortBy"].ToString());
-					}
-				}
-			}
-			catch (Exception exc) //Module failed to load
-			{
-				Exceptions.ProcessModuleLoadException(this, exc);
-			}
-		}
-
-		/// -----------------------------------------------------------------------------
-		/// <summary>
-		/// UpdateSettings saves the modified settings to the Database
-		/// </summary>
-		/// <remarks>
-		/// </remarks>
-		/// <history>
-		/// </history>
-		/// -----------------------------------------------------------------------------
-		public override void UpdateSettings()
-		{
-			try
-			{
-                ModuleController objModules = new ModuleController();
-				if (UserInfo.IsSuperUser)
-				{
-					objModules.UpdateTabModuleSetting(TabModuleId, "includeHost", this.cbIncludeHostUser.Checked.ToString());
-				}
-				objModules.UpdateTabModuleSetting(TabModuleId, "useAjax", this.cbUseAjax.Checked.ToString());
-				objModules.UpdateTabModuleSetting(TabModuleId, "sortBy", rbSortBy.SelectedValue);
-
-				// refresh cache
-				ModuleController.SynchronizeModule(ModuleId);
-			}
-			catch (Exception exc) //Module failed to load
-			{
-				Exceptions.ProcessModuleLoadException(this, exc);
-			}
-		}
-
-#endregion
-
-	}
-
-}


Removed unused variable that broke the build. Expanded command documentation.
Some tidying up.

Signed-off-by: Konstantina Chremmou <a7d1f757a659045fb6db8c1e3849a1c8ad00b97a@citrix.com>

--- xva_verify/verify_main.cs
+++ xva_verify/verify_main.cs
@@ -32,34 +32,38 @@
 using System;
 using System.IO;
 using System.IO.Compression;
+using System.Text;

 class MainClass
 {
     public static void Main(string[] args)
     {
         Export.verbose_debugging = true;
-        if ((args.Length != 1) && (args.Length != 2))
+        if (args.Length < 1 || args.Length > 2)
         {
-            Console.WriteLine("Usage: ");
-            Console.WriteLine("  verify <archive> [optional copy]");
+            var sb = new StringBuilder();
+            sb.AppendLine();
+            sb.AppendLine("Usage").AppendLine();
+            sb.AppendLine("  xva_verify <archive> [copy]").AppendLine();
+            sb.AppendLine("where").AppendLine();
+            sb.AppendLine("  <archive>  The name of the archive file to verify. Use '-' to read from stdin.");
+            sb.AppendLine("  copy       If specified, a copy of the archive file is created.").AppendLine();
+
+            Console.WriteLine(sb.ToString());
             Environment.Exit(1);
         }

         try
         {
             string filename = args[0];
-            Stream f;
+
             Stream g = null;
             if (args.Length == 2)
-            {
                 g = new FileStream(args[1], FileMode.Create);
-            }
-            if (! args[0].Equals("-")) {
-                f = new FileStream(filename, FileMode.Open, FileAccess.Read);
-            } else
-            {
-                f = Console.OpenStandardInput();
-            }
+
+            Stream f = args[0].Equals("-")
+                ? Console.OpenStandardInput()
+                : new FileStream(filename, FileMode.Open, FileAccess.Read);

             // check for gzip compression ( only on seekable inputs - i.e. not the stdin stream )
             if (f.CanSeek)
@@ -74,15 +78,14 @@
                     f.Seek(0, SeekOrigin.Begin);
                     f = new GZipStream(f, CompressionMode.Decompress);
                 }
-                catch (InvalidDataException e)
+                catch (InvalidDataException)
                 {
                     // just reset the stream - Exception means the stream is not compressed
                     f.Seek(0, SeekOrigin.Begin);
                 }
             }

-            bool cancelling = false;
-            new Export().verify(f, g, (Export.cancellingCallback)delegate() { return cancelling; });
+            new Export().verify(f, g, () => false);
         }
         catch (UnauthorizedAccessException)
         {


Adding SendEmail

Adding SendEmail

--- CRM_Project_C/Source/CRM.WebApi/Infrastructure/ApplicationManager.cs
+++ CRM_Project_C/Source/CRM.WebApi/Infrastructure/ApplicationManager.cs
@@ -1,10 +1,8 @@
 using CRM.EntityFrameWorkLib;
 using CRM.WebApi.Models;
-using LinqToExcel;
 using System;
 using System.Collections.Generic;
 using System.Data.Entity;
-using System.IO;
 using System.Linq;
 using System.Net;
 using System.Net.Mail;
@@ -56,83 +54,14 @@
         public async Task<bool> SendEmailToContacts(List<Contact> ContactsToSend, int TamplateId)
         {
             // send email to all contacts of ContactsToSend with text $"Hello {Contact.Name} your message is {TamplateId}"
-            // //testing
-
-            foreach (var item in ContactsToSend)
-            {
-                MailMessage mail = new MailMessage();
-                SmtpClient SmtpServer = new SmtpClient("smtp.mail.yahoo.com");
-
-                mail.From = new MailAddress("h_lusy@yahoo.com");
-                mail.To.Add("tsovinar.ghazaryan@yahoo.com"/*item.Email*/);
-                mail.Subject = "Test Mail";
-                mail.Body = "This is for testing SMTP mail from GMAIL";
-
-
-                ServicePointManager.ServerCertificateValidationCallback = delegate
-                (object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
-                { return true; };
-
-               SmtpServer.Send(mail);
-            }
-
+            // testing
+            throw new Exception();
         }

         public async Task<List<Contact>> GetContactsFromFile(byte[] byteArray)
         {
             // Get all contacts from file and give back
-
-            string path = @"C:\Users\Lusine\Desktop\TestExcel.xlsx";
-            List<Contact> contacts = new List<Contact>();
-            Contact contact = new Contact();
-            try
-            {
-                File.WriteAllBytes(path, byteArray);
-                string sheetName = "Sheet1";
-                var excelFile = new ExcelQueryFactory(path);
-
-                // ADD COLUMN MAPPINGS:
-                //excelFile.AddMapping("FullName", "FullName");
-                //excelFile.AddMapping("CompanyName", "CompanyName");
-                //excelFile.AddMapping("Position", "Position");
-                //excelFile.AddMapping("Country", "Country");
-                //excelFile.AddMapping("Email", "Email");
-
-                var contactList = (from item in excelFile.Worksheet<Row>(sheetName) select item).ToList();
-
-                foreach (var item in contactList)
-                {
-                    contact.FullName = item["FullName"];
-                    contact.CompanyName = item["CompanyName"];
-                    contact.Position = item["Position"];
-                    contact.Country = item["Country"];
-                    contact.Email = item["Email"];
-                    contact.GuID = Guid.NewGuid();
-                    contact.DateInserted = Convert.ToDateTime(item["DateInserted"]);
-                    contacts.Add(contact);
-
-
-                }
-                //foreach (var item in artistAlbums)
-                //{
-                //    Console.WriteLine($"{item.FullName} {item.CompanyName} {item.Position} {item.Country} {item.Email}");
-                //}
-            }
-            catch (Exception)
-            {
-               /* path = path.Remove(path.Length - 4, 4) + "csv";
-                File.WriteAllBytes(path, array);
-                List<Contact> values = File.ReadAllLines(path)
-                             .Skip(1)
-                             .Select(v => FromCsv(v))
-                             .ToList();
-                             */
-                //foreach (var item in values)
-                //{
-                //    Console.WriteLine($"{ item.FullName}, {item.CompanyName}, {item.Position}, {item.Country}, {item.Email}");
-                //}
-            }
-            return contacts;
+            throw new Exception();
         }


bumped version number to force update in V2

--- RelhaxModpack/RelhaxModpack/Properties/AssemblyInfo.cs
+++ RelhaxModpack/RelhaxModpack/Properties/AssemblyInfo.cs
@@ -51,7 +51,7 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.28.2.18")]
-[assembly: AssemblyFileVersion("0.28.2.18")]
+[assembly: AssemblyVersion("0.28.2.19")]
+[assembly: AssemblyFileVersion("0.28.2.19")]
 [assembly: NeutralResourcesLanguage("en-US")]


Nothing really

Nothing really

git-svn-id: 16f658619b342a39b0afd2472f072a689916e5a2@166 6f2d7086-9719-0410-ba06-0b8292a297aa

--- psycho/Psycho/GUI/OutlineView.cs
+++ psycho/Psycho/GUI/OutlineView.cs
@@ -216,14 +216,12 @@

                 public void Update (IModel iModel)
                 {
-                        //if (this.IsFocus) {
                         updatePending = true;
                         UpdateNew (iModel);
                         UpdateDeletedPath (iModel);
                         UpdateChanged (iModel);
                         workingTopic = iModel.CurrentTopic;
                         updatePending = false;
-                        //}
                 }

                 public void UpdateNew (IModel iModel)


Added UTF8 default encoding extension

Added UTF8 default encoding extension

--- Extensions.cs
+++ Extensions.cs
@@ -28,6 +28,8 @@

 #if NET_4
 using System.Collections.Concurrent;
+using System.Text;
+
 #else
 using System.Collections.Generic;
 #endif
@@ -58,7 +60,23 @@
 			return DateTime.FromBinary (reader.ReadInt64());
 		}

-		#if NET_4
+		public static void WriteString (this IValueWriter writer, string value)
+		{
+			if (value == null)
+				throw new ArgumentNullException ("value");
+
+			writer.WriteString (Encoding.UTF8, value);
+		}
+
+		public static string ReadString (this IValueReader reader)
+		{
+			if (reader == null)
+				throw new ArgumentNullException ("reader");
+
+			return reader.ReadString (Encoding.UTF8);
+		}
+
+#if NET_4
 		private static readonly ConcurrentDictionary<Type, ObjectSerializer> Serializers = new ConcurrentDictionary<Type, ObjectSerializer>();
 		#else
 		private static readonly Dictionary<Type, ObjectSerializer> Serializers = new Dictionary<Type, ObjectSerializer> ();


Fix SNES to use notches (#1505)

Fix SNES to use notches (#1505)

* Fix Gui

* Fixes to fix the bugs from the last fixes

* Clean

* string set default protease to trypsin. prevents default changes if protease list is modified.

* refactor default trypsin in GUI

* Fix SNES to allow notches

--- EngineLayer/NonSpecificEnzymeSearch/NonSpecificEnzymeSearchEngine.cs
+++ EngineLayer/NonSpecificEnzymeSearch/NonSpecificEnzymeSearchEngine.cs
@@ -59,28 +59,32 @@
                     }

                     //populate ids of possibly observed with those containing allowed precursor masses
-                    int obsPrecursorFloorMz = (int)Math.Floor(commonParameters.PrecursorMassTolerance.GetMinimumValue(scan.PrecursorMass) * FragmentBinsPerDalton);
-                    int obsPrecursorCeilingMz = (int)Math.Ceiling(commonParameters.PrecursorMassTolerance.GetMaximumValue(scan.PrecursorMass) * FragmentBinsPerDalton);
-
-                    foreach (ProductType pt in DissociationTypeCollection.ProductsFromDissociationType[commonParameters.DissociationType].Intersect(TerminusSpecificProductTypes.ProductIonTypesFromSpecifiedTerminus[commonParameters.DigestionParams.FragmentationTerminus]).ToList())
-                    {
-                        int binShift = (int)Math.Round((WaterMonoisotopicMass - DissociationTypeCollection.GetMassShiftFromProductType(pt)) * FragmentBinsPerDalton);
-
-                        for (int j = obsPrecursorFloorMz; j <= obsPrecursorCeilingMz; j++)
-                        {
-                            int bin = j - binShift;
-                            if (bin < FragmentIndex.Length && FragmentIndex[bin] != null)
-                            {
-                                FragmentIndex[bin].ForEach(id => idsOfPeptidesPossiblyObserved.Add(id));
-                            }
-                        }
-                    }
-
-                    for (int bin = obsPrecursorFloorMz; bin <= obsPrecursorCeilingMz; bin++)
-                    {
-                        if (bin < PrecursorIndex.Length && PrecursorIndex[bin] != null)
-                        {
-                            PrecursorIndex[bin].ForEach(id => idsOfPeptidesPossiblyObserved.Add(id));
+                    IEnumerable< AllowedIntervalWithNotch> validIntervals = MassDiffAcceptor.GetAllowedPrecursorMassIntervals(scan.PrecursorMass);
+                    foreach (AllowedIntervalWithNotch interval in validIntervals)
+                    {
+                        int obsPrecursorFloorMz = (int)Math.Floor(interval.AllowedInterval.Minimum * FragmentBinsPerDalton);
+                        int obsPrecursorCeilingMz = (int)Math.Ceiling(interval.AllowedInterval.Maximum * FragmentBinsPerDalton);
+
+                        foreach (ProductType pt in DissociationTypeCollection.ProductsFromDissociationType[commonParameters.DissociationType].Intersect(TerminusSpecificProductTypes.ProductIonTypesFromSpecifiedTerminus[commonParameters.DigestionParams.FragmentationTerminus]).ToList())
+                        {
+                            int binShift = (int)Math.Round((WaterMonoisotopicMass - DissociationTypeCollection.GetMassShiftFromProductType(pt)) * FragmentBinsPerDalton);
+                            int lowestBin = obsPrecursorFloorMz - binShift;
+                            int highestBin = obsPrecursorCeilingMz - binShift;
+                            for (int bin = lowestBin; bin <= highestBin; bin++)
+                            {
+                                if (bin < FragmentIndex.Length && FragmentIndex[bin] != null)
+                                {
+                                    FragmentIndex[bin].ForEach(id => idsOfPeptidesPossiblyObserved.Add(id));
+                                }
+                            }
+                        }
+
+                        for (int bin = obsPrecursorFloorMz; bin <= obsPrecursorCeilingMz; bin++) //no bin shift, since they're precursor masses
+                        {
+                            if (bin < PrecursorIndex.Length && PrecursorIndex[bin] != null)
+                            {
+                                PrecursorIndex[bin].ForEach(id => idsOfPeptidesPossiblyObserved.Add(id));
+                            }
                         }
                     }


Update ResourceSteamFontSourceExample.cs

--- Examples/CSharp/Rendering-Printing/ResourceSteamFontSourceExample.cs
+++ Examples/CSharp/Rendering-Printing/ResourceSteamFontSourceExample.cs
@@ -8,7 +8,7 @@
 using System.Text;
 using System.Threading.Tasks;

-namespace Aspose.Words.Examples.CSharp.Rendering_Printing
+namespace Aspose.Words.Examples.CSharp.Rendering_and_Printing
 {
     // ExStart:ResourceSteamFontSourceExample
     class ResourceSteamFontSourceExample : StreamFontSource


EnumLocalTexts tests done

EnumLocalTexts tests done

--- Serenity.Test/Core/Localization/EnumLocalTextsTests.cs
+++ Serenity.Test/Core/Localization/EnumLocalTextsTests.cs
@@ -58,6 +58,104 @@
         [Fact]
         public void EnumLocalTexts_Initialize_SearchesOnlyGivenAssemblies()
         {
+            using (new MunqContext())
+            {
+                var registry = A.Fake<ILocalTextRegistry>();
+
+                Dependency.Resolve<IDependencyRegistrar>()
+                    .RegisterInstance(registry);
+
+                EnumLocalTexts.Initialize(new[] { typeof(LocalText).Assembly });
+
+                A.CallTo(() => registry.Add(A<string>._, A<string>.That.Contains("EnumWithoutKey"), A<string>._))
+                    .MustNotHaveHappened();
+            }
+        }
+
+        [Fact]
+        public void EnumLocalTexts_Initialize_UsesFullName_IfEnumKeyAttributeIsNotPresent()
+        {
+            using (new MunqContext())
+            {
+                var registry = A.Fake<ILocalTextRegistry>();
+
+                Dependency.Resolve<IDependencyRegistrar>()
+                    .RegisterInstance(registry);
+
+                EnumLocalTexts.Initialize(new[] { this.GetType().Assembly });
+
+                string expectedKey = "Enums." + typeof(EnumWithoutKey).FullName + "." +
+                    EnumWithoutKey.WithDescriptionNoKey.GetName();
+
+                A.CallTo(() => registry.Add(A<string>._, expectedKey, "Description for WithDescriptionNoKey"))
+                    .MustHaveHappened(Repeated.Exactly.Once);
+            }
+        }
+
+        [Fact]
+        public void EnumLocalTexts_Initialize_UsesKey_IfKeyAttributeIsPresent()
+        {
+            using (new MunqContext())
+            {
+                var registry = A.Fake<ILocalTextRegistry>();
+
+                Dependency.Resolve<IDependencyRegistrar>()
+                    .RegisterInstance(registry);
+
+                EnumLocalTexts.Initialize(new[] { this.GetType().Assembly });
+
+                string expectedKey = "Enums.My.CoolEnumKey." +
+                    EnumWithKey.WithDescriptionKey.GetName();
+
+                A.CallTo(() => registry.Add(A<string>._, expectedKey, "Description for WithDescriptionKey"))
+                    .MustHaveHappened(Repeated.Exactly.Once);
+            }
+        }
+
+        [Fact]
+        public void EnumLocalTexts_Initialize_SkipsEnumValuesWithoutDescriptionAttribute()
+        {
+            using (new MunqContext())
+            {
+                var registry = A.Fake<ILocalTextRegistry>();
+
+                Dependency.Resolve<IDependencyRegistrar>()
+                    .RegisterInstance(registry);
+
+                EnumLocalTexts.Initialize(new[] { this.GetType().Assembly });
+
+                string unexpectedKey1 = "Enums.My.CoolEnumKey." +
+                    EnumWithKey.NoDescriptionKey.GetName();
+
+                string unexpectedKey2 = "Enums." + typeof(EnumWithoutKey).FullName + "." +
+                    EnumWithoutKey.NoDescriptionNoKey.GetName();
+
+                A.CallTo(() => registry.Add(A<string>._, unexpectedKey1, A<string>._))
+                    .MustNotHaveHappened();
+
+                A.CallTo(() => registry.Add(A<string>._, unexpectedKey2, A<string>._))
+                    .MustNotHaveHappened();
+            }
+        }
+
+        [Fact]
+        public void EnumLocalTexts_Initialize_UsesInvariantLanguageId()
+        {
+            using (new MunqContext())
+            {
+                var registry = A.Fake<ILocalTextRegistry>();
+
+                Dependency.Resolve<IDependencyRegistrar>()
+                    .RegisterInstance(registry);
+
+                EnumLocalTexts.Initialize(new[] { this.GetType().Assembly });
+
+                A.CallTo(() => registry.Add("", A<string>._, A<string>._))
+                    .MustHaveHappened();
+
+                A.CallTo(() => registry.Add(A<string>.That.Not.IsEqualTo(""), A<string>._, A<string>._))
+                    .MustNotHaveHappened();
+            }
         }
     }
 }


Altered text to test webhook and OpenShift integration to build automagically.

--- HomeModule.cs
+++ HomeModule.cs
@@ -4,7 +4,7 @@
     {
         public HomeModule()
         {
-            Get("/", args => "Aloha from .NET, using the Nancy framework.");
+            Get("/", args => "Aloha from .NET, using the NancyFX framework.");

             Get("/os", x =>
             {


Another webhook-triggering minor edit.

Another webhook-triggering minor edit.

--- HomeModule.cs
+++ HomeModule.cs
@@ -4,7 +4,7 @@
     {
         public HomeModule()
         {
-            Get("/", args => "Aloha from .NET, using the NancyFX framework.");
+            Get("/", args => "Aloha from .NET, using the NancyFX framework. This is version 2.0 of this program.");

             Get("/os", x =>
             {


Added bit script files to Bit Change Set Manager's default page cshtml

--- Apps/BitChangeSetManager/wwwroot/defaultPageTemplate.cshtml
+++ Apps/BitChangeSetManager/wwwroot/defaultPageTemplate.cshtml
@@ -32,6 +32,13 @@
             environmentConfigs: @(model.EnvironmentConfigsJSON)
         };
     </script>
+    <script src="Files/V@(model.AppVersion)/bower_components/bit/foundation.core/foundation.core.js"></script>
+    <script src="Files/V@(model.AppVersion)/bower_components/bit/foundation.viewmodel/foundation.viewmodel.js"></script>
+    <script src="Files/V@(model.AppVersion)/bower_components/bit/foundation.view/foundation.view.js"></script>
+    <script src="Files/V@(model.AppVersion)/bitChangeSetManager.js"></script>
+    <script type="text/javascript">
+        Foundation.Core.DependencyManager.getCurrent().init();
+    </script>
 </head>

 <body>


set gameId at conversion time not ctor

set gameId at conversion time not ctor

--- Assets/HappyFunTimes/HappyFunTimesCore/HFTRuntimeOptions.cs
+++ Assets/HappyFunTimes/HappyFunTimesCore/HFTRuntimeOptions.cs
@@ -46,6 +46,7 @@
             name = String.IsNullOrEmpty(userOptions.name) ? Application.productName : userOptions.name;

             id = userOptions.id;
+            gameId = String.IsNullOrEmpty(Application.productName) ? "HFTUnityUnnamed" : HFTUtil.SafeName(Application.productName);
             serverPort = userOptions.serverPort;
             rendezvousUrl = userOptions.rendezvousUrl;
             master = userOptions.master;
@@ -114,7 +115,7 @@
         public string url = "";
         public string id = "";
         public string name = "";
-        public string gameId = "HFTUnity";  // this is kind of left over from when one server supported mutiple games
+        public string gameId = "HFTUnityUnnamed";
         public string controllerFilename = "";
         public bool disconnectPlayersIfGameDisconnects = true;
         public bool installationMode = false;


Added missing xmldoc comment

Added missing xmldoc comment

--- AzureWebFarm.OctopusDeploy/Infrastructure/RegistryEditor.cs
+++ AzureWebFarm.OctopusDeploy/Infrastructure/RegistryEditor.cs
@@ -4,8 +4,15 @@

 namespace AzureWebFarm.OctopusDeploy.Infrastructure
 {
+    /// <summary>
+    /// Performs edits to the machines local registry.
+    /// </summary>
     public interface IRegistryEditor
     {
+        /// <summary>
+        /// Recursively delete a sub tree from the HKLM node in local registry.
+        /// </summary>
+        /// <param name="pathToTree">The path to the sub tree to delete</param>
         void DeleteLocalMachineTree(params string[] pathToTree);
     }


Fix timeout issue

Fix timeout issue

--- CSF.Screenplay.JsonApis/Abilities/SynchronousJsonGateway.cs
+++ CSF.Screenplay.JsonApis/Abilities/SynchronousJsonGateway.cs
@@ -1,5 +1,6 @@
 using System;
 using System.IO;
+using System.Linq;
 using System.Net.Http;
 using System.Threading;
 using System.Threading.Tasks;
@@ -35,13 +36,27 @@

     HttpResponseMessage GetResponseMessage(HttpRequestMessage request, TimeSpan timeout)
     {
+      var response = GetResponseRespectingTimeout(request, timeout);
+      AssertThatResultIsSuccess(response);
+      return response;
+    }
+
+    HttpResponseMessage GetResponseRespectingTimeout(HttpRequestMessage request, TimeSpan timeout)
+    {
       var tokenSource = new CancellationTokenSource(timeout);
-      var response = httpClient.SendAsync(request, HttpCompletionOption.ResponseContentRead, tokenSource.Token);
+      var token = tokenSource.Token;

-      var result = response.Result;
-      AssertThatResultIsSuccess(result);
+      try
+      {
+        return httpClient.SendAsync(request, HttpCompletionOption.ResponseContentRead, token).Result;
+      }
+      catch(AggregateException ex)
+      {
+        if(ex.InnerExceptions.OfType<TimeoutException>().Any())
+          throw new TimeoutException($"The JSON API request timed out after {timeout.ToString("g")}.");

-      return result;
+        throw;
+      }
     }

     void AssertThatResultIsSuccess(HttpResponseMessage result)


Refactoring WebsiteControllerTest

Refactoring WebsiteControllerTest

--- CmsEngine.Tests/Ui/Controllers/Api/WebsiteControllerTest.cs
+++ CmsEngine.Tests/Ui/Controllers/Api/WebsiteControllerTest.cs
@@ -18,8 +18,6 @@
     public class WebsiteControllerTest : IClassFixture<WebsiteFixture>
     {
         private Mock<IRepository<Website>> moqRepository;
-        private Mock<IUnitOfWork> moqUnitOfWork;
-        private Mock<IMapper> moqMapper;

         private WebsiteFixture websiteFixture;
         private WebsiteController controller;
@@ -28,10 +26,8 @@
         {
             websiteFixture = fixture;
             moqRepository = websiteFixture.MoqRepository;
-            moqUnitOfWork = websiteFixture.MoqUnitOfWork;
-            moqMapper = websiteFixture.MoqMapper;
-
-            controller = new WebsiteController(moqUnitOfWork.Object, moqMapper.Object);
+
+            controller = new WebsiteController(websiteFixture.MoqUnitOfWork.Object, websiteFixture.MoqMapper.Object, websiteFixture.MoqHttpContextAccessor.Object);
         }

         [Fact]


Updated date comments

Updated date comments

--- CodeCamper.Data/SampleData/CodeCamperDatabaseInitializer.cs
+++ CodeCamper.Data/SampleData/CodeCamperDatabaseInitializer.cs
@@ -56,7 +56,7 @@
             var slots =
                 new List<TimeSlot>
                     {
-                        // Sat March 31, 2012 - Registration
+                        // Sat May 18, 2013 - Registration
                         new TimeSlot {Start = seed1, Duration = 45, IsSessionSlot = false},
                         new TimeSlot {Start = seed1 = seed1.AddMinutes(60), Duration = 60},
                         new TimeSlot {Start = seed1 = seed1.AddMinutes(70), Duration = 60},
@@ -69,7 +69,7 @@
                         // Close
                         new TimeSlot {Start = seed1.AddMinutes(70), Duration = 30, IsSessionSlot = false},

-                        // Sun April 1, 2012 - Registration
+                        // Sun May 19, 2013 - Registration
                         new TimeSlot {Start = seed2, Duration = 45, IsSessionSlot = false},
                         new TimeSlot {Start = seed2 = seed2.AddMinutes(60), Duration = 60},
                         new TimeSlot {Start = seed2 = seed2.AddMinutes(70), Duration = 60},


ENH:  better exception messages from GetAllInstances

--- CodeEndeavors.Extensions/Extensions/ReflectionExtensions.cs
+++ CodeEndeavors.Extensions/Extensions/ReflectionExtensions.cs
@@ -36,9 +36,25 @@

         public static List<T> GetAllInstances<T>(string assemblyPath = null)
         {
-            Type theType = typeof(T);
-            var types = theType.GetAllTypes(assemblyPath);
-            return types.Select(t => Activator.CreateInstance(t)).Cast<T>().ToList();
+            try
+            {
+                Type theType = typeof(T);
+                var types = theType.GetAllTypes(assemblyPath);
+                return types.Select(t => Activator.CreateInstance(t)).Cast<T>().ToList();
+            }
+            catch (System.Reflection.ReflectionTypeLoadException ex)
+            {
+                var sb = new System.Text.StringBuilder();
+                foreach (var e in ex.LoaderExceptions)
+                    sb.AppendLine(e.Message);
+                sb.AppendLine(ex.Message);
+                throw new Exception(sb.ToString());
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+
         }

         public static Type ToType(this string typeName, string assemblyPath = null)


Bugfix

Bugfix

--- Duplicati/Library/Main/ForestHash/Database/LocalDatabase.cs
+++ Duplicati/Library/Main/ForestHash/Database/LocalDatabase.cs
@@ -224,8 +224,8 @@
             lock (m_lock)
             {
                 using (var tr = new TemporaryTransactionWrapper(m_connection, transaction))
-                {
-                    var deletecmd = m_connection.CreateCommand();
+                using (var deletecmd = m_connection.CreateCommand())
+                {
                     deletecmd.Transaction = tr.Parent;

 					deletecmd.ExecuteNonQuery(@"UPDATE ""File"" SET ""BlocksetID"" = -1 WHERE ""BlocksetID"" IN (SELECT DISTINCT ""BlocksetID"" FROM ""BlocksetEntry"" WHERE ""BlockID"" IN (SELECT ""ID"" FROM ""Block"" WHERE ""VolumeID"" IN (SELECT DISTINCT ID FROM ""RemoteVolume"" WHERE ""Name"" = ?)))", name);


Fix auto-surrogate to wire a type once.

Fix auto-surrogate to wire a type once.

--- plugins/Akka.Interfaced.ProtobufSerializer/AutoSurrogate.cs
+++ plugins/Akka.Interfaced.ProtobufSerializer/AutoSurrogate.cs
@@ -34,6 +34,8 @@
                         var sourceType = FindSurrogateSourceType(field.FieldType);
                         if (sourceType != null)
                         {
+                            if (typeModel.CanSerialize(sourceType))
+                                continue;
                             try
                             {
                                 typeModel.Add(sourceType, false).SetSurrogate(field.FieldType);
@@ -49,6 +51,8 @@
                     var sourceType = FindSurrogateSourceType(type);
                     if (sourceType != null)
                     {
+                        if (typeModel.CanSerialize(sourceType))
+                            continue;
                         try
                         {
                             typeModel.Add(sourceType, false).SetSurrogate(type);


DRY up song initialization

DRY up song initialization

--- Test/SongTest.cs
+++ Test/SongTest.cs
@@ -14,11 +14,8 @@
         [TestMethod]
         public void MaryHadALittleLamb()
         {
-            using (var hub = new AudioHub())
+            InitializeSong(120, (song, speaker) =>
             {
-                IActorRef leftSpeaker = hub.NewSpeaker();
-                var song = new Song();
-                song.Tempo = 120;
                 var notes = new List<Note>
                 {
                     new Note(NoteName.E, 1),
@@ -43,19 +40,16 @@

                 var numBeats = 8;
                 var beatTime = (int)Math.Round(1000 / (song.Tempo / 60.0));
-                leftSpeaker.Tell(song);
+                speaker.Tell(song);
                 Thread.Sleep(numBeats * beatTime);
-            }
+            });
         }

         [TestMethod]
         public void TrackWithRests()
         {
-            using (var hub = new AudioHub())
+            InitializeSong(120, (song, speaker) =>
             {
-                IActorRef leftSpeaker = hub.NewSpeaker();
-                var song = new Song();
-                song.Tempo = 120;
                 var notes = new List<Note>
                 {
                     new Note(NoteName.E, 1),
@@ -68,19 +62,16 @@

                 var numBeats = 8;
                 var beatTime = (int)Math.Round(1000 / (song.Tempo / 60.0));
-                leftSpeaker.Tell(song);
+                speaker.Tell(song);
                 Thread.Sleep(numBeats * beatTime);
-            }
+            });
         }

         [TestMethod]
         public void SyncopationTest()
         {
-            using (var hub = new AudioHub())
+            InitializeSong(120, (song, speaker) =>
             {
-                IActorRef leftSpeaker = hub.NewSpeaker();
-                var song = new Song();
-                song.Tempo = 120;
                 var notes = new List<Note>
                 {
                     new Note(NoteName.E, (Rational)3/2),
@@ -94,8 +85,19 @@

                 var numBeats = 5;
                 var beatTime = (int)Math.Round(1000 / (song.Tempo / 60.0));
-                leftSpeaker.Tell(song);
+                speaker.Tell(song);
                 Thread.Sleep(numBeats * beatTime);
+            });
+        }
+
+        private void InitializeSong(int tempo, Action<Song, IActorRef> block)
+        {
+            using (var hub = new AudioHub())
+            {
+                IActorRef speaker = hub.NewSpeaker();
+                var song = new Song();
+                song.Tempo = 120;
+                block(song, speaker);
             }
         }
     }


Add null check to LoadComponentAsync

Add null check to LoadComponentAsync

--- osu.Framework/Graphics/Containers/CompositeDrawable.cs
+++ osu.Framework/Graphics/Containers/CompositeDrawable.cs
@@ -20,6 +20,7 @@
 using osu.Framework.Threading;
 using osu.Framework.Statistics;
 using System.Threading.Tasks;
+using JetBrains.Annotations;
 using osu.Framework.Development;
 using osu.Framework.Extensions.ExceptionExtensions;
 using osu.Framework.Graphics.Effects;
@@ -96,9 +97,13 @@
         /// <param name="cancellation">An optional cancellation token.</param>
         /// <param name="scheduler">The scheduler for <paramref name="onLoaded"/> to be invoked on. If null, the local scheduler will be used.</param>
         /// <returns>The task which is used for loading and callbacks.</returns>
-        protected internal Task LoadComponentAsync<TLoadable>(TLoadable component, Action<TLoadable> onLoaded = null, CancellationToken cancellation = default, Scheduler scheduler = null)
+        protected internal Task LoadComponentAsync<TLoadable>([NotNull] TLoadable component, Action<TLoadable> onLoaded = null, CancellationToken cancellation = default, Scheduler scheduler = null)
             where TLoadable : Drawable
-            => LoadComponentsAsync(component.Yield(), l => onLoaded?.Invoke(l.Single()), cancellation, scheduler);
+        {
+            if (component == null) throw new ArgumentNullException(nameof(component));
+
+            return LoadComponentsAsync(component.Yield(), l => onLoaded?.Invoke(l.Single()), cancellation, scheduler);
+        }

         /// <summary>
         /// Loads a future child or grand-child of this <see cref="CompositeDrawable"/> synchronously and immediately. <see cref="Dependencies"/>


#115 - Added thumbnail to np and some reformatting

--- SoraBot/SoraBot.Bot/Modules/AudioModule/AudioModule.cs
+++ SoraBot/SoraBot.Bot/Modules/AudioModule/AudioModule.cs
@@ -11,7 +11,6 @@

 namespace SoraBot.Bot.Modules.AudioModule
 {
-
     [Name("Music")]
     [Summary("All commands around music playing :>")]
     public partial class AudioModule : SoraSocketCommandModule
@@ -32,7 +31,7 @@
                 await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
                 return;
             }
-
+
             if (!await CheckIfSameVc(player.VoiceChannel))
                 return;

@@ -41,7 +40,7 @@
                 await ReplyFailureEmbed("Queue empty. Nothing to shuffle");
                 return;
             }
-
+
             player.Queue.Shuffle();
             await ReplyMusicEmbed("Shuffled queue for you ;)");
         }
@@ -55,10 +54,10 @@
                 await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
                 return;
             }
-
-            if (!await CheckIfSameVc(player.VoiceChannel))
-                return;
-
+
+            if (!await CheckIfSameVc(player.VoiceChannel))
+                return;
+
             player.Queue.Clear();
             await ReplyMusicEmbed("Cleared entire queue :)");
         }
@@ -72,13 +71,13 @@
                 await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
                 return;
             }
-
+
             if (player.Track == null)
             {
                 await ReplyFailureEmbed("I'm currently not playing anything");
                 return;
             }
-
+
             var eb = new EmbedBuilder()
             {
                 Color = Blue,
@@ -99,9 +98,9 @@
                 await ReplyEmbed(eb);
                 return;
             }
-
+
             // Otherwise built the rest of the queue
-            int count = 0;
+            int count = 0;
             foreach (var item in player.Queue.Items)
             {
                 ++count;
@@ -113,11 +112,11 @@
                     x.Name = $"#{count.ToString()} by {track.Author}";
                     x.Value = $"[{Formatter.FormatTime(track.Duration)}] - **[{track.Title}]({track.Url})**";
                 });
-
+
                 if (count >= 10)
                     break;
             }
-
+
             TimeSpan duration = new TimeSpan();

             foreach (var item in player.Queue.Items)
@@ -125,6 +124,7 @@
                 var track = (LavaTrack) item;
                 duration = duration.Add(track.Duration);
             }
+
             duration = duration.Add(player.Track.Duration.Subtract(player.Track.Position));
             eb.AddField(x =>
             {
@@ -145,7 +145,7 @@
                 await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
                 return;
             }
-
+
             if (player.Track == null)
             {
                 await ReplyFailureEmbed("I'm currently not playing anything");
@@ -157,31 +157,40 @@
                 await ReplyFailureEmbed("I cannot display information about a stream");
                 return;
             }
-
+
             double percentageDone = (100.0 / player.Track.Duration.TotalSeconds) *
                                     player.Track.Position.TotalSeconds;
             int rounded = (int) Math.Floor(percentageDone / 10);
             string progress = "";
             for (int i = 0; i < 10; i++)
             {
-                if (i == rounded) {
+                if (i == rounded)
+                {
                     progress += " :red_circle: ";
                     continue;
                 }
+
                 progress += "▬";
             }
-
+
             var eb = new EmbedBuilder()
             {
                 Color = Blue,
                 Title = $"{MusicalNote} Currently playing by {player.Track.Author}",
-                Description = $"**[{player.Track.Title}]({player.Track.Url})**{(player.PlayerState == PlayerState.Paused ? " (Paused)" : "")}"
+                Description =
+                    $"**[{player.Track.Title}]({player.Track.Url})**{(player.PlayerState == PlayerState.Paused ? " (Paused)" : "")}"
             };
+
+            var imageUrl = await player.Track.FetchArtworkAsync();
+            if (!string.IsNullOrWhiteSpace(imageUrl))
+                eb.WithThumbnailUrl(imageUrl);
+
             eb.AddField(x =>
             {
                 x.IsInline = false;
                 x.Name = "Progress";
-                x.Value = $"[{Formatter.FormatTime(player.Track.Position)}] {progress} [{Formatter.FormatTime(player.Track.Duration)}]";
+                x.Value =
+                    $"[{Formatter.FormatTime(player.Track.Position)}] {progress} [{Formatter.FormatTime(player.Track.Duration)}]";
             });

             await ReplyEmbed(eb);
@@ -197,10 +206,10 @@
                 await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
                 return;
             }
-
-            if (!await CheckIfSameVc(player.VoiceChannel))
-                return;
-
+
+            if (!await CheckIfSameVc(player.VoiceChannel))
+                return;
+
             if (player.PlayerState != PlayerState.Playing)
             {
                 await ReplyFailureEmbed("I'm currently not playing anything");
@@ -210,7 +219,7 @@
             vol = Math.Clamp(vol, 1, 100);
             try
             {
-                await player.UpdateVolumeAsync((ushort)vol);
+                await player.UpdateVolumeAsync((ushort) vol);
                 await ReplyMusicEmbed($"Set volume to {vol.ToString()}");
             }
             catch (Exception)
@@ -218,7 +227,7 @@
                 await ReplyFailureEmbed("Something broke :/");
             }
         }
-
+
         [Command("skip"), Alias("next")]
         [Summary("Skips the specified amount of songs")]
         public async Task SkipSong(
@@ -233,13 +242,13 @@

             if (!await CheckIfSameVc(player.VoiceChannel))
                 return;
-
+
             if (player.Track == null)
             {
                 await ReplyFailureEmbed("I'm currently not playing anything");
                 return;
             }
-
+
             if (number < 1 || number > (player.Queue.Count + 1))
             {
                 await ReplyFailureEmbed(
@@ -261,6 +270,7 @@
                     await ReplyMusicEmbed($"Queue is now finished.");
                     return;
                 }
+
                 var currentTrack = await player.SkipAsync();
                 if (currentTrack == null)
                 {
@@ -287,7 +297,7 @@

                 return Maybe.FromVal<TimeSpan>(TimeSpan.FromSeconds(seconds));
             }
-
+
             // Parse as minute and second string :D
             var split = seek.Split(":");
             if (split.Length != 2)
@@ -303,17 +313,19 @@
         [Command("seek")]
         [Summary("Seeks a certain amount in the track")]
         public async Task SeekSong(
-            [Summary("Time to seek. If just a number it will seek the amount in seconds. Otherwise you can use min:sec")]string seek)
-        {
-            if (!_node.TryGetPlayer(Context.Guild, out var player))
-            {
-                await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
-                return;
-            }
-
-            if (!await CheckIfSameVc(player.VoiceChannel))
-                return;
-
+            [Summary(
+                "Time to seek. If just a number it will seek the amount in seconds. Otherwise you can use min:sec")]
+            string seek)
+        {
+            if (!_node.TryGetPlayer(Context.Guild, out var player))
+            {
+                await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
+                return;
+            }
+
+            if (!await CheckIfSameVc(player.VoiceChannel))
+                return;
+
             if (player.Track == null)
             {
                 await ReplyFailureEmbed("I'm currently not playing anything");
@@ -337,7 +349,7 @@
                                         $"track length ({(player.Track.Duration.TotalSeconds - 1).ToString(CultureInfo.InvariantCulture)} s).");
                 return;
             }
-
+
             try
             {
                 await player.SeekAsync(skip);
@@ -358,10 +370,10 @@
                 await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
                 return;
             }
-
-            if (!await CheckIfSameVc(player.VoiceChannel))
-                return;
-
+
+            if (!await CheckIfSameVc(player.VoiceChannel))
+                return;
+
             if (player.Track == null)
             {
                 await ReplyFailureEmbed("I'm currently not playing anything");
@@ -376,6 +388,7 @@
                     await ReplyMusicEmbed($"Queue is now finished.");
                     return;
                 }
+
                 var currentTrack = await player.SkipAsync();
                 if (currentTrack == null)
                 {
@@ -401,7 +414,7 @@
                 await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
                 return;
             }
-
+
             if (!await CheckIfSameVc(player.VoiceChannel))
                 return;

@@ -410,7 +423,7 @@
                 await ReplyFailureEmbed("I'm already playing ...");
                 return;
             }
-
+
             try
             {
                 await player.ResumeAsync();
@@ -421,7 +434,7 @@
                 await ReplyFailureEmbed("Something broke :/");
             }
         }
-
+
         [Command("pause")]
         [Summary("Pauses the player.")]
         public async Task PausePlayer()
@@ -431,7 +444,7 @@
                 await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
                 return;
             }
-
+
             if (!await CheckIfSameVc(player.VoiceChannel))
                 return;

@@ -463,15 +476,15 @@
                 await ReplyFailureEmbed("I have not joined any Voice Channel yet.");
                 return;
             }
-
-            if (!await CheckIfSameVc(player.VoiceChannel))
-                return;
-
+
+            if (!await CheckIfSameVc(player.VoiceChannel))
+                return;
+
             if (query.StartsWith("<") && query.EndsWith(">"))
                 query = query.TrimStart('<').TrimEnd('>');
-
+
             bool isLink = Uri.IsWellFormedUriString(query, UriKind.RelativeOrAbsolute);
-
+
             var search = isLink
                 ? await _node.SearchAsync(query)
                 : await _node.SearchYouTubeAsync(query);
@@ -501,7 +514,7 @@
                 for (var i = 0; i < search.Tracks.Count; i++)
                 {
                     if (i == skip) continue;
-
+
                     var track = search.Tracks[i];
                     if (player.Track != null)
                         player.Queue.Enqueue(track);
@@ -537,7 +550,7 @@
                 await ReplyFailureEmbed("I'm not connected to any VC in this guild");
                 return;
             }
-
+
             var playerVC = player.VoiceChannel;
             if (!await CheckIfSameVc(playerVC))
                 return;


Make TabbableContainer work on CompositeDrawables

--- osu.Framework/Graphics/Containers/TabbableContainer.cs
+++ osu.Framework/Graphics/Containers/TabbableContainer.cs
@@ -34,7 +34,7 @@
         /// <summary>
         /// Allows for tabbing between multiple levels within the TabbableContentContainer.
         /// </summary>
-        public Container<Drawable> TabbableContentContainer { private get; set; }
+        public CompositeDrawable TabbableContentContainer { private get; set; }

         protected override bool OnKeyDown(KeyDownEvent e)
         {
@@ -46,7 +46,7 @@
             return true;
         }

-        private Drawable nextTabStop(Container<Drawable> target, bool reverse)
+        private Drawable nextTabStop(CompositeDrawable target, bool reverse)
         {
             Stack<Drawable> stack = new Stack<Drawable>();
             stack.Push(target); // Extra push for circular tabbing


(GH-705) Fix stylecop error

(GH-705) Fix stylecop error

--- Source/ChocolateyGui.Common/Services/VersionService.cs
+++ Source/ChocolateyGui.Common/Services/VersionService.cs
@@ -4,9 +4,7 @@
 //   Copyright 2014 - 2017 Rob Reynolds, the maintainers of Chocolatey, and RealDimensions Software, LLC
 // </copyright>
 // --------------------------------------------------------------------------------------------------------------------
-
 using System.Reflection;
-using String = System.String;

 namespace ChocolateyGui.Common.Services
 {
@@ -18,16 +16,13 @@
         }

         public string Version
-    {
+        {
             get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
-    }
+        }

         public string DisplayVersion
         {
-            get
-            {
-                return String.Format("{0} v{1}", ApplicationParameters.Name, Version);
-            }
+            get { return string.Format("{0} v{1}", ApplicationParameters.Name, Version); }
         }
     }
 }


Allow cursor containers to be targetable

--- osu.Framework/Graphics/Visualisation/DrawVisualiser.cs
+++ osu.Framework/Graphics/Visualisation/DrawVisualiser.cs
@@ -203,7 +203,7 @@
             // Finds the targeted drawable and composite drawable. The search stops if a drawable is targeted.
             void findTarget(Drawable drawable)
             {
-                if (drawable == this || drawable is CursorContainer || drawable is Component)
+                if (drawable == this || drawable is Component)
                     return;

                 if (!drawable.IsPresent)


Hide stock Awake; use correct toolbar icon

--- Source/ContractsWindow/Toolbar/contractStockToolbar.cs
+++ Source/ContractsWindow/Toolbar/contractStockToolbar.cs
@@ -56,10 +56,13 @@
 			}
 		}

+		private void Awake()
+		{
+			instance = this;
+		}
+
 		private void Start()
 		{
-			instance = this;
-
 			setupToolbar();
 		}

@@ -84,7 +87,7 @@
 			while (!ApplicationLauncher.Ready)
 				yield return null;

-			toolbarButton = ApplicationLauncher.Instance.AddModApplication(open, close, null, null, null, null, (ApplicationLauncher.AppScenes)63, contractScenario.StockIcon);
+			toolbarButton = ApplicationLauncher.Instance.AddModApplication(open, close, null, null, null, null, (ApplicationLauncher.AppScenes)63, contractSkins.toolbarIcon);

 			GameEvents.onGUIApplicationLauncherUnreadifying.Add(removeButton);
 		}


Fix adding null hit explosions

Fix adding null hit explosions

--- osu.Game.Rulesets.Mania/Skinning/LegacyHitExplosion.cs
+++ osu.Game.Rulesets.Mania/Skinning/LegacyHitExplosion.cs
@@ -32,7 +32,7 @@
             float explosionScale = GetManiaSkinConfig<float>(skin, LegacyManiaSkinConfigurationLookups.ExplosionScale)?.Value
                                    ?? 1;

-            InternalChild = explosion = skin.GetAnimation(imageName, true, false, startAtCurrentTime: true).With(d =>
+            explosion = skin.GetAnimation(imageName, true, false, startAtCurrentTime: true).With(d =>
             {
                 if (d == null)
                     return;
@@ -47,6 +47,9 @@
                 if (texAnimation.FrameCount > 0)
                     texAnimation.DefaultFrameLength = Math.Max(texAnimation.DefaultFrameLength, 170.0 / texAnimation.FrameCount);
             });
+
+            if (explosion != null)
+                InternalChild = explosion;

             direction.BindTo(scrollingInfo.Direction);
             direction.BindValueChanged(onDirectionChanged, true);