Minor

Minor

--- ApiExamples/CSharp/ApiExamples/ExSavingCallback.cs
+++ ApiExamples/CSharp/ApiExamples/ExSavingCallback.cs
@@ -89,15 +89,13 @@
             // Open a document to be converted to html
             Document doc = new Document(MyDir + "Rendering.doc");

-            // If our output document will produce a CSS stylesheet, we can control where and how that stylesheet is created
-            // using a SaveOptions subclass specific Html files, which has a CssSavingCallback member that deals with CSS stylesheets
+            // If our output document will produce a CSS stylesheet, we can use an HtmlSaveOptions to control where it is saved
             HtmlSaveOptions htmlFixedSaveOptions = new HtmlSaveOptions();

-            // By default, CSS stylesheets are stored inside their Html documents,
-            // so if we want our Html to link to an external stylesheet instead, we need to specify the stylesheet type accordingly
+            // By default, a CSS stylesheet are stored inside its HTML document, but we can have it saved to a separate file
             htmlFixedSaveOptions.CssStyleSheetType = CssStyleSheetType.External;

-            // Now that our CSS stylesheet is external, this callback can specify where the linked stylesheet will be saved to
+            // A custom ICssSavingCallback implementation can control where that stylesheet will be saved and linked to by the Html document
             htmlFixedSaveOptions.CssSavingCallback =
                 new CustomCssSavingCallback(ArtifactsDir + "Rendering.CssSavingCallback.css", true, false);

@@ -106,7 +104,7 @@
         }

         /// <summary>
-        /// Sets up a FileStream through which a CSS stylesheet file will be saved to the local file system
+        /// Designates a filename and other parameters for the saving of a CSS stylesheet
         /// </summary>
         private class CustomCssSavingCallback : ICssSavingCallback
         {


add quick access controls

add quick access controls

along with currently playing song

--- SpotifyPlugin.cs
+++ SpotifyPlugin.cs
@@ -56,7 +56,7 @@
             };
         }

-        private List<Result> Pause(string arg)
+        private List<Result> Pause(string arg = null)
         {
             return new List<Result>()
             {
@@ -110,6 +110,7 @@
             }

             var status = _api.IsPlaying ? "Now Playing" : "Paused";
+            var toggleAction = _api.IsPlaying ? "Pause" : "Resume";
             var icon = _api.GetArtworkAsync(t);
             icon.Wait();

@@ -120,20 +121,46 @@
                     Title = t.TrackResource.Name,
                     SubTitle = $"{status} | by {t.ArtistResource.Name}",
                     IcoPath = icon.Result
-                }
-            };
-        }
-
-        private List<Result> ToggleMute(string arg)
-        {
-            var toggleAction = _api.IsMuted ? "unmute" : "mute";
+                },
+                new Result()
+                {
+                    IcoPath = SpotifyIcon,
+                    Title = "Pause / Resume",
+                    SubTitle = $"{toggleAction}: {t.TrackResource.Name}",
+                    Action = _ =>
+                    {
+                        if (_api.IsPlaying)
+                            _api.Pause();
+                        else
+                            _api.Play();
+                        return true;
+                    }
+                },
+                new Result()
+                {
+                    IcoPath = SpotifyIcon,
+                    Title = "Next",
+                    SubTitle = $"Skip: {t.TrackResource.Name}",
+                    Action = context =>
+                    {
+                        _api.Skip();
+                        return true;
+                    }
+                },
+                ToggleMute().First()
+            };
+        }
+
+        private List<Result> ToggleMute(string arg = null)
+        {
+            var toggleAction = _api.IsMuted ? "Unmute" : "Mute";

             return new List<Result>
             {
                 new Result()
                 {
                     Title = "Toggle Mute",
-                    SubTitle = $"Select to {toggleAction} Spotify",
+                    SubTitle = $"{toggleAction}: {_api.CurrentTrack.TrackResource.Name}",
                     IcoPath = SpotifyIcon,
                     Action = context =>
                     {


fixed bug where adding meal to plan adds meal to Meal table

--- Backend/Backend/Controllers/MealPlansController.cs
+++ Backend/Backend/Controllers/MealPlansController.cs
@@ -84,9 +84,9 @@
                 var meal = db.Meals.Find(id);
                 var currentUser = db.Users.Where(x => x.Email == currentUsersName).First();
                 mealPlan.User = currentUser;
-                List<Meal> meals = new List<Meal>();
-                meals.Add(meal);
-                mealPlan.Meals = meals;
+                List<Meal> userListOfMeals = new List<Meal>();
+                userListOfMeals.Add(meal);
+                mealPlan.Meals = userListOfMeals;
                 db.MealPlans.Add(mealPlan);

@@ -95,8 +95,8 @@
             {

                 var mealPlan = db.MealPlans.Where(w => w.User.Email == currentUsersName).First();
-                var Meals = mealPlan.Meals;
-                Meals.Add(currentMeal);
+                var userListOfMeals = mealPlan.Meals;
+                userListOfMeals.Add(currentMeal);
                 mealPlan.Meals = Meals;

             }


Don't tell user to try "use less memory" if they already are (BL-9059)

--- src/BloomExe/Publish/PDF/MakePdfUsingGeckofxHtmlToPdfProgram.cs
+++ src/BloomExe/Publish/PDF/MakePdfUsingGeckofxHtmlToPdfProgram.cs
@@ -143,12 +143,13 @@
 					@"Error message displayed in a message dialog box. {0} is the filename, {1} is a newline character.");

 				// This message string is intentionally separate because it was added after the previous string had already been localized in most languages.
-				var msg2 = L10NSharp.LocalizationManager.GetString(@"PublishTab.PDF.Error.TrySinglePage",
+				// It's not useful to add if we're already in save memory mode.
+				var msg2 = specs.SaveMemoryMode ? "" : L10NSharp.LocalizationManager.GetString(@"PublishTab.PDF.Error.TrySinglePage",
 					"The book's images might have exceeded the amount of RAM memory available. Please turn on the \"Use Less Memory\" option which is slower but uses less memory.",
-					@"Error message displayed in a message dialog box");
+					@"Error message displayed in a message dialog box") + Environment.NewLine;

 				var fullMsg = String.Format(msg, specs.OutputPdfPath, Environment.NewLine) + Environment.NewLine +
-				              msg2 + Environment.NewLine + res.StandardOutput;
+				              msg2 + res.StandardOutput;

 				var except = new ApplicationException(fullMsg);
 				// Note that if we're being run by a BackgroundWorker, it will catch the exception.


Need to also load the unit

Need to also load the unit

--- Battery-Commander.Web/Controllers/SSDController.cs
+++ Battery-Commander.Web/Controllers/SSDController.cs
@@ -23,6 +23,7 @@
                 await db
                 .Soldiers
                 .Include(s => s.SSDSnapshots)
+                .Include(s => s.Unit)
                 .Where(s => !unit.HasValue || s.UnitId == unit)
                 .OrderBy(s => s.LastName)
                 .ThenBy(s => s.FirstName)


HSBC - Inclusão da Espécie de Documento - CobrancaEmissaoCliente = 98

HSBC - Inclusão da Espécie de Documento - CobrancaEmissaoCliente = 98:
-  Na homologação do banco HSBC pelo Fisk, o banco informou que a
especie deve ser 98 - PD e os campos: Desconto/Abatimento, Outras
Deduções, Mora/Multa, Outros Acrescimos, Valor Cobrado e Quantidade,
devem vim em branco. Revision 13443.

--- src/Boleto.Net/Boleto/EspecieDocumento/EspecieDocumento_HSBC.cs
+++ src/Boleto.Net/Boleto/EspecieDocumento/EspecieDocumento_HSBC.cs
@@ -32,6 +32,7 @@
         ParcelaConsorcio = 22, //PC –  PARCELA DE CONSÓRCIO
         NotaFiscal = 23, //NF-Nota Fiscal
         DocumentoDivida = 24, //DD-Documento de Dívida
+        CobrancaEmissaoCliente = 98,
         Outros = 99, //Outros
         PD = 0
     }
@@ -97,6 +98,7 @@
                 case EnumEspecieDocumento_HSBC.ParcelaConsorcio: return "22";
                 case EnumEspecieDocumento_HSBC.NotaFiscal: return "23";
                 case EnumEspecieDocumento_HSBC.DocumentoDivida: return "24";
+                case EnumEspecieDocumento_HSBC.CobrancaEmissaoCliente: return "98";
                 case EnumEspecieDocumento_HSBC.Outros: return "99";
                 case EnumEspecieDocumento_HSBC.PD: return "0";
                 default: return "99";
@@ -132,6 +134,7 @@
                 case "22": return EnumEspecieDocumento_HSBC.ParcelaConsorcio;
                 case "23": return EnumEspecieDocumento_HSBC.NotaFiscal;
                 case "24": return EnumEspecieDocumento_HSBC.DocumentoDivida;
+                case "98": return EnumEspecieDocumento_HSBC.CobrancaEmissaoCliente;
                 case "99": return EnumEspecieDocumento_HSBC.Outros;
                 case "0": return EnumEspecieDocumento_HSBC.PD;
                 default: return EnumEspecieDocumento_HSBC.Outros;
@@ -270,6 +273,11 @@
                         this.Codigo = getCodigoEspecieByEnum(EnumEspecieDocumento_HSBC.Outros);
                         this.Especie = "OUTROS";
                         this.Sigla = "OUTROS";
+                        break;
+                    case EnumEspecieDocumento_HSBC.CobrancaEmissaoCliente:
+                        this.Codigo = getCodigoEspecieByEnum(EnumEspecieDocumento_HSBC.CobrancaEmissaoCliente);
+                        this.Especie = "COBRANÇA COM EMISSÃO TOTAL DO BLOQUETO PELO CLIENTE";
+                        this.Sigla = "PD";
                         break;
                     case EnumEspecieDocumento_HSBC.PD:
                         this.Codigo = getCodigoEspecieByEnum(EnumEspecieDocumento_HSBC.PD);


Turn on schema driven document validation  (#5300)

* - minor change

* remove blankline

--- src/Microsoft.DocAsCode.Build.SchemaDriven/Processors/MarkdownInterpreter.cs
+++ src/Microsoft.DocAsCode.Build.SchemaDriven/Processors/MarkdownInterpreter.cs
@@ -35,7 +35,7 @@
         {
             var host = context.Host;

-            var mr = host.Markup(content, context.GetOriginalContentFile(path));
+            var mr = host.Markup(content, context.GetOriginalContentFile(path), false, true);
             (context.FileLinkSources).Merge(mr.FileLinkSources);
             (context.UidLinkSources).Merge(mr.UidLinkSources);
             (context.Dependency).UnionWith(mr.Dependency);


Castle.Facilities.AutoTx: add TService type restriction to be a class to match windsor-3.0 restriction

* otherwise fails when adding AutoTx facility

Signed-off-by: Martin Jansa <3ba6c51779fb31acf0de04bbcb2aad34c65b9c1c@oksystem.cz>

--- src/Castle.Facilities.AutoTx/LifestyleRegistrationExtensions.cs
+++ src/Castle.Facilities.AutoTx/LifestyleRegistrationExtensions.cs
@@ -27,6 +27,7 @@
 	{
 		public static ComponentRegistration<TService> PerTransaction<TService>(
 			this LifestyleGroup<TService> @group)
+			where TService : class
 		{
 			Contract.Requires(group != null);
 			return @group.Custom<WrapperResolveLifestyleManager<PerTransactionLifestyleManager>>();
@@ -34,6 +35,7 @@

 		public static ComponentRegistration<TService> PerTopTransaction<TService>(
 			this LifestyleGroup<TService> @group)
+			where TService : class
 		{
 			Contract.Requires(group != null);
 			return @group.Custom<WrapperResolveLifestyleManager<PerTopTransactionLifestyleManager>>();


Fixed copy paste error with exception message

--- src/Cofoundry.Plugins.Mail.MailKit/MilKitMailDispatchSession.cs
+++ src/Cofoundry.Plugins.Mail.MailKit/MilKitMailDispatchSession.cs
@@ -151,7 +151,7 @@
             {
                 if (string.IsNullOrEmpty(_mailSettings.DebugEmailAddress))
                 {
-                    throw new Exception("MailSendMode.SendToDebugAddress requested but Cofoundry:SmtpMail:DebugEmailAddress setting is not defined.");
+                    throw new Exception("MailSendMode.SendToDebugAddress requested but Cofoundry:Mail:DebugEmailAddress setting is not defined.");
                 }
                 toAddress = CreateMailAddress(_mailSettings.DebugEmailAddress, message.To.DisplayName);
             }


565: TextServiceClient

565: TextServiceClient

--- src/PixelFarm/PixelFarm.Drawing.GLES/TextPrinter/GLBitmapGlyphTextPrinter.cs
+++ src/PixelFarm/PixelFarm.Drawing.GLES/TextPrinter/GLBitmapGlyphTextPrinter.cs
@@ -34,7 +34,7 @@
         GLBitmap _glBmp;

         ResolvedFont _resolvedFont;
-        readonly OpenFontTextService _textServices;
+        readonly TextServiceClient _txtClient;
         readonly TextureCoordVboBuilder _vboBuilder = new TextureCoordVboBuilder();

@@ -61,7 +61,8 @@
             //create text printer for use with canvas painter
             _painter = painter;
             _pcx = painter.Core;
-            _textServices = textServices;
+
+            _txtClient = textServices.CreateNewServiceClient();

             //_currentTextureKind = TextureKind.Msdf;
             //_currentTextureKind = TextureKind.StencilGreyScale;
@@ -169,7 +170,7 @@
             {
                 return;
             }
-            ChangeFont(_textServices.ResolveFont(font));
+            ChangeFont(_txtClient.ResolveFont(font));
         }
         public void LoadFontAtlas(string fontTextureInfoFile, string atlasImgFilename)
         {
@@ -244,7 +245,7 @@
         public void MeasureString(char[] buffer, int startAt, int len, out int w, out int h)
         {
             var textBufferSpan = new TextBufferSpan(buffer, startAt, len);
-            Size s = _textServices.MeasureString(textBufferSpan, _painter.CurrentFont);
+            Size s = _txtClient.MeasureString(textBufferSpan, _painter.CurrentFont);
             w = s.Width;
             h = s.Height;
         }
@@ -272,7 +273,7 @@
             //check each split segment

-            GlyphPlanSequence glyphPlanSeq = _textServices.CreateGlyphPlanSeq(textBufferSpan, _resolvedFont);
+            GlyphPlanSequence glyphPlanSeq = _txtClient.CreateGlyphPlanSeq(textBufferSpan, _resolvedFont);
             //-----------------

             _vboBuilder.Clear();
@@ -978,7 +979,7 @@
             var buffSpan = new TextBufferSpan(buffer, startAt, len);

             RequestFont reqFont = _painter.CurrentFont; //init with default
-            ResolvedFont resolvedFont = _textServices.ResolveFont(reqFont);
+            ResolvedFont resolvedFont = _txtClient.ResolveFont(reqFont);
             //Typeface defaultTypeface = resolvedFont.Typeface;
             Typeface curTypeface = resolvedFont.Typeface;

@@ -986,7 +987,7 @@

             _lineSegs.Clear();
             _textPrinterWordVisitor.SetLineSegmentList(_lineSegs);
-            _textServices.BreakToLineSegments(buffSpan, _textPrinterWordVisitor);
+            _txtClient.BreakToLineSegments(buffSpan, _textPrinterWordVisitor);
             _textPrinterWordVisitor.SetLineSegmentList(null);
             //typeface may not have a glyph for some char
             //eg eng font + emoji
@@ -1062,7 +1063,7 @@
                         AlternativeTypefaceSelector.LatestTypeface = curTypeface;
                     }

-                    if (_textServices.TryGetAlternativeTypefaceFromCodepoint(codepoint, AlternativeTypefaceSelector, out Typeface alternative))
+                    if (_txtClient.TryGetAlternativeTypefaceFromCodepoint(codepoint, AlternativeTypefaceSelector, out Typeface alternative))
                     {
                         //change to another
                         //create local resolved font
@@ -1082,23 +1083,23 @@
                 }

-                _textServices.CurrentScriptLang = new ScriptLang(spBreakInfo.ScriptTag, spBreakInfo.LangTag);
+                _txtClient.CurrentScriptLang = new ScriptLang(spBreakInfo.ScriptTag, spBreakInfo.LangTag);

                 //in some text context (+typeface)=>user can disable gsub, gpos
                 //this is an example
                 if (line_seg.WordKind == WordKind.Tab || line_seg.WordKind == WordKind.Number ||
                        (spBreakInfo.UnicodeRange == Unicode13RangeInfoList.C0_Controls_and_Basic_Latin))
                 {
-                    _textServices.EnableGpos = false;
-                    _textServices.EnableGsub = false;
+                    _txtClient.EnableGpos = false;
+                    _txtClient.EnableGsub = false;
                 }
                 else
                 {
-                    _textServices.EnableGpos = true;
-                    _textServices.EnableGsub = true;
+                    _txtClient.EnableGpos = true;
+                    _txtClient.EnableGsub = true;
                 }
                 //layout glyphs in each context
-                GlyphPlanSequence seq = _textServices.CreateGlyphPlanSeq(buff, curTypeface, reqFont.SizeInPoints);
+                GlyphPlanSequence seq = _txtClient.CreateGlyphPlanSeq(buff, curTypeface, reqFont.SizeInPoints);
                 seq.IsRightToLeft = spBreakInfo.RightToLeft;

                 //calculate font key => get resolved font


Using this.Context.Stop() in Master actor Pi sample

--- Samples/Pi/Actors/Master.cs
+++ Samples/Pi/Actors/Master.cs
@@ -54,6 +54,7 @@
                 if (this.noresults >= this.nomessages)
                 {
                     this.listener.Tell(new PiAproximation(pi));
+                    this.Context.Stop(this.Self);
                 }

                 return;


Consolidate common directive pattern parts

--- src/Dotnet.Script.DependencyModel/ProjectSystem/ScriptParser.cs
+++ src/Dotnet.Script.DependencyModel/ProjectSystem/ScriptParser.cs
@@ -66,27 +66,22 @@

         const string Hws = @"[\x20\t]"; // hws = horizontal whitespace

+        const string DirectivePatternPrefix = @"^"
+                                            + Hws + @"*#";
+        const string DirectivePatternSuffix = Hws + @"*""nuget:"
+                                            + Hws + @"*(.+)"
+                                            + Hws + @"*,"
+                                            + Hws + @"*(.*)""";
+
         private static IEnumerable<PackageReference> ReadPackageReferencesFromReferenceDirective(string fileContent)
         {
-            const string pattern = @"^"
-                                 + Hws + @"*#r"
-                                 + Hws + @"*""nuget:"
-                                 + Hws + @"*(.+)"
-                                 + Hws + @"*,"
-                                 + Hws + @"*(.*)""";
-
+            const string pattern = DirectivePatternPrefix + "r" + DirectivePatternSuffix;
             return ReadPackageReferencesFromDirective(PackageOrigin.ReferenceDirective, pattern, fileContent);
         }

         private static IEnumerable<PackageReference> ReadPackageReferencesFromLoadDirective(string fileContent)
         {
-            const string pattern = @"^"
-                                 + Hws + @"*#load"
-                                 + Hws + @"*""nuget:"
-                                 + Hws + @"*(.+)"
-                                 + Hws + @"*,"
-                                 + Hws + @"*(.*)""";
-
+            const string pattern = DirectivePatternPrefix + "load" + DirectivePatternSuffix;
             return ReadPackageReferencesFromDirective(PackageOrigin.LoadDirective, pattern, fileContent);
         }


Cleanup

Cleanup

--- SendGrid/Example/Example.cs
+++ SendGrid/Example/Example.cs
@@ -37,9 +37,6 @@
             mail.TemplateId = "TEMPLATE_ID";
             mail.Personalization[0].AddSubstitution("[KEY_1]", "VALUE_1");
             mail.Personalization[0].AddSubstitution("[KEY_2]", "VALUE_1");
-
-
-

             dynamic response = sg.client.mail.send.post(requestBody: mail.Get());
             Console.WriteLine(response.StatusCode);


Add TestPatterns_Is_ConstUnaryAndBinaryPattern to TypeInferrerTests

--- src/EditorFeatures/CSharpTest/TypeInferrer/TypeInferrerTests.cs
+++ src/EditorFeatures/CSharpTest/TypeInferrer/TypeInferrerTests.cs
@@ -3092,5 +3092,42 @@

             await TestAsync(text, "global::System.IO.FileAttributes", mode);
         }
+
+        [Theory]
+        [Trait(Traits.Feature, Traits.Features.TypeInferenceService)]
+        [InlineData("")]
+        [InlineData("Re")]
+        [InlineData("Col")]
+        [InlineData("Color.Green or", false)]
+        [InlineData("Color.Green or ")]
+        [InlineData("(Color.Green or ")] // start of: is (Color.Red or Color.Green) and not Color.Blue
+        [InlineData("Color.Green or Re")]
+        [InlineData("Color.Green or Color.Red or ")]
+        [InlineData("Color.Green orWrittenWrong ", false)]
+        [InlineData("not ")]
+        [InlineData("not Re")]
+        public async Task TestPatterns_Is_ConstUnaryAndBinaryPattern(string isPattern, bool shouldInferColor = true)
+        {
+            var markup = @$"
+class C
+{{
+    public enum Color
+    {{
+        Red,
+        Green,
+    }}
+
+    public void M(Color c)
+    {{
+        var isRed = c is {isPattern}[||];
+    }}
+}}
+";
+
+            var expectedType = shouldInferColor
+                ? "global::C.Color"
+                : "global::System.Object";
+            await TestAsync(markup, expectedType, TestMode.Position);
+        }
     }
 }


Replace GetFiles in TestModuleManifestCommand (#14317)

--- src/System.Management.Automation/engine/Modules/TestModuleManifestCommand.cs
+++ src/System.Management.Automation/engine/Modules/TestModuleManifestCommand.cs
@@ -420,23 +420,13 @@

             try
             {
-                var allFiles = Directory.GetFiles(gacPath, assemblyFile, SearchOption.AllDirectories);
-
-                if (allFiles.Length == 0)
-                {
-                    var allNgenFiles = Directory.GetFiles(gacPath, ngenAssemblyFile, SearchOption.AllDirectories);
-                    if (allNgenFiles.Length == 0)
-                    {
-                        return false;
-                    }
-                }
+                return Directory.EnumerateFiles(gacPath, assemblyFile, SearchOption.AllDirectories).Any()
+                    || Directory.EnumerateFiles(gacPath, ngenAssemblyFile, SearchOption.AllDirectories).Any();
             }
             catch
             {
                 return false;
             }
-
-            return true;
 #endif
         }
     }


Added filtering of coordinate duplicates when drawing geometries in mapbox (thanks djonio)
Issue #33911

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS01]$/SharpMap/Trunk;C102208

--- SharpMap.UI/Forms/MapBox.cs
+++ SharpMap.UI/Forms/MapBox.cs
@@ -2002,6 +2002,20 @@
         {
             base.OnMouseDoubleClick(e);

+            /*Remove duplicate coordinates in _pointArray
+             We will at least get one doubleclick since we did a DoubleClick*/
+            if (_pointArray != null && (_activeTool == Tools.DrawLine || _activeTool == Tools.DrawPolygon))
+            {
+                for (int i = 1; i < _pointArray.Count; i++)
+                {
+                    if (_pointArray[i].Equals2D(_pointArray[i - 1]))
+                    {
+                        _pointArray.RemoveAt(i);
+                        i--;
+                    }
+                }
+            }
+
             if (_activeTool == Tools.DrawPolygon)
             {
                 if (GeometryDefined != null)


No longer using Created as filter for deletion (since it's mostly null anyhow and last write is more the enough)

--- SingleDevicePhoneCleaner.cs
+++ SingleDevicePhoneCleaner.cs
@@ -343,7 +343,6 @@

                 // Filter out files that should not be removed
                 var validSourceFilesForDeletion = _sourceFiles
-                    .Where(x => x.CreationTimeUtc < DateTime.UtcNow.AddMonths(-1)) // Exclude files that were created during the last month's
                     .Where(x => x.LastWriteTimeUtc < DateTime.UtcNow.AddMonths(-1)) // For cases where the 'created' attribute is missing (e.g. when mapping a drive over WebDAV)
                     .Where(x => !excludeFilesShortName.Contains(x.Name)) // Respect exclude files list
                     .ToArray();


Implemented IEquatable.

Implemented IEquatable.

--- src/Wave.Extensions.Esri/ESRI/ArcGIS/Geodatabase/Internal/IntermediateRow.cs
+++ src/Wave.Extensions.Esri/ESRI/ArcGIS/Geodatabase/Internal/IntermediateRow.cs
@@ -9,7 +9,7 @@
     ///     A lightweight structure for the intermediate row.
     /// </summary>
     [ComVisible(false)]
-    internal class IntermediateRow : IIntermediateRow
+    internal class IntermediateRow : IIntermediateRow, IEquatable<IIntermediateRow>
     {
         #region Constructors

@@ -30,7 +30,7 @@

         #endregion

-        #region IIntermediateRow Members
+        #region Public Properties

         /// <summary>
         ///     Gets the destination foreign key.
@@ -51,6 +51,29 @@
         ///     Gets the physical intermediate row.
         /// </summary>
         public IRow Row { get; private set; }
+
+        #endregion
+
+        #region IEquatable<IIntermediateRow> Members
+
+        /// <summary>
+        ///     Indicates whether the current object is equal to another object of the same type.
+        /// </summary>
+        /// <param name="other">An object to compare with this object.</param>
+        /// <returns>
+        ///     true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.
+        /// </returns>
+        public bool Equals(IIntermediateRow other)
+        {
+            if (other == null)
+                return false;
+
+            return other.DestinationForeignKey.Equals(this.DestinationForeignKey, StringComparison.InvariantCultureIgnoreCase) && other.OriginForeignKey.Equals(this.OriginForeignKey, StringComparison.InvariantCultureIgnoreCase);
+        }
+
+        #endregion
+
+        #region IIntermediateRow Members

         /// <summary>
         ///     Updates the field with specified <paramref name="fieldName" /> with the <paramref name="value" />.
@@ -84,9 +107,7 @@
         public override bool Equals(object obj)
         {
             IntermediateRow other = obj as IntermediateRow;
-            if (other == null) return false;
-
-            return other.DestinationForeignKey.Equals(this.DestinationForeignKey, StringComparison.InvariantCultureIgnoreCase) && other.OriginForeignKey.Equals(this.OriginForeignKey, StringComparison.InvariantCultureIgnoreCase);
+            return this.Equals(other);
         }

         /// <summary>


fix typo

fix typo

--- TCC.Core/Game.cs
+++ TCC.Core/Game.cs
@@ -161,7 +161,7 @@
                 if (!App.Loading)
                 {
                     Log.N("TCC",
-                        $"Some database files are out of date, updating... Contact the deveolper if you see this message at every login.",
+                        $"Some database files are out of date, updating... Contact the developer if you see this message at every login.",
                         NotificationType.Warning, 5000);
                     ChatManager.Instance.AddTccMessage($"Some database files are out of date, updating...");
                 }


Unused

Unused

--- Source/contractScenario.cs
+++ Source/contractScenario.cs
@@ -606,12 +606,6 @@
 			if (param.GetType() == typeof(PartTest))
 				return "partTest";

-			if (contractAssembly.FPLoaded)
-			{
-				if (param.GetType() == contractAssembly._FPType)
-					return "FinePrint";
-			}
-
 			if (contractAssembly.MCELoaded)
 			{
 				if (param.GetType() == contractAssembly._MCEType)


Fix #5342: Incorrect specification of global alias (#5343)

--- src/Orleans.CodeGeneration/Utilities/SyntaxFactoryExtensions.cs
+++ src/Orleans.CodeGeneration/Utilities/SyntaxFactoryExtensions.cs
@@ -111,8 +111,8 @@
                     "bindingFlags",
                     string.Format("Can't create parenthesized binary expression with {0} arguments", bindingFlags.Length));
             }
-
-            var flags = SyntaxFactory.AliasQualifiedName("global", SyntaxFactory.IdentifierName("System")).Member("Reflection").Member("BindingFlags");
+
+            var flags = SyntaxFactory.AliasQualifiedName(SyntaxFactory.IdentifierName(SyntaxFactory.Token(SyntaxKind.GlobalKeyword)), SyntaxFactory.IdentifierName("System")).Member("Reflection").Member("BindingFlags");
             var bindingFlagsBinaryExpression = SyntaxFactory.BinaryExpression(
                 operationKind,
                 flags.Member(bindingFlags[0].ToString()),


Call Rolback on the Transaction for SingleTransactionAlwaysRollbackStartegy.

--- src/dbup-core/Engine/Transactions/SingleTransactionAlwaysRollbackStrategy.cs
+++ src/dbup-core/Engine/Transactions/SingleTransactionAlwaysRollbackStrategy.cs
@@ -77,11 +77,14 @@
                 log.WriteWarning("Error occured when executing scripts, transaction will be rolled back");
             }

+            // Always rollback
+            transaction?.Rollback();
+
             //Restore the executed scripts collection
             executedScriptsCollection.Clear();
             executedScriptsCollection.AddRange(executedScriptsListBeforeExecution);

-            transaction.Dispose();
+            transaction?.Dispose();
         }
     }
 }


fix to PDO prepare

fix to PDO prepare

fixes https://github.com/peachpiecompiler/peachpie/issues/629

--- src/PDO/Peachpie.Library.PDO/Utilities/StatementStringParser.cs
+++ src/PDO/Peachpie.Library.PDO/Utilities/StatementStringParser.cs
@@ -53,9 +53,11 @@
                             if (text[i] == '\\') i++;   // skip the escaped character
                         }

+                        i++; // consume the closing quote
+
                         Next(Tokens.QuotedString, text, tstart, i - tstart);

-                        tstart = i + 1;
+                        tstart = i;
                         break;
                 }
             }


Fix initialization.

Fix initialization.

--- Code2Xml.Learner.Core/Learning/SelectedFragment.cs
+++ Code2Xml.Learner.Core/Learning/SelectedFragment.cs
@@ -13,7 +13,7 @@
         public int StartLine { get; set; }

         private static int _lastStartLine;
-        private static int _lastIndex;
+        private static int _lastIndex = -1;

         public void Update(StructuredCode structuredCode, CstNode cst) {
             var startLineIndex = structuredCode.GetIndex(StartLine, 0);


Add OnRequestPermissionsResult for MainActivity.

--- client/BlueMonkey/BlueMonkey.Droid/MainActivity.cs
+++ client/BlueMonkey/BlueMonkey.Droid/MainActivity.cs
@@ -6,6 +6,8 @@
 using BlueMonkey.LoginService.Azure.Droid;
 using Microsoft.Practices.Unity;
 using Microsoft.WindowsAzure.MobileServices;
+using Plugin.Permissions;
+using Plugin.Permissions.Abstractions;
 using Prism.Unity;

 namespace BlueMonkey.Droid
@@ -23,6 +25,11 @@
             global::Xamarin.Forms.Forms.Init(this, bundle);
             LoadApplication(new App(new AndroidInitializer()));
         }
+
+        public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
+        {
+            PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
+        }
     }

     public class AndroidInitializer : IPlatformInitializer


fix: on failed test, memory was not de-allocated

--- Tests/Program.cs
+++ Tests/Program.cs
@@ -47,6 +47,9 @@
             Distorm._DecodeResult r =
                 Distorm.distorm_decompose(ref ci, result, (uint)result.Length, ref usedInstructionsCount);

+            // Release the handle pinned to the code.
+            gch.Free();
+
             // Return false if an error occured during decomposition.
             if (!r.Equals(Distorm._DecodeResult.DECRES_SUCCESS))
             {
@@ -65,9 +68,6 @@
                 actualOutput += inst.Mnemonic + " " + inst.Operands + "\n";
             }

-            // Release the handle pinned to the code.
-            gch.Free();
-
             return expectedOutput.Equals(actualOutput);
         }


fix HeavyProfiler when disabling while Switch sequence

--- Signum.Utilities/Profiler/HeavyProfiler.cs
+++ Signum.Utilities/Profiler/HeavyProfiler.cs
@@ -113,7 +113,7 @@
         private static Tracer CreateNewEntry(string role, Func<string> additionalData, bool stackTrace)
         {
             long beforeStart = PerfCounter.Ticks;
-
+
             if (enabled == false || TimeLimit.Value < beforeStart)
             {
                 enabled = false;
@@ -121,50 +121,62 @@
                 return null;
             }

-            var saveCurrent = current.Value;
+            var parent = current.Value;

             var newCurrent = current.Value = new HeavyProfilerEntry()
             {
                 BeforeStart = beforeStart,
                 Role = role,
-                AdditionalData = additionalData == null ? null: additionalData(),
+                AdditionalData = additionalData == null ? null : additionalData(),
                 StackTrace = stackTrace ? new StackTrace(2, true) : null,
+                Parent = parent,
+                Depth = parent == null ? 0 : (parent.Depth + 1),
             };

             newCurrent.Start = PerfCounter.Ticks;

-            return new Tracer { saveCurrent = saveCurrent };
+            return new Tracer { newCurrent = newCurrent };
         }

         public class Tracer : IDisposable
         {
-            internal HeavyProfilerEntry saveCurrent;
+            internal HeavyProfilerEntry newCurrent;

             public void Dispose()
             {
-                var cur = current.Value;
+                if (newCurrent == null) //After a Switch sequence disabled in the middle
+                    return;
+
+                if (current.Value != newCurrent)
+                    throw new InvalidOperationException("Unexpected");
+
+                var cur = newCurrent;
                 cur.End = PerfCounter.Ticks;
-
-                if (saveCurrent == null)
+                var parent = newCurrent.Parent;
+
+                if (parent == null)
                 {
                     lock (Entries)
                     {
+                        if (cur.Depth != 0)
+                            throw new InvalidOperationException("Invalid depth");
                         cur.Index = Entries.Count;
-                        cur.Parent = null;
                         Entries.Add(cur);
                     }
                 }
                 else
                 {
-                    if (saveCurrent.Entries == null)
-                        saveCurrent.Entries = new List<HeavyProfilerEntry>();
-
-                    cur.Index = saveCurrent.Entries.Count;
-                    cur.Parent = saveCurrent;
-                    saveCurrent.Entries.Add(cur);
+                    if (parent.Entries == null)
+                        parent.Entries = new List<HeavyProfilerEntry>();
+
+                    if (cur.Depth != parent.Depth + 1)
+                        throw new InvalidOperationException("Invalid depth");
+
+                    cur.Index = parent.Entries.Count;
+                    parent.Entries.Add(cur);
                 }

-                current.Value = saveCurrent;
+                current.Value = parent;
             }
         }

@@ -179,10 +191,7 @@

             var newTracer = CreateNewEntry(role, additionalData, hasStackTrace);

-            if (newTracer != null)
-            {
-                tracer.saveCurrent = newTracer.saveCurrent;
-            }
+            tracer.newCurrent = newTracer == null ? null : newTracer.newCurrent;
         }

         public static IEnumerable<HeavyProfilerEntry> AllEntries()
@@ -299,10 +308,7 @@

         public int Index;

-        public int Depth
-        {
-            get { return this.Parent == null ? 0 : this.Parent.Depth + 1; }
-        }
+        public int Depth;

         public string FullIndex()
         {


Slightly reduced the line count of Fixture.OmitAutoProperties.

--- Src/AutoFixture/Fixture.cs
+++ Src/AutoFixture/Fixture.cs
@@ -166,25 +166,21 @@
                 if (value == this.OmitAutoProperties)
                     return;

+                var g = this.graph;
                 if (value)
-                {
-                    var g = this.graph;
+                {
                     foreach (var p in this.graph.Parents(b => b is AutoPropertiesTargetNode))
                     {
                         foreach (var b in p)
                         {
                             var aptn = b as AutoPropertiesTargetNode;
                             if (aptn != null)
-                            {
-                                g = g.ReplaceNode(with: aptn, when: n => p.Equals(n));
-                            }
+                                g = g.ReplaceNode(with: aptn, when: p.Equals);
                         }
                     }
-                    this.graph = g;
                 }
                 else
                 {
-                    var g = this.graph;
                     foreach (var p in this.graph.Parents(b => b is AutoPropertiesTargetNode))
                     {
                         var pps = p
@@ -193,10 +189,10 @@
                                 new AutoPropertiesCommand().Execute,
                                 new AnyTypeSpecification()))
                             .Cast<ISpecimenBuilder>();
-                        g = g.ReplaceNode(with: pps, when: n => p.Equals(n));
-                    }
-                    this.graph = g;
+                        g = g.ReplaceNode(with: pps, when: p.Equals);
+                    }
                 }
+                this.graph = g;
             }
         }


instruction REUPLOAD

instruction REUPLOAD

--- Skermstafir/Views/Home/Instructions.cshtml
+++ Skermstafir/Views/Home/Instructions.cshtml
@@ -48,9 +48,27 @@

Skref 4

-
+

                         Í kassanum sem birtist skaltu finna möppuna þar sem myndin þín er geymd og velja hana eins og sést á myndinni hér til hliðar
+

+
+

+

+
+
Skref 5

+
+

+                        Í kassanum sem birtist skaltu finna möppuna þar sem myndin þín er geymd og velja hana eins og sést á myndinni hér til hliðar
+

+
+

+

+
+
Skref 6

+
+

+                        Núna geturðu horft á videoið með textanum sem þú varst að ná í


Fixed button text color.

Fixed button text color.

--- SlicerConfiguration/SliceSettingsWidget.cs
+++ SlicerConfiguration/SliceSettingsWidget.cs
@@ -128,6 +128,7 @@
             buttonFactory.FixedHeight = 20;
             buttonFactory.fontSize = 10;
             buttonFactory.normalFillColor = RGBA_Bytes.White;
+            buttonFactory.normalTextColor = RGBA_Bytes.DarkGray;

             showHelpBox = new CheckBox(0, 0, LocalizedString.Get("Show Help"), textSize: 10);
             showHelpBox.Checked = UserSettings.Instance.get(SliceSettingsShowHelpEntry) == "true";


Extract settings group creation to new helper method

--- SlicerConfiguration/SliceSettingsWidget.cs
+++ SlicerConfiguration/SliceSettingsWidget.cs
@@ -266,31 +266,7 @@
 					child.Padding = new BorderDouble(10);
 				}

-				var subgroupPanel = new FlowLayoutWidget(FlowDirection.TopToBottom)
-				{
-					VAnchor = VAnchor.Fit,
-					HAnchor = HAnchor.Stretch
-				};
-
-				foreach (OrganizerSubGroup subGroup in group.SubGroupsList)
-				{
-					var section = AddSettingRowsForSubgroup(subGroup, oemAndUserContext, showHelpControls);
-					if (section != null)
-					{
-						var groupBox = new AltGroupBox(subGroup.Name.Localize())
-						{
-							TextColor = ActiveTheme.Instance.PrimaryTextColor,
-							BorderColor = ActiveTheme.Instance.PrimaryTextColor,
-							HAnchor = HAnchor.Stretch,
-							Margin = new BorderDouble(bottom: 8, top: 8),
-							Padding = new BorderDouble(left: 4),
-						};
-						groupBox.AddChild(section);
-
-						subgroupPanel.AddChild(groupBox);
-					}
-				}
-
+				FlowLayoutWidget subgroupPanel = CreateGroupContent(group, oemAndUserContext, showHelpControls);
 				if (subgroupPanel.Children.Count > 0)
 				{
 					var scrollableWidget = new ScrollableWidget()
@@ -329,6 +305,35 @@
 			};

 			return secondaryTabControl;
+		}
+
+		private FlowLayoutWidget CreateGroupContent(OrganizerGroup group, SettingsContext oemAndUserContext, bool showHelpControls)
+		{
+			var groupPanel = new FlowLayoutWidget(FlowDirection.TopToBottom)
+			{
+				VAnchor = VAnchor.Fit,
+				HAnchor = HAnchor.Stretch
+			};
+			foreach (OrganizerSubGroup subGroup in group.SubGroupsList)
+			{
+				var section = AddSettingRowsForSubgroup(subGroup, oemAndUserContext, showHelpControls);
+				if (section != null)
+				{
+					var groupBox = new AltGroupBox(subGroup.Name.Localize())
+					{
+						TextColor = ActiveTheme.Instance.PrimaryTextColor,
+						BorderColor = ActiveTheme.Instance.PrimaryTextColor,
+						HAnchor = HAnchor.Stretch,
+						Margin = new BorderDouble(bottom: 8, top: 8),
+						Padding = new BorderDouble(left: 4),
+					};
+					groupBox.AddChild(section);
+
+					groupPanel.AddChild(groupBox);
+				}
+			}
+
+			return groupPanel;
 		}

 		private GuiWidget AddSettingRowsForSubgroup(OrganizerSubGroup subGroup, SettingsContext oemAndUserContext, bool showHelpControls)


Custom prop in routing.

Custom prop in routing.

--- Snippets/Snippets_6/Routing/RoutingAPIs.cs
+++ Snippets/Snippets_6/Routing/RoutingAPIs.cs
@@ -58,7 +58,7 @@
                 {
                     return new[]
                     {
-                        new EndpointInstance(e, "1").AtMachine("A"),
+                        new EndpointInstance(e, "1").SetProperty("SomeProp", "SomeValue"),
                         new EndpointInstance(e, "2").AtMachine("B")
                     };
                 }


removed unused variable (less wasted cpu ticks)

--- SolrNet/Impl/SolrDocumentResponseParser.cs
+++ SolrNet/Impl/SolrDocumentResponseParser.cs
@@ -43,7 +43,6 @@
             var results = new List<T>();
             if (parentNode == null)
                 return results;
-            var allFields = mappingManager.GetFields(typeof (T));
             var nodes = parentNode.Elements("doc");
             foreach (var docNode in nodes) {
                 results.Add(ParseDocument(docNode));


Retry starting a containerizer process in tests

Seems to be failing periodically on CI to bind to the port, hoping this
will fix whatever race we have

Signed-off-by: Dave_Goddard <a5692579077bf98cb035292473fe12572309d028@pivotal.io>

--- Containerizer/Containerizer.Tests/Specs/Helpers.cs
+++ Containerizer/Containerizer.Tests/Specs/Helpers.cs
@@ -5,10 +5,12 @@
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
+using System.Net;
 using System.Net.Http;
 using System.Reflection;
 using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
+using System.Threading;
 using Microsoft.Web.Administration;
 using Newtonsoft.Json.Linq;
 using IronFrame;
@@ -99,7 +101,7 @@
                 process.StartInfo.CreateNoWindow = true;
                 process.StartInfo.FileName = Path.Combine(Helpers.AssemblyDirectory, "..", "..", "..", "Containerizer", "bin", "Containerizer.exe");
                 process.StartInfo.Arguments = ExternalIP + " " + Port.ToString();
-                process.Start();
+                Retry.Do(() => process.Start(), TimeSpan.FromSeconds(1), 5);
                 job.AddProcess(process.Handle);
                 process.StandardOutput.ReadLine().should_start_with("SUCCESS");
             }
@@ -150,5 +152,43 @@
             }
             if (!isAdmin) { throw new Exception("You will need to run the tests with Administrator Privileges"); }
         }
+
+        public static class Retry
+        {
+            public static void Do(
+                Action action,
+                TimeSpan retryInterval,
+                int retryCount = 3)
+            {
+                Do<object>(() =>
+                {
+                    action();
+                    return null;
+                }, retryInterval, retryCount);
+            }
+
+            public static T Do<T>(
+                Func<T> action,
+                TimeSpan retryInterval,
+                int retryCount = 3)
+            {
+                var exceptions = new List<Exception>();
+
+                for (int retry = 0; retry < retryCount; retry++)
+                {
+                    try
+                    {
+                        return action();
+                    }
+                    catch (Exception ex)
+                    {
+                        exceptions.Add(ex);
+                        Thread.Sleep(retryInterval);
+                    }
+                }
+
+                throw new AggregateException(exceptions);
+            }
+        }
     }
 }


Make variable names in CustomGrid.Row struct more readable

--- Corale.Colore/Razer/Keyboard/Effects/CustomGrid.cs
+++ Corale.Colore/Razer/Keyboard/Effects/CustomGrid.cs
@@ -160,8 +160,8 @@

                 Columns = new uint[Constants.MaxColumns];

-                for (var i = 0; i < (int)Constants.MaxColumns; i++)
-                    Columns[i] = colors[i];
+                for (var col = 0; col < (int)Constants.MaxColumns; col++)
+                    Columns[col] = colors[col];
             }

             /// <summary>


Mac: Setting Control.Title to null throws an exception, use an empty string.

--- Source/Eto.Platform.Mac/Forms/MacWindow.cs
+++ Source/Eto.Platform.Mac/Forms/MacWindow.cs
@@ -311,7 +311,7 @@

 		public override NSView ContentControl { get { return Control.ContentView; } }

-		public virtual string Title { get { return Control.Title; } set { Control.Title = value; } }
+		public virtual string Title { get { return Control.Title; } set { Control.Title = value ?? ""; } } // Control.Title throws an exception if value is null

 		void SetButtonStates()
 		{


#4137 add testing for null Fields and actions

--- Core/NakedObjects.Metamodel.Test/Meta/CacheTest.cs
+++ Core/NakedObjects.Metamodel.Test/Meta/CacheTest.cs
@@ -224,7 +224,19 @@
         private static void CompareCaches(ISpecificationCache cache, ISpecificationCache newCache) {
             Assert.AreEqual(cache.AllSpecifications().Count(), newCache.AllSpecifications().Count());

+            // checks for fields and Objects actions
+
+            Assert.IsTrue(newCache.AllSpecifications().Select(s => s.Fields).All(fs => !fs.Any() || fs.All(f => f != null)));
+            Assert.IsTrue(newCache.AllSpecifications().Select(s => s.ObjectActions).All(fs => !fs.Any() || fs.All(f => f != null)));
+
+
             var zipped = cache.AllSpecifications().Zip(newCache.AllSpecifications(), (a, b) => new {a, b});
+
+
+
+
+
+

             foreach (var item in zipped) {
                 Assert.AreEqual(item.a.FullName, item.b.FullName);


Always authenticate with API Key

Always authenticate with API Key

--- StockFighter/AbstractAPI.cs
+++ StockFighter/AbstractAPI.cs
@@ -127,12 +127,12 @@

             var request = new RestRequest(commandString, method);

+            request.RequestFormat = DataFormat.Json;
+
+            request.AddParameter(authorizationParameter, apiKey, ParameterType.HttpHeader);
+
             if (post != null)
             {
-                request.RequestFormat = DataFormat.Json;
-
-                request.AddParameter(authorizationParameter, apiKey, ParameterType.HttpHeader);
-
                 request.AddBody(post);
             }


Attempting to fix the close operation

Attempting to fix the close operation

--- src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PopupWindow.cs
+++ src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PopupWindow.cs
@@ -43,6 +43,11 @@
         {
             OnClose.SafeInvoke(false);
             OnClose = null;
+
+            onClose = onClose ?? (b => {
+                Logger.Trace("Closing Window");
+                //Close();
+            });

             Logger.Trace("OpenView: {0}", popupViewType.ToString());

@@ -172,7 +177,6 @@
         {
             OnClose.SafeInvoke(result);
             OnClose = null;
-            Close();
             base.Finish(result);
         }


refactoring : put some common code in methods

--- StyleCopAutoFix/Program.cs
+++ StyleCopAutoFix/Program.cs
@@ -126,64 +126,69 @@
 			 select Path.Combine(directoryName, el.Attribute("Include").Value);
 		}

+		private static void AddEmptyLine(List<Tuple<int, string>> sourceCode, int lineNumber)
+		{
+			sourceCode.Insert(sourceCode.FindIndex(x => x.Item1 == lineNumber), new Tuple<int, string>(-1, string.Empty));
+		}
+
+		private static void RemoveEmptyLine(List<Tuple<int, string>> sourceCode, int lineNumber)
+		{
+			Debug.Assert(string.IsNullOrEmpty(sourceCode[sourceCode.FindIndex(x => x.Item1 == lineNumber)].Item2.Trim()));
+			sourceCode.RemoveAt(sourceCode.FindIndex(x => x.Item1 == lineNumber));
+		}
+
 		private static void FixStyleCopViolation(List<Tuple<int, string>> sourceCode, ViolationEventArgs e)
 		{
 			switch (e.Violation.Rule.CheckId)
 			{
 				//ElementsMustBeSeparatedByBlankLine
 				case "SA1516":
-					sourceCode.Insert(sourceCode.FindIndex(x => x.Item1 == e.LineNumber), new Tuple<int, string>(-1, string.Empty));
+					AddEmptyLine(sourceCode, e.LineNumber);
 					break;

 				//CodeMustNotContainMultipleBlankLinesInARow
 				case "SA1507":
-					Debug.Assert(string.IsNullOrEmpty(sourceCode[sourceCode.FindIndex(x => x.Item1 == e.LineNumber)].Item2.Trim()));
-					sourceCode.RemoveAt(sourceCode.FindIndex(x => x.Item1 == e.LineNumber));
+					RemoveEmptyLine(sourceCode, e.LineNumber);
 					break;

 				//ClosingCurlyBracketsMustNotBePrecededByBlankLine
 				case "SA1508":
-					Debug.Assert(string.IsNullOrEmpty(sourceCode[sourceCode.FindIndex(x => x.Item1 == e.LineNumber - 1)].Item2.Trim()));
-					sourceCode.RemoveAt(sourceCode.FindIndex(x => x.Item1 == e.LineNumber - 1));
+					RemoveEmptyLine(sourceCode, e.LineNumber - 1);
 					break;

 				//CodeMustNotContainBlankLinesAtEndOfFile
 				case "SA1518":
-					Debug.Assert(string.IsNullOrEmpty(sourceCode[sourceCode.FindIndex(x => x.Item1 == e.LineNumber)].Item2.Trim()));
-					sourceCode.RemoveAt(sourceCode.FindIndex(x => x.Item1 == e.LineNumber));
+					RemoveEmptyLine(sourceCode, e.LineNumber);
 					break;

 				//OpeningCurlyBracketsMustNotBeFollowedByBlankLine
 				case "SA1505":
-					Debug.Assert(string.IsNullOrEmpty(sourceCode[sourceCode.FindIndex(x => x.Item1 == e.LineNumber + 1)].Item2.Trim()));
-					sourceCode.RemoveAt(sourceCode.FindIndex(x => x.Item1 == e.LineNumber + 1));
+					RemoveEmptyLine(sourceCode, e.LineNumber+1);
 					break;

 				//ClosingCurlyBracketMustBeFollowedByBlankLine
 				case "SA1513":
-					sourceCode.Insert(sourceCode.FindIndex(x => x.Item1 == e.LineNumber + 1), new Tuple<int, string>(-1, string.Empty));
+					AddEmptyLine(sourceCode, e.LineNumber + 1);
 					break;

 				//SingleLineCommentsMustBePrecededByBlankLine
 				case "SA1515":
-					sourceCode.Insert(sourceCode.FindIndex(x => x.Item1 == e.LineNumber), new Tuple<int, string>(-1, string.Empty));
+					AddEmptyLine(sourceCode, e.LineNumber);
 					break;

 				//ElementDocumentationHeadersMustBePrecededByBlankLine
 				case "SA1514":
-					sourceCode.Insert(sourceCode.FindIndex(x => x.Item1 == e.LineNumber), new Tuple<int, string>(-1, string.Empty));
+					AddEmptyLine(sourceCode, e.LineNumber);
 					break;

 				//SingleLineCommentsMustNotBeFollowedByBlankLine
 				case "SA1512":
-					Debug.Assert(string.IsNullOrEmpty(sourceCode[sourceCode.FindIndex(x => x.Item1 == e.LineNumber + 1)].Item2.Trim()));
-					sourceCode.RemoveAt(sourceCode.FindIndex(x => x.Item1 == e.LineNumber + 1));
+					RemoveEmptyLine(sourceCode, e.LineNumber + 1);
 					break;

 				//CodeMustNotContainBlankLinesAtStartOfFile
 				case "SA1517":
-					Debug.Assert(string.IsNullOrEmpty(sourceCode[sourceCode.FindIndex(x => x.Item1 == e.LineNumber)].Item2.Trim()));
-					sourceCode.RemoveAt(sourceCode.FindIndex(x => x.Item1 == e.LineNumber));
+					RemoveEmptyLine(sourceCode, e.LineNumber);
 					break;

 				default:


Polar plots: Show numbers on angle axis

Polar plots: Show numbers on angle axis

--- Source/OxyPlot/Render/AngleAxisRenderer.cs
+++ Source/OxyPlot/Render/AngleAxisRenderer.cs
@@ -1,5 +1,7 @@
 namespace OxyPlot
 {
+    using System;
+
     public class AngleAxisRendererBase : AxisRendererBase
     {
         public AngleAxisRendererBase(IRenderContext rc, PlotModel plot)
@@ -17,6 +19,7 @@
             {
                 magnitudeAxis = axis.RelatedAxis;
             }
+            double eps = axis.MinorStep * 1e-3;

             if (axis.ShowMinorTicks)
             {
@@ -24,7 +27,7 @@

                 foreach (double xValue in MinorTickValues)
                 {
-                    if (xValue < axis.ActualMinimum || xValue > axis.ActualMaximum)
+                    if (xValue < axis.ActualMinimum - eps || xValue > axis.ActualMaximum + eps)
                     {
                         continue;
                     }
@@ -34,7 +37,7 @@
                         continue;
                     }

-                    var pt = magnitudeAxis.Transform(new DataPoint(magnitudeAxis.ActualMaximum, xValue), axis);
+                    var pt = magnitudeAxis.Transform(magnitudeAxis.ActualMaximum, xValue, axis);

                     if (MinorPen != null)
                     {
@@ -49,30 +52,54 @@

             foreach (double xValue in MajorTickValues)
             {
-                if (xValue < axis.ActualMinimum || xValue > axis.ActualMaximum)
+                if (xValue < axis.ActualMinimum - eps || xValue > axis.ActualMaximum + eps)
                 {
                     continue;
                 }

-                var pt = magnitudeAxis.Transform(new DataPoint(magnitudeAxis.ActualMaximum, xValue), axis);
+                var pt = magnitudeAxis.Transform(magnitudeAxis.ActualMaximum, xValue, axis);

                 if (MajorPen != null)
                 {
                     rc.DrawLine(axis.MidPoint.x, axis.MidPoint.y, pt.x, pt.y, MajorPen, false);
                 }

-                // RenderGridline(x, y + y0, x, y + y1, majorTickPen);
+            }

+            foreach (var value in MajorLabelValues)
+            {
+                // skip the last value (overlapping with the first)
+                if (value > axis.ActualMaximum - eps) continue;

-                // var pt = new ScreenPoint(x, istop ? y + y1 - TICK_DIST : y + y1 + TICK_DIST);
-                // string text = axis.FormatValue(xValue);
-                // double h = rc.MeasureText(text, axis.Font, axis.FontSize, axis.FontWeight).Height;
+                var pt = magnitudeAxis.Transform(magnitudeAxis.ActualMaximum, value, axis);
+                double angle = Math.Atan2(pt.y - axis.MidPoint.y, pt.x - axis.MidPoint.x) ;
+
+                // add some margin
+                pt.x += Math.Cos(angle) * axis.AxisTickToLabelDistance;
+                pt.y += Math.Sin(angle) * axis.AxisTickToLabelDistance;
+
+                // Convert to degrees
+                angle *= 180 / Math.PI;
+
+                string text = axis.FormatValue(value);

-                // rc.DrawText(pt, text, plot.TextColor,
-                // axis.Font, axis.FontSize, axis.FontWeight,
-                // axis.Angle,
-                // HorizontalTextAlign.Center, istop ? VerticalTextAlign.Bottom : VerticalTextAlign.Top);
-                // maxh = Math.Max(maxh, h);
+                var ha = HorizontalTextAlign.Left;
+                var va = VerticalTextAlign.Middle;
+
+                if (Math.Abs(Math.Abs(angle) - 90) < 10)
+                {
+                    ha = HorizontalTextAlign.Center;
+                    va = angle > 90 ? VerticalTextAlign.Top : VerticalTextAlign.Bottom;
+                    angle = 0;
+                }
+                else if (angle > 90 || angle < -90)
+                {
+                    angle -= 180;
+                    ha = HorizontalTextAlign.Right;
+                }
+                rc.DrawMathText(pt, text, Plot.TextColor,
+                                     axis.ActualFont, axis.FontSize, axis.FontWeight,
+                                     angle, ha, va, false);
             }
         }
     }


>implying i'd let you file:/// my passwd and all that jazz

--- Coremero/Coremero.Plugin.Playground/ImageSnatch.cs
+++ Coremero/Coremero.Plugin.Playground/ImageSnatch.cs
@@ -15,6 +15,11 @@
         [Command("geturl")]
         public async Task<IMessage> GetUrl(string url)
         {
+            if (!url.StartsWith("http"))
+            {
+                throw new ArgumentException("Not a HTTP/S URL. You trying to be sneaky?");
+            }
+
             using (HttpClient client = new HttpClient())
             {
                 var result = await client.GetAsync(url);


fixed nullreferenceexception in recurlyList impl

--- Library/List/RecurlyList.cs
+++ Library/List/RecurlyList.cs
@@ -114,7 +114,7 @@

         public IEnumerator<T> GetEnumerator()
         {
-            return Items.GetEnumerator();
+            return Items == null ? RecurlyList.Empty<T>().GetEnumerator() : Items.GetEnumerator();
         }

         IEnumerator IEnumerable.GetEnumerator()


Woops. My bad.

Woops. My bad.

--- TMDbLibTests/ClientTests.cs
+++ TMDbLibTests/ClientTests.cs
@@ -25,13 +25,13 @@
         [Fact]
         public void GetConfigSslTest()
         {
-            Config = new TestConfig(true);
+            TestConfig config = new TestConfig(true);

-            Assert.False(Config.Client.HasConfig);
-            Config.Client.GetConfig();
-            Assert.True(Config.Client.HasConfig);
+            Assert.False(config.Client.HasConfig);
+            config.Client.GetConfig();
+            Assert.True(config.Client.HasConfig);

-            Assert.NotNull(Config.Client.Config);
+            Assert.NotNull(config.Client.Config);
         }

         [Fact]


Rename Rule to Region, add the MasterRule setting

--- YGOSharp/Game.cs
+++ YGOSharp/Game.cs
@@ -17,7 +17,8 @@

         public Banlist Banlist { get; private set; }
         public int Mode { get; set; }
-        public int Rule { get; set; }
+        public int Region { get; set; }
+        public int MasterRule { get; set; }
         public int StartLp { get; set; }
         public int StartHand { get; set; }
         public int DrawCount { get; set; }
@@ -76,7 +77,13 @@
         {
             State = GameState.Lobby;
             Mode = Config.GetInt("Mode");
-            Rule = Config.GetInt("Rule");
+            Region = Config.GetInt("Rule", -1);
+            if (Region != -1)
+                Console.Error.WriteLine("'Rule' is deprecated, please use 'Region' instead.");
+            else
+                Region = Config.GetInt("Region");
+            MasterRule = Config.GetInt("MasterRule", 3);
+
             IsMatch = Mode == 1;
             IsTag = Mode == 2;
             CurrentPlayer = 0;
@@ -114,7 +121,8 @@
             uint lfList = packet.ReadUInt32();
             if (lfList >= 0 && lfList < BanlistManager.Banlists.Count)
                 Banlist = BanlistManager.Banlists[BanlistManager.GetIndex(lfList)];
-            Rule = packet.ReadByte();
+            Region = packet.ReadByte();
+            MasterRule = packet.ReadByte();
             Mode = packet.ReadByte();
             IsMatch = Mode == 1;
             IsTag = Mode == 2;
@@ -445,8 +453,8 @@

             if (ready)
             {
-                bool ocg = Rule == 0 || Rule == 2;
-                bool tcg = Rule == 1 || Rule == 2;
+                bool ocg = Region == 0 || Region == 2;
+                bool tcg = Region == 1 || Region == 2;
                 int result = 1;

                 if (player.Deck != null)
@@ -570,7 +578,7 @@
             if (player.Type != _startplayer)
                 return;

-            int opt = 0;
+            int opt = MasterRule << 16;
             if (EnablePriority)
                 opt += 0x08;
             if (NoShuffleDeck)
@@ -1122,7 +1130,7 @@
         {
             BinaryWriter join = GamePacketFactory.Create(StocMessage.JoinGame);
             join.Write(Banlist == null ? 0U : Banlist.Hash);
-            join.Write((byte)Rule);
+            join.Write((byte)Region);
             join.Write((byte)Mode);
             join.Write(EnablePriority);
             join.Write(NoCheckDeck);


Fix the UpdateData message again, into something better

--- YGOSharp/Game.cs
+++ YGOSharp/Game.cs
@@ -731,21 +731,24 @@

             MemoryStream ms = new MemoryStream(result);
             BinaryReader reader = new BinaryReader(ms);
-            BinaryWriter writer = new BinaryWriter(ms);
             for (int i = 0; i < 5; i++)
             {
                 int len = reader.ReadInt32();
                 if (len == 4)
                     continue;
-                long pos = ms.Position;
+
                 byte[] raw = reader.ReadBytes(len - 4);
-                if ((raw[11] & (int)CardPosition.FaceDown) != 0)
-                {
-                    ms.Position = pos + 4;
-                    writer.Write(new byte[len - 8]);
-                }
-            }
-            update.Write(result);
+                if ((raw[11] & (int) CardPosition.FaceDown) != 0)
+                {
+                    update.Write(8);
+                    update.Write(0);
+                }
+                else
+                {
+                    update.Write(len);
+                    update.Write(raw);
+                }
+            }

             if (observer == null)
             {
@@ -774,21 +777,24 @@

             MemoryStream ms = new MemoryStream(result);
             BinaryReader reader = new BinaryReader(ms);
-            BinaryWriter writer = new BinaryWriter(ms);
             for (int i = 0; i < 8; i++)
             {
                 int len = reader.ReadInt32();
                 if (len == 4)
                     continue;
-                long pos = ms.Position;
+
                 byte[] raw = reader.ReadBytes(len - 4);
                 if ((raw[11] & (int)CardPosition.FaceDown) != 0)
                 {
-                    ms.Position = pos + 4;
-                    writer.Write(new byte[len - 8]);
-                }
-            }
-            update.Write(result);
+                    update.Write(8);
+                    update.Write(0);
+                }
+                else
+                {
+                    update.Write(len);
+                    update.Write(raw);
+                }
+            }

             if (observer == null)
             {
@@ -817,21 +823,24 @@

             MemoryStream ms = new MemoryStream(result);
             BinaryReader reader = new BinaryReader(ms);
-            BinaryWriter writer = new BinaryWriter(ms);
             while (ms.Position < ms.Length)
             {
                 int len = reader.ReadInt32();
                 if (len == 4)
                     continue;
-                long pos = ms.Position;
+
                 byte[] raw = reader.ReadBytes(len - 4);
                 if (raw[len - 8] == 0)
                 {
-                    ms.Position = pos + 4;
-                    writer.Write(new byte[len - 8]);
-                }
-            }
-            update.Write(result);
+                    update.Write(8);
+                    update.Write(0);
+                }
+                else
+                {
+                    update.Write(len);
+                    update.Write(raw);
+                }
+            }

             if (observer == null)
                 SendToAllBut(update, player);


Prepend file size check on scan target blocks

--- Duplicati/Library/Main/Operation/RestoreHandler.cs
+++ Duplicati/Library/Main/Operation/RestoreHandler.cs
@@ -852,20 +852,39 @@
                                 return;

                             var currentfilelength = m_systemIO.FileLength(targetpath);
+                            var wasTruncated = false;
+
+                            // Adjust file length in overwrite mode if necessary (smaller is ok, will be extended during restore)
+                            // We do it before scanning for blocks. This allows full verification on files that only needs to
+                            // be truncated (i.e. forthwritten log files).
+                            if (!rename && currentfilelength > targetfilelength)
+                            {
+                                var currentAttr = m_systemIO.GetFileAttributes(targetpath);
+                                if ((currentAttr & System.IO.FileAttributes.ReadOnly) != 0) // clear readonly attribute
+                                {
+                                    if (options.Dryrun) result.AddDryrunMessage(string.Format("Would reset read-only attribute on file: {0}", targetpath));
+                                    else m_systemIO.SetFileAttributes(targetpath, currentAttr & ~System.IO.FileAttributes.ReadOnly);
+                                }
+                                if (options.Dryrun)
+                                    result.AddDryrunMessage(string.Format("Would truncate file '{0}' to length of {1:N0} bytes", targetpath, targetfilelength));
+                                else
+                                {
+                                    using (var file = m_systemIO.FileOpenWrite(targetpath))
+                                        file.SetLength(targetfilelength);
+                                    currentfilelength = targetfilelength;
+                                }
+                                wasTruncated = true;
+                            }

                             // If file size does not match and we have to rename on conflict,
-                            // the whole check can be skipped here and all blocks have to be restored anyway.
+                            // the whole scan can be skipped here because all blocks have to be restored anyway.
                             // For the other cases, we will check block and and file hashes and look for blocks
                             // to be restored and files that can already be verified.
                             if (!rename || currentfilelength == targetfilelength)
                             {
-                                // a file hash for verification will only be necessary if the file exact the
-                                // wanted size so we have a chance to already mark the file as data-verified.
-                                // Actually, we could also check larger files in overwrite mode that only have
-                                // to be cut (applies to files only being written forth).
-                                // But we will have to touch them to truncate, so we will trigger a separate
-                                // verification after the file size was adjusted.
-                                bool calcFileHash = (currentfilelength == targetfilelength);
+                                // a file hash for verification will only be necessary if the file has exactly
+                                // the wanted size so we have a chance to already mark the file as data-verified.
+                                bool calcFileHash = (currentfilelength == targetfilelength);
                                 if (calcFileHash) filehasher.Initialize();

                                 using (var file = m_systemIO.FileOpenRead(targetpath))
@@ -916,28 +935,13 @@
                                     fullfilehashmatch = (filekey == targetfilehash);
                                 }

-                                if (!rename) // Adjust file length and reset read-only (if set) attribute to overwrite
+                                if (!rename && !fullfilehashmatch && !wasTruncated) // Reset read-only attribute (if set) to overwrite
                                 {
                                     var currentAttr = m_systemIO.GetFileAttributes(targetpath);
                                     if ((currentAttr & System.IO.FileAttributes.ReadOnly) != 0)
-                                    {   // clear readonly attribute
-                                        if ((currentfilelength > targetfilelength) || !fullfilehashmatch)
-                                        {
-                                            if (options.Dryrun)
-                                                result.AddDryrunMessage(string.Format("Would reset read-only attribute on file: {0}", targetpath));
-                                            else
-                                                m_systemIO.SetFileAttributes(targetpath, currentAttr & ~System.IO.FileAttributes.ReadOnly);
-                                        }
-                                    }
-
-                                    // Adjust file length if necessary (smaller is ok, will be extended during restore)
-                                    if (currentfilelength > targetfilelength)
                                     {
-                                        if (options.Dryrun)
-                                            result.AddDryrunMessage(string.Format("Would truncate file '{0}' to length of {1:N0} bytes", targetpath, targetfilelength));
-                                        else
-                                            using (var file = m_systemIO.FileOpenWrite(targetpath))
-                                                file.SetLength(targetfilelength);
+                                        if (options.Dryrun) result.AddDryrunMessage(string.Format("Would reset read-only attribute on file: {0}", targetpath));
+                                        else m_systemIO.SetFileAttributes(targetpath, currentAttr & ~System.IO.FileAttributes.ReadOnly);
                                     }
                                 }

@@ -945,7 +949,7 @@
                                 {
                                     //TODO: Check metadata to trigger rename? If metadata changed, it will still be restored for the file in-place.
                                     blockmarker.SetFileDataVerified(targetfileid);
-                                    result.AddVerboseMessage("Target file exists and is correct version: {0}", targetpath);
+                                    result.AddVerboseMessage("Target file exists{1} and is correct version: {0}", targetpath, wasTruncated ? " (but was truncated)" : "");
                                     rename = false;
                                 }
                                 else if (rename)


port rev. 2185:
Simplify old multiply logic for GF

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS05/]$/ZXingNet/trunk;C73286

--- Source/lib/common/reedsolomon/GenericGF.cs
+++ Source/lib/common/reedsolomon/GenericGF.cs
@@ -1,34 +1,32 @@
-/*
- * Copyright 2007 ZXing authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+/*
+ * Copyright 2007 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */

 using System;

 namespace com.google.zxing.common.reedsolomon
 {
-   /**
-    *
This class contains utility methods for performing mathematical operations over
-    * the Galois Fields. Operations use a given primitive polynomial in calculations.

-    *
-    *
Throughout this package, elements of the GF are represented as an {@code int}
-    * for convenience and speed (but at the cost of memory).
-    *

-    *
-    * @author Sean Owen
-    * @author David Olivier
-    */
+   ///
+   ///
This class contains utility methods for performing mathematical operations over
+   /// the Galois Fields. Operations use a given primitive polynomial in calculations.

+   ///
Throughout this package, elements of the GF are represented as an {@code int}
+   /// for convenience and speed (but at the cost of memory).
+   ///

+   ///
+   /// <author>Sean Owen</author>
+   /// <author>David Olivier</author>
    public sealed class GenericGF
    {
       public static GenericGF AZTEC_DATA_12 = new GenericGF(0x1069, 4096); // x^12 + x^6 + x^5 + x^3 + 1
@@ -40,22 +38,22 @@
       public static GenericGF AZTEC_DATA_8 = DATA_MATRIX_FIELD_256;
       public static GenericGF MAXICODE_FIELD_64 = AZTEC_DATA_6;

-      private static int INITIALIZATION_THRESHOLD = 0;
+      private const int INITIALIZATION_THRESHOLD = 0;

       private int[] expTable;
       private int[] logTable;
       private GenericGFPoly zero;
       private GenericGFPoly one;
-      private int size;
-      private int primitive;
+      private readonly int size;
+      private readonly int primitive;
       private bool initialized = false;

-      /**
-       * Create a representation of GF(size) using the given primitive polynomial.
-       *
-       * @param primitive irreducible polynomial whose coefficients are represented by
-       *  the bits of an int, where the least-significant bit represents the constant
-       *  coefficient
+      /**
+       * Create a representation of GF(size) using the given primitive polynomial.
+       *
+       * @param primitive irreducible polynomial whose coefficients are represented by
+       *  the bits of an int, where the least-significant bit represents the constant
+       *  coefficient
        */
       public GenericGF(int primitive, int size)
       {
@@ -120,8 +118,8 @@

       }

-      /**
-       * @return the monomial representing coefficient * x^degree
+      /**
+       * @return the monomial representing coefficient * x^degree
        */
       internal GenericGFPoly buildMonomial(int degree, int coefficient)
       {
@@ -140,18 +138,18 @@
          return new GenericGFPoly(this, coefficients);
       }

-      /**
-       * Implements both addition and subtraction -- they are the same in GF(size).
-       *
-       * @return sum/difference of a and b
+      /**
+       * Implements both addition and subtraction -- they are the same in GF(size).
+       *
+       * @return sum/difference of a and b
        */
       static internal int addOrSubtract(int a, int b)
       {
          return a ^ b;
       }

-      /**
-       * @return 2 to the power of a in GF(size)
+      /**
+       * @return 2 to the power of a in GF(size)
        */
       internal int exp(int a)
       {
@@ -160,8 +158,8 @@
          return expTable[a];
       }

-      /**
-       * @return base 2 log of a in GF(size)
+      /**
+       * @return base 2 log of a in GF(size)
        */
       internal int log(int a)
       {
@@ -174,8 +172,8 @@
          return logTable[a];
       }

-      /**
-       * @return multiplicative inverse of a
+      /**
+       * @return multiplicative inverse of a
        */
       internal int inverse(int a)
       {
@@ -188,11 +186,12 @@
          return expTable[size - logTable[a] - 1];
       }

-      /**
-       * @param a
-       * @param b
-       * @return product of a and b in GF(size)
-       */
+      ///
+      /// Multiplies the specified a with b.
+      ///
+      /// <param name="a">A.</param>
+      /// <param name="b">The b.</param>
+      /// <returns>product of a and b in GF(size)</returns>
       internal int multiply(int a, int b)
       {
          checkInit();
@@ -201,14 +200,7 @@
          {
             return 0;
          }
-
-         if (a < 0 || b < 0 || a >= size || b >= size)
-         {
-            a++;
-         }
-
-         int logSum = logTable[a] + logTable[b];
-         return expTable[(logSum % size) + logSum / size];
+         return expTable[(logTable[a] + logTable[b]) % (size - 1)];
       }

       public int Size


Fix for initializing test resources.

Fix for initializing test resources.

--- Tests/Details/FileHelper.cs
+++ Tests/Details/FileHelper.cs
@@ -44,9 +44,9 @@
         /* ----------------------------------------------------------------- */
         protected FileHelper()
         {
-            var reader = AssemblyReader.Default;
-            Root = Path.GetDirectoryName(reader.Location);
-            _folder = GetType().FullName.Replace($"{reader.Product}.", "");
+            var asm = new AssemblyReader(Assembly.GetExecutingAssembly());
+            Root = Path.GetDirectoryName(asm.Location);
+            _folder = GetType().FullName.Replace($"{asm.Product}.", "");
             if (!Directory.Exists(Results)) Directory.CreateDirectory(Results);
             Clean(Results);
         }


[LowLevelGLPaint] _format variable was never used

--- LowLevelGLPaint/EAGLView.cs
+++ LowLevelGLPaint/EAGLView.cs
@@ -12,7 +12,6 @@
 namespace LowLevelGLPaint
 {
 	public class EAGLView : UIView {
-		All _format;
 		All _depthFormat;
 		bool _autoResize;
 		iPhoneOSGraphicsContext _context;
@@ -45,7 +44,7 @@
 				new NSObject [] {NSNumber.FromBoolean (true),           EAGLColorFormat.RGBA8},
 				new NSObject [] {EAGLDrawableProperty.RetainedBacking,  EAGLDrawableProperty.ColorFormat}
 			);
-			_format = format;
+
 			_depthFormat = depth;

 			_context = (iPhoneOSGraphicsContext) ((IGraphicsContextInternal) GraphicsContext.CurrentContext).Implementation;


QueryableTransformer review

QueryableTransformer review

--- Framework.Core/System/Linq/QueryableTransformer.cs
+++ Framework.Core/System/Linq/QueryableTransformer.cs
@@ -73,21 +73,17 @@
         {
             if (type.IsGenericInstanceOf(typeof(IQueryable<>)))
             {
-                type = typeof(IEnumerable<>).MakeGenericTypeFrom(type);
-            }
-            else if (type.IsGenericInstanceOf(typeof(IOrderedQueryable<>)))
-            {
-                type = typeof(IOrderedEnumerable<>).MakeGenericTypeFrom(type);
-            }
-            else if (type.IsGenericInstanceOf(typeof(Expression<>)))
-            {
-                type = type.GetGenericArguments()[0];
-            }
-            else if (type == typeof(IQueryable))
-            {
-                type = typeof(IEnumerable);
-            }
-            return type;
+                return typeof(IEnumerable<>).MakeGenericTypeFrom(type);
+            }
+            if (type.IsGenericInstanceOf(typeof(IOrderedQueryable<>)))
+            {
+                return typeof(IOrderedEnumerable<>).MakeGenericTypeFrom(type);
+            }
+            if (type.IsGenericInstanceOf(typeof(Expression<>)))
+            {
+                return type.GetGenericArguments()[0];
+            }
+            return type == typeof(IQueryable) ? typeof(IEnumerable) : type;
         }

         private static MethodInfo GetMatchingMethod(MethodInfo method, Type declaring)
@@ -123,7 +119,7 @@

         private static bool MethodMatch(MethodInfo candidate, MethodInfo method)
         {
-            if (candidate.Name != method.Name || !HasExtensionAttribute(candidate))
+            if (!string.Equals(candidate.Name, method.Name, StringComparison.Ordinal) || !HasExtensionAttribute(candidate))
             {
                 return false;
             }


Safety

Safety

--- Core/Simulation/Math/VectorRotation.cs
+++ Core/Simulation/Math/VectorRotation.cs
@@ -1,30 +1,38 @@
 using UnityEngine;
 using System.Collections;
 using System;
-[Serializable]
-public struct VectorRotation {

-    public VectorRotation (long cos, long sin) {
-        this._cos = cos;
-        this._sin = sin;
+namespace Lockstep
+{
+    [Serializable]
+    public struct VectorRotation
+    {
+
+        public VectorRotation(long cos, long sin)
+        {
+            this._cos = cos;
+            this._sin = sin;
+
+            #if UNITY_EDITOR
+            _angle = Mathf.Atan2 (sin,cos) * Mathf.Rad2Deg;
+            _timescaled = false;
+            #endif
+        }
+
+        [SerializeField]
+        private long _cos;
+        [SerializeField]
+        private long _sin;
+
+        public long Cos { get { return _cos; } }
+
+        public long Sin { get { return _sin; } }

         #if UNITY_EDITOR
-        _angle = 0;
-        _timescaled = false;
+        [SerializeField]
+        private double _angle;
+        [SerializeField]
+        private bool _timescaled;
         #endif
     }
-
-	[SerializeField]
-	private long _cos;
-	[SerializeField]
-	private long _sin;
-	public long Cos {get {return _cos;}}
-	public long Sin {get {return _sin;}}
-
-#if UNITY_EDITOR
-	[SerializeField]
-	private double _angle;
-	[SerializeField]
-	private bool _timescaled;
-#endif
-}
+}


row count fix

row count fix

--- DbShell.Driver.Sqlite/SqliteStorage.cs
+++ DbShell.Driver.Sqlite/SqliteStorage.cs
@@ -23,6 +23,7 @@
         private TableInfo _table;
         public const string TABLE_NAME = "_data";
         private int _rowCount;
+        private int _rowCountCommited;
         private SQLiteTransaction _tran;

         public SqliteStorage(TableInfo table)
@@ -56,7 +57,7 @@

         public int RowCount
         {
-            get { return _rowCount; }
+            get { return _rowCountCommited; }
         }

         public void Dispose()
@@ -193,6 +194,7 @@
             {
                 _tran.Commit();
                 _tran = null;
+                _rowCountCommited = _rowCount;
             }
         }


Refactoring methods for launching the miner executable

--- MultiMiner.Xgminer/Miner.cs
+++ MultiMiner.Xgminer/Miner.cs
@@ -17,17 +17,11 @@

         public List<Device> EnumerateDevices()
         {
-            List<Device> result = new List<Device>();

-            ProcessStartInfo startInfo = new ProcessStartInfo();
-            startInfo.FileName = minerConfiguration.ExecutablePath;
-            startInfo.WindowStyle = ProcessWindowStyle.Hidden;
-            startInfo.CreateNoWindow = true;
-            startInfo.Arguments = MinerParameter.EnumerateDevices;
-            startInfo.UseShellExecute = false;
-            startInfo.RedirectStandardOutput = true;
+            string arguments = MinerParameter.EnumerateDevices;
+            bool redirectOutput = true;

-            Process minerProcess = Process.Start(startInfo);
+            Process minerProcess = StartMinerProcess(arguments, redirectOutput);

             List<string> output = new List<string>();

@@ -37,6 +31,7 @@
                 output.Add(line);
             }

+            List<Device> result = new List<Device>();
             EnumerateDevicesParser.ParseTextForDevices(output, result);

             return result;
@@ -44,16 +39,13 @@

         public Process Launch()
         {
-            ProcessStartInfo startInfo = new ProcessStartInfo();
-            startInfo.FileName = minerConfiguration.ExecutablePath;
-            startInfo.WindowStyle = ProcessWindowStyle.Hidden;
-            startInfo.CreateNoWindow = true;
-            startInfo.UseShellExecute = false;
+            bool redirectOutput = false;
+            bool ensureProcessStarts = true;

             //otherwise cgminer output shows under *nix in the terminal
             //DONT do it for Windows though or cgminer will close after opening
             if (Environment.OSVersion.Platform == PlatformID.Unix)
-                startInfo.RedirectStandardOutput = true;
+                redirectOutput = true;

             string arguments = minerConfiguration.Arguments;

@@ -72,17 +64,32 @@
             if (minerConfiguration.ApiListen)
                 arguments = string.Format("{0} --api-listen --api-port {1} --api-allow W:127.0.0.1", arguments, minerConfiguration.ApiPort);

-            startInfo.Arguments = arguments;
-
-            Process process = StartMiningProcess(startInfo);
+            Process process = StartMinerProcess(arguments, redirectOutput, ensureProcessStarts);

             return process;
         }

-        private static Process StartMiningProcess(ProcessStartInfo startInfo)
+        private Process StartMinerProcess(string arguments, bool redirectOutput, bool ensureProcessStarts = false)
         {
+            ProcessStartInfo startInfo = new ProcessStartInfo();
+
+            startInfo.FileName = minerConfiguration.ExecutablePath;
+            startInfo.WindowStyle = ProcessWindowStyle.Hidden;
+            startInfo.CreateNoWindow = true;
+            startInfo.Arguments = arguments;
+            startInfo.UseShellExecute = false;
+            startInfo.RedirectStandardOutput = redirectOutput;
+
             Process process = Process.Start(startInfo);

+            if (ensureProcessStarts)
+                EnsureProcessStarts(process, startInfo);
+
+            return process;
+        }
+
+        private static void EnsureProcessStarts(Process process, ProcessStartInfo startInfo)
+        {
             //newest cgminer, paired with USB ASIC's, likes to die on startup a few times saying the specified device
             //wasn't detected, happens when starting/stopping mining on USB ASIC's repeatedly
             Thread.Sleep(2000);
@@ -99,8 +106,6 @@
                 Thread.Sleep(2000);
                 retries++;
             }
-
-            return process;
         }
     }
 }


adding a space before "..." makes it easier to copy/paste the path from command prompt window.

--- Tst/Tools/CheckP/Checker.cs
+++ Tst/Tools/CheckP/Checker.cs
@@ -312,7 +312,7 @@
             }

             //debudding only?
-            Console.WriteLine("Running test under {0}...", activeDirectory);
+            Console.WriteLine("Running test under {0} ...", activeDirectory);

             //If isAdd is true, remove old acceptor file
             //Note: this will break the logic of multiple acceptors;


Changed default value for <HTMLPage>

Changed default value for <HTMLPage>

--- TwitchBotLib/BotSettings.cs
+++ TwitchBotLib/BotSettings.cs
@@ -91,7 +91,7 @@
                 { "FTPAddress", new BotSetting() { DefaultValue = "ftp.dram55.com" } },
                 { "FTPUserName", new BotSetting() { DefaultValue = "username@dram55.com" } },
                 { "FTPPassword", new BotSetting() { DefaultValue = "" } },
-                { "HTMLPage", new BotSetting() { DefaultValue = "index.html" } },
+                { "HTMLPage", new BotSetting() { DefaultValue = "queue.html" } },
                 //Add other settings here
                 //{ "NewSettingName", new BotSetting() { DefaultValue = "New Setting Default Value" } },
             };


Rewrote IconEntry.Clone() to be safe for DependencyObjects.

--- UIconEdit.Core/IconEntry.cs
+++ UIconEdit.Core/IconEntry.cs
@@ -36,6 +36,7 @@
 using System.Drawing.Imaging;
 using System.Globalization;
 using System.Linq;
+using System.Reflection;
 using System.Runtime.InteropServices;
 using System.Windows;
 using System.Windows.Media;
@@ -450,6 +451,10 @@
             return g;
         }

+        private static readonly Dictionary<string, DependencyPropertyKey> propertyKeys =
+            typeof(IconEntry).GetFields(BindingFlags.Static | BindingFlags.NonPublic).Where(i => i.FieldType == typeof(DependencyPropertyKey))
+            .ToDictionary(k => k.Name, v => (DependencyPropertyKey)v.GetValue(null));
+
         /// <summary>
         /// Returns a duplicate of the current instance.
         /// </summary>
@@ -457,7 +462,23 @@
         public virtual IconEntry Clone()
         {
             IconEntry copy = (IconEntry)MemberwiseClone();
-            copy.BaseImage = BaseImage.Clone();
+
+            LocalValueEnumerator enumerator = GetLocalValueEnumerator();
+            while (enumerator.MoveNext())
+            {
+                LocalValueEntry curEntry = enumerator.Current;
+
+                object value = curEntry.Value;
+                ICloneable cloneable = value as ICloneable;
+                if (cloneable != null) value = cloneable.Clone();
+
+                DependencyPropertyKey key;
+                if (propertyKeys.TryGetValue(curEntry.Property.Name + "PropertyKey", out key))
+                    copy.SetValue(key, value);
+                else
+                    copy.SetValue(curEntry.Property, value);
+            }
+
             copy.File = null;
             return copy;
         }


Fixed a bug with resizing images.

Fixed a bug with resizing images.

--- UIconEdit.Core/IconEntry.cs
+++ UIconEdit.Core/IconEntry.cs
@@ -984,6 +984,7 @@
 #endif
         #endregion

+        #region IsPng
         /// <summary>
         /// Gets a value indicating whether the current instance will be saved as a PNG image within the icon structure by default.
         /// </summary>
@@ -1037,6 +1038,7 @@
             set { SetValue(IsPngProperty, value); }
         }
 #endif
+        #endregion

         /// <summary>
         /// Gets a key for the icon entry.
@@ -2120,7 +2122,7 @@
                 SetScalingFilter(g);
                 g.DrawImage(image, 0, 0, _width, _height);

-                BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
+                BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);

                 ColorValue[] pixels = new ColorValue[bmp.Width * bmp.Height];


Fix icons being repeated between apps, default to app.Icon

--- UWPHook/GamesWindow.xaml.cs
+++ UWPHook/GamesWindow.xaml.cs
@@ -284,7 +284,7 @@
         {
             SteamGridDbApi api = new SteamGridDbApi(Properties.Settings.Default.SteamGridDbApiKey);
             string tmpGridDirectory = Path.GetTempPath() + "UWPHook\\tmp_grid\\";
-            GameResponse[] games;
+            GameResponse[] games = null;

             try
             {
@@ -293,7 +293,6 @@
             catch (TaskCanceledException exception)
             {
                 Log.Error(exception.Message);
-                throw;
             }

             if (games != null)
@@ -389,6 +388,8 @@
                         gridImagesDownloadTasks.Add(DownloadTempGridImages(app.Name, exePath));
                     }
                 }
+
+                await Task.WhenAll(gridImagesDownloadTasks);

                 // Export the selected apps and the downloaded images to each user
                 // in the steam folder by modifying it's VDF file
@@ -415,29 +416,25 @@
                         {
                             foreach (var app in selected_apps)
                             {
-                                string icon = "";
-                                if (gridImagesDownloadTasks.Count > 0)
+                                try
                                 {
-                                    await Task.WhenAll(gridImagesDownloadTasks);
+
+                                    app.Icon = PersistAppIcon(app);
+                                    Log.Verbose("Defaulting to app.Icon for app " + app.Name);
+
+                                }
+                                catch (System.IO.IOException)
+                                {
+                                    Log.Verbose("Using backup icon for app " + app.Name);

                                     await Task.Run(() =>
                                     {
                                         string tmpGridDirectory = Path.GetTempPath() + "UWPHook\\tmp_grid\\";
                                         string[] images = Directory.GetFiles(tmpGridDirectory);

-                                        foreach (string image in images)
-                                        {
-                                            if (image.EndsWith("_logo.png"))
-                                            {
-                                                icon = PersistAppIcon(app, image);
-                                                break;
-                                            }
-                                        }
+                                        UInt64 gameId = GenerateSteamGridAppId(app.Name, exePath);
+                                        app.Icon = PersistAppIcon(app, tmpGridDirectory + gameId + "_logo.png");
                                     });
-                                }
-                                else
-                                {
-                                    icon = PersistAppIcon(app);
                                 }

                                 VDFEntry newApp = new VDFEntry()
@@ -448,7 +445,7 @@
                                     LaunchOptions = app.Aumid + " " + app.Executable,
                                     AllowDesktopConfig = 1,
                                     AllowOverlay = 1,
-                                    Icon = icon,
+                                    Icon = app.Icon,
                                     Index = shortcuts.Length,
                                     IsHidden = 0,
                                     OpenVR = 0,
@@ -537,7 +534,6 @@
             // If we do not have an specific icon to copy, copy app.icon, if we do, copy the specified icon
             string icon_to_copy = String.IsNullOrEmpty(forcedIcon) ? app.Icon : forcedIcon;

-
             if (!Directory.Exists(icons_path))
             {
                 Directory.CreateDirectory(icons_path);
@@ -548,13 +544,10 @@
             {
                 File.Copy(icon_to_copy, dest_file, true);
             }
-            catch (System.IO.IOException)
-            {
-                // This file is most likely encrypted or does not exist, so we return the app.Icon itself
-                // but this app is now prone to #90 unfortunately, if we return String.empty, Steam will default
-                // to UWPHook's icon
-                Log.Warning("File could not be copied: " + icon_to_copy);
-                dest_file = app.Icon;
+            catch (System.IO.IOException e)
+            {
+                Log.Warning(e, "Could not copy icon " + app.Icon);
+                throw e;
             }

             return dest_file;


fix bug

fix bug

--- Utils/Client/TokenHelper.cs
+++ Utils/Client/TokenHelper.cs
@@ -58,6 +58,11 @@
         public string appId { get; set; }

         /// <summary>
+        /// 用户ID
+        /// </summary>
+        public string userId { get; set; }
+
+        /// <summary>
         /// 登录账号
         /// </summary>
         public string account { get; set; }
@@ -87,8 +92,7 @@
             var key = Util.Hash(sign + code);
             var url = $"{baseServer}/authapi/v1.0/{account}/tokens?signature={key}&tenantid={tenantId}&appid={appId}&deptid={deptId}";
             var request = new HttpRequest();
-            success = request.Send(url);
-            if (!success)
+            if (!request.Send(url))
             {
                 Messages.ShowError(request.message);
                 return;
@@ -101,11 +105,14 @@
                 return;
             }

-            time = DateTime.Now;
             accessToken = result.data.accessToken;
             refreshToken = result.data.refreshToken;
             expiryTime = result.data.expiryTime;
             failureTime = result.data.failureTime;
+
+            time = DateTime.Now;
+            userId = Util.Base64ToAccessToken(accessToken).userId;
+            success = true;
         }

         /// <summary>
@@ -115,8 +122,7 @@
         {
             var url = $"{baseServer}/authapi/v1.0/tokens";
             var request = new HttpRequest(token);
-            success = request.Send(url, null, RequestMethod.DELETE);
-            if (success) return;
+            if (request.Send(url, null, RequestMethod.DELETE)) return;

             Messages.ShowError(request.message);
         }
@@ -129,8 +135,7 @@
         {
             var url = $"{baseServer}/authapi/v1.0/{account}/codes";
             var request = new HttpRequest();
-            success = request.Send(url);
-            if (!success)
+            if (!request.Send(url))
             {
                 Messages.ShowError(request.message);
                 return null;
@@ -169,11 +174,13 @@
                 return;
             }

-            time = DateTime.Now;
             accessToken = result.data.accessToken;
             refreshToken = result.data.refreshToken;
             expiryTime = result.data.expiryTime;
             failureTime = result.data.failureTime;
+
+            time = DateTime.Now;
+            success = true;
         }
     }
 }


Added the capability to add OnMessageAccept delegate within Notify Method, allowing you to play custom sound when the user accepts a message you sent

--- Utils/NotificationSystem.cs
+++ Utils/NotificationSystem.cs
@@ -364,14 +364,22 @@
 		#region Public functions

 		/// <summary>
-		/// Shows a simple message with an accept button which only closes the window.
+		/// Shows a simple message with an accept button which if specified execute the OnMessageAccept delegate passed, and closes the window.
 		/// </summary>
-		public void NotifyMessage (string message, Sprite icon = null){
+		public void NotifyMessage (string message, Sprite icon = null, OnMessageAcceptDelegate onAccept = null){

 			// Disable progress mode if enabled
 			MessageProgressMode = false;

 			OnMessageAccept = Terminate;
+            OnMessageAccept = delegate {
+
+                if (onAccept != null)
+                    onAccept();
+
+                Terminate();
+            };
+
 			OnMessageDecline = null;

 			MessageIcon = icon;


#49: add Telegram link

#49: add Telegram link

--- Views/Home/Resources.cshtml
+++ Views/Home/Resources.cshtml
@@ -6,6 +6,11 @@

              GitHub organization
+
+

+

+
+             XMPP conference

@@ -29,8 +34,8 @@

-
-             XMPP conference
+
+             Telegram group