Add content type management methods

Add content type management methods

--- Contentful.Core/ContentfulManagementClient.cs
+++ Contentful.Core/ContentfulManagementClient.cs
@@ -212,7 +212,7 @@
         /// </summary>
         /// <param name="spaceId">The id of the space to create the content type in. Will default to the one set when creating the client.</param>
         /// <returns>An <see cref="IEnumerable{T}"/> of <see cref="ContentType"/>.</returns>
-        public async Task<IEnumerable<ContentType>> GetContentTypes(string spaceId = null)
+        public async Task<IEnumerable<ContentType>> GetContentTypesAsync(string spaceId = null)
         {
             var res = await _httpClient.GetAsync($"{_baseUrl}{spaceId ?? _options.SpaceId}/content_types");

@@ -234,7 +234,7 @@
         /// <param name="version">The last version known of the content type. Must be set for existing content types. Should be null if one is created.</param>
         /// <returns>The created or updated <see cref="ContentType"/>.</returns>
         /// <exception cref="ArgumentException">Thrown if the id of the content type is not set.</exception>
-        public async Task<ContentType> CreateOrUpdateContentType(ContentType contentType, string spaceId = null, int? version = null)
+        public async Task<ContentType> CreateOrUpdateContentTypeAsync(ContentType contentType, string spaceId = null, int? version = null)
         {
             if(contentType.SystemProperties?.Id == null)
             {
@@ -267,6 +267,33 @@
             var json = JObject.Parse(await res.Content.ReadAsStringAsync());

             return json.ToObject<ContentType>();
+        }
+
+        /// <summary>
+        /// Gets a <see cref="ContentType"/> by the specified ID.
+        /// </summary>
+        /// <param name="contentTypeId">The ID of the content type.</param>
+        /// <returns>The response from the API serialized into a <see cref="ContentType"/>.</returns>
+        /// <exception cref="ContentfulException">There was an error when communicating with the Contentful API.</exception>
+        /// <exception cref="ArgumentException">The <param name="contentTypeId">contentTypeId</param> parameter was null or empty</exception>
+        public async Task<ContentType> GetContentTypeAsync(string contentTypeId)
+        {
+            if (string.IsNullOrEmpty(contentTypeId))
+            {
+                throw new ArgumentException(nameof(contentTypeId));
+            }
+
+            var res = await _httpClient.GetAsync($"{_baseUrl}{_options.SpaceId}/content_types/{contentTypeId}");
+
+            if (!res.IsSuccessStatusCode)
+            {
+                await CreateExceptionForFailedRequestAsync(res);
+            }
+
+            var jsonObject = JObject.Parse(await res.Content.ReadAsStringAsync());
+            var contentType = jsonObject.ToObject<ContentType>();
+
+            return contentType;
         }

         private StringContent ConvertObjectToJsonStringContent(object ob)


Fix baseurl for management client

Fix baseurl for management client

--- Contentful.Core/ContentfulManagementClient.cs
+++ Contentful.Core/ContentfulManagementClient.cs
@@ -15,7 +15,7 @@
     public class ContentfulManagementClient
     {
         private readonly HttpClient _httpClient;
-        private readonly string _baseUrl = "https://cdn.contentful.com/spaces/";
+        private readonly string _baseUrl = "https://api.contentful.com/spaces/";
         private readonly ContentfulOptions _options;

         /// <summary>


фикс путей начинающихся на /

фикс путей начинающихся на /

--- Core/ActionExecutors/GetScreenShotExecutor.cs
+++ Core/ActionExecutors/GetScreenShotExecutor.cs
@@ -59,6 +59,8 @@
             if (act.SaveFileParam?.SaveFile == true)
             {
                 var param = act.SaveFileParam;
+                if (param.Path?.Length > 1 && (param.Path[0] == '/' || param.Path[0] == '\\'))
+                    param.Path = param.Path.Substring(1, param.Path.Length - 1);
                 DirectoryHelper.CreateDirectory(param.Path);
                 ImageFormat imgF;
                 switch (param.Type)


Rename DbConnection.Execute to DbConnection.Fetch to resolve overload resolution.

--- Ctl.Core/Extensions/DbConnectionExtensions.cs
+++ Ctl.Core/Extensions/DbConnectionExtensions.cs
@@ -90,7 +90,7 @@
         /// <summary>
         /// Executes a command.
         /// </summary>
-        public static List<TRet> Execute<TRet>(this DbConnection con, string commandText, CommandType commandType)
+        public static List<TRet> Fetch<TRet>(this DbConnection con, string commandText, CommandType commandType)
         {
             using (DbCommand cmd = con.CreateCommand(commandText, commandType))
             {
@@ -101,7 +101,7 @@
         /// <summary>
         /// Executes a command.
         /// </summary>
-        public static async Task<List<TRet>> ExecuteAsync<TRet>(this DbConnection con, string commandText, CommandType commandType, CancellationToken token)
+        public static async Task<List<TRet>> FetchAsync<TRet>(this DbConnection con, string commandText, CommandType commandType, CancellationToken token)
         {
             using (DbCommand cmd = con.CreateCommand(commandText, commandType))
             {
@@ -112,7 +112,7 @@
         /// <summary>
         /// Executes a parameterized command.
         /// </summary>
-        public static List<TRet> Execute<TRet, TParameters>(this DbConnection con, string commandText, CommandType commandType, TParameters parameters)
+        public static List<TRet> Fetch<TRet, TParameters>(this DbConnection con, string commandText, CommandType commandType, TParameters parameters)
         {
             using (DbCommand cmd = con.CreateCommand(commandText, commandType, parameters))
             {
@@ -123,7 +123,7 @@
         /// <summary>
         /// Executes a parameterized command.
         /// </summary>
-        public static async Task<List<TRet>> ExecuteAsync<TRet, TParameters>(this DbConnection con, string commandText, CommandType commandType, CancellationToken token, TParameters parameters)
+        public static async Task<List<TRet>> FetchAsync<TRet, TParameters>(this DbConnection con, string commandText, CommandType commandType, CancellationToken token, TParameters parameters)
         {
             using (DbCommand cmd = con.CreateCommand(commandText, commandType, parameters))
             {


origin

origin

--- StandardContainer/StandardContainer.cs
+++ StandardContainer/StandardContainer.cs
@@ -14,6 +14,7 @@

 namespace StandardContainer
 {
+
     [AttributeUsage(AttributeTargets.Constructor)]
     public sealed class ContainerConstructorAttribute : Attribute { }


keep old message text when editing lfg

keep old message text when editing lfg

--- TCC.Core/Windows/LfgListWindow.xaml.cs
+++ TCC.Core/Windows/LfgListWindow.xaml.cs
@@ -145,6 +145,7 @@
             {
                 NewMessageGrid.LayoutTransform.BeginAnimation(ScaleTransform.ScaleYProperty, new DoubleAnimation(1, TimeSpan.FromMilliseconds(150)) { EasingFunction = new QuadraticEase() });
                 NewMessageTextBox.Focus();
+                VM.NewMessage = VM.MyLfg != null ? VM.MyLfg.Message : "";
                 VM.Creating = true;
             }
             else if (VM.Creating && !string.IsNullOrEmpty(VM.NewMessage))
@@ -152,13 +153,15 @@
                 NewMessageGrid.LayoutTransform.BeginAnimation(ScaleTransform.ScaleYProperty, new DoubleAnimation(0, TimeSpan.FromMilliseconds(150)) { EasingFunction = new QuadraticEase() });
                 Proxy.RegisterLfg(VM.NewMessage, RaidSwitch.IsOn);
                 VM.Creating = false;
-                VM.NewMessage = "";
+                //VM.NewMessage = "";
+                VM.NewMessage = VM.MyLfg != null ? VM.MyLfg.Message : "";
                 Task.Delay(200).ContinueWith(t => Proxy.RequestLfgList());
             }
             else
             {
                 NewMessageGrid.LayoutTransform.BeginAnimation(ScaleTransform.ScaleYProperty, new DoubleAnimation(0, TimeSpan.FromMilliseconds(150)) { EasingFunction = new QuadraticEase() });
-                VM.NewMessage = "";
+                //VM.NewMessage = "";
+                VM.NewMessage = VM.MyLfg != null ? VM.MyLfg.Message : "";
                 VM.Creating = false;
             }
         }


Single can never return null. Added TODO about error handling.

--- TestBot/Handlers/FogBugzCaseHandler.cs
+++ TestBot/Handlers/FogBugzCaseHandler.cs
@@ -44,13 +44,11 @@
 			var http = new HttpClient();
 			http.DefaultRequestHeaders.ExpectContinue = false;

+			// TODO: Error handling.
 			var xml = XDocument.Load(new Uri(url, $"api.asp?token={UrlEncode(token)}&cmd=search&q={UrlEncode(caseNumber)}&cols=sTitle,sStatus,sPersonAssignedTo,sLatestTextSummary,sProject,sArea,ixBugOriginal,sFixFor,sCategory").AbsoluteUri);

 			var caseXml = xml.Descendants("case").Single();
-
-			if (caseXml == null)
-				return null;
-
+
 			var parent = int.Parse(caseXml.Element("ixBugOriginal").Value);
 			return new Case
 			{


Move media keys after Mouse buttons in InputKey enum inline with osuTK Key enum changes

--- osu.Framework/Input/Bindings/InputKey.cs
+++ osu.Framework/Input/Bindings/InputKey.cs
@@ -760,6 +760,40 @@
         /// </summary>
         MouseWheelDown = 146,

+        /// The media mute key.
+        /// </summary>
+        Mute = 256,
+
+        /// <summary>
+        /// The media play / pause key.
+        /// </summary>
+        PlayPause,
+
+        /// <summary>
+        /// The media stop key.
+        /// </summary>
+        Stop,
+
+        /// <summary>
+        /// The media volume up key.
+        /// </summary>
+        VolumeUp,
+
+        /// <summary>
+        /// The media volume down key.
+        /// </summary>
+        VolumeDown,
+
+        /// <summary>
+        /// The media previous key.
+        /// </summary>
+        TrackPrevious,
+
+        /// <summary>
+        /// The media next key.
+        /// </summary>
+        TrackNext,
+
         /// <summary>
         /// Indicates the first available joystick button.
         /// </summary>


Add icon for random mod

Add icon for random mod

--- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs
+++ osu.Game.Rulesets.Mania/Mods/ManiaMod.cs
@@ -90,12 +90,14 @@
     {
         public override string Name => "Random";
         public override string ShortenedName => "RD";
+        public override FontAwesome Icon => FontAwesome.fa_osu_dice;
         public override string Description => @"Shuffle around the notes!";
         public override double ScoreMultiplier => 1;

         public void ApplyToRulesetContainer(RulesetContainer<ManiaHitObject> rulesetContainer)
         {
             int availableColumns = ((ManiaRulesetContainer)rulesetContainer).AvailableColumns;
+
             var shuffledColumns = Enumerable.Range(0, availableColumns).OrderBy(item => RNG.Next()).ToList();

             rulesetContainer.Objects.OfType<ManiaHitObject>().ForEach(h => h.Column = shuffledColumns[h.Column]);


Add equals (=) query operator variants

Add equals (=) query operator variants

--- osu.Game/Screens/Select/FilterControl.cs
+++ osu.Game/Screens/Select/FilterControl.cs
@@ -183,7 +183,7 @@
         private void updateCriteria() => FilterChanged?.Invoke(CreateCriteria());

         private static readonly Regex query_syntax_regex = new Regex(
-            @"\b(?<key>stars|ar|dr|cs|divisor|length|objects|bpm|status)(?<op>[:><]+)(?<value>\S*)",
+            @"\b(?<key>stars|ar|dr|cs|divisor|length|objects|bpm|status)(?<op>[=:><]+)(?<value>\S*)",
             RegexOptions.Compiled | RegexOptions.IgnoreCase);

         private void applyQueries(FilterCriteria criteria, ref string query)
@@ -246,6 +246,7 @@
                 default:
                     return;

+                case "=":
                 case ":":
                     range.IsInclusive = true;
                     range.Min = value - equalityToleration;
@@ -257,6 +258,7 @@
                     range.Min = value;
                     break;

+                case ">=":
                 case ">:":
                     range.IsInclusive = true;
                     range.Min = value;
@@ -267,6 +269,7 @@
                     range.Max = value;
                     break;

+                case "<=":
                 case "<:":
                     range.IsInclusive = true;
                     range.Max = value;


Set the ruleset bindable value at the BDL for its subclasses usages

There are test scenes using current value of ruleset bindable on their BDL (example in TestSceneSliderSnaking's BDL)

--- osu.Game/Tests/Visual/PlayerTestScene.cs
+++ osu.Game/Tests/Visual/PlayerTestScene.cs
@@ -34,6 +34,8 @@
         [BackgroundDependencyLoader]
         private void load()
         {
+            Ruleset.Value = ruleset.RulesetInfo;
+
             Dependencies.Cache(LocalConfig = new OsuConfigManager(LocalStorage));
             LocalConfig.GetBindable<double>(OsuSetting.DimLevel).Value = 1.0;
         }
@@ -67,7 +69,6 @@
             var beatmap = CreateBeatmap(ruleset.RulesetInfo);

             Beatmap.Value = CreateWorkingBeatmap(beatmap);
-            Ruleset.Value = ruleset.RulesetInfo;
             SelectedMods.Value = Array.Empty<Mod>();

             if (!AllowFail)


Remove redundant string interpolation

Remove redundant string interpolation

--- osu.Game/Users/Drawables/DrawableFlag.cs
+++ osu.Game/Users/Drawables/DrawableFlag.cs
@@ -26,7 +26,7 @@
             if (ts == null)
                 throw new ArgumentNullException(nameof(ts));

-            Texture = ts.Get($@"Flags/{country?.FlagName ?? @"__"}") ?? ts.Get($@"Flags/__");
+            Texture = ts.Get($@"Flags/{country?.FlagName ?? @"__"}") ?? ts.Get(@"Flags/__");
         }
     }
 }


dump tmp texture content to image files.

--- Demos/DepthPeeling.DualPeeling/PeelingNode.cs
+++ Demos/DepthPeeling.DualPeeling/PeelingNode.cs
@@ -47,6 +47,13 @@
             set { renderStep = value; }
         }

+        private bool dump = true;
+        public bool Dump
+        {
+            get { return dump; }
+            set { dump = value; }
+        }
+
         #region IRenderable 成员

         public ThreeFlags EnableRendering { get { return ThreeFlags.BeforeChildren; } set { } }
@@ -82,6 +89,8 @@

                 Framebuffer fbo = this.resources.peelingSingleFBO;
                 fbo.Bind();
+
+                bool dump = this.Dump;

                 {
                     // 1. Initialize Min-Max Depth Buffer
@@ -91,12 +100,27 @@
                     fbo.SetDrawBuffers(GL.GL_COLOR_ATTACHMENT0 + 1, GL.GL_COLOR_ATTACHMENT0 + 2);
                     GL.Instance.ClearColor(0, 0, 0, 0);
                     GL.Instance.Clear(GL.GL_COLOR_BUFFER_BIT);
+                    if (dump)
+                    {
+                        var image = this.resources.frontBlenderTextures[0].GetImage(width, height);
+                        image.Save(string.Format("0.init.0.frontBlenders[0].png"));
+                    }
                     // Render target 0 stores (-minDepth, maxDepth, alphaMultiplier)
                     fbo.SetDrawBuffer(GL.GL_COLOR_ATTACHMENT0);
                     GL.Instance.ClearColor(-MAX_DEPTH, -MAX_DEPTH, 0, 0);
                     GL.Instance.Clear(GL.GL_COLOR_BUFFER_BIT);
+                    if (dump)
+                    {
+                        var image = this.resources.depthTextures[0].GetImage(width, height);
+                        image.Save(string.Format("0.init.1.depths[0].png"));
+                    }
                     glBlendEquation(GL.GL_MAX); //this.blendMax.On();
                     this.DrawScene(arg, CubeNode.RenderMode.Init);
+                    if (dump)
+                    {
+                        var image = this.resources.depthTextures[0].GetImage(width, height);
+                        image.Save(string.Format("0.init.2.depths[0].png"));
+                    }
                 }
                 uint currId = 0;
                 {
@@ -107,6 +131,11 @@
                     fbo.SetDrawBuffer(GL.GL_COLOR_ATTACHMENT0 + 6);
                     GL.Instance.ClearColor(clearColor[0], clearColor[1], clearColor[2], 0);
                     GL.Instance.Clear(GL.GL_COLOR_BUFFER_BIT);
+                    if (dump)
+                    {
+                        var image = this.resources.backBlenderTexture.GetImage(width, height);
+                        image.Save(string.Format("0.init.2.backBlender.png"));
+                    }

                     const uint g_numPasses = 4;

@@ -132,6 +161,21 @@
                         glBlendEquation(GL.GL_MAX);

                         this.DrawScene(arg, CubeNode.RenderMode.Init, this.resources.depthTextures[prevId], this.resources.frontBlenderTextures[prevId]);
+                        if (dump)
+                        {
+                            var image = this.resources.depthTextures[bufId / 3].GetImage(width, height);
+                            image.Save(string.Format("1.[{0}].1.depths[{1}].png", pass, bufId / 3));
+                        }
+                        if (dump)
+                        {
+                            var image = this.resources.frontBlenderTextures[bufId / 3].GetImage(width, height);
+                            image.Save(string.Format("1.[{0}].2.frontBlenders[{1}].png", pass, bufId / 3));
+                        }
+                        if (dump)
+                        {
+                            var image = this.resources.backTmpTextures[bufId / 3].GetImage(width, height);
+                            image.Save(string.Format("1.[{0}].3.backTmps[{1}].png", pass, bufId / 3));
+                        }

                         // TODO: not finished yet.
                         // Full screen pass to alpha-blend the back color
@@ -146,6 +190,11 @@
                         }

                         this.DrawFullScreenQuad(arg, QuadNode.RenderMode.Blend, this.resources.backTmpTextures[currId]);
+                        if (dump)
+                        {
+                            var image = this.resources.backBlenderTexture.GetImage(width, height);
+                            image.Save(string.Format("1.[{0}].4.backBlender.png", pass));
+                        }

                         //CHECK_GL_ERRORS;

@@ -171,6 +220,9 @@
                         this.resources.frontBlenderTextures[currId],
                         this.resources.backBlenderTexture);
                 }
+
+                this.Dump = false;
+
                 // restore clear color.
                 GL.Instance.ClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
             }


update

update

--- Demos/OrderIndependentTransparency/OITNode.cs
+++ Demos/OrderIndependentTransparency/OITNode.cs
@@ -60,7 +60,7 @@
         private int canvasHeight = 0;
         private Texture headTexture;
         private PixelUnpackBuffer headClearBuffer;
-        private AtomicCounterBuffer atomicCountBuffer;
+        private AtomicCounterBuffer atomicCounterBuffer;
         private Texture linkedListTexture;
         private DepthTestState depthTestState;
         private CullFaceState cullFaceState;
@@ -136,8 +136,18 @@
                 // another way to do this:
                 //uint data = 1;
                 //AtomicCounterBuffer buffer = data.GenAtomicCounterBuffer(BufferUsage.DynamicCopy);
-                this.atomicCountBuffer = buffer;
-            }
+                // Reset atomic counter
+                IntPtr data = buffer.MapBuffer(MapBufferAccess.WriteOnly);
+                unsafe
+                {
+                    var array = (uint*)data.ToPointer();
+                    array[0] = 0;
+                }
+                buffer.UnmapBuffer();
+
+                this.atomicCounterBuffer = buffer;
+            }
+
             {
                 this.depthTestState = new DepthTestState(false);
                 this.cullFaceState = new CullFaceState(false);
@@ -158,16 +168,6 @@
             {
                 this.cullFaceState.On();
                 this.depthTestState.On();
-            }
-            {
-                // Reset atomic counter
-                IntPtr data = this.atomicCountBuffer.MapBuffer(MapBufferAccess.WriteOnly);
-                unsafe
-                {
-                    var array = (uint*)data.ToPointer();
-                    array[0] = 0;
-                }
-                this.atomicCountBuffer.UnmapBuffer();
             }
             {
                 // Clear head-pointer image


AssemblyInfo

AssemblyInfo

--- DiscoverValidation/Properties/AssemblyInfo.cs
+++ DiscoverValidation/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.1.1.0")]
-[assembly: AssemblyFileVersion("1.1.1.0")]
+[assembly: AssemblyVersion("1.1.2.0")]
+[assembly: AssemblyFileVersion("1.1.2.0")]


Changed Update.cs to not deactivate extensions after they are updated. We will wait until the app restarts.

--- DotSpatial.Plugins.ExtensionManager/Update.cs
+++ DotSpatial.Plugins.ExtensionManager/Update.cs
@@ -225,7 +225,8 @@
             if (pack == null) return;

             // deactivate the old version and mark for uninstall
-            var extension = App.EnsureDeactivated(pack.Id);
+            //var extension = App.EnsureDeactivated(pack.Id);
+            var extension = App.GetExtension(pack.Id);

             if (IsPackageInstalled(pack))
             {
@@ -242,6 +243,7 @@

             // get new version
             packages.Update(pack);
+            App.ProgressHandler.Progress(null, 0, "");
         }

         //Determines if a package has a local version that can be deleted and is out of date.


Add warning if user tries to move multiple legs to the same place

--- DynamixelServo.Quadruped/QuadrupedIkDriver.cs
+++ DynamixelServo.Quadruped/QuadrupedIkDriver.cs
@@ -289,21 +289,25 @@

         public void MoveLeg(Vector3 target, LegFlags legs = LegFlags.All)
         {
-            if ((legs & LegFlags.LeftFront) != 0)
+            if (legs == LegFlags.LeftFront)
             {
                 MoveLeftFrontLeg(target);
             }
-            if ((legs & LegFlags.RightFront) != 0)
+            if (legs == LegFlags.RightFront)
             {
                 MoveRightFrontLeg(target);
             }
-            if ((legs & LegFlags.LeftRear) != 0)
+            if (legs == LegFlags.LeftRear)
             {
                 MoveLeftRearLeg(target);
             }
-            if ((legs & LegFlags.RightRear) != 0)
+            if (legs == LegFlags.RightRear)
             {
                 MoveRightRearLeg(target);
+            }
+            else
+            {
+                throw new InvalidOperationException("Moveing multiple legs to the same position is not advisable");
             }
         }


Log entries with no event name

Log entries with no event name

--- EDDiscovery/EliteDangerous/EDJournalReader.cs
+++ EDDiscovery/EliteDangerous/EDJournalReader.cs
@@ -82,6 +82,12 @@
                 {
                     return null;
                 }
+            }
+
+            if (je == null)
+            {
+                System.Diagnostics.Trace.WriteLine($"Bad journal line:\n{line}");
+                return null;
             }

             if (je.EventTypeID == JournalTypeEnum.Fileheader)


Internal visibility for Moq

Internal visibility for Moq

--- Espera/Espera.Core/Properties/AssemblyInfo.cs
+++ Espera/Espera.Core/Properties/AssemblyInfo.cs
@@ -14,6 +14,7 @@
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 [assembly: InternalsVisibleTo("Espera.Core.Tests")]
+[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] // Moq
 // Setting ComVisible to false makes the types in this assembly not visible
 // to COM components.  If you need to access a type in this assembly from
 // COM, set the ComVisible attribute to true on that type.


hide internal fxp method

hide internal fxp method

--- FluentFTP/Client/FtpClient_FXPFileTransfer.cs
+++ FluentFTP/Client/FtpClient_FXPFileTransfer.cs
@@ -166,7 +166,7 @@
 		/// <summary>
 		/// Transfers a file from the source FTP Server to the destination FTP Server via the FXP protocol
 		/// </summary>
-		public bool TransferFileFXPInternal(string sourcePath, FtpClient remoteClient, string remotePath, bool createRemoteDir, FtpRemoteExists existsMode,
+		private bool TransferFileFXPInternal(string sourcePath, FtpClient remoteClient, string remotePath, bool createRemoteDir, FtpRemoteExists existsMode,

 			Action<FtpProgress> progress, FtpProgress metaProgress) {
 			FtpReply reply;


Moved AbstractPlotRenderer to correct namespace

--- GitSharp.Core/RevPlot/AbstractPlotRenderer.cs
+++ GitSharp.Core/RevPlot/AbstractPlotRenderer.cs
@@ -40,201 +40,204 @@
 using GitSharp.Core.RevPlot;
 using GitSharp.Core.RevWalk;

-/// <summary>
-/// Basic commit graph renderer for graphical user interfaces.
-/// <para>
-/// Lanes are drawn as columns left-to-right in the graph, and the commit short
-/// message is drawn to the right of the lane lines for this cell. It is assumed
-/// that the commits are being drawn as rows of some sort of table.
-/// </para>
-/// <para>
-/// Client applications can subclass this implementation to provide the necessary
-/// drawing primitives required to display a commit graph. Most of the graph
-/// layout is handled by this class, allowing applications to implement only a
-/// handful of primitive stubs.
-/// </para>
-/// <para>
-/// This class is suitable for us within an AWT TableCellRenderer or within a SWT
-/// PaintListener registered on a Table instance. It is meant to rubber stamp the
-/// graphics necessary for one row of a plotted commit list.
-/// </para>
-/// <para>
-/// Subclasses should call {@link #paintCommit(PlotCommit, int)} after they have
-/// otherwise configured their instance to draw one commit into the current
-/// location.
-/// </para>
-/// <para>
-/// All drawing methods assume the coordinate space for the current commit's cell
-/// starts at (upper left corner is) 0,0. If this is not true (like say in SWT)
-/// the implementation must perform the cell offset computations within the
-/// various draw methods.
-/// </para>
-/// </summary>
-/// <typeparam name="TLane">type of lane being used by the application.</typeparam>
-/// <typeparam name="TColor">type of color object used by the graphics library.</typeparam>
-public abstract class AbstractPlotRenderer<TLane, TColor> where TLane : PlotLane {
-	private static int LANE_WIDTH = 14;
-
-	private static int LINE_WIDTH = 2;
-
-	private static int LEFT_PAD = 2;
-
-    /// <summary>
-    /// Paint one commit using the underlying graphics library.
-    /// </summary>
-    /// <param name="commit">the commit to render in this cell. Must not be null.</param>
-    /// <param name="h">total height (in pixels) of this cell.</param>
-    protected void paintCommit(PlotCommit<TLane> commit, int h) {
-		int dotSize = computeDotSize(h);
-		TLane myLane = commit.getLane();
-		int myLaneX = laneC(myLane);
-		TColor myColor = laneColor(myLane);
-
-		int maxCenter = 0;
-		foreach (TLane passingLane in (TLane[]) commit.passingLanes) {
-			int cx = laneC(passingLane);
-			TColor c = laneColor(passingLane);
-			drawLine(c, cx, 0, cx, h, LINE_WIDTH);
-			maxCenter = Math.Max(maxCenter, cx);
-		}
-
-		int nParent = commit.ParentCount;
-		for (int i = 0; i < nParent; i++) {
-			PlotCommit<TLane> p;
-			TLane pLane;
-			TColor pColor;
-			int cx;
-
-			p = (PlotCommit<TLane>) commit.GetParent(i);
-			pLane = p.getLane();
-			if (pLane == null)
-				continue;
-
-			pColor = laneColor(pLane);
-			cx = laneC(pLane);
-
-			if (Math.Abs(myLaneX - cx) > LANE_WIDTH) {
-				if (myLaneX < cx) {
-					int ix = cx - LANE_WIDTH / 2;
-					drawLine(pColor, myLaneX, h / 2, ix, h / 2, LINE_WIDTH);
-					drawLine(pColor, ix, h / 2, cx, h, LINE_WIDTH);
+namespace GitSharp.Core.RevPlot
+{
+	/// <summary>
+	/// Basic commit graph renderer for graphical user interfaces.
+	/// <para>
+	/// Lanes are drawn as columns left-to-right in the graph, and the commit short
+	/// message is drawn to the right of the lane lines for this cell. It is assumed
+	/// that the commits are being drawn as rows of some sort of table.
+	/// </para>
+	/// <para>
+	/// Client applications can subclass this implementation to provide the necessary
+	/// drawing primitives required to display a commit graph. Most of the graph
+	/// layout is handled by this class, allowing applications to implement only a
+	/// handful of primitive stubs.
+	/// </para>
+	/// <para>
+	/// This class is suitable for us within an AWT TableCellRenderer or within a SWT
+	/// PaintListener registered on a Table instance. It is meant to rubber stamp the
+	/// graphics necessary for one row of a plotted commit list.
+	/// </para>
+	/// <para>
+	/// Subclasses should call {@link #paintCommit(PlotCommit, int)} after they have
+	/// otherwise configured their instance to draw one commit into the current
+	/// location.
+	/// </para>
+	/// <para>
+	/// All drawing methods assume the coordinate space for the current commit's cell
+	/// starts at (upper left corner is) 0,0. If this is not true (like say in SWT)
+	/// the implementation must perform the cell offset computations within the
+	/// various draw methods.
+	/// </para>
+	/// </summary>
+	/// <typeparam name="TLane">type of lane being used by the application.</typeparam>
+	/// <typeparam name="TColor">type of color object used by the graphics library.</typeparam>
+	public abstract class AbstractPlotRenderer<TLane, TColor> where TLane : PlotLane {
+		private static int LANE_WIDTH = 14;
+
+		private static int LINE_WIDTH = 2;
+
+		private static int LEFT_PAD = 2;
+
+	    /// <summary>
+	    /// Paint one commit using the underlying graphics library.
+	    /// </summary>
+	    /// <param name="commit">the commit to render in this cell. Must not be null.</param>
+	    /// <param name="h">total height (in pixels) of this cell.</param>
+	    protected void paintCommit(PlotCommit<TLane> commit, int h) {
+			int dotSize = computeDotSize(h);
+			TLane myLane = commit.getLane();
+			int myLaneX = laneC(myLane);
+			TColor myColor = laneColor(myLane);
+
+			int maxCenter = 0;
+			foreach (TLane passingLane in (TLane[]) commit.passingLanes) {
+				int cx = laneC(passingLane);
+				TColor c = laneColor(passingLane);
+				drawLine(c, cx, 0, cx, h, LINE_WIDTH);
+				maxCenter = Math.Max(maxCenter, cx);
+			}
+
+			int nParent = commit.ParentCount;
+			for (int i = 0; i < nParent; i++) {
+				PlotCommit<TLane> p;
+				TLane pLane;
+				TColor pColor;
+				int cx;
+
+				p = (PlotCommit<TLane>) commit.GetParent(i);
+				pLane = p.getLane();
+				if (pLane == null)
+					continue;
+
+				pColor = laneColor(pLane);
+				cx = laneC(pLane);
+
+				if (Math.Abs(myLaneX - cx) > LANE_WIDTH) {
+					if (myLaneX < cx) {
+						int ix = cx - LANE_WIDTH / 2;
+						drawLine(pColor, myLaneX, h / 2, ix, h / 2, LINE_WIDTH);
+						drawLine(pColor, ix, h / 2, cx, h, LINE_WIDTH);
+					} else {
+						int ix = cx + LANE_WIDTH / 2;
+						drawLine(pColor, myLaneX, h / 2, ix, h / 2, LINE_WIDTH);
+						drawLine(pColor, ix, h / 2, cx, h, LINE_WIDTH);
+					}
 				} else {
-					int ix = cx + LANE_WIDTH / 2;
-					drawLine(pColor, myLaneX, h / 2, ix, h / 2, LINE_WIDTH);
-					drawLine(pColor, ix, h / 2, cx, h, LINE_WIDTH);
+					drawLine(pColor, myLaneX, h / 2, cx, h, LINE_WIDTH);
 				}
-			} else {
-				drawLine(pColor, myLaneX, h / 2, cx, h, LINE_WIDTH);
+				maxCenter = Math.Max(maxCenter, cx);
 			}
-			maxCenter = Math.Max(maxCenter, cx);
-		}
-
-		int dotX = myLaneX - dotSize / 2 - 1;
-		int dotY = (h - dotSize) / 2;
-
-		if (commit.getChildCount() > 0)
-			drawLine(myColor, myLaneX, 0, myLaneX, dotY, LINE_WIDTH);
-
-		if (commit.has(RevFlag.UNINTERESTING))
-			drawBoundaryDot(dotX, dotY, dotSize, dotSize);
-		else
-			drawCommitDot(dotX, dotY, dotSize, dotSize);
-
-		int textx = Math.Max(maxCenter + LANE_WIDTH / 2, dotX + dotSize) + 8;
-		int n = commit.refs == null ? 0 : commit.refs.Length;
-		for (int i = 0; i < n; ++i) {
-			textx += drawLabel(textx + dotSize, h/2, commit.refs[i]);
-		}
-
-		String msg = commit.getShortMessage();
-		drawText(msg, textx + dotSize + n*2, h / 2);
+
+			int dotX = myLaneX - dotSize / 2 - 1;
+			int dotY = (h - dotSize) / 2;
+
+			if (commit.getChildCount() > 0)
+				drawLine(myColor, myLaneX, 0, myLaneX, dotY, LINE_WIDTH);
+
+			if (commit.has(RevFlag.UNINTERESTING))
+				drawBoundaryDot(dotX, dotY, dotSize, dotSize);
+			else
+				drawCommitDot(dotX, dotY, dotSize, dotSize);
+
+			int textx = Math.Max(maxCenter + LANE_WIDTH / 2, dotX + dotSize) + 8;
+			int n = commit.refs == null ? 0 : commit.refs.Length;
+			for (int i = 0; i < n; ++i) {
+				textx += drawLabel(textx + dotSize, h/2, commit.refs[i]);
+			}
+
+			String msg = commit.getShortMessage();
+			drawText(msg, textx + dotSize + n*2, h / 2);
+		}
+
+		/// <summary>
+	    /// Draw a decoration for the Ref ref at x,y
+		/// </summary>
+		/// <param name="x">left</param>
+		/// <param name="y">top</param>
+		/// <param name="ref">A peeled ref</param>
+	    /// <returns>width of label in pixels</returns>
+	    protected abstract int drawLabel(int x, int y, Ref @ref);
+
+		private int computeDotSize(int h) {
+			int d = (int) (Math.Min(h, LANE_WIDTH) * 0.50f);
+			d += (d & 1);
+			return d;
+		}
+
+	    /// <summary>
+	    /// Obtain the color reference used to paint this lane.
+		 /// <para>
+		 /// Colors returned by this method will be passed to the other drawing
+		 /// primitives, so the color returned should be application specific.
+		 /// </para>
+		 /// <para>
+		 /// If a null lane is supplied the return value must still be acceptable to a
+		 /// drawing method. Usually this means the implementation should return a
+		 /// default color.
+	    /// </para>
+	    /// </summary>
+	    /// <param name="myLane">the current lane. May be null.</param>
+	    /// <returns>graphics specific color reference. Must be a valid color.</returns>
+	    protected abstract TColor laneColor(TLane myLane);
+
+		/// <summary>
+	    /// Draw a single line within this cell.
+		/// </summary>
+	    /// <param name="color">the color to use while drawing the line.</param>
+	    /// <param name="x1">starting X coordinate, 0 based.</param>
+	    /// <param name="y1">starting Y coordinate, 0 based.</param>
+	    /// <param name="x2">ending X coordinate, 0 based.</param>
+	    /// <param name="y2">ending Y coordinate, 0 based.</param>
+	    /// <param name="width">number of pixels wide for the line. Always at least 1.</param>
+	    protected abstract void drawLine(TColor color, int x1, int y1, int x2,
+				int y2, int width);
+
+	    /// <summary>
+	    /// Draw a single commit dot.
+	    /// <para>
+	    /// Usually the commit dot is a filled oval in blue, then a drawn oval in
+	    /// black, using the same coordinates for both operations.
+	    /// </para>
+	    /// </summary>
+	    /// <param name="x">upper left of the oval's bounding box.</param>
+	    /// <param name="y">upper left of the oval's bounding box.</param>
+	    /// <param name="w">width of the oval's bounding box.</param>
+	    /// <param name="h">height of the oval's bounding box.</param>
+		protected abstract void drawCommitDot(int x, int y, int w, int h);
+
+	    /// <summary>
+	    /// Draw a single boundary commit (aka uninteresting commit) dot.
+	    /// <para>
+	    /// Usually a boundary commit dot is a light gray oval with a white center.</para>
+	    /// </summary>
+	    /// <param name="x">upper left of the oval's bounding box.</param>
+	    /// <param name="y">upper left of the oval's bounding box.</param>
+	    /// <param name="w">width of the oval's bounding box.</param>
+	    /// <param name="h">height of the oval's bounding box.</param>
+	    protected abstract void drawBoundaryDot(int x, int y, int w, int h);
+
+	    /// <summary>
+	    /// Draw a single line of text.
+	    /// <para>
+	    /// The font and colors used to render the text are left up to the
+	    /// implementation.
+	    /// </para>
+	    /// </summary>
+	    /// <param name="msg">the text to draw. Does not contain LFs.</param>
+	    /// <param name="x">first pixel from the left that the text can be drawn at. Character data must not appear before this position.</param>
+	    /// <param name="y">pixel coordinate of the centerline of the text. Implementations must adjust this coordinate to account for the way their implementation handles font rendering.</param>
+		protected abstract void drawText(String msg, int x, int y);
+
+		private int laneX(PlotLane myLane) {
+			int p = myLane != null ? myLane.getPosition() : 0;
+			return LEFT_PAD + LANE_WIDTH * p;
+		}
+
+		private int laneC(PlotLane myLane) {
+			return laneX(myLane) + LANE_WIDTH / 2;
+		}
 	}
-
-	/// <summary>
-    /// Draw a decoration for the Ref ref at x,y
-	/// </summary>
-	/// <param name="x">left</param>
-	/// <param name="y">top</param>
-	/// <param name="ref">A peeled ref</param>
-    /// <returns>width of label in pixels</returns>
-    protected abstract int drawLabel(int x, int y, Ref @ref);
-
-	private int computeDotSize(int h) {
-		int d = (int) (Math.Min(h, LANE_WIDTH) * 0.50f);
-		d += (d & 1);
-		return d;
-	}
-
-    /// <summary>
-    /// Obtain the color reference used to paint this lane.
-	 /// <para>
-	 /// Colors returned by this method will be passed to the other drawing
-	 /// primitives, so the color returned should be application specific.
-	 /// </para>
-	 /// <para>
-	 /// If a null lane is supplied the return value must still be acceptable to a
-	 /// drawing method. Usually this means the implementation should return a
-	 /// default color.
-    /// </para>
-    /// </summary>
-    /// <param name="myLane">the current lane. May be null.</param>
-    /// <returns>graphics specific color reference. Must be a valid color.</returns>
-    protected abstract TColor laneColor(TLane myLane);
-
-	/// <summary>
-    /// Draw a single line within this cell.
-	/// </summary>
-    /// <param name="color">the color to use while drawing the line.</param>
-    /// <param name="x1">starting X coordinate, 0 based.</param>
-    /// <param name="y1">starting Y coordinate, 0 based.</param>
-    /// <param name="x2">ending X coordinate, 0 based.</param>
-    /// <param name="y2">ending Y coordinate, 0 based.</param>
-    /// <param name="width">number of pixels wide for the line. Always at least 1.</param>
-    protected abstract void drawLine(TColor color, int x1, int y1, int x2,
-			int y2, int width);
-
-    /// <summary>
-    /// Draw a single commit dot.
-    /// <para>
-    /// Usually the commit dot is a filled oval in blue, then a drawn oval in
-    /// black, using the same coordinates for both operations.
-    /// </para>
-    /// </summary>
-    /// <param name="x">upper left of the oval's bounding box.</param>
-    /// <param name="y">upper left of the oval's bounding box.</param>
-    /// <param name="w">width of the oval's bounding box.</param>
-    /// <param name="h">height of the oval's bounding box.</param>
-	protected abstract void drawCommitDot(int x, int y, int w, int h);
-
-    /// <summary>
-    /// Draw a single boundary commit (aka uninteresting commit) dot.
-    /// <para>
-    /// Usually a boundary commit dot is a light gray oval with a white center.</para>
-    /// </summary>
-    /// <param name="x">upper left of the oval's bounding box.</param>
-    /// <param name="y">upper left of the oval's bounding box.</param>
-    /// <param name="w">width of the oval's bounding box.</param>
-    /// <param name="h">height of the oval's bounding box.</param>
-    protected abstract void drawBoundaryDot(int x, int y, int w, int h);
-
-    /// <summary>
-    /// Draw a single line of text.
-    /// <para>
-    /// The font and colors used to render the text are left up to the
-    /// implementation.
-    /// </para>
-    /// </summary>
-    /// <param name="msg">the text to draw. Does not contain LFs.</param>
-    /// <param name="x">first pixel from the left that the text can be drawn at. Character data must not appear before this position.</param>
-    /// <param name="y">pixel coordinate of the centerline of the text. Implementations must adjust this coordinate to account for the way their implementation handles font rendering.</param>
-	protected abstract void drawText(String msg, int x, int y);
-
-	private int laneX(PlotLane myLane) {
-		int p = myLane != null ? myLane.getPosition() : 0;
-		return LEFT_PAD + LANE_WIDTH * p;
-	}
-
-	private int laneC(PlotLane myLane) {
-		return laneX(myLane) + LANE_WIDTH / 2;
-	}
-}
+}


Implementing trivial Injection API.

Implementing trivial Injection API.

--- Infusion.LegacyApi/Injection/InjectionHost.cs
+++ Infusion.LegacyApi/Injection/InjectionHost.cs
@@ -10,11 +10,13 @@
         private Runtime runtime;
         private readonly Legacy api;
         private readonly IConsole console;
+        private readonly SpeechJournal journal;

         public InjectionHost(Legacy api, IConsole console)
         {
             this.api = api;
             this.console = console;
+            journal = api.CreateSpeechJournal();
         }

         public void LoadScript(string fileName)
@@ -41,15 +43,90 @@

         private void RegisterNatives()
         {
+            runtime.Metadata.Add(new NativeSubrutineDefinition("wait", (Action<int>)Wait));
+
             runtime.Metadata.Add(new NativeSubrutineDefinition("UO", "print", (Action<string>)Print));
             runtime.Metadata.Add(new NativeSubrutineDefinition("UO", "getx", (Func<int>)GetX));
             runtime.Metadata.Add(new NativeSubrutineDefinition("UO", "gety", (Func<int>)GetY));
             runtime.Metadata.Add(new NativeSubrutineDefinition("UO", "getz", (Func<int>)GetZ));
+            runtime.Metadata.Add(new NativeSubrutineDefinition("UO", "dead", (Func<int>)Dead));
+
+            runtime.Metadata.Add(new NativeSubrutineDefinition("UO", "deletejournal", (Action)DeleteJournal));
+
+            runtime.Metadata.Add(new NativeSubrutineDefinition("UO", "warmode", (Action<int>)SetWarMode));
+
+            runtime.Metadata.Add(new NativeSubrutineDefinition("UO", "useskill", (Action<string>)UseSkill));
+            runtime.Metadata.Add(new NativeSubrutineDefinition("UO", "cast", (Action<string>)Cast));
         }

+        private void Wait(int ms) => api.Wait(ms);
         private void Print(string msg) => api.ClientPrint(msg);
         private int GetX() => api.Me.Location.X;
         private int GetY() => api.Me.Location.Y;
         private int GetZ() => api.Me.Location.Z;
+        private int Dead() => api.Me.IsDead ? 1 : 0;
+
+        private void DeleteJournal() => journal.Delete();
+
+        private void SetWarMode(int mode)
+        {
+            if (mode == 0)
+                api.WarModeOff();
+            else
+                api.WarModeOn();
+        }
+
+        private void UseSkill(string skillName) => api.UseSkill(TranslateSkill(skillName));
+        private void Cast(string spellName) => api.CastSpell(TranslateSpell(spellName));
+
+        private Skill TranslateSkill(string skillName)
+        {
+            switch (skillName.ToLower())
+            {
+                case "animal lore":
+                    return Skill.AnimalLore;
+                case "animal taming":
+                    return Skill.AnimalTaming;
+                case "hiding":
+                    return Skill.Hiding;
+                case "peacemaking":
+                    return Skill.Peacemaking;
+                case "meditation":
+                    return Skill.Meditation;
+                case "tracking":
+                    return Skill.Tracking;
+                default:
+                    throw new NotImplementedException($"Unknown skill {skillName}");
+            }
+        }
+
+        private Spell TranslateSpell(string spellName)
+        {
+            switch (spellName.ToLower())
+            {
+                case "bless":
+                    return Spell.Bless;
+                case "protection":
+                    return Spell.Protection;
+                case "magic reflection":
+                    return Spell.Reflection;
+                case "reactive armor":
+                    return Spell.ReactiveArmor;
+                case "agility":
+                    return Spell.Agility;
+                case "strength":
+                    return Spell.Strength;
+                case "cunning":
+                    return Spell.Cunning;
+                case "night sight":
+                    return Spell.NightSight;
+                case "recall":
+                    return Spell.Recall;
+                case "arch protection":
+                    return Spell.ArchProtection;
+                default:
+                    throw new NotImplementedException($"Unknown spell {spellName}");
+            }
+        }
     }
 }


use less aggressive caching to fix conditional evaluation

--- KJade/src/KJade.ViewEngine/KJadeViewEngine.cs
+++ KJade/src/KJade.ViewEngine/KJadeViewEngine.cs
@@ -37,6 +37,7 @@

         public Response RenderView(ViewLocationResult viewLocationResult, dynamic model, IRenderContext renderContext)
         {
+            /*
             var response = new HtmlResponse();
             var html = renderContext.ViewCache.GetOrAdd(viewLocationResult, result =>
             {
@@ -53,6 +54,20 @@
             };

             return response;
+            */
+            return new HtmlResponse(contents: s =>
+            {
+                var writer = new StreamWriter(s);
+                var templateContents = renderContext.ViewCache.GetOrAdd(viewLocationResult, vr =>
+                {
+                    using (var reader = vr.Contents.Invoke())
+                        return reader.ReadToEnd();
+                });
+
+                var renderedHtml = EvaluateKJade(viewLocationResult, model, renderContext);
+                writer.Write(renderedHtml);
+                writer.Flush();
+            });
         }

         private string ReadView(ViewLocationResult locationResult)


With removal of helpers, get the tests to build again.

--- LINQToTTree/LINQToTTreeLib.Tests/TestUtils.cs
+++ LINQToTTree/LINQToTTreeLib.Tests/TestUtils.cs
@@ -1,5 +1,9 @@
 using System;
+using System.Collections.Generic;
+using System.IO;
 using System.Linq;
+using System.Linq.Expressions;
+using System.Text.RegularExpressions;
 using LinqToTTreeInterfacesLib;

 namespace LINQToTTreeLib.Tests
@@ -56,6 +60,28 @@
             return result;
         }

+        /// <summary>
+        /// Returns all files below the base directory whose name (including extension) match the regex pattern.
+        /// </summary>
+        /// <param name="baseDir"></param>
+        /// <param name="fileExtension"></param>
+        /// <returns></returns>
+        public static IEnumerable<FileInfo> FindAllFiles(this DirectoryInfo baseDir, string pattern)
+        {
+            var subfiles = from subdir in baseDir.EnumerateDirectories()
+                           from f in subdir.FindAllFiles(pattern)
+                           select f;
+
+            Regex matcher = new Regex(pattern);
+            var goodFiles = from f in baseDir.EnumerateFiles()
+                            where matcher.Match(f.Name).Success
+                            select f;
+
+            var allfiles = subfiles.Concat(goodFiles);
+
+            return allfiles;
+        }
+
         public static IBookingStatementBlock GetDeepestBookingLevel(GeneratedCode target)
         {
             IBookingStatementBlock result = target.CodeBody;
@@ -70,5 +96,60 @@
             return result;
         }

+        /// <summary>
+        /// Create a TH1F plot from a stream of objects (with a lambda function to give flexability in conversion).
+        /// </summary>
+        /// <typeparam name="TSource"></typeparam>
+        /// <param name="source"></param>
+        /// <param name="plotID"></param>
+        /// <param name="plotTitle"></param>
+        /// <param name="nbins"></param>
+        /// <param name="lowBin"></param>
+        /// <param name="highBin"></param>
+        /// <param name="getter"></param>
+        /// <returns></returns>
+        public static ROOTNET.NTH1F Plot<TSource>
+            (
+            this IQueryable<TSource> source,
+            string plotID, string plotTitle,
+            int nbins, double lowBin, double highBin,
+            Expression<Func<TSource, double>> getter)
+        {
+            var hParameter = Expression.Parameter(typeof(ROOTNET.NTH1F), "h");
+            var vParameter = Expression.Parameter(typeof(TSource), "v");
+
+            /// h.Fill(getter(v)) is what we want to code up
+
+            var callGetter = Expression.Invoke(getter, vParameter);
+
+            var fillMethod = typeof(ROOTNET.NTH1F).GetMethod("Fill", new Type[] { typeof(double) });
+            var callFill = Expression.Call(hParameter, fillMethod, callGetter);
+
+            var lambda = Expression.Lambda<Action<ROOTNET.NTH1F, TSource>>(callFill, hParameter, vParameter);
+            return source.ApplyToObject(new ROOTNET.NTH1F(plotID, plotTitle, nbins, lowBin, highBin), lambda);
+        }
+
+        /// <summary>
+        /// Generate a TH1F from a stream of T's that can be converted to a double.
+        /// </summary>
+        /// <typeparam name="TSource"></typeparam>
+        /// <param name="source"></param>
+        /// <param name="plotID"></param>
+        /// <param name="plotTitle"></param>
+        /// <param name="nbins"></param>
+        /// <param name="lowBin"></param>
+        /// <param name="highBin"></param>
+        /// <returns></returns>
+        public static ROOTNET.NTH1F Plot<T>
+            (
+            this IQueryable<T> source,
+            string plotID, string plotTitle,
+            int nbins, double lowBin, double highBin
+            )
+            where T : IConvertible
+        {
+            return source.Plot(plotID, plotTitle, nbins, lowBin, highBin, v => Convert.ToDouble(v));
+        }
+
     }
 }


Update DateTimeMinMax_Tests.cs

Update DateTimeMinMax_Tests.cs

--- LiteDB.Tests/Database/DateTimeMinMax_Tests.cs
+++ LiteDB.Tests/Database/DateTimeMinMax_Tests.cs
@@ -4,7 +4,7 @@
 using LiteDB;
 using Microsoft.VisualStudio.TestTools.UnitTesting;

-namespace LiteDBDateTimeIndexMinMax
+namespace LiteDB.Tests.Database
 {
     #region Model

@@ -76,4 +76,4 @@
             Assert.AreEqual(max, linqmax);
         }
     }
-}+}


Fixing conflicts with the enumeration numbers.

git-svn-id: bab0c2de90ee11a20376049c2cdee62584491f34@1287 73e77b4c-caa6-f847-a29a-24ab75ae54b6

--- MonoRail/Castle.MonoRail.Framework/IFilter.cs
+++ MonoRail/Castle.MonoRail.Framework/IFilter.cs
@@ -46,11 +46,11 @@
 		/// <summary>
 		/// The filter is invoked after the action.
 		/// </summary>
-		AfterAction = 0x11,
+		AfterAction = 0x02,
 		/// <summary>
 		/// The filter is invoked after the rendering.
 		/// </summary>
-		AfterRendering = 0x12,
+		AfterRendering = 0x04,
 		/// <summary>
 		/// The filter is invoked around all steps.
 		/// </summary>


Bumped version number

Bumped version number

Signed-off-by: Martin Evans <fbe68550a3878a44ead7fa06f7b29f9942900ad3@gmail.com>

--- Myre/Myre.Graphics/Properties/AssemblyInfo.cs
+++ Myre/Myre.Graphics/Properties/AssemblyInfo.cs
@@ -30,4 +30,4 @@
 //      Build Number
 //      Revision
 //
-[assembly: AssemblyVersion("1.2.0")]
+[assembly: AssemblyVersion("1.3.0")]


Fixed catalog

Fixed catalog

--- OfflineServer/Servers/Http/Classes/Catalog.cs
+++ OfflineServer/Servers/Http/Classes/Catalog.cs
@@ -15,7 +15,7 @@
         public static String categories()
         {
             String targetCategoryName = Access.sHttp.request.Params.Get("categoryName");
-            if (!String.IsNullOrWhiteSpace(targetCategoryName))
+            if (String.IsNullOrWhiteSpace(targetCategoryName))
                 return "<ArrayOfCategoryTrans/>";

             String targetLocalFile = Path.Combine(DataEx.dir_CurrentHttpServerCategories, targetCategoryName + ".xml");
@@ -28,7 +28,7 @@
         public static String productsInCategory()
         {
             String targetProductName = Access.sHttp.request.Params.Get("categoryName");
-            if (!String.IsNullOrWhiteSpace(targetProductName))
+            if (String.IsNullOrWhiteSpace(targetProductName))
                 return "<ArrayOfProductTrans/>";

             String targetLocalFile = Path.Combine(DataEx.dir_CurrentHttpServerProducts, targetProductName + ".xml");


same in a few more spots

same in a few more spots

--- OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -296,13 +296,15 @@
                 }
             }

+            bool ret = AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
+
             if (attachToBackup && (!alreadyPersisted))
             {
                 sceneObject.ForceInventoryPersistence();
                 sceneObject.HasGroupChanged = true;
             }

-            return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
+            return ret;
         }

         /// <summary>
@@ -319,12 +321,17 @@
         /// </returns>
         protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
         {
-            // Ensure that we persist this new scene object if it's not an
+
+
+            bool ret = AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
+
+           // Ensure that we persist this new scene object if it's not an
             // attachment
+
             if (attachToBackup)
                 sceneObject.HasGroupChanged = true;

-            return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
+            return ret;
         }

         /// <summary>


fall back to using a display mesh for physics proxy if no physics_mesh entry was wound in a mesh asset

--- OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -358,6 +358,10 @@
                     physicsParms = (OSDMap)map["physics_shape"]; // old asset format
                 else if (map.ContainsKey("physics_mesh"))
                     physicsParms = (OSDMap)map["physics_mesh"]; // new asset format
+                else if (map.ContainsKey("medium_lod"))
+                    physicsParms = (OSDMap)map["medium_lod"]; // if no physics mesh, try to fall back to medium LOD display mesh
+                else if (map.ContainsKey("high_lod"))
+                    physicsParms = (OSDMap)map["high_lod"]; // if all else fails, use highest LOD display mesh and hope it works :)

                 if (physicsParms == null)
                 {


Add test

Add test

--- ProxySample/TransparentHttpConsole/Program.cs
+++ ProxySample/TransparentHttpConsole/Program.cs
@@ -8,12 +8,28 @@
     {
         static void Main(string[] args)
         {
+            HttpProxyTest();
+            ObjectMethodsTest();
+        }
+
+        static void HttpProxyTest()
+        {
             var zipCloud = HttpProxy.CreateProxy<IZipCloudService>();
             Console.WriteLine(zipCloud.Get("6020881"));

             var cgis = HttpProxy.CreateProxy<ICgisService>();
             Console.WriteLine(cgis.Get("6048301"));
             Console.WriteLine(cgis.Get("501", 1));
+        }
+
+        static void ObjectMethodsTest()
+        {
+            var zipCloud = HttpProxy.CreateProxy<IZipCloudService>();
+
+            var h = zipCloud.GetHashCode();
+            var b = zipCloud.Equals(zipCloud);
+            var t = zipCloud.GetType();
+            var s = zipCloud.ToString();
         }
     }


Add method to force a writing system to be marked as changed

--- SIL.WritingSystems/WritingSystemDefinition.cs
+++ SIL.WritingSystems/WritingSystemDefinition.cs
@@ -773,6 +773,11 @@
 			ChildrenAcceptChanges(_characterSets);
 		}

+		public void ForceChanged()
+		{
+			IsChanged = true;
+		}
+
 		/// <summary>
 		/// Gets or sets a value indicating whether the writing system will be deleted.
 		/// </summary>


Added a couple of new encryption related functions

--- SharpTox/Encryption/ToxEncryptionFunctions.cs
+++ SharpTox/Encryption/ToxEncryptionFunctions.cs
@@ -9,6 +9,12 @@
     {
         const string dll = "libtox";

+        [DllImport(dll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "tox_pass_encryption_extra_length")]
+        public static extern int PassEncryptionExtraLength();
+
+        [DllImport(dll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "tox_pass_key_length")]
+        public static extern int PassKeyLength();
+
         [DllImport(dll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "tox_encrypted_size")]
         public static extern uint EncryptedSize(ToxHandle tox);

@@ -18,8 +24,14 @@
         [DllImport(dll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "tox_pass_key_encrypt")]
         public static extern int PassKeyEncrypt(byte[] data, uint data_len, byte[] key, byte[] output);

+        [DllImport(dll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "tox_pass_encrypt")]
+        public static extern int PassEncrypt(byte[] data, uint len, byte[] passphrase, uint pplength, byte[] output);
+
         [DllImport(dll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "tox_encrypted_save")]
         public static extern int EncryptedSave(ToxHandle tox, byte[] data, byte[] passphrase, uint pplength);
+
+        [DllImport(dll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "tox_pass_key_decrypt")]
+        public static extern int PassKeyDecrypt(byte[] data, uint length, byte[] key, byte[] output);

         [DllImport(dll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "tox_pass_decrypt")]
         public static extern int PassDecrypt(byte[] data, uint length, uint[] passphrase, uint pplength, byte[] output);


Request Repo Ready

Request Repo Ready

--- Skermstafir/Repositories/RequestRepository.cs
+++ Skermstafir/Repositories/RequestRepository.cs
@@ -11,12 +11,23 @@
         // adds new request to database
         public void AddRequest(RequestModel newRequest)
         {
+            using(SkermData db = new SkermData())
+            {
+                db.Requests.Add(newRequest.request);
+                db.SaveChanges();
+            }
         }

         //deletes a request with a specific id
         public void DeleteRequest(int id)
         {
-
+            using(SkermData db = new SkermData())
+            {
+                Request discardRequest = (from req in db.Requests
+                                          where req.IdRequest == id
+                                          select req).Single();
+                db.Requests.Remove(discardRequest);
+            }
         }

         // queries and gets requests starting from index start and ending at index end


Fix the invalid parameter name in the List.UpdateAsync method

Resolves #35

--- Source/CakeMail.RestClient/Resources/Lists.cs
+++ Source/CakeMail.RestClient/Resources/Lists.cs
@@ -200,7 +200,7 @@
 			};
 			if (name != null) parameters.Add(new KeyValuePair<string, object>("name", name));
 			if (language != null) parameters.Add(new KeyValuePair<string, object>("language", language));
-			if (spamPolicyAccepted.HasValue) parameters.Add(new KeyValuePair<string, object>("list_policy", spamPolicyAccepted.Value ? "accepted" : "declined"));
+			if (spamPolicyAccepted.HasValue) parameters.Add(new KeyValuePair<string, object>("policy", spamPolicyAccepted.Value ? "accepted" : "declined"));
 			if (status.HasValue) parameters.Add(new KeyValuePair<string, object>("status", status.Value.GetEnumMemberValue()));
 			if (senderName != null) parameters.Add(new KeyValuePair<string, object>("sender_name", senderName));
 			if (senderEmail != null) parameters.Add(new KeyValuePair<string, object>("sender_email", senderEmail));


GSF.Web: Fixed calling assembly reference to load ASHX type from.

--- Source/Libraries/GSF.Web/Hosting/WebServer.cs
+++ Source/Libraries/GSF.Web/Hosting/WebServer.cs
@@ -29,6 +29,7 @@
 using System.Net;
 using System.Net.Http;
 using System.Net.Http.Headers;
+using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Text;
 using System.Threading.Tasks;
@@ -325,7 +326,8 @@
                 className = className.Substring(1, className.Length - 2).Trim();

                 // ReSharper disable once AssignNullToNotNullAttribute
-                IHostedHttpHandler handler = Activator.CreateInstance(Type.GetType(className)) as IHostedHttpHandler;
+                Assembly entryAssembly = AssemblyInfo.EntryAssembly.Assembly;
+                IHostedHttpHandler handler = Activator.CreateInstance(entryAssembly.GetType(className)) as IHostedHttpHandler;

                 if (handler == null)
                     throw new InvalidOperationException($"Failed to create hosted HTTP handler \"{className}\" - make sure class implements IHostedHttpHandler interface.");


SafetyAnalysis: add some statistics output on heuristics

--- Source/SafetySharp/Analysis/SafetyAnalysis.cs
+++ Source/SafetySharp/Analysis/SafetyAnalysis.cs
@@ -45,6 +45,11 @@
 		private readonly Dictionary<FaultSet, CounterExample> counterExamples = new Dictionary<FaultSet, CounterExample>();
 		private readonly Dictionary<FaultSet, Exception> exceptions = new Dictionary<FaultSet, Exception>();

+		private int trivialCount = 0;
+		private int heuristicCount = 0;
+		private int heuristicTrivialCount = 0;
+		private int heuristicNonTrivialSafeCount = 0;
+
 		/// <summary>
 		///   The model checker's configuration that determines certain model checker settings.
 		/// </summary>
@@ -195,6 +200,11 @@
 			// due to heuristics usage, we may have informatiuon on non-minimal critical sets
 			var minimalCritical = RemoveNonMinimalCriticalSets();

+			ConsoleHelpers.WriteLine($"Of {heuristicCount} sets suggested by heuristics,\n\t{heuristicTrivialCount} were trivially safe / critical\n"
+				+ $"\t{heuristicNonTrivialSafeCount} were non-trivially safe\n"
+				+ $"\t{heuristicCount-heuristicNonTrivialSafeCount} were non-trivially critical\n"
+				+ $"In total, {trivialCount} trivial checks were performed.\n");
+
 			return new Result(
 				model, isComplete, minimalCritical, checkedSets,
 				allFaults, suppressedFaults, forcedFaults,
@@ -230,16 +240,29 @@
 		private bool CheckSet(FaultSet set, Fault[] nondeterministicFaults, Fault[] allFaults,
 			int cardinality, RuntimeModelSerializer serializer, InvariantChecker invariantChecker)
 		{
+			bool isHeuristic = cardinality != set.Cardinality;
+			if (isHeuristic)
+				heuristicCount++;
 			bool isSafe = true;

 			// check if set is trivially safe or critical
 			// (do not add to safeSets / criticalSets if so, in order to keep them small)
 			if (IsTriviallySafe(set))
+			{
+				trivialCount++;
+				if (isHeuristic)
+					heuristicTrivialCount++;
 				// do not add to safeSets: all subsets are subsets of safeSet as well
 				return true;
+			}
 			else if (IsTriviallyCritical(set))
+			{
+				trivialCount++;
+				if (isHeuristic)
+					heuristicTrivialCount++;
 				// do not add to criticalSets: non-minimal, and all supersets are supersets of criticalSet as well
 				return false;
+			}

 			// if configured to do so, check with forced fault activation
 			if (FaultActivationBehaviour == FaultActivationBehaviour.ForceOnly
@@ -254,7 +277,11 @@
 				isSafe = CheckSet(set, nondeterministicFaults, allFaults, cardinality, serializer, invariantChecker, Activation.Nondeterministic);

 			if (isSafe) // remember non-trivially safe sets to avoid checking their subsets
+			{
 				safeSets.Add(set);
+				if (isHeuristic)
+					heuristicNonTrivialSafeCount++;
+			}

 			return isSafe;
 		}


[add]ハーシャッド数判定メソッドの追加

[add]ハーシャッド数判定メソッドの追加

--- Src/LoveWholeNumber/LoveWholeNumber/Class1.cs
+++ Src/LoveWholeNumber/LoveWholeNumber/Class1.cs
@@ -1011,5 +1011,18 @@

             return true;
         }
+
+        /// <summary>
+        /// ハーシャッド数判定
+        /// </summary>
+        /// <param name="n">判定したい自然数</param>
+        /// <returns>ハーシャッド数ならtrue でないならfalse</returns>
+        public static bool IsHarshadNumber(int n)
+        {
+            if (n % GetDigitSum(n) == 0)
+                return true;
+
+            return false;
+        }
     }
 }


update liblog to latest

update liblog to latest

--- Src/Metrics/App_Packages/LibLog.3.1/LibLog.cs
+++ Src/Metrics/App_Packages/LibLog.3.1/LibLog.cs
@@ -32,10 +32,10 @@

 namespace Metrics.Logging
 {
+    using System;
     using System.Collections.Generic;
+    using System.Diagnostics;
     using Metrics.Logging.LogProviders;
-    using System;
-    using System.Diagnostics;

     /// <summary>
     /// Simple interface that represent a logger.


Fixed assembly info

Fixed assembly info

--- SteamBulkActivator/Properties/AssemblyInfo.cs
+++ SteamBulkActivator/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.1")]
+[assembly: AssemblyFileVersion("1.0.1")]


Suppress CA1804

Suppress CA1804

--- ThScoreFileConverter/Models/Th075Converter.cs
+++ ThScoreFileConverter/Models/Th075Converter.cs
@@ -822,6 +822,7 @@
             public Status Status { get; private set; }

             [SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "unknownChara", Justification = "Reviewed.")]
+            [SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "knownLevel", Justification = "Reviewed.")]
             public void ReadFrom(BinaryReader reader)
             {
                 var levels = Utils.GetEnumerator<Level>();
@@ -839,7 +840,7 @@

                 foreach (var unknownChara in Enumerable.Range(1, 4))
                 {
-                    foreach (var level in levels)
+                    foreach (var knownLevel in levels)
                         new ClearData().ReadFrom(reader);
                 }

@@ -966,6 +967,7 @@
             public Dictionary<Chara, Dictionary<Chara, int>> ArcadeScores { get; private set; }

             [SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "unknownChara", Justification = "Reviewed.")]
+            [SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "knownEnemy", Justification = "Reviewed.")]
             [SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "unknownEnemy", Justification = "Reviewed.")]
             public void ReadFrom(BinaryReader reader)
             {
@@ -990,7 +992,7 @@

                 foreach (var unknownChara in unknownCharas)
                 {
-                    foreach (var enemy in charas)
+                    foreach (var knownEnemy in charas)
                         reader.ReadInt32();
                     foreach (var unknownEnemy in unknownCharas)
                         reader.ReadInt32();


Added chat window close when pressing ESC

--- UnityProject/Assets/Scripts/UI/ControlChat.cs
+++ UnityProject/Assets/Scripts/UI/ControlChat.cs
@@ -86,6 +86,10 @@
 					CloseChatWindow();
 				}
 			}
+            if(chatInputWindow.activeInHierarchy && Input.GetKey(KeyCode.Escape))
+            {
+                CloseChatWindow();
+            }
 		}

 		public void OnClickSend()


fix about menu link

fix about menu link

--- VsGitToolsPackage/VsGitToolsPackagePackage.cs
+++ VsGitToolsPackage/VsGitToolsPackagePackage.cs
@@ -240,9 +240,9 @@

         private void OnAbout(object sender, EventArgs e)
         {
-            var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
-            path = Path.Combine(path, "Readme.html");
-            Process.Start(path);
+            //var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+            //path = Path.Combine(path, "Readme.html");
+            Process.Start("http://yysun.github.io/git-tools");
         }

         private void OnEditIgnore(object sender, EventArgs e)


Not to delete white space and line feed characters

--- WPPMM/RemoteApi/RemoteApi/RequestGenerator.cs
+++ WPPMM/RemoteApi/RemoteApi/RequestGenerator.cs
@@ -36,7 +36,8 @@
                 new JProperty("id", GetID()),
                 new JProperty("params", param));

-            return json.ToString().Replace(" ", "").Replace("\n", "").Replace("\r", "");
+            //return json.ToString().Replace(" ", "").Replace("\n", "").Replace("\r", "");
+            return json.ToString();
         }

         /// <summary>


Update Startup.cs

Update Startup.cs

--- WebApp-WebAPI-OpenIdConnect-DotNet/Startup.cs
+++ WebApp-WebAPI-OpenIdConnect-DotNet/Startup.cs
@@ -77,6 +77,7 @@
                 ClientId = ClientId,
                 Authority = Authority,
                 PostLogoutRedirectUri = Configuration["AzureAd:PostLogoutRedirectUri"],
+                ResponseType = OpenIdConnectResponseTypes.CodeIdToken,
                 GetClaimsFromUserInfoEndpoint = false,

                 Events = new OpenIdConnectEvents


add ZipFile impl for non osx

add ZipFile impl for non osx

--- Xtc/src/Xtc.TestCloud/Utilities/FileHelper.cs
+++ Xtc/src/Xtc.TestCloud/Utilities/FileHelper.cs
@@ -5,6 +5,7 @@
 using System.Runtime.InteropServices;
 using System.Text;
 using Microsoft.Xtc.Common.Services;
+using System.IO.Compression;

 namespace Microsoft.Xtc.TestCloud.Utilities
 {
@@ -57,26 +58,74 @@
                     $@"Expected bundle to end with .app, got ${appBundlePath}");
             }

-            var platformService = new PlatformService();
-            if (platformService.CurrentPlatform == OSPlatform.Windows)
-            {
-                throw new InvalidOperationException("Can not archive an iOS application on Windows");
-            }
-
-            if (!Directory.Exists(appBundlePath))
-            {
-                throw new FileNotFoundException(
-                  $@"'${appBundlePath}' does not exist or is not a directory");
-            }
-
-            return CreateIpaWithDitto(appBundlePath);
-        }
-
-        private static string CreateIpaWithDitto(string appBundlePath)
+			if (!Directory.Exists(appBundlePath))
+			{
+				throw new FileNotFoundException(
+				  $@"'${appBundlePath}' does not exist or is not a directory");
+			}
+
+			var platformService = new PlatformService();
+            if (platformService.CurrentPlatform == OSPlatform.OSX && false)
+            {
+				return CreateIpaWithDitto(appBundlePath);
+            }
+            else
+            {
+                return CreateIpaWithZip(appBundlePath);
+            }
+        }
+
+        private static string CreateIpaWithZip(string appBundlePath)
         {
             // /tmp/<uuid>
             string tmpDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
+            // /tmp/<uuid>/Payload/MyApp.app
             string destination = CreateTempAppDestination(appBundlePath, tmpDir);
+
+            try
+            {
+                Copy(appBundlePath, destination);
+				var ipaFilePath = Path.ChangeExtension(appBundlePath, ".ipa");
+                ZipFile.CreateFromDirectory(tmpDir, ipaFilePath);
+                return ipaFilePath;
+            }
+            finally
+            {
+                Directory.Delete(tmpDir, true);
+            }
+        }
+
+		public static void Copy(string sourceDirectory, string targetDirectory)
+		{
+			DirectoryInfo diSource = new DirectoryInfo(sourceDirectory);
+			DirectoryInfo diTarget = new DirectoryInfo(targetDirectory);
+
+			CopyAll(diSource, diTarget);
+		}
+
+		public static void CopyAll(DirectoryInfo source, DirectoryInfo target)
+		{
+			Directory.CreateDirectory(target.FullName);
+
+			foreach (FileInfo fi in source.GetFiles())
+			{
+				fi.CopyTo(Path.Combine(target.FullName, fi.Name), true);
+			}
+
+			foreach (DirectoryInfo diSourceSubDir in source.GetDirectories())
+			{
+				DirectoryInfo nextTargetSubDir =
+					target.CreateSubdirectory(diSourceSubDir.Name);
+				CopyAll(diSourceSubDir, nextTargetSubDir);
+			}
+		}
+
+        private static string CreateIpaWithDitto(string appBundlePath)
+        {
+            // /tmp/<uuid>
+            string tmpDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
+			// /tmp/<uuid>/Payload/MyApp.app
+			string destination = CreateTempAppDestination(appBundlePath, tmpDir);

             try
             {


Bug fix

Bug fix

--- TextMining/Snowball/SnowballProgram.cs
+++ TextMining/Snowball/SnowballProgram.cs
@@ -370,6 +370,9 @@
                     cursor = c + w.sSize;
                     return w.result;
                 }
+                i = w.substringI;
+                if (i < 0)
+                    return 0;
             }
         }

@@ -524,6 +527,9 @@
                     cursor = c - w.sSize;
                     return w.result;
                 }
+                i = w.substringI;
+                if (i < 0)
+                    return 0;
             }
         }


small cleanup

small cleanup

Still broken

--- TodoListWebApp/DAL/EFADALTokenCache.cs
+++ TodoListWebApp/DAL/EFADALTokenCache.cs
@@ -55,7 +55,7 @@

                 // retrieve last write from the DB
                 // if there's a lock, wait
-                // TBD
+                    // TBD
                 // if it's not in memory OR
                 // if it's in memory but older than last write
                 if (status.First().LastWrite > Cache.LastWrite)
@@ -79,8 +79,7 @@
                     WriteLock = false
                 };

-                //// update the DB and the lastwrite
-                //db.PerUserCacheList.Attach(Cache);
+                //// update the DB and the lastwrite
                 db.Entry(Cache).State = Cache.EntryId == 0 ? EntityState.Added : EntityState.Modified;
                 db.SaveChanges();
                 this.HasStateChanged = false;


Switch from AutomationToolLauncher to AutomationTool for UE5.

--- UnrealBinaryBuilder/MainWindow.xaml.cs
+++ UnrealBinaryBuilder/MainWindow.xaml.cs
@@ -25,7 +25,8 @@
 	{
 		public static readonly string SetupBatFileName = "Setup.bat";
 		public static readonly string GenerateProjectBatFileName = "GenerateProjectFiles.bat";
-		public static readonly string AUTOMATION_TOOL_NAME = "AutomationToolLauncher";
+		public static readonly string AUTOMATION_TOOL_NAME = "AutomationTool";
+		public static readonly string AUTOMATION_TOOL_LAUNCHER_NAME = $"{AUTOMATION_TOOL_NAME}Launcher";
 		public static readonly string DEFAULT_BUILD_XML_FILE = "Engine/Build/InstalledEngineBuild.xml";
 		public static bool IsUnrealEngine5 { get; private set; } = false;

@@ -107,11 +108,11 @@
 			{
 				if (IsUnrealEngine5)
 				{
-					return File.Exists(Path.Combine(BaseEnginePath, "Engine", "Binaries", "DotNET", "AutomationTool", "AutomationTool.exe"));
+					return File.Exists(Path.Combine(BaseEnginePath, "Engine", "Binaries", "DotNET", AUTOMATION_TOOL_NAME, $"{AUTOMATION_TOOL_NAME}.exe"));
 				}
 				else
 				{
-					return File.Exists(Path.Combine(BaseEnginePath, "Engine", "Binaries", "DotNET", "AutomationTool.exe"));
+					return File.Exists(Path.Combine(BaseEnginePath, "Engine", "Binaries", "DotNET", $"{AUTOMATION_TOOL_LAUNCHER_NAME}.exe"));
 				}
 			}

@@ -125,7 +126,7 @@
 				return null;
 			}

-			return Path.Combine(BaseEnginePath, "Engine", "Source", "Programs", "AutomationTool", "AutomationTool.csproj");
+			return Path.Combine(BaseEnginePath, "Engine", "Source", "Programs", AUTOMATION_TOOL_NAME, $"{AUTOMATION_TOOL_NAME}.csproj");
 		}

 		public static string GetAutomationToolLauncherProjectFile(string BaseEnginePath)
@@ -135,7 +136,7 @@
 				return null;
 			}

-			return Path.Combine(BaseEnginePath, "Engine", "Source", "Programs", "AutomationToolLauncher", "AutomationToolLauncher.csproj");
+			return Path.Combine(BaseEnginePath, "Engine", "Source", "Programs", AUTOMATION_TOOL_LAUNCHER_NAME, $"{AUTOMATION_TOOL_LAUNCHER_NAME}.csproj");
 		}
 	}
 	public partial class MainWindow
@@ -536,11 +537,11 @@
 						BuildAutomationTool();
 						break;
 					case CurrentProcessType.BuildAutomationTool:
-						GameAnalyticsCSharp.AddProgressEnd("Build", "AutomationTool");
+						GameAnalyticsCSharp.AddProgressEnd("Build", UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_NAME);
 						BuildAutomationToolLauncher();
 						break;
 					case CurrentProcessType.BuildAutomationToolLauncher:
-						GameAnalyticsCSharp.AddProgressEnd("Build", "AutomationToolLauncher");
+						GameAnalyticsCSharp.AddProgressEnd("Build", UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_LAUNCHER_NAME);
 						if (bContinueToEngineBuild.IsChecked == true)
 						{
 							BuildEngine();
@@ -621,11 +622,11 @@
 			{
 				if (UnrealBinaryBuilderHelpers.IsUnrealEngine5)
 				{
-					AutomationExePath = Path.Combine(SetupBatFilePath.Text, "Engine", "Binaries", "DotNET", "AutomationToolLauncher", $"{UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_NAME}.exe");
+					AutomationExePath = Path.Combine(SetupBatFilePath.Text, "Engine", "Binaries", "DotNET", UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_NAME, $"{UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_NAME}.exe");
 				}
 				else
 				{
-					AutomationExePath = Path.Combine(SetupBatFilePath.Text, "Engine", "Binaries", "DotNET", $"{UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_NAME}.exe");
+					AutomationExePath = Path.Combine(SetupBatFilePath.Text, "Engine", "Binaries", "DotNET", $"{UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_LAUNCHER_NAME}.exe");
 				}
 			}

@@ -1171,7 +1172,7 @@
 					{
 						if (TryUpdateAutomationExePath() == false)
 						{
-							AddLogEntry("Failed to build Automation Tool. AutomationExePath was null.", true);
+							AddLogEntry($"Failed to build {UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_NAME}. AutomationExePath was null.", true);
 							return null;
 						}
 					}
@@ -1181,7 +1182,7 @@
 					currentProcessType = CurrentProcessType.BuildAutomationTool;
 					if (UnrealBinaryBuilderHelpers.AutomationToolExists(SetupBatFilePath.Text) == true)
 					{
-						AddLogEntry("Skip building Automation Tool. Already exists.");
+						AddLogEntry($"Skip building ${UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_NAME}. Already exists.");
 						OnBuildFinished(true);
 						return false;
 					}
@@ -1201,12 +1202,12 @@

 						CreateProcess(processStartInfo, false);
 						ChangeStatusLabel("Building...");
-						GameAnalyticsCSharp.AddProgressStart("Build", "AutomationTool");
+						GameAnalyticsCSharp.AddProgressStart("Build", UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_NAME);
 						return true;
 					}
 					else
 					{
-						AddLogEntry($"Unable to build AutomationTool. MsBuild not found in {MsBuildFile}", true);
+						AddLogEntry($"Unable to build {UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_NAME}. MsBuild not found in {MsBuildFile}", true);
 					}
 				}

@@ -1223,7 +1224,7 @@
 				{
 					if (TryUpdateAutomationExePath() == false)
 					{
-						AddLogEntry("Failed to build Automation Tool Launcher. AutomationExePath was null.", true);
+						AddLogEntry($"Failed to build {UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_LAUNCHER_NAME}. AutomationExePath was null.", true);
 						return null;
 					}
 				}
@@ -1233,7 +1234,7 @@
 				currentProcessType = CurrentProcessType.BuildAutomationToolLauncher;
 				if (File.Exists(AutomationExePath))
 				{
-					AddLogEntry("Skip building Automation Tool Launcher. Already exists.");
+					AddLogEntry($"Skip building ${UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_LAUNCHER_NAME}. Already exists.");
 					OnBuildFinished(true);
 					return false;
 				}
@@ -1255,12 +1256,12 @@

 						CreateProcess(processStartInfo, false);
 						ChangeStatusLabel("Building...");
-						GameAnalyticsCSharp.AddProgressStart("Build", "AutomationToolLauncher");
+						GameAnalyticsCSharp.AddProgressStart("Build", UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_LAUNCHER_NAME);
 						return true;
 					}
 					else
 					{
-						AddLogEntry($"Unable to build ${UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_NAME}. MsBuild not found in {MsBuildFile}", true);
+						AddLogEntry($"Unable to build ${UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_LAUNCHER_NAME}. MsBuild not found in {MsBuildFile}", true);
 					}
 				}
 				else
@@ -1280,7 +1281,7 @@

 						CreateProcess(processStartInfo, false);
 						ChangeStatusLabel("Building...");
-						GameAnalyticsCSharp.AddProgressStart("Build", "AutomationTool");
+						GameAnalyticsCSharp.AddProgressStart("Build", UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_LAUNCHER_NAME);
 						return true;
 					}
 				}
@@ -1649,7 +1650,7 @@

 			if (string.IsNullOrWhiteSpace(FilePath))
 			{
-				HandyControl.Controls.MessageBox.Fatal($"Please choose Engine root folder or {UnrealBinaryBuilderHelpers.AUTOMATION_TOOL_NAME}.exe first.");
+				HandyControl.Controls.MessageBox.Fatal("Please choose Engine root folder first.");
 				return;
 			}


@ Fixed key Find traversal -- PreAction was not invoked on nodes that match the key

--- Utils/DataStructures/SplayTree/Node.cs
+++ Utils/DataStructures/SplayTree/Node.cs
@@ -292,13 +292,13 @@
         /// is not present in the tree.</returns>
         public Node<TKey, TValue> Find(TKey searchKey, NodeTraversalActions<TKey, TValue> nodeActions)
         {
+            if (!nodeActions.InvokeKeyPreAction(this, searchKey))
+                return null;
+
             int comp = nodeActions.KeyComparer.Compare(searchKey, Key);

             if (comp == 0)
                 return this;
-
-            if (!nodeActions.InvokeKeyPreAction(this, searchKey))
-                return null;

             try
             {


Fix argumentnull exception

Fix argumentnull exception

--- WalletWasabi/Services/WalletService.cs
+++ WalletWasabi/Services/WalletService.cs
@@ -264,8 +264,8 @@

 			using (await HandleFiltersLock.LockAsync())
 			{
-				SmartTransaction[] unconfirmedTransactions = null;
-				SmartTransaction[] confirmedTransactions = null;
+				var unconfirmedTransactions = new SmartTransaction[0];
+				var confirmedTransactions = new SmartTransaction[0];

 				if (File.Exists(TransactionsFilePath))
 				{


Fix fingerprint issue

Fix fingerprint issue

--- WalletWasabi/Services/WalletService.cs
+++ WalletWasabi/Services/WalletService.cs
@@ -1258,7 +1258,8 @@
 			}

 			PSBT psbt = PSBT.FromTransaction(tx);
-			uint masterFP = BitConverter.ToUInt32(KeyManager.ExtPubKey.Fingerprint);
+			//uint masterFP = BitConverter.ToUInt32(KeyManager.ExtPubKey.Fingerprint); - DON'T DO THIS, THERE ARE SOME FINGERPRINT CONSISTENCY ISSUES
+			uint masterFP = BitConverter.ToUInt32(ByteHelpers.FromHex(KeyManager.HardwareWalletInfo.Fingerprint));
 			HashSet<SmartCoin> allTxCoins = spentCoins.Concat(innerWalletOutputs).Concat(outerWalletOutputs).ToHashSet();
 			foreach (var coin in allTxCoins)
 			{


Make sure unconfirmed transactions are not lost at wallet crash

--- WalletWasabi/Services/WalletService.cs
+++ WalletWasabi/Services/WalletService.cs
@@ -238,6 +238,7 @@
 				// Load in dummy mempool
 				if (File.Exists(TransactionsFilePath))
 				{
+					var deleteTxFile = false;
 					try
 					{
 						string jsonString = File.ReadAllText(TransactionsFilePath, Encoding.UTF8);
@@ -251,23 +252,28 @@
 							}
 							catch (Exception ex)
 							{
+								deleteTxFile = true;
 								Logger.LogWarning<WalletService>(ex);
 							}
 						}
 					}
 					catch (Exception ex)
 					{
+						deleteTxFile = true;
 						Logger.LogWarning<WalletService>(ex);
 					}

-					try
-					{
-						File.Delete(TransactionsFilePath);
-					}
-					catch (Exception ex)
-					{
-						// Don't fail because of this. It's not important.
-						Logger.LogWarning<WalletService>(ex);
+					if (deleteTxFile)
+					{
+						try
+						{
+							File.Delete(TransactionsFilePath);
+						}
+						catch (Exception ex)
+						{
+							// Don't fail because of this. It's not important.
+							Logger.LogWarning<WalletService>(ex);
+						}
 					}
 				}
 			}


Speed up processtransaction a bit

Speed up processtransaction a bit

--- WalletWasabi/Services/WalletService.cs
+++ WalletWasabi/Services/WalletService.cs
@@ -425,14 +425,14 @@
 			//		add coin

 			var justUpdate = new List<SmartCoin>();
-			for (var i = 0; i < tx.Transaction.Outputs.Count; i++)
-			{
-				// If we already had it, just update the height. Maybe got from mempool to block or reorged.
-				SmartCoin foundCoin = Coins.FirstOrDefault(x => x.TransactionId == txId && x.Index == i);
-				if (foundCoin != default)
-				{
-					// If tx height is mempool then don't, otherwise update the height.
-					if (tx.Height != Height.MemPool)
+			// If tx height is mempool then don't, otherwise update the height.
+			if (tx.Height != Height.MemPool)
+			{
+				for (var i = 0; i < tx.Transaction.Outputs.Count; i++)
+				{
+					// If we already had it, just update the height. Maybe got from mempool to block or reorged.
+					SmartCoin foundCoin = Coins.FirstOrDefault(x => x.TransactionId == txId && x.Index == i);
+					if (foundCoin != default)
 					{
 						foundCoin.Height = tx.Height;
 						justUpdate.Add(foundCoin);


Fix for 45743 which works with iOS 8 (#616)

* Explicitly set window bounds when presenting alert

* Remove unused methods

--- Xamarin.Forms.Platform.iOS/Platform.cs
+++ Xamarin.Forms.Platform.iOS/Platform.cs
@@ -46,13 +46,9 @@
 				if (!PageIsChildOfPlatform(sender))
 					return;

-				if (Forms.IsiOS9OrNewer)
+				if (Forms.IsiOS8OrNewer)
 				{
 					PresentAlert(arguments);
-				}
-				else if (Forms.IsiOS8OrNewer)
-				{
-					Present8Alert(arguments);
 				}
 				else
 				{
@@ -70,13 +66,9 @@
 					pageRoot = (Page)pageRoot.RealParent;
 				var pageRenderer = GetRenderer(pageRoot);

-				if (Forms.IsiOS9OrNewer)
+				if (Forms.IsiOS8OrNewer)
 				{
 					PresentActionSheet(arguments);
-				}
-				else if (Forms.IsiOS8OrNewer)
-				{
-					Present8ActionSheet(arguments, pageRenderer);
 				}
 				else
 				{
@@ -460,6 +452,12 @@
 				alert.PopoverPresentationController.PermittedArrowDirections = 0; // No arrow
 			}

+			if(!Forms.IsiOS9OrNewer)
+			{
+				// For iOS 8, we need to explicitly set the size of the window
+				window.Frame = new RectangleF(0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height);
+			}
+
 			window.RootViewController.PresentViewController(alert, true, null);
 		}

@@ -522,62 +520,6 @@
 			};
 		}

-		void Present8Alert(AlertArguments arguments)
-		{
-			var alert = UIAlertController.Create(arguments.Title, arguments.Message, UIAlertControllerStyle.Alert);
-			var oldFrame = alert.View.Frame;
-			alert.View.Frame = new RectangleF(oldFrame.X, oldFrame.Y, oldFrame.Width, oldFrame.Height - _alertPadding * 2);
-			alert.AddAction(UIAlertAction.Create(arguments.Cancel, UIAlertActionStyle.Cancel, a => arguments.SetResult(false)));
-			if (arguments.Accept != null)
-				alert.AddAction(UIAlertAction.Create(arguments.Accept, UIAlertActionStyle.Default, a => arguments.SetResult(true)));
-			var page = _modals.Any() ? _modals.Last() : Page;
-			var vc = GetRenderer(page).ViewController;
-			vc.PresentViewController(alert, true, null);
-		}
-
-		void Present8ActionSheet(ActionSheetArguments arguments, IVisualElementRenderer pageRenderer)
-		{
-			var alert = UIAlertController.Create(arguments.Title, null, UIAlertControllerStyle.ActionSheet);
-
-			if (arguments.Cancel != null)
-			{
-				alert.AddAction(UIAlertAction.Create(arguments.Cancel, UIAlertActionStyle.Cancel, a => arguments.SetResult(arguments.Cancel)));
-			}
-
-			if (arguments.Destruction != null)
-			{
-				alert.AddAction(UIAlertAction.Create(arguments.Destruction, UIAlertActionStyle.Destructive, a => arguments.SetResult(arguments.Destruction)));
-			}
-
-			foreach (var label in arguments.Buttons)
-			{
-				if (label == null)
-					continue;
-
-				var blabel = label;
-				alert.AddAction(UIAlertAction.Create(blabel, UIAlertActionStyle.Default, a => arguments.SetResult(blabel)));
-			}
-
-			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
-			{
-				UIDevice.CurrentDevice.BeginGeneratingDeviceOrientationNotifications();
-				var observer = NSNotificationCenter.DefaultCenter.AddObserver(UIDevice.OrientationDidChangeNotification,
-					n => { alert.PopoverPresentationController.SourceRect = pageRenderer.ViewController.View.Bounds; });
-
-				arguments.Result.Task.ContinueWith(t =>
-				{
-					NSNotificationCenter.DefaultCenter.RemoveObserver(observer);
-					UIDevice.CurrentDevice.EndGeneratingDeviceOrientationNotifications();
-				}, TaskScheduler.FromCurrentSynchronizationContext());
-
-				alert.PopoverPresentationController.SourceView = pageRenderer.ViewController.View;
-				alert.PopoverPresentationController.SourceRect = pageRenderer.ViewController.View.Bounds;
-				alert.PopoverPresentationController.PermittedArrowDirections = 0; // No arrow
-			}
-
-			pageRenderer.ViewController.PresentViewController(alert, true, null);
-		}
-
 		internal class DefaultRenderer : VisualElementRenderer<VisualElement>
 		{
 		}