Fix Sql wrapping

Fix Sql wrapping

--- src/Smooth.IoC.Dapper.Repository.UnitOfWork/Helpers/SqlInstance.cs
+++ src/Smooth.IoC.Dapper.Repository.UnitOfWork/Helpers/SqlInstance.cs
@@ -64,8 +64,7 @@
         public IFormattable TableAndColumn<TEntity>(string propertyName,
             EntityMapping entityMappingOverride = null) where TEntity : class
         {
-            return TableAndColumn<TEntity>(EnumHelper.ConvertEnumToEnum<SqlDialect>(sqlDialect), propertyName,
-                entityMappingOverride);
+            return Sql.TableAndColumn<TEntity>(propertyName, entityMappingOverride);
         }

         public IFormattable TableAndColumn<TEntity>(IoC.UnitOfWork.SqlDialect sqlDialect, string propertyName,


Measure image resizing

Measure image resizing

--- src/Squidex/Areas/Api/Controllers/Assets/AssetContentController.cs
+++ src/Squidex/Areas/Api/Controllers/Assets/AssetContentController.cs
@@ -13,6 +13,7 @@
 using Squidex.Infrastructure;
 using Squidex.Infrastructure.Assets;
 using Squidex.Infrastructure.Commands;
+using Squidex.Infrastructure.Log;
 using Squidex.Pipeline;

 #pragma warning disable 1573
@@ -82,20 +83,32 @@
                     }
                     catch (AssetNotFoundException)
                     {
-                        using (var sourceStream = GetTempStream())
+                        using (Profiler.Trace("Resize"))
                         {
-                            using (var destinationStream = GetTempStream())
+                            using (var sourceStream = GetTempStream())
                             {
-                                await assetStore.DownloadAsync(assetId, entity.FileVersion, null, sourceStream);
-                                sourceStream.Position = 0;
+                                using (var destinationStream = GetTempStream())
+                                {
+                                    using (Profiler.Trace("ResizeDownload"))
+                                    {
+                                        await assetStore.DownloadAsync(assetId, entity.FileVersion, null, sourceStream);
+                                        sourceStream.Position = 0;
+                                    }

-                                await assetThumbnailGenerator.CreateThumbnailAsync(sourceStream, destinationStream, width, height, mode);
-                                destinationStream.Position = 0;
+                                    using (Profiler.Trace("ResizeImage"))
+                                    {
+                                        await assetThumbnailGenerator.CreateThumbnailAsync(sourceStream, destinationStream, width, height, mode);
+                                        destinationStream.Position = 0;
+                                    }

-                                await assetStore.UploadAsync(assetId, entity.FileVersion, assetSuffix, destinationStream);
-                                destinationStream.Position = 0;
+                                    using (Profiler.Trace("ResizeUpload"))
+                                    {
+                                        await assetStore.UploadAsync(assetId, entity.FileVersion, assetSuffix, destinationStream);
+                                        destinationStream.Position = 0;
+                                    }

-                                await destinationStream.CopyToAsync(bodyStream);
+                                    await destinationStream.CopyToAsync(bodyStream);
+                                }
                             }
                         }
                     }


Return faster

Return faster

--- sphere-knn/Tree.cs
+++ sphere-knn/Tree.cs
@@ -140,7 +140,7 @@
             }

             var result = new List<NodeMeasured<T>>();
-            if (node == null || max <= 0 || n == 0)
+            if (node == null || max <= 0 || n <= 0)
             {
                 return result;
             }


Fixed issue with no content on glacier upload.

--- AWSSDK_DotNet35/Amazon.Glacier/Transfer/Internal/MultipartUploadCommand.cs
+++ AWSSDK_DotNet35/Amazon.Glacier/Transfer/Internal/MultipartUploadCommand.cs
@@ -89,7 +89,8 @@
                         Checksum = checksum,
                         Range = "bytes " + currentPosition + "-" + (currentPosition + length - 1) + "/*",
                         UploadId = uploadId,
-                        VaultName = vaultName
+                        VaultName = vaultName,
+                        Body = partStream
                     };

                     uploadRequest.StreamTransferProgress += this.ProgressCallback;


Server root for HTTP HEAD

Server root for HTTP HEAD

Allow the root to be served using an HTTP HEAD request.

--- src/API/Controllers/HomeController.cs
+++ src/API/Controllers/HomeController.cs
@@ -26,6 +26,7 @@
         /// The view for the home page.
         /// </returns>
         [HttpGet]
+        [HttpHead]
         public IActionResult Index()
         {
             if (IsJsonRequest())


Change finger cursor position to match shell

--- Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Cursors/FingerCursor.cs
+++ Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Cursors/FingerCursor.cs
@@ -66,6 +66,12 @@
                     indexFingerRotation = transform.rotation;
                 }

+                Vector3 indexKnucklePosition;
+                if (!TryGetJoint(TrackedHandJoint.IndexKnuckle, out indexKnucklePosition, out _)) // knuckle rotation not used
+                {
+                    indexKnucklePosition = transform.position;
+                }
+
                 Vector3 thumbPosition;
                 Quaternion thumbRotation;
                 if (!TryGetJoint(TrackedHandJoint.ThumbTip, out thumbPosition, out thumbRotation))
@@ -87,7 +93,7 @@

                     if (indexFingerRingRenderer != null)
                     {
-                        TranslateToFinger(indexFingerRingRenderer.transform, deltaTime, indexFingerPosition, indexFingerRotation, false);
+                        TranslateToFinger(indexFingerRingRenderer.transform, deltaTime, indexFingerPosition, indexKnucklePosition);

                         Vector3 surfaceNormal;
                         if ((distance < alignWithSurfaceDistance) &&
@@ -118,14 +124,21 @@

                     if (indexFingerRingRenderer != null)
                     {
-                        TranslateToFinger(indexFingerRingRenderer.transform, deltaTime, indexFingerPosition, indexFingerRotation, nearGrabbable);
+                        if (nearGrabbable)
+                        {
+                            TranslateToFingerPad(indexFingerRingRenderer.transform, deltaTime, indexFingerPosition, indexFingerRotation);
+                        }
+                        else
+                        {
+                            TranslateToFinger(indexFingerRingRenderer.transform, deltaTime, indexFingerPosition, indexKnucklePosition);
+                        }
                         RotateToFinger(indexFingerRingRenderer.transform, deltaTime, indexFingerRotation, nearGrabbable);
                         UpdateVisuals(indexFingerRingRenderer, distance, nearGrabbable);
                     }

                     if (thumbRingRenderer != null)
                     {
-                        TranslateToFinger(thumbRingRenderer.transform, deltaTime, thumbPosition, thumbRotation, true);
+                        TranslateToFingerPad(thumbRingRenderer.transform, deltaTime, thumbPosition, thumbRotation);
                         RotateToFinger(thumbRingRenderer.transform, deltaTime, thumbRotation, true);
                         UpdateVisuals(thumbRingRenderer, distance, nearGrabbable);
                     }
@@ -204,10 +217,15 @@
             return false;
         }

-        private void TranslateToFinger(Transform target, float deltaTime, Vector3 fingerPosition, Quaternion fingerRoation, bool useFingerPad)
-        {
-            var targetPosition = (useFingerPad) ? fingerPosition + (fingerRoation * -Vector3.up) * skinSurfaceOffset :
-                                                      fingerPosition + (fingerRoation * Vector3.forward) * skinSurfaceOffset;
+        private void TranslateToFinger(Transform target, float deltaTime, Vector3 fingerPosition, Vector3 knucklePosition)
+        {
+            var targetPosition = fingerPosition + (fingerPosition - knucklePosition).normalized * skinSurfaceOffset;
+            target.position = Vector3.Lerp(target.position, targetPosition, deltaTime / PositionLerpTime);
+        }
+
+        private void TranslateToFingerPad(Transform target, float deltaTime, Vector3 fingerPosition, Quaternion fingerRoation)
+        {
+            var targetPosition = fingerPosition + (fingerRoation * Vector3.forward) * skinSurfaceOffset;
             target.position = Vector3.Lerp(target.position, targetPosition, deltaTime / PositionLerpTime);
         }


attribute simplified

attribute simplified

--- Assets/RainbowFoldersAsset/RainbowFolders/Editor/Settings/RainbowFolder.cs
+++ Assets/RainbowFoldersAsset/RainbowFolders/Editor/Settings/RainbowFolder.cs
@@ -20,7 +20,7 @@
     [Serializable]
     public class RainbowFolder
     {
-        [ObsoleteAttribute("Use RainbowFolder.Key and RainbowFolder.Type instead.", false)]
+        [Obsolete("Use RainbowFolder.Key and RainbowFolder.Type instead.", false)]
         public string Name;

         public string Key;


Added argument sample in ReadInteractiveOption doc.

--- Code.Cake/CodeCakeSpecific/InteractiveAliases.cs
+++ Code.Cake/CodeCakeSpecific/InteractiveAliases.cs
@@ -87,7 +87,7 @@

         /// <summary>
         /// Prompts the user for one of the <paramref name="options"/> characters that MUST be uppercase after
-        /// having looked for a program argument that answers the prompt.
+        /// having looked for a program argument that answers the prompt (ex: -RunUnitTests=N).
         /// <see cref="InteractiveMode()"/> must be <see cref="CodeCake.InteractiveMode.AutoInteraction"/>
         /// or <see cref="CodeCake.InteractiveMode.Interactive"/> otherwise an <see cref="InvalidOperationException"/> is thrown.
         /// </summary>


Postgres record null value fix.

Postgres record null value fix.

It seems that null string was sent as empty string.
While conditions avoided this in most scenarios, it's still incorrect behavoir.

--- Code/Database/Revenj.DatabasePersistence.Postgres/Converters/ValueTuple.cs
+++ Code/Database/Revenj.DatabasePersistence.Postgres/Converters/ValueTuple.cs
@@ -28,8 +28,7 @@
 			}
 			else
 			{
-				EscapeArray = EscapeRecord = true;
-				HasMarkers = false;
+				EscapeArray = true;
 			}
 		}


Collision relationship back to front no longer crashes on unpartitioned due to multiples being destroyed.

--- Engines/FlatRedBallXNA/FlatRedBall/Math/Collision/CollisionRelationship.cs
+++ Engines/FlatRedBallXNA/FlatRedBall/Math/Collision/CollisionRelationship.cs
@@ -1189,15 +1189,19 @@

                     for (j = secondListStartInclusive; j > secondListEndExclusive; j--)
                     {
-                        var second = secondList[j];
-
-                        if (CollideConsideringSubCollisions(first, second))
+                        // collision can remove more than one, so let's be safe:
+                        if(j < secondList.Count)
                         {
-                            CollisionOccurred?.Invoke(first, second);
-                            collisionOccurred = true;
-                            if (CollisionLimit == CollisionLimit.First)
+                            var second = secondList[j];
+
+                            if (CollideConsideringSubCollisions(first, second))
                             {
-                                break;
+                                CollisionOccurred?.Invoke(first, second);
+                                collisionOccurred = true;
+                                if (CollisionLimit == CollisionLimit.First)
+                                {
+                                    break;
+                                }
                             }
                         }
                     }


just resolved a warning

just resolved a warning

--- Commencement/Controllers/EmailQueueController.cs
+++ Commencement/Controllers/EmailQueueController.cs
@@ -49,7 +49,7 @@
                 emailQueue.Pending = false;
                 _emailQueueRepository.EnsurePersistent(emailQueue);
             }
-            catch (Exception ex)
+            catch
             {
 #if debug
                 throw;


Fixes not to destroy coins

Fixes not to destroy coins

--- ConsoleApplication/ConsoleApplication/Program.cs
+++ ConsoleApplication/ConsoleApplication/Program.cs
@@ -26,43 +26,37 @@

             const String SILVER = "oLcV5F6R59zbChoTBQ962Har24tAnhbtHo";

-            Transfer(BobAddress, 5, AliceAddress, SILVER, BobWIFKey);
+            String result = Transfer(BobAddress, 1, AliceAddress, SILVER, BobWIFKey);
         }

         public static string Transfer(String fromAddress, Int64 amount, String toAddress, String assetId, String senderWifKey)
         {
-
-
             NBitcoin.Network network = NBitcoin.Network.TestNet;
             NBitcoin.BitcoinSecret _key = NBitcoin.Network.TestNet.CreateBitcoinSecret(senderWifKey);
-
-
-            //Get bitcoin balance, 0.0006 is required
-            Decimal fundingBalance = 0;
-
-            const Decimal BITCOIN_TRANSACTION_FEE = 0.00006M;
-
             NBitcoin.BitcoinAddress bitcoinToAddress = new BitcoinAddress(toAddress);
             NBitcoin.BitcoinAddress bitcoinFromAddress = new BitcoinAddress(fromAddress);

             //UTXOS
             CoinPrism txRepo = new CoinPrism(true);
-            var ccutoxs = txRepo.GetTransactions(fromAddress);

             //Get a UTXO to fund.  Make sure its large enough, order by size.  Maybe order by date?
             var fundingUTXO = txRepo.Get(fromAddress).Where(ux => ux.value > 10000).OrderByDescending(o => o.value).First();

+            var ccutoxs = txRepo.GetTransactions(fromAddress);
+
             //Find output which contains an incoming asset
             var assetOutput = ccutoxs.FirstOrDefault(i => i.outputs.Any(o => o.asset_id == assetId)).outputs.FirstOrDefault(o => o.asset_id == assetId);
+
+            var coin_nic = new Coin(fromTxHash: new uint256("dc19133d57bf9013d898bd89198069340d8ca99d71f0d5f6c6e142d724a9ba92"),
+                fromOutputIndex: 0,
+                amount: Money.Satoshis(600), //default fee
+                scriptPubKey: BitcoinAddress.Create("mxSimcis5yCPkBaFZ7ZrJ7fsPqLXatxTax").ScriptPubKey);
+

             if (1 == 2)
             {
                 //Find the coin bob sent
                 //Coin from Bob
-                var coin_nic = new Coin(fromTxHash: new uint256("dc19133d57bf9013d898bd89198069340d8ca99d71f0d5f6c6e142d724a9ba92"),
-                    fromOutputIndex: 0,
-                    amount: Money.Satoshis(600), //default fee
-                    scriptPubKey: BitcoinAddress.Create("mxSimcis5yCPkBaFZ7ZrJ7fsPqLXatxTax").ScriptPubKey);

                 //Coin from Alice
                 var forfees_nic = new Coin(fromTxHash: new uint256("b4326462d6d3b522d7e2c06d9c904313f546395eb62661b06b57195691f5fe5f"),
@@ -71,45 +65,57 @@
                     scriptPubKey: BitcoinAddress.Create("muJjaSHk99LGMnaFduU9b3pWHdT1ZRPASF").ScriptPubKey);
             }

-            //Senders address
+            //Colour coin utxo that was sent
             var coin = new Coin(fromTxHash: new uint256(assetOutput.transaction_hash),
                 fromOutputIndex: Convert.ToUInt32(assetOutput.index),
                 amount: Money.Satoshis(600), //default fee
                 scriptPubKey: BitcoinAddress.Create("mxSimcis5yCPkBaFZ7ZrJ7fsPqLXatxTax").ScriptPubKey);

-
+            //Arbitary coin
             var forfees = new Coin(fromTxHash: new uint256(fundingUTXO.transaction_hash),
                 fromOutputIndex: fundingUTXO.output_index,
                 amount: Money.Satoshis(fundingUTXO.value), //20000
                 scriptPubKey: new Script(Encoders.Hex.DecodeData(fundingUTXO.script_hex)));

-
             BitcoinAssetId assetIdx = new BitcoinAssetId(assetId, Network.TestNet);
             var alice = NBitcoin.BitcoinAddress.Create(toAddress, NBitcoin.Network.TestNet);

-            ulong u = Convert.ToUInt64(amount);
-            ColoredCoin colored = coin.ToColoredCoin(assetIdx, u);
-
-            //redundant
-            //var satoshi = Key.Parse(, Network.TestNet);
-            //string aliceWIF = "cPKW4EsFiPeczwHeSCgo4GTzm4T291Xb6sLGi1HoroXkiqGcGgsH";
-            //var satoshi = Key.Parse(aliceWIF, Network.TestNet);
+            ColoredCoin colored = coin.ToColoredCoin(assetIdx, Convert.ToUInt64(assetOutput.asset_quantity));

             //FROM NIC
             var bobKey = new BitcoinSecret("cMdLBsUCQ92VSRmqfEL4TgJCisWpjVBd8GsP2mAmUZxQ9bh5E7CN");
             var aliceKey = new BitcoinSecret("cPKW4EsFiPeczwHeSCgo4GTzm4T291Xb6sLGi1HoroXkiqGcGgsH");
             var txBuilder = new TransactionBuilder();
+
             var tx = txBuilder
-                .AddKeys(bobKey,aliceKey)
+                .AddKeys(bobKey, aliceKey)
                 .AddCoins(forfees, colored)
-                .SendAsset(alice, new AssetMoney(assetIdx, u))
-                //.SendAsset(satoshi.PubKey, new NBitcoin.OpenAsset.AssetMoney(assetIdx, u))
+                .SendAsset(alice, new AssetMoney(assetIdx, Convert.ToUInt64(amount)))
                 .SetChange(bitcoinFromAddress)
                 .SendFees(Money.Coins(0.001m))
                 .BuildTransaction(true);
+
             var ok = txBuilder.Verify(tx);
             Submit(tx);
             return "ok";
+        }
+
+        private static ColoredCoin GetCoin(String assetId, UInt64 amount)
+        {
+            //Gold
+            if (assetId == "")
+            {
+
+            }
+
+            var goldCoin = new Coin(fromTxHash: new uint256("dc19133d57bf9013d898bd89198069340d8ca99d71f0d5f6c6e142d724a9ba92"),
+                fromOutputIndex: 0,
+                amount: Money.Satoshis(600), //default fee
+                scriptPubKey: BitcoinAddress.Create("mxSimcis5yCPkBaFZ7ZrJ7fsPqLXatxTax").ScriptPubKey);
+
+            BitcoinAssetId assetIdx = new BitcoinAssetId(assetId, Network.TestNet);
+            return goldCoin.ToColoredCoin(assetIdx, amount);
+
         }

         public static void Submit(Transaction tx)


rename test

rename test

--- Construktion.Tests/AbstractExitBlueprintTests.cs
+++ Construktion.Tests/AbstractExitBlueprintTests.cs
@@ -5,7 +5,7 @@
     public class AbstractExitBlueprintTests
     {
         [Fact]
-        public void should_apply_value_after_the_pipeline()
+        public void should_apply_value_after_the_normal_blueprints()
         {
             var construktion = new Construktion().With(x =>
             {


Fix time management bugs in RadiationPulseSystem (#4743)

--- Content.Server/Radiation/RadiationPulseSystem.cs
+++ Content.Server/Radiation/RadiationPulseSystem.cs
@@ -20,15 +20,16 @@
         {
             base.Update(frameTime);

-            _accumulator += RadiationCooldown;
+            _accumulator += frameTime;

             while (_accumulator > RadiationCooldown)
             {
                 _accumulator -= RadiationCooldown;

+                // All code here runs effectively every RadiationCooldown seconds, so use that as the "frame time".
                 foreach (var comp in EntityManager.EntityQuery<RadiationPulseComponent>(true))
                 {
-                    comp.Update(frameTime);
+                    comp.Update(RadiationCooldown);
                     var ent = comp.Owner;

                     if (ent.Deleted) continue;


Discover messages

Discover messages

--- Desktop/Tempest.Social/Protocol/SocialMessage.cs
+++ Desktop/Tempest.Social/Protocol/SocialMessage.cs
@@ -61,5 +61,10 @@
 	public static class SocialProtocol
 	{
 		public static readonly Protocol Instance = new Protocol (2, 1);
+
+		static SocialProtocol()
+		{
+			Instance.DiscoverFromAssemblyOf<SocialMessage>();
+		}
 	}
 }


Correct handling of super classes in GUI, correct highlighting

--- DesktopAntlrGrammarEditor/MainWindowViewModel.cs
+++ DesktopAntlrGrammarEditor/MainWindowViewModel.cs
@@ -22,6 +22,14 @@
 {
     public class MainWindowViewModel : ReactiveObject
     {
+        private readonly static Dictionary<string, string> _highlightings = new Dictionary<string, string>
+        {
+            [".cs"] = "C#",
+            [".java"] = "Java",
+            [".php"] = "PHP",
+            [".js"] = "JavaScript",
+        };
+
         private readonly Window _window;
         private readonly Settings _settings;
         private Grammar _grammar;
@@ -49,13 +57,7 @@
             _parseTreeTextBox = _window.Find<TextEditor>("ParseTreeTextBox");
             _tokensTextBox = _window.Find<TextEditor>("TokensTextBox");

-            using (Stream s = Assembly.GetExecutingAssembly().GetManifestResourceStream("DesktopAntlrGrammarEditor.Antlr4.xshd"))
-            {
-                using (XmlTextReader reader = new XmlTextReader(s))
-                {
-                    _grammarTextBox.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);
-                }
-            }
+            SetAntlrHighlighting();

             _settings = Settings.Load();

@@ -132,6 +134,17 @@

             AutoProcessing = _settings.Autoprocessing;
             IndentedTree = _settings.IndentedTree;
+        }
+
+        private void SetAntlrHighlighting()
+        {
+            using (Stream s = Assembly.GetExecutingAssembly().GetManifestResourceStream("DesktopAntlrGrammarEditor.Antlr4.xshd"))
+            {
+                using (XmlTextReader reader = new XmlTextReader(s))
+                {
+                    _grammarTextBox.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);
+                }
+            }
         }

         public string OpenedGrammarFile
@@ -164,6 +177,16 @@
                         _settings.OpenedGrammarFile = value;
                         _settings.Save();

+                        string extension = Path.GetExtension(value).ToLowerInvariant();
+                        if (_highlightings.TryGetValue(extension, out string highlighting))
+                        {
+                            _grammarTextBox.SyntaxHighlighting = HighlightingManager.Instance.GetDefinition(highlighting);
+                        }
+                        else if (extension == ".g4")
+                        {
+                            SetAntlrHighlighting();
+                        }
+
                         this.RaisePropertyChanged(nameof(IsParserOpened));
                         this.RaisePropertyChanged(nameof(IsPreprocessor));
                         this.RaisePropertyChanged();
@@ -219,6 +242,28 @@
                     _workflow.Runtime = value.Runtime;
                     _grammar.Runtimes.Clear();
                     _grammar.Runtimes.Add(value.Runtime);
+
+                    int index = 0;
+                    while (index < GrammarFiles.Count)
+                    {
+                        string grammarFile = GrammarFiles[index];
+                        if (!Path.GetExtension(grammarFile).Equals(".g4", StringComparison.OrdinalIgnoreCase))
+                        {
+                            GrammarFiles.Remove(grammarFile);
+                        }
+                        else
+                        {
+                            index++;
+                        }
+                    }
+
+                    InitGrammarRuntimeFiles();
+
+                    if (!GrammarFiles.Contains(OpenedGrammarFile))
+                    {
+                        OpenedGrammarFile = GrammarFiles.First();
+                    }
+
                     this.RaisePropertyChanged();
                     if (AutoProcessing)
                     {
@@ -798,14 +843,41 @@
         private void InitFiles()
         {
             GrammarFiles.Clear();
+
             foreach (var file in _grammar.Files)
             {
                 GrammarFiles.Add(file);
             }
+
+            InitGrammarRuntimeFiles();
+
             TextFiles.Clear();
             foreach (var file in _grammar.TextFiles)
             {
                 TextFiles.Add(new FileName(file));
+            }
+        }
+
+        private void InitGrammarRuntimeFiles()
+        {
+            RuntimeInfo value = SelectedRuntime;
+            string[] runtimeFiles = new string[0];
+            string runtimeName = value.Runtime.ToString();
+            string runtimeFilesPath = Path.Combine(_grammar.Directory, runtimeName);
+            if (!Directory.Exists(runtimeFilesPath))
+            {
+                runtimeName = value.Runtime.GetGeneralRuntimeName();
+                runtimeFilesPath = Path.Combine(_grammar.Directory, runtimeName);
+            }
+
+            if (Directory.Exists(runtimeFilesPath))
+            {
+                runtimeFiles = Directory.GetFiles(runtimeFilesPath, "*." + value.Extensions[0]);
+            }
+
+            foreach (string runtimeFile in runtimeFiles)
+            {
+                GrammarFiles.Add(Path.Combine(runtimeName, Path.GetFileName(runtimeFile)));
             }
         }


Change commandReceiver to accept only pending commands #37685

--- src/Takenet.MessagingHub.Client/Listener/CommandReceivedHandler.cs
+++ src/Takenet.MessagingHub.Client/Listener/CommandReceivedHandler.cs
@@ -14,6 +14,8 @@

         protected override async Task CallReceiversAsync(Command command, CancellationToken cancellationToken)
         {
+            if (command.Status != CommandStatus.Pending) return;
+
             try
             {
                 await base.CallReceiversAsync(command, cancellationToken);


Update Summary w/ large image card documentation

--- src/TwitterCardTagHelpers.Web/Views/Cards/SummaryLargeImage.cshtml
+++ src/TwitterCardTagHelpers.Web/Views/Cards/SummaryLargeImage.cshtml
@@ -4,3 +4,35 @@
 @{
     // ViewBag.Title = "SummaryLargeImage Page";
 }
+

+

+
Summary Card with Large Image tag helper

+

+

+
The Summary Card with Large Image features a large, full-width prominent image alongside a tweet. It is designed to give the reader a rich photo experience, and clicking on the image brings the user to your website.

+

+  https://dev.twitter.com/cards/types/summary-large-image
+

+    <twitter-summary-large-image site="@@nytimes"
+      creator="@@SarahMaslinNir"
+      title="Parade of Fans for Houston’s Funeral"
+      description="NEWARK - The guest list and parade of limousines with celebrities emerging from them seemed more suited to a red carpet event in Hollywood or New York than than a gritty stretch of Sussex Avenue near the former site of the James M. Baxter Terrace public housing project here."
+      image="http://graphics8.nytimes.com/images/2012/02/19/us/19whitney-span/19whitney-span-articleLarge.jpg" />
+

+

+    This will produce:
+

+

+    <meta name="twitter:card" content="summary_large_image">
+<meta name="twitter:site" content="@@nytimes">
+<meta name="twitter:creator" content="@@SarahMaslinNir">
+<meta name="twitter:title" content="Parade of Fans for Houston’s Funeral">
+<meta name="twitter:description" content="NEWARK - The guest list and parade of limousines with celebrities emerging from them seemed more suited to a red carpet event in Hollywood or New York than than a gritty stretch of Sussex Avenue near the former site of the James M. Baxter Terrace public housing project here.">
+<meta name="twitter:image" content="http://graphics8.nytimes.com/images/2012/02/19/us/19whitney-span/19whitney-span-articleLarge.jpg">
+

+  <twitter-summary-large-image site="@@nytimes"
+    creator="@@SarahMaslinNir"
+    title="Parade of Fans for Houston’s Funeral"
+    description="NEWARK - The guest list and parade of limousines with celebrities emerging from them seemed more suited to a red carpet event in Hollywood or New York than than a gritty stretch of Sussex Avenue near the former site of the James M. Baxter Terrace public housing project here."
+    image="http://graphics8.nytimes.com/images/2012/02/19/us/19whitney-span/19whitney-span-articleLarge.jpg" />
+


Fixes: U4-3517 Package tree doesnt load

Fixes: U4-3517 Package tree doesnt load

--- src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs
+++ src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs
@@ -113,15 +113,18 @@

                     _repoGuid = HttpContext.Current.Request.QueryString["repoGuid"];
                     Umbraco.Web.org.umbraco.our.Repository r = new Umbraco.Web.org.umbraco.our.Repository();
+
                     foreach (var cat in r.Categories(_repoGuid))
                     {
                         XmlTreeNode xNode = XmlTreeNode.Create(this);
+                        xNode.NodeID = cat.Id.ToInvariantString();
                         xNode.Text = cat.Text;
                         xNode.Action = "javascript:openPackageCategory('BrowseRepository.aspx?category=" + cat.Id + "&repoGuid=" + _repoGuid + "');";
                         xNode.Icon = "icon-folder";
                         xNode.OpenIcon = "icon-folder";
                         xNode.NodeType = "packagesCategory" + cat.Id;
                         tree.Add(xNode);
+
                     }

                     break;


changes to services.Configure calls by microsoft

--- src/Web/Startup.cs
+++ src/Web/Startup.cs
@@ -47,7 +47,7 @@
             services.AddDbContext<ApplicationDbContext>(options =>
                 options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

-            services.Configure<DRSConfig>(Configuration.GetSection("DRS"));
+            services.Configure<DRSConfig>(_ => Configuration.GetSection("DRS"));

             services.AddIdentity<ApplicationUser, IdentityRole>()
                 .AddEntityFrameworkStores<ApplicationDbContext>()


Replace string keys in ColorSchemes with const strings and an enum


Make handler shim abstract.

Make handler shim abstract.

--- src/VisualStudio/LiveShare/Impl/Shims/GoToDefinitionHandlerShim.cs
+++ src/VisualStudio/LiveShare/Impl/Shims/GoToDefinitionHandlerShim.cs
@@ -7,16 +7,16 @@

 namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Shims
 {
-    internal class GoToDefinitionHandlerShim : AbstractLiveShareHandlerShim<TextDocumentPositionParams, object>
+    internal abstract class AbstractGoToDefinitionHandlerShim : AbstractLiveShareHandlerShim<TextDocumentPositionParams, object>
     {
-        public GoToDefinitionHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
+        public AbstractGoToDefinitionHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
             : base(requestHandlers, Methods.TextDocumentDefinitionName)
         {
         }
     }

     [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentDefinitionName)]
-    internal class CSharpGoToDefinitionHandlerShim : GoToDefinitionHandlerShim
+    internal class CSharpGoToDefinitionHandlerShim : AbstractGoToDefinitionHandlerShim
     {
         [ImportingConstructor]
         public CSharpGoToDefinitionHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
@@ -26,7 +26,7 @@
     }

     [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentDefinitionName)]
-    internal class VisualBasicGoToDefinitionHandlerShim : GoToDefinitionHandlerShim
+    internal class VisualBasicGoToDefinitionHandlerShim : AbstractGoToDefinitionHandlerShim
     {
         [ImportingConstructor]
         public VisualBasicGoToDefinitionHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)


Updating version number

Updating version number


Small histograms when displaying result data


Use ConcurrentDictionary (#7)

Use ConcurrentDictionary (#7)

* Use ConcurrentDictionary


map ready to be nice and beauty :)

map ready to be nice and beauty :)

--- BikeTracker/Views/Home/Index.cshtml
+++ BikeTracker/Views/Home/Index.cshtml
@@ -1,5 +1,5 @@
 @{
-    ViewBag.Title = "Home Page";
+	ViewBag.Title = "Home Page";
 }

@@ -27,41 +27,58 @@

 @section scripts
 {
-
-
+
-
+			map = new google.maps.Map(document.getElementById('map', mapOptions), {
+
+			});
+
+			//map.mapTypes.set('map_style', styledMap);
+			//map.setMapTypeId('map_style');
+
+			var directionsService = new google.maps.DirectionsService();
+			// TO pass points form server
+			var request = {
+				origin: '54.402658,18.572466',
+				destination: '52.954730,-1.158253',
+				travelMode: 'BICYCLING'
+			};
+			var directionsDisplay = new google.maps.DirectionsRenderer();
+			directionsDisplay.setMap(map);
+			directionsService.route(request, function (result, status) {
+				if (status == 'OK') {
+					route = result;
+					directionsDisplay.setDirections(route);
+
+					// to add points from server
+					var point = Sii.findPositionOnRoute(213632, route.routes[0].legs[0]);
+					var marker = new google.maps.Marker({
+						position: point,
+						map: map,
+						title: 'I am here!'
+					});
+				}
+			});
+		};
+
+	</script>
+
 }


better block rate averaging

better block rate averaging

--- BitSharp.Common/ExtensionMethods.cs
+++ BitSharp.Common/ExtensionMethods.cs
@@ -11,6 +11,7 @@
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
+using BitSharp.Common;

 namespace BitSharp.Common.ExtensionMethods
 {
@@ -455,5 +456,18 @@
             foreach (var keyPair in keyPairs)
                 dictionary.Add(keyPair);
         }
+
+        public static double? AverageOrDefault<TSource>(this IEnumerable<TSource> source, Func<TSource, long> selector)
+        {
+            try
+            {
+                return source.Average(selector);
+            }
+            catch (InvalidOperationException)
+            {
+                //TODO something better than catching exception?
+                return null;
+            }
+        }
     }
 }


TSS-50 Fixed re-authentication logic for private API connections

AQIS was experiencing 401-Unauthorized when syncing reports (over a private API) after a long idle connection.

Turns out that all the private API connections were not being updated with the new session token.

--- src/Aquarius.Client/AquariusClient.cs
+++ src/Aquarius.Client/AquariusClient.cs
@@ -131,7 +131,13 @@
         {
             SessionToken = ClientHelper.Login(_serviceClients.First().Value, Username, Password);

-            foreach (var client in _serviceClients.Values)
+            SetAuthenticationTokenForConnectedClients(_serviceClients);
+            SetAuthenticationTokenForConnectedClients(_customClients);
+        }
+
+        private void SetAuthenticationTokenForConnectedClients<TKey>(Dictionary<TKey, ServiceClientBase> clientDictionary)
+        {
+            foreach (var client in clientDictionary.Values)
             {
                 ClientHelper.SetAuthenticationToken(client, SessionToken);
             }


Fix bug that causes exception after title changed (BL-8472, BL-8487)

Just added back some code that was in 4.7 that got deleted during a rewrite of a class in 4.8.

--- src/BloomExe/Edit/WebThumbNailList.cs
+++ src/BloomExe/Edit/WebThumbNailList.cs
@@ -36,6 +36,7 @@
 		private Bloom.Browser _browser;
 		internal EditingModel Model;
 		private static string _thumbnailInterval;
+		private string _baseForRelativePaths;

 		// Store this so we don't have to reload the thing from disk everytime we refresh the screen.
 		private readonly string _baseHtml;
@@ -269,6 +270,7 @@

 			_browser.WebBrowser.DocumentCompleted += WebBrowser_DocumentCompleted;

+			_baseForRelativePaths = pageListDom.BaseForRelativePaths;
 			_browser.Navigate(pageListDom, source:BloomServer.SimulatedPageFileSource.Pagelist);
 			return result.ToList();
 		}
@@ -401,6 +403,13 @@

 		public void UpdateThumbnailAsync(IPage page)
 		{
+			if (page.Book.Storage.NormalBaseForRelativepaths != _baseForRelativePaths)
+			{
+				// book has been renamed! can't go on with old document that pretends to be in the wrong place.
+				// Regenerate completely.
+				UpdateItems(_pages);
+				return;
+			}
 			WebSocketServer.SendString("pageThumbnailList", "pageNeedsRefresh", page.Id);
 		}


Fixed selectlist creation in alternate path

--- CVGS/Controllers/OrderController.cs
+++ CVGS/Controllers/OrderController.cs
@@ -108,12 +108,18 @@
         [ValidateAntiForgeryToken]
         public ActionResult Checkout([Bind(Include = "OrderId,MemberId,BillingAddressId,ShippingAddressId,CreditCardId,DateCreated")] ORDERHEADER orderHeader)
         {
+            // Redirect unauthenticated members
+            var memberId = Session["MemberId"];
+            if (memberId == null)
+            {
+                return RedirectToAction("Index", "Login");
+            }
             if (ModelState.IsValid)
             {
                 db.ORDERHEADERs.Add(orderHeader);

                 // Add all items from user's cart into the new order
-                var cartItems = db.CARTITEMs.Where(c => c.MemberId == orderHeader.MemberId).Include(c => c.GAME);
+                var cartItems = db.CARTITEMs.Where(c => c.MemberId == orderHeader.MemberId);
                 foreach (var cartItem in cartItems)
                 {
                     ORDERITEM orderItem = new ORDERITEM()
@@ -130,10 +136,12 @@
                 db.SaveChanges();
                 return RedirectToAction("MyOrders");
             }
-
-            ViewBag.BillingAddressId = new SelectList(db.ADDRESSes, "AddressId", "StreetAddress", orderHeader.BillingAddressId);
-            ViewBag.ShippingAddressId = new SelectList(db.ADDRESSes, "AddressId", "StreetAddress", orderHeader.ShippingAddressId);
-            ViewBag.CreditCardId = new SelectList(db.CREDITCARDs, "CardId", "CardNumber", orderHeader.CreditCardId);
+            var memberAddresses = db.ADDRESSes.Where(a => a.MemberId == (int)memberId && !a.Deleted);
+            var memberCreditCards = db.CREDITCARDs.Where(c => c.MemberId == (int)memberId && !c.Deleted);
+
+            ViewBag.BillingAddressId = new SelectList(memberAddresses, "AddressId", "StreetAddress");
+            ViewBag.ShippingAddressId = new SelectList(memberAddresses, "AddressId", "StreetAddress");
+            ViewBag.CreditCardId = new SelectList(memberCreditCards, "CardId", "CardNumber");
             return View(orderHeader);
         }


IssueTime is optional

IssueTime is optional

--- src/main/Zyborg.Vault.POSH/GetAuthToken.cs
+++ src/main/Zyborg.Vault.POSH/GetAuthToken.cs
@@ -118,7 +118,7 @@
 			{ get; set; }

 			[JsonProperty("issue_time")]
-			public DateTime IssueTime
+			public DateTime? IssueTime
 			{ get; set; }

 			[JsonProperty("meta")]


Removing 'zzz' from method name

Removing 'zzz' from method name

Goodbye test code.

--- Collections/Paging/PagingHelpers.cs
+++ Collections/Paging/PagingHelpers.cs
@@ -13,7 +13,7 @@
 		/// <param name="page">the 1 indexed page number you are interested in, cannot be zero or negative</param>
 		/// <param name="pageSize">the size of the page you want, cannot be zero or negative</param>
 		/// <returns>A queryable of the page of entities with counts appended.</returns>
-		public static IQueryable<EntityWithCount<T>> GetPageWithTotalzzz<T>(this IQueryable<T> entities, int page, int pageSize) where T : class
+		public static IQueryable<EntityWithCount<T>> GetPageWithTotal<T>(this IQueryable<T> entities, int page, int pageSize) where T : class
 		{
 			if (entities == null)
 			{


Add VerifyAccess with parameter

Add VerifyAccess with parameter

--- GoldenAnvil.Utility/NotifyPropertyChangedBase.cs
+++ GoldenAnvil.Utility/NotifyPropertyChangedBase.cs
@@ -203,6 +203,17 @@
 		{
 		}

+		/// <summary>
+		/// Call this method to verify in DEBUG builds that this class can be accessed in the current context.
+		/// </summary>
+		/// <param name="value">The value to return.</param>
+		/// <returns>The value passed as an argument.</returns>
+		protected T VerifyAccess<T>(T value)
+		{
+			VerifyAccess();
+			return value;
+		}
+
 		private void RaisePropertyChanging(string propertyName)
 		{
 			VerifyAccess();


Regenerate Grafeas.V1 (#4187)

Regenerate Grafeas.V1 (#4187)

Descriptor-only change

--- apis/Grafeas.V1/Grafeas.V1/Grafeas.cs
+++ apis/Grafeas.V1/Grafeas.V1/Grafeas.cs
@@ -116,7 +116,7 @@
             "YWdlci5nb29nbGVhcGlzLmNvbS9Qcm9qZWN0EjAKC29jY3VycmVuY2VzGAIg",
             "AygLMhYuZ3JhZmVhcy52MS5PY2N1cnJlbmNlQgPgQQIiTQoeQmF0Y2hDcmVh",
             "dGVPY2N1cnJlbmNlc1Jlc3BvbnNlEisKC29jY3VycmVuY2VzGAEgAygLMhYu",
-            "Z3JhZmVhcy52MS5PY2N1cnJlbmNlMu0PCgdHcmFmZWFzEn0KDUdldE9jY3Vy",
+            "Z3JhZmVhcy52MS5PY2N1cnJlbmNlMpIQCgdHcmFmZWFzEn0KDUdldE9jY3Vy",
             "cmVuY2USIC5ncmFmZWFzLnYxLkdldE9jY3VycmVuY2VSZXF1ZXN0GhYuZ3Jh",
             "ZmVhcy52MS5PY2N1cnJlbmNlIjKC0+STAiUSIy92MS97bmFtZT1wcm9qZWN0",
             "cy8qL29jY3VycmVuY2VzLyp92kEEbmFtZRKXAQoPTGlzdE9jY3VycmVuY2Vz",
@@ -161,9 +161,10 @@
             "c3ROb3RlT2NjdXJyZW5jZXMSJi5ncmFmZWFzLnYxLkxpc3ROb3RlT2NjdXJy",
             "ZW5jZXNSZXF1ZXN0GicuZ3JhZmVhcy52MS5MaXN0Tm90ZU9jY3VycmVuY2Vz",
             "UmVzcG9uc2UiP4LT5JMCKxIpL3YxL3tuYW1lPXByb2plY3RzLyovbm90ZXMv",
-            "Kn0vb2NjdXJyZW5jZXPaQQtuYW1lLGZpbHRlckJRCg1pby5ncmFmZWFzLnYx",
-            "UAFaOGdvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvZ3Jh",
-            "ZmVhcy92MTtncmFmZWFzogIDR1JBYgZwcm90bzM="));
+            "Kn0vb2NjdXJyZW5jZXPaQQtuYW1lLGZpbHRlchojykEgY29udGFpbmVyYW5h",
+            "bHlzaXMuZ29vZ2xlYXBpcy5jb21CUQoNaW8uZ3JhZmVhcy52MVABWjhnb29n",
+            "bGUuZ29sYW5nLm9yZy9nZW5wcm90by9nb29nbGVhcGlzL2dyYWZlYXMvdjE7",
+            "Z3JhZmVhc6ICA0dSQWIGcHJvdG8z"));
       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
           new pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Api.ClientReflection.Descriptor, global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.FieldMaskReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Grafeas.V1.AttestationReflection.Descriptor, global::Grafeas.V1.BuildReflection.Descriptor, global::Grafeas.V1.CommonReflection.Descriptor, global::Grafeas.V1.DeploymentReflection.Descriptor, global::Grafeas.V1.DiscoveryReflection.Descriptor, global::Grafeas.V1.ImageReflection.Descriptor, global::Grafeas.V1.PackageReflection.Descriptor, global::Grafeas.V1.UpgradeReflection.Descriptor, global::Grafeas.V1.VulnerabilityReflection.Descriptor, },
           new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {


functionalize sort

functionalize sort

--- Colours.Core/Application/Schemer.cs
+++ Colours.Core/Application/Schemer.cs
@@ -1,4 +1,4 @@
-using System;
+using System.Linq;
 using System.Collections.Generic;

 namespace Colours
@@ -98,7 +98,6 @@
         public static List<HsvColor> Monochromatic(HsvColor c)
         {
             HsvColor c1, c2;
-            List<HsvColor> l;

             if (c.Saturation < 0.1d)
             {
@@ -111,10 +110,8 @@
                 c2 = new HsvColor(c.Hue, c.Saturation, (c.Value + 2d * (1d / 3d)) % 1d);
             }

-            l = new List<HsvColor>() { c, c1, c2 };
-            l.Sort((x, y) => x.Value == y.Value ? 0 :
-                (x.Value < y.Value ? 1 : -1));
-            return l;
+            return new List<HsvColor>() { c, c1, c2 }
+                .OrderBy(x => x.Value).Reverse().ToList();
         }
     }
 }


Minor edits to LockingUtilTests

Minor edits to LockingUtilTests

--- Jabberwocky.Core.Tests/Utils/LockingUtilTests.cs
+++ Jabberwocky.Core.Tests/Utils/LockingUtilTests.cs
@@ -85,7 +85,8 @@
 				Assert.IsNull(lock2);

 				// Continue Task1 (verify that task2 threadstate is 'blocked')
-				SpinWait.SpinUntil(() => task2.ThreadState == ThreadState.WaitSleepJoin, TimeSpan.FromMilliseconds(100));
+				if (!SpinWait.SpinUntil(() => task2.ThreadState == ThreadState.WaitSleepJoin, TimeSpan.FromMilliseconds(100)))
+					Assert.Fail("Timeout expired trying to validate state of task2.");
 				Assert.AreEqual(ThreadState.WaitSleepJoin, task2.ThreadState);
 				mre1.Set();

@@ -183,7 +184,8 @@
 				Assert.IsNull(lock2);

 				// Continue Task1 (verify that task2 threadstate is 'blocked')
-				SpinWait.SpinUntil(() => task2.Status == TaskStatus.WaitingForActivation, TimeSpan.FromMilliseconds(100));
+				if (!SpinWait.SpinUntil(() => task2.Status == TaskStatus.WaitingForActivation, TimeSpan.FromMilliseconds(100)))
+					Assert.Fail("Timeout expired trying to validate state of task2.");
 				Assert.AreEqual(TaskStatus.WaitingForActivation, task2.Status);
 				mre1.Set();


fix test case

fix test case

--- King.Azure.BackgroundWorker.Tests/TimingTests.cs
+++ King.Azure.BackgroundWorker.Tests/TimingTests.cs
@@ -35,7 +35,7 @@
             var random = new Random();
             var max = random.Next(1, 60);
             var time = new Timing();
-            var ex = time.Exponential(0, max, random.Next(61));
+            var ex = time.Exponential(0, max, random.Next(61, 500));
             Assert.AreEqual(max, ex);
         }


Improve code

Improve code

--- Leap-v2/LeapTutorials/ImagePinchLeap/AppModel.cs
+++ Leap-v2/LeapTutorials/ImagePinchLeap/AppModel.cs
@@ -13,11 +13,9 @@
         public LeapManager LeapManager { get; } = new LeapManager();

         public ReadOnlyReactiveProperty<Leap.Hand> FrontHand { get; }
-        public ReadOnlyReactiveProperty<double?> PinchStrength { get; }
-        public ReadOnlyReactiveProperty<bool?> IsPinched { get; }
+        public ReadOnlyReactiveProperty<bool> IsPinched { get; }

         public IObservable<IObservable<Vector3D>> PinchDrag { get; }
-
         public ReactiveProperty<Vector3D> DraggedDelta { get; } = new ReactiveProperty<Vector3D>(new Vector3D());

         public AppModel()
@@ -25,11 +23,8 @@
             FrontHand = LeapManager.FrameArrived
                 .Select(f => f.Hands.Frontmost)
                 .ToReadOnlyReactiveProperty();
-            PinchStrength = FrontHand
-                .Select(h => h?.IsValid == true ? h.PinchStrength : default(double?))
-                .ToReadOnlyReactiveProperty();
-            IsPinched = PinchStrength
-                .Select(v => v.HasValue ? v.Value == 1.0 : default(bool?))
+            IsPinched = FrontHand
+                .Select(h => h?.IsValid == true && h.PinchStrength == 1.0)
                 .ToReadOnlyReactiveProperty();

             PinchDrag = IsPinched
@@ -38,7 +33,6 @@
                 .Select(p0 => FrontHand
                     .TakeWhile(_ => IsPinched.Value == true)
                     .Select(_ => GetPosition(FrontHand.Value) - p0));
-
             PinchDrag
                 .Select(d => new { v0 = DraggedDelta.Value, d })
                 .Subscribe(_ => _.d.Subscribe(v => DraggedDelta.Value = _.v0 + v));


фикс для ifnode

фикс для ifnode

--- Lens.SyntaxTree/SyntaxTree/ControlFlow/IfNode.cs
+++ Lens.SyntaxTree/SyntaxTree/ControlFlow/IfNode.cs
@@ -39,18 +39,16 @@

 		protected override Type resolveExpressionType(Context ctx, bool mustReturn = true)
 		{
-			if (!mustReturn)
+			if (!mustReturn || FalseAction == null)
 				return typeof (Unit);

 			var type = TrueAction.GetExpressionType(ctx);
-			if (FalseAction != null)
-			{
-				var otherType = FalseAction.GetExpressionType(ctx);
-				if (otherType.IsExtendablyAssignableFrom(type))
-					type = otherType;
-				else if(!type.IsExtendablyAssignableFrom(otherType))
-					Error(CompilerMessages.ConditionInconsistentTyping, type, otherType);
-			}
+			var otherType = FalseAction.GetExpressionType(ctx);
+			if (otherType.IsExtendablyAssignableFrom(type))
+				return otherType;
+
+			if(!type.IsExtendablyAssignableFrom(otherType))
+				Error(CompilerMessages.ConditionInconsistentTyping, type, otherType);

 			return type;
 		}
@@ -74,11 +72,11 @@
 			{
 				gen.EmitBranchFalse(endLabel);
 				TrueAction.Compile(ctx, mustReturn);
+				if(TrueAction.GetExpressionType(ctx).IsNotVoid())
+					gen.EmitPop();
+
 				gen.MarkLabel(endLabel);
-				if(!mustReturn && TrueAction.GetExpressionType(ctx).IsNotVoid())
-					gen.EmitPop();
-				else
-					gen.EmitNop();
+				gen.EmitNop();
 			}
 			else
 			{
@@ -92,11 +90,12 @@

 				gen.MarkLabel(falseLabel);
 				FalseAction.Compile(ctx, mustReturn);
-				gen.MarkLabel(endLabel);
+
 				if (!mustReturn && FalseAction.GetExpressionType(ctx).IsNotVoid())
 					gen.EmitPop();
-				else
-					gen.EmitNop();
+
+				gen.MarkLabel(endLabel);
+				gen.EmitNop();
 			}
 		}


Show whether the game requires video proof or not

This is really important information to know, so the user should get
notified about this before actually doing runs of the game.

--- LiveSplit/LiveSplit.View/View/MetadataControl.cs
+++ LiveSplit/LiveSplit.View/View/MetadataControl.cs
@@ -125,7 +125,13 @@

                 if (Metadata.Category != null)
                 {
-                    tbxRules.Text = Metadata.Category.Rules ?? string.Empty;
+                    if (Metadata.Game.Ruleset.RequiresVideo)
+                    {
+                        tbxRules.SelectionFont = new Font(tbxRules.Font, FontStyle.Bold);
+                        tbxRules.AppendText("Runs of this game require video proof." + Environment.NewLine + Environment.NewLine);
+                        tbxRules.SelectionFont = new Font(tbxRules.Font, FontStyle.Regular);
+                    }
+                    tbxRules.AppendText(Metadata.Category.Rules ?? string.Empty);
                 }

                 var controlIndex = 0;


Made the Additional Rules Text more flexible

Instead of showing multiple lines, it now constructs a sentence out of
individual tokens.

--- LiveSplit/LiveSplit.View/View/MetadataControl.cs
+++ LiveSplit/LiveSplit.View/View/MetadataControl.cs
@@ -9,6 +9,7 @@
 using SpeedrunComSharp;
 using LiveSplit.Web.Share;
 using System.Diagnostics;
+using System.Text;

 namespace LiveSplit.View
 {
@@ -122,32 +123,7 @@
                 cmbPlatform.Items.AddRange(Metadata.Game.Platforms.Select(x => x.Name).ToArray());
                 cmbRegion.DataBindings.Add("SelectedItem", Metadata, "RegionName", false, DataSourceUpdateMode.OnPropertyChanged);
                 cmbPlatform.DataBindings.Add("SelectedItem", Metadata, "PlatformName", false, DataSourceUpdateMode.OnPropertyChanged);
-
-                if (Metadata.Game.Ruleset.DefaultTimingMethod != SpeedrunComSharp.TimingMethod.RealTime)
-                {
-                    var timingMethodText = Metadata.Game.Ruleset.DefaultTimingMethod == SpeedrunComSharp.TimingMethod.RealTimeWithoutLoads
-                        ? "Runs of this game are timed without the loading times."
-                        : "Runs of this game are timed with the Game Time.";
-
-                    tbxRules.SelectionFont = new Font(tbxRules.Font, FontStyle.Bold);
-                    tbxRules.AppendText(timingMethodText + Environment.NewLine);
-                    tbxRules.SelectionFont = new Font(tbxRules.Font, FontStyle.Regular);
-                }
-
-                if (Metadata.Category != null)
-                {
-                    if (Metadata.Game.Ruleset.RequiresVideo)
-                    {
-                        tbxRules.SelectionFont = new Font(tbxRules.Font, FontStyle.Bold);
-                        tbxRules.AppendText("Runs of this game require video proof." + Environment.NewLine);
-                        tbxRules.SelectionFont = new Font(tbxRules.Font, FontStyle.Regular);
-                    }
-                    if (tbxRules.Text.Length > 0)
-                    {
-                        tbxRules.AppendText(Environment.NewLine);
-                    }
-                    tbxRules.AppendText(Metadata.Category.Rules ?? string.Empty);
-                }
+                refreshRules();

                 var controlIndex = 0;

@@ -231,6 +207,59 @@
             RefreshAssociateButton();
         }

+        private void refreshRules()
+        {
+            var additionalRules = new List<string>();
+
+            if (Metadata.Game.Ruleset.DefaultTimingMethod != SpeedrunComSharp.TimingMethod.RealTime)
+            {
+                var timingText = Metadata.Game.Ruleset.DefaultTimingMethod == SpeedrunComSharp.TimingMethod.RealTimeWithoutLoads
+                    ? "are timed without the loading times"
+                    : "are timed with the Game Time";
+
+                additionalRules.Add(timingText);
+            }
+
+            if (Metadata.Game.Ruleset.RequiresVideo)
+            {
+                additionalRules.Add("require video proof");
+            }
+
+            if (additionalRules.Any())
+            {
+                var firstRule = additionalRules.First();
+                var lastRule = additionalRules.Last();
+
+                var stringBuilder = new StringBuilder();
+                stringBuilder.Append("Runs of this game ");
+
+                foreach (var additionalRule in additionalRules)
+                {
+                    if (additionalRule != firstRule)
+                    {
+                        if (additionalRule != lastRule)
+                            stringBuilder.Append(", ");
+                        else
+                            stringBuilder.Append(" and ");
+                    }
+
+                    stringBuilder.Append(additionalRule);
+                }
+
+                stringBuilder.AppendLine(".");
+                stringBuilder.AppendLine();
+
+                tbxRules.SelectionFont = new Font(tbxRules.Font, FontStyle.Bold);
+                tbxRules.AppendText(stringBuilder.ToString());
+                tbxRules.SelectionFont = new Font(tbxRules.Font, FontStyle.Regular);
+            }
+
+            if (Metadata.Category != null)
+            {
+                tbxRules.AppendText(Metadata.Category.Rules ?? string.Empty);
+            }
+        }
+
         public void RefreshAssociateButton()
         {
             if (InvokeRequired)


fixing build

fixing build

--- Mapsui.UI.Forms/Extensions/PositionExtensions.cs
+++ Mapsui.UI.Forms/Extensions/PositionExtensions.cs
@@ -1,8 +1,7 @@
-#if __MAUI__
+using Mapsui.Projections;
+#if __MAUI__
 namespace Mapsui.UI.Maui.Extensions
 #else
-using Mapsui.Projections;
-
 namespace Mapsui.UI.Forms.Extensions
 #endif
 {


Adding SendSmsSilently to UWP.

Adding SendSmsSilently to UWP.

--- Messaging/Plugin.Messaging.WinPhoneRT/SmsTask.cs
+++ Messaging/Plugin.Messaging.WinPhoneRT/SmsTask.cs
@@ -1,4 +1,6 @@
 using Windows.ApplicationModel.Chat;
+using Windows.Devices.Sms;
+using System;

 namespace Plugin.Messaging
 {
@@ -28,6 +30,18 @@
             }
         }

+	    public async void SendSmsSilently(string recipient, string message = null)
+	    {
+		    message = message ?? string.Empty;
+
+		    if (CanSendSms)
+		    {
+			    SmsTextMessage2 sendingMessage = new SmsTextMessage2();
+			    sendingMessage.Body = message;
+			    sendingMessage.To = recipient;
+			    SmsSendMessageResult result = await SmsDevice2.GetDefault().SendMessageAndGetResultAsync(sendingMessage);
+			}
+	    }
         #endregion
     }
 }


removed unnecessary property

removed unnecessary property

--- src/biz.dfch.CS.CoffeeTracker.Client.Wpf/Controls/ClientContext.cs
+++ src/biz.dfch.CS.CoffeeTracker.Client.Wpf/Controls/ClientContext.cs
@@ -30,20 +30,6 @@

         private static CoffeeTrackerServiceContext _coffeeTrackerClient;
         public static string CurrentUserName = "";
-        private static List<Coffee> coffees = new List<Coffee>();
-
-        public static List<Coffee> Coffees
-        {
-            get
-            {
-                return RefreshCoffeeList();
-            }
-
-            set
-            {
-                coffees = value;
-            }
-        }

         public static CoffeeTrackerServiceContext GetServiceContext()
         {
@@ -55,11 +41,5 @@

             return _coffeeTrackerClient;
         }
-
-        private static List<Coffee> RefreshCoffeeList()
-        {
-            Coffees = GetServiceContext().Coffees.ToList();
-            return Coffees;
-        }
     }
 }


Deflake StorageTest.TestMove().

Deflake StorageTest.TestMove().

I think there's a race condition where move sometimes fails to find a very-recently uploaded file.

--- storage/api/StorageTest/StorageTest.cs
+++ storage/api/StorageTest/StorageTest.cs
@@ -420,8 +420,12 @@
             // Make sure the file doesn't exist until we move it there.
             var got = Run("get-metadata", _bucketName, "ByeMove.txt");
             Assert.Equal(404, got.ExitCode);
-            // Now move it there.
-            AssertSucceeded(Run("move", _bucketName, "HelloMove.txt", Collect("ByeMove.txt")));
+            Eventually(() =>
+            {
+                // Now move it there.
+                AssertSucceeded(Run("move", _bucketName, "HelloMove.txt",
+                    Collect("ByeMove.txt")));
+            });
             // If we try to clean up "HelloMove.txt", it will fail because it moved.
             _garbage[_bucketName].Remove("HelloMove.txt");
             AssertSucceeded(Run("get-metadata", _bucketName, "ByeMove.txt"));


Puzzle 14b

Puzzle 14b

--- 14/Puzzle14/Program.cs
+++ 14/Puzzle14/Program.cs
@@ -14,9 +14,19 @@
         {
             foreach (var filename in args)
             {
-                var reindeers = GetInput(filename).Select(x => new Reindeer(x));
+                var reindeers = GetInput(filename).Select(x => new Reindeer(x)).ToList();

-                var best = reindeers.Select(r => r.GetDistance(Time)).Max();
+                var fastest = reindeers.Select(r => r.GetDistance(Time)).Max();
+                Console.WriteLine("Fastest reindeer: {0}", fastest);
+
+                for (int i = 1; i <= Time; i++)
+                {
+                    var dist = reindeers.Select(x => new Tuple<int, Reindeer>(x.GetDistance(i), x)).ToList();
+                    var max = dist.Max(x => x.Item1);
+                    dist.Where(x => x.Item1 == max).ToList().ForEach(x => x.Item2.GiveStar());
+                }
+
+                var best = reindeers.Max(x => x.Stars);
                 Console.WriteLine("Best reindeer: {0}", best);
             }

@@ -40,6 +50,7 @@
             public int Velocity { get; private set; }
             public int RunTime { get; private set; }
             public int WaitTime { get; private set; }
+            public int Stars { get; private set; } = 0;

             private static readonly Regex LineRegex =
                 new Regex(@"^(?<name>\w+) can fly (?<velocity>\d+) km/s for (?<run_time>\d+) seconds, but then must rest for (?<wait_time>\d+) seconds.$");
@@ -64,6 +75,16 @@

                 return cycles * RunTime * Velocity + r * Velocity;
             }
+
+            public void GiveStar()
+            {
+                Stars++;
+            }
+
+            public override string ToString()
+            {
+                return Name;
+            }
         }
     }
 }


Upgrade version to 1.3.5

Upgrade version to 1.3.5

--- src/EQueue/Properties/AssemblyInfo.cs
+++ src/EQueue/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // 可以指定所有这些值，也可以使用“生成号”和“修订号”的默认值，
 // 方法是按如下所示使用“*”:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.3.4")]
-[assembly: AssemblyFileVersion("1.3.4")]
+[assembly: AssemblyVersion("1.3.5")]
+[assembly: AssemblyFileVersion("1.3.5")]


Resolved issuer with .net 3.5 (#19)

Resolved issuer with .net 3.5 (#19)

#9

--- src/Evolve/Utilities/MigrationUtil.cs
+++ src/Evolve/Utilities/MigrationUtil.cs
@@ -19,7 +19,8 @@
             Check.NotNullOrEmpty(separator, nameof(separator)); // __

             // Check prefix
-            if (string.Concat(Path.GetFileNameWithoutExtension(script).Take(prefix.Length)) != prefix)
+            //Resolved issuer with .net 3.5
+            if (!Path.GetFileNameWithoutExtension(script).Substring(0, prefix.Length).Equals(prefix))
                 throw new EvolveConfigurationException(string.Format(MigrationNamePrefixNotFound, prefix, script));

             string migrationName = Path.GetFileNameWithoutExtension(script).Substring(prefix.Length); // 1_3_1__Migration_description


remove comment out for dinke MVP award date

--- src/Firehose.Web/Authors/DougFinke.cs
+++ src/Firehose.Web/Authors/DougFinke.cs
@@ -33,6 +33,6 @@

         public GeoPosition Position => new GeoPosition(40.7526970, -73.9749950);

-        //DateTime IAmAMicrosoftMVP.FirstAwarded => new DateTime(2008, 4, 1);
+        DateTime IAmAMicrosoftMVP.FirstAwarded => new DateTime(2008, 4, 1);
     }
 }


デリゲート的にやればよさそうな気がした

デリゲート的にやればよさそうな気がした

--- CoreCode/MapObject/MainMapObject.cs
+++ CoreCode/MapObject/MainMapObject.cs
@@ -31,7 +31,37 @@
         /// <summary>
         /// 状態
         /// </summary>
-        public MainMapObjectState State { get; set; }
+        public MainMapObjectState State
+        {
+            get
+            {
+                return state;
+            }
+            set
+            {
+                switch (value)
+                {
+                    case MainMapObjectState.Standing:
+                        updateSelfPreprocess = PreprocessNotFloating;
+                        updateSelfMainProcess = MainProcessStanding;
+                        break;
+                    case MainMapObjectState.Floating:
+                        updateSelfPreprocess = PreprocessFloating;
+                        updateSelfMainProcess = MainProcessFloating;
+                        break;
+                    case MainMapObjectState.Falling:
+                        updateSelfPreprocess = PreprocessNotFloating;
+                        updateSelfMainProcess = MainProcessFalling;
+                        break;
+                    default:
+                        throw new Exception("MainMapObjectのStateがおかしいぞ。");
+                }
+                state = value;
+            }
+        }
+        private MainMapObjectState state;
+        private Action updateSelfPreprocess;
+        private Action<IMapEnvironment> updateSelfMainProcess;

         #endregion

@@ -236,38 +266,23 @@
             var env = args.GetEnvironment(X, Y);
             SwitchFloatingMode(env.Gravity);

-            switch (State)
-            {
-                case MainMapObjectState.Standing:
-                    UpdateSelfStanding(env);
-                    break;
-                case MainMapObjectState.Floating:
-                    UpdateSelfFloating(env);
-                    break;
-                case MainMapObjectState.Falling:
-                    UpdateSelfFalling(env);
-                    break;
-                default:
-                    throw new Exception("MainMapObjectのStateがおかしいぞ。");
-            }
-        }
-
-        private void UpdateSelfStanding(IMapEnvironment env)
-        {
-            PreprocessNotFloating();
-        }
-
-        private void UpdateSelfFloating(IMapEnvironment env)
-        {
-            PreprocessFloating();
+            updateSelfPreprocess();
+            updateSelfMainProcess(env);
+        }
+
+        private void MainProcessStanding(IMapEnvironment env)
+        {
+        }
+
+        private void MainProcessFloating(IMapEnvironment env)
+        {
             double accelX = Input.X * FloatingAccel;
             double accelY = Input.Y * FloatingAccel;
             UpdatePositionFloating(env.Wind, accelX, accelY, Input.IsPressed(Keys.Jump) ? 2 : 1);
         }

-        private void UpdateSelfFalling(IMapEnvironment env)
-        {
-            PreprocessNotFloating();
+        private void MainProcessFalling(IMapEnvironment env)
+        {
             double accelX = Input.X * FloatingAccel;
             double accelY = 0;
             UpdatePositionFalling(env.Gravity, env.Wind, accelX, accelY);


Funciones de suavizado (tweening)

Funciones de suavizado (tweening)

--- CoreComponents/Core/Modules/Math.cs
+++ CoreComponents/Core/Modules/Math.cs
@@ -33,24 +33,24 @@

 namespace MCART
 {
-	/// <summary>
-	/// Funciones matemáticas varias
-	/// </summary>
-	public static class Math
-	{
-		#region Constantes
-		/// <summary>
-		/// Representa la proporción de 1 grado DEG sobre PI
-		/// </summary>
-		public const double Deg_Rad = System.Math.PI / 180;
-		#endregion
-
-		/// <summary>
-		/// Series matemáticas
-		/// </summary>
-		public static class Series
-		{
-			/*
+    /// <summary>
+    /// Funciones matemáticas varias
+    /// </summary>
+    public static class Math
+    {
+        #region Constantes
+        /// <summary>
+        /// Representa la proporción de 1 grado DEG sobre PI
+        /// </summary>
+        public const double Deg_Rad = System.Math.PI / 180;
+        #endregion
+
+        /// <summary>
+        /// Series matemáticas
+        /// </summary>
+        public static class Series
+        {
+            /*
 			Las series utilizan enumeradores para exponer las series completas
 			de una manera infinita. Es necesario silenciar la advertencia en
 			MonoDevelop que indica que estas funciones nunca finalizan.
@@ -60,384 +60,439 @@
 			bien, el programa podría dejar de responder.
 			*/
 #pragma warning disable RECS0135
-			/// <summary>
-			/// Expone un enumerador que contiene la secuencia completa de
-			/// Fibonacci.
-			/// </summary>
-			/// <returns>
-			/// Un <see cref="IEnumerable{T}"/> con la secuencia infinita de
-			/// Fibonacci.
-			/// </returns>
-			public static IEnumerable<long> Fibonacci()
-			{
-				long a = 0;
-				long b = 1;
-				while (true)
-				{
-					yield return a;
-					yield return b;
-					a += b;
-					b += a;
-				}
-			}
-			/// <summary>
-			/// Expone un enumerador que contiene la secuencia completa de
-			/// Lucas.
-			/// </summary>
-			/// <returns>
-			/// Un <see cref="IEnumerable{T}"/> con la secuencia infinita de
-			/// Lucas.
-			/// </returns>
-			public static IEnumerable<long> Lucas()
-			{
-				long a = 2;
-				long b = 1;
-				while (true)
-				{
-					yield return a;
-					yield return b;
-					a += b;
-					b += a;
-				}
-			}
+            /// <summary>
+            /// Expone un enumerador que contiene la secuencia completa de
+            /// Fibonacci.
+            /// </summary>
+            /// <returns>
+            /// Un <see cref="IEnumerable{T}"/> con la secuencia infinita de
+            /// Fibonacci.
+            /// </returns>
+            public static IEnumerable<long> Fibonacci()
+            {
+                long a = 0;
+                long b = 1;
+                while (true)
+                {
+                    yield return a;
+                    yield return b;
+                    a += b;
+                    b += a;
+                }
+            }
+            /// <summary>
+            /// Expone un enumerador que contiene la secuencia completa de
+            /// Lucas.
+            /// </summary>
+            /// <returns>
+            /// Un <see cref="IEnumerable{T}"/> con la secuencia infinita de
+            /// Lucas.
+            /// </returns>
+            public static IEnumerable<long> Lucas()
+            {
+                long a = 2;
+                long b = 1;
+                while (true)
+                {
+                    yield return a;
+                    yield return b;
+                    a += b;
+                    b += a;
+                }
+            }
 #pragma warning restore RECS0135
-		}
-
-		/// <summary>
-		/// Comprueba si un número es primo.
-		/// </summary>
-		/// <returns>
-		/// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
-		/// </returns>
-		/// <param name="i">Número a comprobar.</param>
-		public static bool IsPrime(this long i)
-		{
-			long s = i / 2;
-			for (long j = 1; j < s; j += 2)
-				if (i % j == 0) return false;
-			return true;
-		}
-		/// <summary>
-		/// Comprueba si un número es primo.
-		/// </summary>
-		/// <returns>
-		/// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
-		/// </returns>
-		/// <param name="i">Número a comprobar.</param>
-		[Thunk] public static bool IsPrime(this int i) => ((long)i).IsPrime();
-		/// <summary>
-		/// Comprueba si un número es primo.
-		/// </summary>
-		/// <returns>
-		/// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
-		/// </returns>
-		/// <param name="i">Número a comprobar.</param>
-		[Thunk] public static bool IsPrime(this uint i) => ((long)i).IsPrime();
-		/// <summary>
-		/// Comprueba si un número es primo.
-		/// </summary>
-		/// <returns>
-		/// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
-		/// </returns>
-		/// <param name="i">Número a comprobar.</param>
-		[Thunk] public static bool IsPrime(this short i) => ((long)i).IsPrime();
-		/// <summary>
-		/// Comprueba si un número es primo.
-		/// </summary>
-		/// <returns>
-		/// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
-		/// </returns>
-		/// <param name="i">Número a comprobar.</param>
-		[Thunk] public static bool IsPrime(this ushort i) => ((long)i).IsPrime();
-		/// <summary>
-		/// Comprueba si un número es primo.
-		/// </summary>
-		/// <returns>
-		/// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
-		/// </returns>
-		/// <param name="i">Número a comprobar.</param>
-		[Thunk] public static bool IsPrime(this sbyte i) => ((long)i).IsPrime();
-		/// <summary>
-		/// Comprueba si un número es primo.
-		/// </summary>
-		/// <returns>
-		/// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
-		/// </returns>
-		/// <param name="i">Número a comprobar.</param>
-		[Thunk] public static bool IsPrime(this byte i) => ((long)i).IsPrime();
-		/// <summary>
-		/// Determina si un <see cref="double"/> es un número real operable.
-		/// </summary>
-		/// <param name="x"><see cref="double"/> a comprobar.</param>
-		/// <returns>
-		/// <c>true</c> si <paramref name="x"/> es un número real
-		/// <see cref="double"/> operable, en otras palabras, si no es igual a
-		/// <see cref="double.NaN"/>, <see cref="double.PositiveInfinity"/> o
-		/// <see cref="double.NegativeInfinity"/>; en cuyo caso se devuelve
-		/// <c>false</c>.
-		/// </returns>
-		public static bool IsValid(this double x) => !(double.IsNaN(x) || double.IsInfinity(x));
-		/// <summary>
-		/// Determina si un <see cref="float"/> es un número real operable.
-		/// </summary>
-		/// <param name="x"><see cref="float"/> a comprobar.</param>
-		/// <returns>
-		/// <c>true</c> si <paramref name="x"/> es un número real
-		/// <see cref="float"/> operable, en otras palabras, si no es igual a
-		/// <see cref="float.NaN"/>, <see cref="float.PositiveInfinity"/> o
-		/// <see cref="float.NegativeInfinity"/>; en cuyo caso se devuelve
-		/// <c>false</c>.
-		/// </returns>
-		public static bool IsValid(this float x) => !(float.IsNaN(x) || float.IsInfinity(x));
-		/// <summary>
-		/// Determina si una colección de <see cref="double"/> son números
-		/// reales operables.
-		/// </summary>
-		/// <param name="x">
-		/// Colección  de <see cref="double"/> a comprobar.
-		/// </param>
-		/// <returns>
-		/// <c>true</c> si todos los elementos de <paramref name="x"/> son
-		/// números operables, en otras palabras, si no son NaN o Infinito; en
-		/// caso contrario, se devuelve <c>false</c>.
-		/// </returns>
-		public static bool AreValid(params double[] x)
-		{
-			foreach (double j in x) if (!IsValid(j)) return false;
-			return true;
-		}
-		/// <summary>
-		/// Determina si una colección de <see cref="float"/> son números
-		/// reales operables.
-		/// </summary>
-		/// <param name="x">
-		/// Colección  de <see cref="float"/> a comprobar.
-		/// </param>
-		/// <returns>
-		/// <c>true</c> si todos los elementos de <paramref name="x"/> son
-		/// números operables, en otras palabras, si no son NaN o Infinito; en
-		/// caso contrario, se devuelve <c>false</c>.
-		/// </returns>
-		public static bool AreValid(params float[] x)
-		{
-			foreach (float j in x) if (!IsValid(j)) return false;
-			return true;
-		}
-		/// <summary>
-		/// Calcula la potencia de dos más cercana mayor o igual al número
-		/// </summary>
-		/// <param name="x">Número de entrada. Se buscará una potencia de dos mayor o igual a este valor.</param>
-		/// <returns>Un valor ULong que es resultado de la operación.</returns>
-		public static ulong Nearest2Pow(uint x)
-		{
-			ulong c = 1;
-			while (!(c >= x)) c *= 2;
-			return c;
-		}
-		/// <summary>
-		/// Devuelve el primer múltiplo de <paramref name="multiplier"/> que es mayor que <paramref name="x"/>
-		/// </summary>
-		/// <param name="x">Número objetivo</param>
-		/// <param name="multiplier">Base multiplicativa. Esta función devolverá un múltiplo de este valor que sea mayor a <paramref name="x"/></param>
-		/// <returns>Un <see cref="double"/> que es el primer múltiplo de <paramref name="multiplier"/> que es mayor que <paramref name="x"/></returns>
-		public static double NearestMultiplyUp(double x, double multiplier)
-		{
-			double a = 1;
-			if (ArePositives(x, multiplier))
-				while (!(a > x)) a *= multiplier;
-			return a;
-		}
-		/// <summary>
-		/// Devuelve <c>True</c> si todos los números son positivos.
-		/// </summary>
-		/// <param name="x">números a comprobar.</param>
-		public static bool ArePositives(params double[] x)
-		{
-			foreach (double j in x) if (j <= 0) return false;
-			return true;
-		}
-		/// <summary>
-		/// Devuelve <c>True</c> si todos los números son negativos.
-		/// </summary>
-		/// <param name="x">números a comprobar.</param>
-		public static bool AreNegatives(params double[] x)
-		{
-			foreach (double j in x) if (j >= 0) return false;
-			return true;
-		}
-		/// <summary>
-		/// Devuelve <c>True</c> si todos los números son iguales a cero.
-		/// </summary>
-		/// <param name="x">números a comprobar.</param>
-		public static bool AreZero<T>(params T[] x) where T : struct,
-			IComparable,
-			IComparable<T>,
-			IConvertible,
-			IEquatable<T>,
-			IFormattable
-		{
-			foreach (T j in x) if (j.CompareTo(default(T)) != 0) return false;
-			return true;
-		}
-		/// <summary>
-		/// Devuelve <c>true</c> si todos los números son distintos de cero.
-		/// </summary>
-		/// <param name="x">números a comprobar.</param>
-		public static bool AreNotZero<T>(params T[] x) where T :
-			IComparable,
-			IComparable<T>,
-			IConvertible,
-			IEquatable<T>,
-			IFormattable
-		{
-			foreach (T j in x) if (j.CompareTo(default(T)) == 0) return false;
-			return true;
-		}
+        }
+
+        /// <summary>
+        /// Fórmulas de suavizado.
+        /// </summary>
+        public static class Tween
+        {
+            /// <summary>
+            /// Realiza un suavizado lineal de un valor.
+            /// </summary>
+            /// <returns>
+            /// Un valor correspondiente al suavizado aplicado.
+            /// </returns>
+            /// <param name="step">Número de paso a suavizar.</param>
+            /// <param name="total">Total de pasos.</param>
+            public static float Linear(int step, int total) => (float)step / total;
+            /// <summary>
+            /// Realiza un suavizado cuadrático de un valor.
+            /// </summary>
+            /// <returns>
+            /// Un valor correspondiente al suavizado aplicado.
+            /// </returns>
+            /// <param name="step">Número de paso a suavizar.</param>
+            /// <param name="total">Total de pasos.</param>
+            public static float Quadratic(int step, int total)
+            {
+                float t = ((float)step / total);
+                return (t * t) / (2 * t * t - 2 * t + 1);
+            }
+            /// <summary>
+            /// Realiza un suavizado cúbico de un valor.
+            /// </summary>
+            /// <returns>
+            /// Un valor correspondiente al suavizado aplicado.
+            /// </returns>
+            /// <param name="step">Número de paso a suavizar.</param>
+            /// <param name="total">Total de pasos.</param>
+            public static float Cubic(int step, int total)
+            {
+                float t = ((float)step / total);
+                return (t * t * t) / (3 * t * t - 3 * t + 1);
+            }
+            /// <summary>
+            /// Realiza un suavizado cuártico de un valor.
+            /// </summary>
+            /// <returns>
+            /// Un valor correspondiente al suavizado aplicado.
+            /// </returns>
+            /// <param name="step">Número de paso a suavizar.</param>
+            /// <param name="total">Total de pasos.</param>
+            public static float Quartic(int step, int total)
+            {
+                float t = ((float)step / total);
+                return -((t - 1) * (t - 1) * (t - 1) * (t - 1)) + 1;
+            }
+        }
+
+        /// <summary>
+        /// Comprueba si un número es primo.
+        /// </summary>
+        /// <returns>
+        /// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
+        /// </returns>
+        /// <param name="i">Número a comprobar.</param>
+        public static bool IsPrime(this long i)
+        {
+            long s = i / 2;
+            for (long j = 1; j < s; j += 2)
+                if (i % j == 0) return false;
+            return true;
+        }
+        /// <summary>
+        /// Comprueba si un número es primo.
+        /// </summary>
+        /// <returns>
+        /// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
+        /// </returns>
+        /// <param name="i">Número a comprobar.</param>
+        [Thunk] public static bool IsPrime(this int i) => ((long)i).IsPrime();
+        /// <summary>
+        /// Comprueba si un número es primo.
+        /// </summary>
+        /// <returns>
+        /// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
+        /// </returns>
+        /// <param name="i">Número a comprobar.</param>
+        [Thunk] public static bool IsPrime(this uint i) => ((long)i).IsPrime();
+        /// <summary>
+        /// Comprueba si un número es primo.
+        /// </summary>
+        /// <returns>
+        /// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
+        /// </returns>
+        /// <param name="i">Número a comprobar.</param>
+        [Thunk] public static bool IsPrime(this short i) => ((long)i).IsPrime();
+        /// <summary>
+        /// Comprueba si un número es primo.
+        /// </summary>
+        /// <returns>
+        /// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
+        /// </returns>
+        /// <param name="i">Número a comprobar.</param>
+        [Thunk] public static bool IsPrime(this ushort i) => ((long)i).IsPrime();
+        /// <summary>
+        /// Comprueba si un número es primo.
+        /// </summary>
+        /// <returns>
+        /// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
+        /// </returns>
+        /// <param name="i">Número a comprobar.</param>
+        [Thunk] public static bool IsPrime(this sbyte i) => ((long)i).IsPrime();
+        /// <summary>
+        /// Comprueba si un número es primo.
+        /// </summary>
+        /// <returns>
+        /// <c>true</c>si el número es primo, <c>false</c> en caso contrario.
+        /// </returns>
+        /// <param name="i">Número a comprobar.</param>
+        [Thunk] public static bool IsPrime(this byte i) => ((long)i).IsPrime();
+        /// <summary>
+        /// Determina si un <see cref="double"/> es un número real operable.
+        /// </summary>
+        /// <param name="x"><see cref="double"/> a comprobar.</param>
+        /// <returns>
+        /// <c>true</c> si <paramref name="x"/> es un número real
+        /// <see cref="double"/> operable, en otras palabras, si no es igual a
+        /// <see cref="double.NaN"/>, <see cref="double.PositiveInfinity"/> o
+        /// <see cref="double.NegativeInfinity"/>; en cuyo caso se devuelve
+        /// <c>false</c>.
+        /// </returns>
+        public static bool IsValid(this double x) => !(double.IsNaN(x) || double.IsInfinity(x));
+        /// <summary>
+        /// Determina si un <see cref="float"/> es un número real operable.
+        /// </summary>
+        /// <param name="x"><see cref="float"/> a comprobar.</param>
+        /// <returns>
+        /// <c>true</c> si <paramref name="x"/> es un número real
+        /// <see cref="float"/> operable, en otras palabras, si no es igual a
+        /// <see cref="float.NaN"/>, <see cref="float.PositiveInfinity"/> o
+        /// <see cref="float.NegativeInfinity"/>; en cuyo caso se devuelve
+        /// <c>false</c>.
+        /// </returns>
+        public static bool IsValid(this float x) => !(float.IsNaN(x) || float.IsInfinity(x));
+        /// <summary>
+        /// Determina si una colección de <see cref="double"/> son números
+        /// reales operables.
+        /// </summary>
+        /// <param name="x">
+        /// Colección  de <see cref="double"/> a comprobar.
+        /// </param>
+        /// <returns>
+        /// <c>true</c> si todos los elementos de <paramref name="x"/> son
+        /// números operables, en otras palabras, si no son NaN o Infinito; en
+        /// caso contrario, se devuelve <c>false</c>.
+        /// </returns>
+        public static bool AreValid(params double[] x)
+        {
+            foreach (double j in x) if (!IsValid(j)) return false;
+            return true;
+        }
+        /// <summary>
+        /// Determina si una colección de <see cref="float"/> son números
+        /// reales operables.
+        /// </summary>
+        /// <param name="x">
+        /// Colección  de <see cref="float"/> a comprobar.
+        /// </param>
+        /// <returns>
+        /// <c>true</c> si todos los elementos de <paramref name="x"/> son
+        /// números operables, en otras palabras, si no son NaN o Infinito; en
+        /// caso contrario, se devuelve <c>false</c>.
+        /// </returns>
+        public static bool AreValid(params float[] x)
+        {
+            foreach (float j in x) if (!IsValid(j)) return false;
+            return true;
+        }
+        /// <summary>
+        /// Calcula la potencia de dos más cercana mayor o igual al número
+        /// </summary>
+        /// <param name="x">Número de entrada. Se buscará una potencia de dos mayor o igual a este valor.</param>
+        /// <returns>Un valor ULong que es resultado de la operación.</returns>
+        public static ulong Nearest2Pow(uint x)
+        {
+            ulong c = 1;
+            while (!(c >= x)) c *= 2;
+            return c;
+        }
+        /// <summary>
+        /// Devuelve el primer múltiplo de <paramref name="multiplier"/> que es mayor que <paramref name="x"/>
+        /// </summary>
+        /// <param name="x">Número objetivo</param>
+        /// <param name="multiplier">Base multiplicativa. Esta función devolverá un múltiplo de este valor que sea mayor a <paramref name="x"/></param>
+        /// <returns>Un <see cref="double"/> que es el primer múltiplo de <paramref name="multiplier"/> que es mayor que <paramref name="x"/></returns>
+        public static double NearestMultiplyUp(double x, double multiplier)
+        {
+            double a = 1;
+            if (ArePositives(x, multiplier))
+                while (!(a > x)) a *= multiplier;
+            return a;
+        }
+        /// <summary>
+        /// Devuelve <c>True</c> si todos los números son positivos.
+        /// </summary>
+        /// <param name="x">números a comprobar.</param>
+        public static bool ArePositives(params double[] x)
+        {
+            foreach (double j in x) if (j <= 0) return false;
+            return true;
+        }
+        /// <summary>
+        /// Devuelve <c>True</c> si todos los números son negativos.
+        /// </summary>
+        /// <param name="x">números a comprobar.</param>
+        public static bool AreNegatives(params double[] x)
+        {
+            foreach (double j in x) if (j >= 0) return false;
+            return true;
+        }
+        /// <summary>
+        /// Devuelve <c>True</c> si todos los números son iguales a cero.
+        /// </summary>
+        /// <param name="x">números a comprobar.</param>
+        public static bool AreZero<T>(params T[] x) where T : struct,
+            IComparable,
+            IComparable<T>,
+            IConvertible,
+            IEquatable<T>,
+            IFormattable
+        {
+            foreach (T j in x) if (j.CompareTo(default(T)) != 0) return false;
+            return true;
+        }
+        /// <summary>
+        /// Devuelve <c>true</c> si todos los números son distintos de cero.
+        /// </summary>
+        /// <param name="x">números a comprobar.</param>
+        public static bool AreNotZero<T>(params T[] x) where T :
+            IComparable,
+            IComparable<T>,
+            IConvertible,
+            IEquatable<T>,
+            IFormattable
+        {
+            foreach (T j in x) if (j.CompareTo(default(T)) == 0) return false;
+            return true;
+        }

 #if IncludeSpecialClamp
-		/// <summary>
-		/// Establece límites de sobreflujo para evaluar una expresión.
-		/// </summary>
-		/// <param name="expression">Expresión a evaluar.</param>
-		/// <param name="min">Límite inferior de salida, inclusive.</param>
-		/// <param name="max">Límite superior de salida, inclusive.</param>
-		/// <returns>
-		/// El valor evaluado que se encuentra dentro del rango especificado.
-		/// </returns>
-		/// <remarks>
-		/// Esta implementación se incluye para permitir parámetros de tipo
-		/// <see cref="double.NaN"/>, <see cref="double.NegativeInfinity"/> y
-		/// <see cref="double.PositiveInfinity"/>.
-		/// </remarks>
-		public static double Clamp(this double expression, double min = double.NegativeInfinity, double max = double.PositiveInfinity)
-		{
-			if (!double.IsNaN(expression))
-			{
-				if (expression > max) return max;
-				if (expression < min) return min;
-				return expression;
-			}
-			return double.NaN;
-		}
-		/// <summary>
-		/// Establece límites de sobreflujo para evaluar una expresión.
-		/// </summary>
-		/// <param name="expression">Expresión a evaluar.</param>
-		/// <param name="min">Límite inferior de salida, inclusive.</param>
-		/// <param name="max">Límite superior de salida, inclusive.</param>
-		/// <returns>
-		/// El valor evaluado que se encuentra dentro del rango especificado.
-		/// </returns>
-		/// <remarks>
-		/// Esta implementación se incluye para permitir parámetros de tipo
-		/// <see cref="float.NaN"/>, <see cref="float.NegativeInfinity"/> y
-		/// <see cref="float.PositiveInfinity"/>.
-		/// </remarks>
-		public static float Clamp(this float expression, float min = float.NegativeInfinity, float max = float.PositiveInfinity)
-		{
-			if (!float.IsNaN(expression))
-			{
-				if (expression > max) return max;
-				if (expression < min) return min;
-				return expression;
-			}
-			return float.NaN;
-		}
+        /// <summary>
+        /// Establece límites de sobreflujo para evaluar una expresión.
+        /// </summary>
+        /// <param name="expression">Expresión a evaluar.</param>
+        /// <param name="min">Límite inferior de salida, inclusive.</param>
+        /// <param name="max">Límite superior de salida, inclusive.</param>
+        /// <returns>
+        /// El valor evaluado que se encuentra dentro del rango especificado.
+        /// </returns>
+        /// <remarks>
+        /// Esta implementación se incluye para permitir parámetros de tipo
+        /// <see cref="double.NaN"/>, <see cref="double.NegativeInfinity"/> y
+        /// <see cref="double.PositiveInfinity"/>.
+        /// </remarks>
+        public static double Clamp(this double expression, double min = double.NegativeInfinity, double max = double.PositiveInfinity)
+        {
+            if (!double.IsNaN(expression))
+            {
+                if (expression > max) return max;
+                if (expression < min) return min;
+                return expression;
+            }
+            return double.NaN;
+        }
+        /// <summary>
+        /// Establece límites de sobreflujo para evaluar una expresión.
+        /// </summary>
+        /// <param name="expression">Expresión a evaluar.</param>
+        /// <param name="min">Límite inferior de salida, inclusive.</param>
+        /// <param name="max">Límite superior de salida, inclusive.</param>
+        /// <returns>
+        /// El valor evaluado que se encuentra dentro del rango especificado.
+        /// </returns>
+        /// <remarks>
+        /// Esta implementación se incluye para permitir parámetros de tipo
+        /// <see cref="float.NaN"/>, <see cref="float.NegativeInfinity"/> y
+        /// <see cref="float.PositiveInfinity"/>.
+        /// </remarks>
+        public static float Clamp(this float expression, float min = float.NegativeInfinity, float max = float.PositiveInfinity)
+        {
+            if (!float.IsNaN(expression))
+            {
+                if (expression > max) return max;
+                if (expression < min) return min;
+                return expression;
+            }
+            return float.NaN;
+        }
 #endif
-		/// <summary>
-		/// Establece límites de sobreflujo para evaluar una expresión.
-		/// </summary>
-		/// <param name="expression">Expresión a evaluar.</param>
-		/// <param name="max">Límite superior de salida, inclusive.</param>
-		/// <param name="min">Límite inferior de salida, inclusive.</param>
-		/// <returns>
-		/// El valor evaluado que se encuentra dentro del rango especificado.
-		/// </returns>
-		public static T Clamp<T>(this T expression, T min, T max) where T :
-			IComparable,
-			IComparable<T>
-		{
-
-			if (expression.CompareTo(max) > 0) return max;
-			if (expression.CompareTo(min) < 0) return min;
-			return expression;
-		}
-		/// <summary>
-		/// Establece límites de sobreflujo para evaluar una expresión.
-		/// </summary>
-		/// <param name="expression">Expresión a evaluar.</param>
-		/// <param name="max">Límite superior de salida, inclusive.</param>
-		/// <returns>
-		/// El valor evaluado que se encuentra entre 0 y
-		/// <paramref name="max"/>.
-		/// </returns>
-		public static T Clamp<T>(this T expression, T max) where T :
-			IComparable,
-			IComparable<T>
-		{
-			if (expression.CompareTo(max) > 0) return max;
-			if (expression.CompareTo(default(T)) < 0) return default(T);
-			return expression;
-		}
-
-		/// <summary>
-		/// Determina si un <see cref="double"/> es un número entero.
-		/// </summary>
-		/// <param name="x">Valor a comprobar.</param>
-		/// <returns><c>True</c> si el valor es entero; de lo contrario, <c>False</c></returns>
-		public static bool IsWhole(this double x) { return !x.ToString().Contains("."); }
-		/// <summary>
-		/// Obtiene las cooerdenadas X,Y de una posición específica dentro de un
-		/// bézier cuadrático
-		/// </summary>
-		/// <param name="Position">
-		/// Posición a obtener. Debe ser un <see cref="double"/> entre 0.0 y
-		/// 1.0.
-		/// </param>
-		/// <param name="StartPoint">
-		/// Punto inicial del bézier cuadrático.
-		/// </param>
-		/// <param name="ControlPoint">
-		/// Punto de control del bézier cuadrático.
-		/// </param>
-		/// <param name="EndPoint">Punto final del bézier cuadrático.</param>
-		/// <returns>
-		/// Un <see cref="Point"/> con las coordenadas correspondientes a la
-		/// posición dentro del bézier cuadrático dado por
-		/// <paramref name="Position"/>.
-		/// </returns>
-		public static Point GetQuadBezierPoint(double Position, Point StartPoint, Point ControlPoint, Point EndPoint)
-		{
-			if (!Position.IsBetween(0, 1)) throw new ArgumentOutOfRangeException(nameof(Position));
-			return new Point((1 - Position) * (1 - Position) * StartPoint.X + 2 * (1 - Position) * Position * ControlPoint.X + Position * Position * EndPoint.X, (1 - Position) * (1 - Position) * StartPoint.Y + 2 * (1 - Position) * Position * ControlPoint.Y + Position * Position * EndPoint.Y);
-		}
-		/// <summary>
-		/// Obtiene las coordenadas de un punto dentro de un arco.
-		/// </summary>
-		/// <param name="radius">Radio del arco.</param>
-		/// <param name="startAngle">
-		/// Ángulo inicial del arco; en el sentido de las agujas del reloj.
-		/// </param>
-		/// <param name="endAngle">
-		/// Ángulo final del arco; en el sentido de las agujas del reloj.
-		/// </param>
-		/// <param name="place">Posición a obtener dentro del arco.</param>
-		/// <returns>
-		/// Un conjunto de coordenadas con la posición del punto solicitado.
-		/// </returns>
-		public static Point GetArcPoint(double radius, double startAngle, double endAngle, double place = 0.5)
-		{
-			double x = (startAngle - endAngle) * place;
-			return new Point(System.Math.Sin(Deg_Rad * x) * radius, System.Math.Cos(Deg_Rad * x) * radius);
-		}
-		/// <summary>
-		/// Obtiene las coordenadas de un punto dentro de un círculo.
-		/// </summary>
-		/// <param name="radius">Radio del círculo.</param>
-		/// <param name="place">Posición a obtener dentro del círculo.</param>
-		/// <returns>
-		/// Un conjunto de coordenadas con la posición del punto solicitado.
-		/// </returns>
-		[Thunk] public static Point GetCirclePoint(double radius, double place) => GetArcPoint(radius, 0, 360, place);
-	}
+        /// <summary>
+        /// Establece límites de sobreflujo para evaluar una expresión.
+        /// </summary>
+        /// <param name="expression">Expresión a evaluar.</param>
+        /// <param name="max">Límite superior de salida, inclusive.</param>
+        /// <param name="min">Límite inferior de salida, inclusive.</param>
+        /// <returns>
+        /// El valor evaluado que se encuentra dentro del rango especificado.
+        /// </returns>
+        public static T Clamp<T>(this T expression, T min, T max) where T :
+            IComparable,
+            IComparable<T>
+        {
+
+            if (expression.CompareTo(max) > 0) return max;
+            if (expression.CompareTo(min) < 0) return min;
+            return expression;
+        }
+        /// <summary>
+        /// Establece límites de sobreflujo para evaluar una expresión.
+        /// </summary>
+        /// <param name="expression">Expresión a evaluar.</param>
+        /// <param name="max">Límite superior de salida, inclusive.</param>
+        /// <returns>
+        /// El valor evaluado que se encuentra entre 0 y
+        /// <paramref name="max"/>.
+        /// </returns>
+        public static T Clamp<T>(this T expression, T max) where T :
+            IComparable,
+            IComparable<T>
+        {
+            if (expression.CompareTo(max) > 0) return max;
+            if (expression.CompareTo(default(T)) < 0) return default(T);
+            return expression;
+        }
+
+        /// <summary>
+        /// Determina si un <see cref="double"/> es un número entero.
+        /// </summary>
+        /// <param name="x">Valor a comprobar.</param>
+        /// <returns><c>True</c> si el valor es entero; de lo contrario, <c>False</c></returns>
+        public static bool IsWhole(this double x) { return !x.ToString().Contains("."); }
+        /// <summary>
+        /// Obtiene las cooerdenadas X,Y de una posición específica dentro de un
+        /// bézier cuadrático
+        /// </summary>
+        /// <param name="Position">
+        /// Posición a obtener. Debe ser un <see cref="double"/> entre 0.0 y
+        /// 1.0.
+        /// </param>
+        /// <param name="StartPoint">
+        /// Punto inicial del bézier cuadrático.
+        /// </param>
+        /// <param name="ControlPoint">
+        /// Punto de control del bézier cuadrático.
+        /// </param>
+        /// <param name="EndPoint">Punto final del bézier cuadrático.</param>
+        /// <returns>
+        /// Un <see cref="Point"/> con las coordenadas correspondientes a la
+        /// posición dentro del bézier cuadrático dado por
+        /// <paramref name="Position"/>.
+        /// </returns>
+        public static Point GetQuadBezierPoint(double Position, Point StartPoint, Point ControlPoint, Point EndPoint)
+        {
+            if (!Position.IsBetween(0, 1)) throw new ArgumentOutOfRangeException(nameof(Position));
+            return new Point((1 - Position) * (1 - Position) * StartPoint.X + 2 * (1 - Position) * Position * ControlPoint.X + Position * Position * EndPoint.X, (1 - Position) * (1 - Position) * StartPoint.Y + 2 * (1 - Position) * Position * ControlPoint.Y + Position * Position * EndPoint.Y);
+        }
+        /// <summary>
+        /// Obtiene las coordenadas de un punto dentro de un arco.
+        /// </summary>
+        /// <param name="radius">Radio del arco.</param>
+        /// <param name="startAngle">
+        /// Ángulo inicial del arco; en el sentido de las agujas del reloj.
+        /// </param>
+        /// <param name="endAngle">
+        /// Ángulo final del arco; en el sentido de las agujas del reloj.
+        /// </param>
+        /// <param name="place">Posición a obtener dentro del arco.</param>
+        /// <returns>
+        /// Un conjunto de coordenadas con la posición del punto solicitado.
+        /// </returns>
+        public static Point GetArcPoint(double radius, double startAngle, double endAngle, double place = 0.5)
+        {
+            double x = (startAngle - endAngle) * place;
+            return new Point(System.Math.Sin(Deg_Rad * x) * radius, System.Math.Cos(Deg_Rad * x) * radius);
+        }
+        /// <summary>
+        /// Obtiene las coordenadas de un punto dentro de un círculo.
+        /// </summary>
+        /// <param name="radius">Radio del círculo.</param>
+        /// <param name="place">Posición a obtener dentro del círculo.</param>
+        /// <returns>
+        /// Un conjunto de coordenadas con la posición del punto solicitado.
+        /// </returns>
+        [Thunk] public static Point GetCirclePoint(double radius, double place) => GetArcPoint(radius, 0, 360, place);
+    }
 }