Minor tweak

Minor tweak

--- AngleSharp/Css/ValueConverters/UnorderedOptionsConverter.cs
+++ AngleSharp/Css/ValueConverters/UnorderedOptionsConverter.cs
@@ -34,19 +34,26 @@

         public IPropertyValue Construct(CssProperty[] properties)
         {
-            var values = new IPropertyValue[_converters.Length];
+            var result = properties.Guard<OptionsValue>();

-            for (var i = 0; i < _converters.Length; i++)
+            if (result == null)
             {
-                var result = _converters[i].Construct(properties);
+                var values = new IPropertyValue[_converters.Length];

-                if (result == null)
-                    return null;
+                for (var i = 0; i < _converters.Length; i++)
+                {
+                    var value = _converters[i].Construct(properties);

-                values[i] = result;
+                    if (value == null)
+                        return null;
+
+                    values[i] = value;
+                }
+
+                result = new OptionsValue(values, Enumerable.Empty<CssToken>());
             }

-            return new OptionsValue(values, Enumerable.Empty<CssToken>());
+            return result;
         }

         sealed class OptionsValue : IPropertyValue


Fix feature FootprintY having FootprintX value

--- Mappy/Data/FeatureRecord.cs
+++ Mappy/Data/FeatureRecord.cs
@@ -30,7 +30,7 @@
                     World = n.Entries.GetOrDefault("world", string.Empty),
                     Category = n.Entries.GetOrDefault("category", string.Empty),
                     FootprintX = TdfConvert.ToInt32(n.Entries.GetOrDefault("footprintx", "0")),
-                    FootprintY = TdfConvert.ToInt32(n.Entries.GetOrDefault("footprintx", "0")),
+                    FootprintY = TdfConvert.ToInt32(n.Entries.GetOrDefault("footprintz", "0")),
                     AnimFileName = n.Entries.GetOrDefault("filename", string.Empty),
                     SequenceName = n.Entries.GetOrDefault("seqname", string.Empty),
                     ObjectName = n.Entries.GetOrDefault("object", string.Empty)


typos in documentation removed

typos in documentation removed

--- Maxwe11.Bimap/BitsReader.cs
+++ Maxwe11.Bimap/BitsReader.cs
@@ -64,7 +64,7 @@
         /// <param name="bitsCount"></param>
         /// <returns>The 8-bit unsigned integer value of the specified amount of bits</returns>
         /// <exception cref="ArgumentException">Thrown if <paramref name="bitsCount"/> is not in inclusive range [1, 8]</exception>
-        /// <exception cref="InvalidOperationException">Thow if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
+        /// <exception cref="InvalidOperationException">Thrown if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
         public byte ReadUInt8(int bitsCount = BitsCount.BitsPerByte)
         {
             BitsCount.EnsureBitsCount(bitsCount, BitsCount.BitsPerByte);
@@ -83,7 +83,7 @@
         /// <param name="bitsCount"></param>
         /// <returns>The 16-bit unsigned integer value of the specified amount of bits</returns>
         /// <exception cref="ArgumentException">Thrown if <paramref name="bitsCount"/> is not in inclusive range [1, 16]</exception>
-        /// <exception cref="InvalidOperationException">Thow if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
+        /// <exception cref="InvalidOperationException">Thrown if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
         [CLSCompliant(false)]
         public ushort ReadUInt16(int bitsCount = BitsCount.BitsPerWord)
         {
@@ -103,7 +103,7 @@
         /// <param name="bitsCount"></param>
         /// <returns>The 32-bit unsigned integer value of the specified amount of bits</returns>
         /// <exception cref="ArgumentException">Thrown if <paramref name="bitsCount"/> is not in inclusive range [1, 32]</exception>
-        /// <exception cref="InvalidOperationException">Thow if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
+        /// <exception cref="InvalidOperationException">Thrown if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
         [CLSCompliant(false)]
         public uint ReadUInt32(int bitsCount = BitsCount.BitsPerDWord)
         {
@@ -123,7 +123,7 @@
         /// <param name="bitsCount"></param>
         /// <returns>The 64-bit unsigned integer value of the specified amount of bits</returns>
         /// <exception cref="ArgumentException">Thrown if <paramref name="bitsCount"/> is not in inclusive range [1, 64]</exception>
-        /// <exception cref="InvalidOperationException">Thow if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
+        /// <exception cref="InvalidOperationException">Thrown if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
         [CLSCompliant(false)]
         public ulong ReadUInt64(int bitsCount = BitsCount.BitsPerQWord)
         {
@@ -143,7 +143,7 @@
         /// <param name="bitsCount"></param>
         /// <returns>The 8-bit signed integer value of the specified amount of bits</returns>
         /// <exception cref="ArgumentException">Thrown if <paramref name="bitsCount"/> is not in inclusive range [1, 8]</exception>
-        /// <exception cref="InvalidOperationException">Thow if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
+        /// <exception cref="InvalidOperationException">Thrown if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
         [CLSCompliant(false)]
         public sbyte ReadInt8(int bitsCount = BitsCount.BitsPerByte)
         {
@@ -175,7 +175,7 @@
         /// <param name="bitsCount"></param>
         /// <returns>The 16-bit signed integer value of the specified amount of bits</returns>
         /// <exception cref="ArgumentException">Thrown if <paramref name="bitsCount"/> is not in inclusive range [1, 16]</exception>
-        /// <exception cref="InvalidOperationException">Thow if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
+        /// <exception cref="InvalidOperationException">Thrown if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
         public short ReadInt16(int bitsCount = BitsCount.BitsPerWord)
         {
             BitsCount.EnsureBitsCount(bitsCount, BitsCount.BitsPerWord);
@@ -206,7 +206,7 @@
         /// <param name="bitsCount"></param>
         /// <returns>The 32-bit signed integer value of the specified amount of bits</returns>
         /// <exception cref="ArgumentException">Thrown if <paramref name="bitsCount"/> is not in inclusive range [1, 32]</exception>
-        /// <exception cref="InvalidOperationException">Thow if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
+        /// <exception cref="InvalidOperationException">Thrown if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
         public int ReadInt32(int bitsCount = BitsCount.BitsPerDWord)
         {
             BitsCount.EnsureBitsCount(bitsCount, BitsCount.BitsPerDWord);
@@ -237,7 +237,7 @@
         /// <param name="bitsCount"></param>
         /// <returns>The 64-bit signed integer value of the specified amount of bits</returns>
         /// <exception cref="ArgumentException">Thrown if <paramref name="bitsCount"/> is not in inclusive range [1, 64]</exception>
-        /// <exception cref="InvalidOperationException">Thow if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
+        /// <exception cref="InvalidOperationException">Thrown if requested <paramref name="bitsCount"/> amount of bits couldn't be read</exception>
         public long ReadInt64(int bitsCount = BitsCount.BitsPerQWord)
         {
             BitsCount.EnsureBitsCount(bitsCount, BitsCount.BitsPerQWord);


For re-build

For re-build

--- Modules/Wow/WarcraftLogs.cs
+++ Modules/Wow/WarcraftLogs.cs
@@ -299,6 +299,7 @@
             {
                 guildList = db.WowGuildAssociations.ToList();
                 logWatchList = db.LogMonitoring.ToList();
+
             }
             if (guildList != null)
             {


Delete AssemblyInfo.cs

Delete AssemblyInfo.cs


Make Array(JSValue[]) ctor public

Make Array(JSValue[]) ctor public

--- NiL.JS/BaseLibrary/Array.cs
+++ NiL.JS/BaseLibrary/Array.cs
@@ -62,7 +62,8 @@
                 _data[(int)((uint)length - 1)] = null;
         }

-        internal Array(JSValue[] data)
+        [DoNotEnumerate]
+        public Array(JSValue[] data)
         {
             _oValue = this;
             _valueType = JSValueType.Object;


Add description for the mapserver installer

--- PackageList.aspx.cs
+++ PackageList.aspx.cs
@@ -60,6 +60,9 @@

         if (Regex.Match(file.Name, @"MapScript-.*py.*\.(exe|msi)", RegexOptions.IgnoreCase).Success)
             return "Installer for the MapScript python bindings (Not yet working)";
+
+        if (Regex.Match(file.Name, @"mapserver.*\.msi", RegexOptions.IgnoreCase).Success)
+            return "MapServer installer with IIS registration support, including GDAL. The plugin installers can be used to install further drivers. When registering with IIS, the IIS6 management compatibility option should be installed in the IIS7+ web servers.";

         return "";
     }


Changing user export to support windows authentication in addition to sql authentication by allowing the dp.type_desc of the database principle to be 'WINDOWS_USER' in addition to 'SQL_User'.  Still filtering out guest and dbo by checking that dp.sid doesn't match 0x00 or 0x01 but added a check by name because I came across a case where my dbo user had a different value.  Implications of these changes should be minimal as all current filters/criteria still exist and additional filters/criteria will only affect users who have data that will benefit from these changes.

--- model/Models/Database.cs
+++ model/Models/Database.cs
@@ -335,8 +335,8 @@
 				select dp.name as UserName, USER_NAME(drm.role_principal_id) as AssociatedDBRole, default_schema_name
 				from sys.database_principals dp
 				left outer join sys.database_role_members drm on dp.principal_id = drm.member_principal_id
-				where dp.type_desc = 'SQL_USER'
-				and dp.sid not in (0x00, 0x01) --ignore guest and dbo
+				where (dp.type_desc = 'SQL_USER' or dp.type_desc = 'WINDOWS_USER')
+				and dp.sid not in (0x00, 0x01) and dp.name not in ('dbo', 'guest')
 				and dp.is_fixed_role = 0
 				order by dp.name";
 			SqlUser u = null;


fix null reference

fix null reference

--- osu.Framework/Input/InputManager.cs
+++ osu.Framework/Input/InputManager.cs
@@ -378,7 +378,7 @@
             var mouse = state.Mouse;

             // confine cursor
-            if ((Host.Window.CursorState & CursorState.Confined) > 0)
+            if (Host.Window != null && (Host.Window.CursorState & CursorState.Confined) > 0)
             {
                 mouse.Position = Vector2.Clamp(mouse.Position, Vector2.Zero, new Vector2(Host.Window.Width, Host.Window.Height));
             }


Expose FocusedDrawable

Expose FocusedDrawable

--- osu.Framework/Input/InputManager.cs
+++ osu.Framework/Input/InputManager.cs
@@ -38,7 +38,7 @@
         [Resolved(CanBeNull = true)]
         protected GameHost Host { get; private set; }

-        internal Drawable FocusedDrawable;
+        public Drawable FocusedDrawable { get; internal set; }

         protected abstract IEnumerable<InputHandler> InputHandlers { get; }


Ensure `WorkingBeatmap` is invalidated after update

--- osu.Game/Beatmaps/BeatmapUpdater.cs
+++ osu.Game/Beatmaps/BeatmapUpdater.cs
@@ -16,13 +16,13 @@
     /// </summary>
     public class BeatmapUpdater
     {
-        private readonly BeatmapManager beatmapManager;
+        private readonly IWorkingBeatmapCache workingBeatmapCache;
         private readonly BeatmapOnlineLookupQueue onlineLookupQueue;
         private readonly BeatmapDifficultyCache difficultyCache;

-        public BeatmapUpdater(BeatmapManager beatmapManager, BeatmapOnlineLookupQueue onlineLookupQueue, BeatmapDifficultyCache difficultyCache)
+        public BeatmapUpdater(IWorkingBeatmapCache workingBeatmapCache, BeatmapOnlineLookupQueue onlineLookupQueue, BeatmapDifficultyCache difficultyCache)
         {
-            this.beatmapManager = beatmapManager;
+            this.workingBeatmapCache = workingBeatmapCache;
             this.onlineLookupQueue = onlineLookupQueue;
             this.difficultyCache = difficultyCache;
         }
@@ -48,17 +48,19 @@

                 foreach (var beatmap in beatmapSet.Beatmaps)
                 {
-                    var working = beatmapManager.GetWorkingBeatmap(beatmap);
-
                     // Because we aren't guaranteed all processing will happen on this thread, it's very hard to use the live realm object.
                     // This can be fixed by adding a synchronous flow to `BeatmapDifficultyCache`.
                     var detachedBeatmap = beatmap.Detach();

                     beatmap.StarRating = difficultyCache.GetDifficultyAsync(detachedBeatmap).GetResultSafely()?.Stars ?? 0;
+
+                    var working = workingBeatmapCache.GetWorkingBeatmap(beatmap);
                     beatmap.Length = calculateLength(working.Beatmap);
                     beatmap.BPM = 60000 / working.Beatmap.GetMostCommonBeatLength();
                 }
             });
+
+            workingBeatmapCache.Invalidate(beatmapSet);
         }

         private double calculateLength(IBeatmap b)


Make sidebar behaviour feel a bit nicer.

--- osu.Game/Overlays/OptionsOverlay.cs
+++ osu.Game/Overlays/OptionsOverlay.cs
@@ -22,6 +22,7 @@
 using osu.Game.Overlays.Options.Graphics;
 using osu.Game.Overlays.Options.Input;
 using osu.Game.Overlays.Options.Online;
+using System;

 namespace osu.Game.Overlays
 {
@@ -112,8 +113,7 @@
                         {
                             Selected = sections[0] == section,
                             Section = section,
-                            Action = () => scrollContainer.ScrollTo(
-                                scrollContainer.GetChildYInContent(section) - scrollContainer.DrawSize.Y / 2),
+                            Action = () => scrollContainer.ScrollIntoView(section),
                         }
                     ).ToArray()
                 }
@@ -130,25 +130,30 @@
         {
             base.Update();

-            if (scrollContainer.Current != lastKnownScroll)
+            float currentScroll = scrollContainer.Current;
+            if (currentScroll != lastKnownScroll)
             {
-                lastKnownScroll = scrollContainer.Current;
+                lastKnownScroll = currentScroll;

-                for (int i = sections.Length - 1; i >= 0; i--)
+                OptionsSection bestCandidate = null;
+                float bestDistance = float.MaxValue;
+
+                foreach (OptionsSection section in sections)
                 {
-                    var section = sections[i];
-                    float y = scrollContainer.GetChildYInContent(section) - scrollContainer.Current;
-                    if (y <= scrollContainer.DrawSize.Y / 2 + 25)
+                    float distance = Math.Abs(scrollContainer.GetChildYInContent(section) - currentScroll);
+                    if (distance < bestDistance)
                     {
-                        var previous = sidebarButtons.SingleOrDefault(sb => sb.Selected);
-                        var next = sidebarButtons.SingleOrDefault(sb => sb.Section == section);
-                        if (next != null)
-                        {
-                            previous.Selected = false;
-                            next.Selected = true;
-                        }
-                        break;
+                        bestDistance = distance;
+                        bestCandidate = section;
                     }
+                }
+
+                var previous = sidebarButtons.SingleOrDefault(sb => sb.Selected);
+                var next = sidebarButtons.SingleOrDefault(sb => sb.Section == bestCandidate);
+                if (next != null)
+                {
+                    previous.Selected = false;
+                    next.Selected = true;
                 }
             }
         }


Fix tracking position during 150ms state change delay

--- osu.Game/Screens/Menu/ButtonArea.cs
+++ osu.Game/Screens/Menu/ButtonArea.cs
@@ -32,6 +32,7 @@
                 RelativeSizeAxes = Axes.X,
                 Size = new Vector2(1, BUTTON_AREA_HEIGHT),
                 Alpha = 0,
+                AlwaysPresent = true, // Always needs to be present for correct tracking on initial -> toplevel state change
                 Children = new Drawable[]
                 {
                     buttonAreaBackground = new ButtonAreaBackground(),


parameter renaming + typo

parameter renaming + typo

--- Promises/Promise.cs
+++ Promises/Promise.cs
@@ -254,7 +254,7 @@

 		public Promise<T> Recover(Func<PromiseError, T> f)
 		{
-			return Recover(e => new Promise<T>(cb => cb(null, f(e))));
+			return Recover(error => new Promise<T>(cb => cb(null, f(error))));
 		}

 		/// <summary>
@@ -273,7 +273,7 @@
 		}

 		/// <summary>
-		/// Combine two promises of different types into one promise of a pair.
+		/// Combine two promises of different types into one promise of a tuple.
 		/// </summary>
 		public Promise<Tuple<T, S>> Combine<S>(Promise<S> that)
 		{


Log BASS failure in runtime as important and return

--- osu.Framework/Audio/AudioManager.cs
+++ osu.Framework/Audio/AudioManager.cs
@@ -245,7 +245,11 @@
                 InitBass(deviceIndex);
             }

-            Trace.Assert(Bass.LastError == Errors.OK);
+            if (Bass.LastError != Errors.OK)
+            {
+                Logger.Log($@"BASS failed to initialize with error code {Bass.LastError:D}: {Bass.LastError}.", LoggingTarget.Runtime, LogLevel.Important);
+                return false;
+            }

             Logger.Log($@"BASS Initialized
                           BASS Version:               {Bass.Version}


Excess newline.

Excess newline.

--- osu.Framework/Audio/AudioManager.cs
+++ osu.Framework/Audio/AudioManager.cs
@@ -110,7 +110,6 @@

         /// <summary>
         /// Returns a list of the names of recognized audio devices.
-        ///
         /// </summary>
         /// <remarks>
         /// The No Sound device that is in the list of Audio Devices that are stored internally is not returned.


Remove IgnoreTooltip; Override TooltipText to null

--- osu.Game/Overlays/Mods/ModButton.cs
+++ osu.Game/Overlays/Mods/ModButton.cs
@@ -35,7 +35,6 @@
         public Action<Mod> Action; // Passed the selected mod or null if none

         public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty;
-        public bool IgnoreTooltip => false;

         private const Easing mod_switch_easing = Easing.InOutSine;
         private const double mod_switch_duration = 120;
@@ -263,10 +262,10 @@

         private class DisplayableModIcon : ModIcon {

-            public override bool IgnoreTooltip { get; }
-
+            public override string TooltipText { get; }
+
             public DisplayableModIcon(Mod mod) : base(mod) {
-                IgnoreTooltip = true;
+                TooltipText = null;
             }

         }


Only initialise when required

Only initialise when required

--- osu.Game/Skinning/SkinnableSound.cs
+++ osu.Game/Skinning/SkinnableSound.cs
@@ -16,7 +16,7 @@
     {
         private readonly ISampleInfo[] hitSamples;

-        private readonly List<(AdjustableProperty, BindableDouble)> adjustments = new List<(AdjustableProperty, BindableDouble)>();
+        private List<(AdjustableProperty, BindableDouble)> adjustments;

         private SampleChannel[] channels;

@@ -56,13 +56,15 @@

         public void AddAdjustment(AdjustableProperty type, BindableDouble adjustBindable)
         {
+            if (adjustments == null) adjustments = new List<(AdjustableProperty, BindableDouble)>();
+
             adjustments.Add((type, adjustBindable));
             channels?.ForEach(c => c.AddAdjustment(type, adjustBindable));
         }

         public void RemoveAdjustment(AdjustableProperty type, BindableDouble adjustBindable)
         {
-            adjustments.Remove((type, adjustBindable));
+            adjustments?.Remove((type, adjustBindable));
             channels?.ForEach(c => c.RemoveAdjustment(type, adjustBindable));
         }

@@ -84,8 +86,9 @@
                     ch.Looping = looping;
                     ch.Volume.Value = s.Volume / 100.0;

-                    foreach (var adjustment in adjustments)
-                        ch.AddAdjustment(adjustment.Item1, adjustment.Item2);
+                    if (adjustments != null)
+                        foreach (var adjustment in adjustments)
+                            ch.AddAdjustment(adjustment.Item1, adjustment.Item2);
                 }

                 return ch;


added "Add Item" button to home page after user authenticates.

--- otr-project/Views/Home/Index.cshtml
+++ otr-project/Views/Home/Index.cshtml
@@ -54,7 +54,18 @@

                     @if (Request.IsAuthenticated){
-

+

+

+

+

+
+                                        <button class="btn btn-large btn-primary">Add Item</button>
+
+

+

+

+

+

Hi, @Session["USER_F_NAME"]
@@ -148,7 +159,7 @@

-                                    @Html.DropDownList("RegionId", regionList, "Province", new { @class="input-full search-query input-fatty" })
+                                    @Html.DropDownList("RegionId", regionList, "Province", new { @class = "input-full search-query input-fatty" })


Add missing '.' to /// comment

Add missing '.' to /// comment

Add missing full-stop to XML comment.

--- src/API/Controllers/ErrorController.cs
+++ src/API/Controllers/ErrorController.cs
@@ -19,7 +19,7 @@
         /// <summary>
         /// Gets the view for the error page.
         /// </summary>
-        /// <param name="id">The optional HTTP status code associated with the error</param>
+        /// <param name="id">The optional HTTP status code associated with the error.</param>
         /// <returns>
         /// The view for the error page.
         /// </returns>


Set environment variable configuration to the passed in parameter

--- src/AppHarbor/Commands/LoginCommand.cs
+++ src/AppHarbor/Commands/LoginCommand.cs
@@ -10,7 +10,7 @@
 		public LoginCommand(AppHarborApi appHarborApi, EnvironmentVariableConfiguration environmentVariableConfiguration)
 		{
 			_appHarborApi = appHarborApi;
-			_environmentVariableConfiguration = _environmentVariableConfiguration;
+			_environmentVariableConfiguration = environmentVariableConfiguration;
 		}

 		public void Execute(string[] arguments)


fix menu property updates.

fix menu property updates.

--- src/Avalonia.Native/IAvnAppMenuItem.cs
+++ src/Avalonia.Native/IAvnAppMenuItem.cs
@@ -75,17 +75,17 @@

                 UpdateIsChecked(item.IsChecked);

-                _propertyDisposables.Add(Disposable.Create(() => ManagedMenuItem.GetObservable(NativeMenuItem.HeaderProperty)
-                    .Subscribe(x => UpdateTitle(x))));
+                _propertyDisposables.Add(ManagedMenuItem.GetObservable(NativeMenuItem.HeaderProperty)
+                    .Subscribe(x => UpdateTitle(x)));

-                _propertyDisposables.Add(Disposable.Create(() => ManagedMenuItem.GetObservable(NativeMenuItem.GestureProperty)
-                    .Subscribe(x => UpdateGesture(x))));
+                _propertyDisposables.Add(ManagedMenuItem.GetObservable(NativeMenuItem.GestureProperty)
+                    .Subscribe(x => UpdateGesture(x)));

-                _propertyDisposables.Add(Disposable.Create(() => ManagedMenuItem.GetObservable(NativeMenuItem.CommandProperty)
-                    .Subscribe(x => UpdateAction(ManagedMenuItem as NativeMenuItem))));
+                _propertyDisposables.Add(ManagedMenuItem.GetObservable(NativeMenuItem.CommandProperty)
+                    .Subscribe(x => UpdateAction(ManagedMenuItem as NativeMenuItem)));

-                _propertyDisposables.Add(Disposable.Create(() => ManagedMenuItem.GetObservable(NativeMenuItem.IsCheckedProperty)
-                    .Subscribe(x => UpdateIsChecked(x))));
+                _propertyDisposables.Add(ManagedMenuItem.GetObservable(NativeMenuItem.IsCheckedProperty)
+                    .Subscribe(x => UpdateIsChecked(x)));
             }
         }


Reformat

Reformat

--- src/AvaloniaEdit/Rendering/TextView.cs
+++ src/AvaloniaEdit/Rendering/TextView.cs
@@ -25,6 +25,7 @@
 using System.Globalization;
 using System.Linq;
 using System.Threading.Tasks;
+
 using Avalonia;
 using Avalonia.Controls;
 using Avalonia.Controls.Documents;
@@ -37,6 +38,7 @@
 using Avalonia.Media.TextFormatting;
 using Avalonia.Threading;
 using Avalonia.VisualTree;
+
 using AvaloniaEdit.Document;
 using AvaloniaEdit.Editing;
 using AvaloniaEdit.Utils;
@@ -63,8 +65,8 @@
             FocusableProperty.OverrideDefaultValue<TextView>(false);
             OptionsProperty.Changed.Subscribe(OnOptionsChanged);

-			DocumentProperty.Changed.Subscribe(OnDocumentChanged);
-		}
+            DocumentProperty.Changed.Subscribe(OnDocumentChanged);
+        }

         private readonly ColumnRulerRenderer _columnRulerRenderer;
         private readonly CurrentLineHighlightRenderer _currentLineHighlighRenderer;
@@ -94,7 +96,7 @@
             _hoverLogic.PointerHoverStopped += (sender, e) => RaiseHoverEventPair(e, PreviewPointerHoverStoppedEvent, PointerHoverStoppedEvent);
         }

-		#endregion
+        #endregion

         #region Document Property
         /// <summary>
@@ -433,12 +435,12 @@

         private readonly List<InlineObjectRun> _inlineObjects = new List<InlineObjectRun>();

-		/// <summary>
-		/// Adds a new inline object.
-		/// </summary>
-		internal void AddInlineObject(InlineObjectRun inlineObject)
-		{
-			Debug.Assert(inlineObject.VisualLine != null);
+        /// <summary>
+        /// Adds a new inline object.
+        /// </summary>
+        internal void AddInlineObject(InlineObjectRun inlineObject)
+        {
+            Debug.Assert(inlineObject.VisualLine != null);

             // Remove inline object if its already added, can happen e.g. when recreating textrun for word-wrapping
             var alreadyAdded = false;
@@ -652,7 +654,7 @@
                 {
                     changedSomethingBeforeOrInLine = true;

-                    if ( recreate && offset + length >= lineStart)
+                    if (recreate && offset + length >= lineStart)
                     {
                         _allVisualLines.RemoveAt(i--);
                         DisposeVisualLine(visualLine);
@@ -743,40 +745,43 @@
             return null;
         }

-		/// <summary>
-		/// Gets the visual line that contains the document line with the specified number.
-		/// If that line is outside the visible range, a new VisualLine for that document line is constructed.
-		/// </summary>
-		public VisualLine GetOrConstructVisualLine(DocumentLine documentLine)
-		{
-			if (documentLine == null)
-				throw new ArgumentNullException("documentLine");
-			if (!this.Document.Lines.Contains(documentLine))
-				throw new InvalidOperationException("Line belongs to wrong document");
-			VerifyAccess();
-
-			VisualLine l = GetVisualLine(documentLine.LineNumber);
-			if (l == null) {
-				TextRunProperties globalTextRunProperties = CreateGlobalTextRunProperties();
-				VisualLineTextParagraphProperties paragraphProperties = CreateParagraphProperties(globalTextRunProperties);
-
-				while (_heightTree.GetIsCollapsed(documentLine.LineNumber)) {
-					documentLine = documentLine.PreviousLine;
-				}
-
-				l = BuildVisualLine(documentLine,
-									globalTextRunProperties, paragraphProperties,
-									_elementGenerators.ToArray(), _lineTransformers.ToArray(),
-									_lastAvailableSize);
-				_allVisualLines.Add(l);
-				// update all visual top values (building the line might have changed visual top of other lines due to word wrapping)
-				foreach (var line in _allVisualLines) {
-					line.VisualTop = _heightTree.GetVisualPosition(line.FirstDocumentLine);
-				}
-			}
-			return l;
-		}
-		#endregion
+        /// <summary>
+        /// Gets the visual line that contains the document line with the specified number.
+        /// If that line is outside the visible range, a new VisualLine for that document line is constructed.
+        /// </summary>
+        public VisualLine GetOrConstructVisualLine(DocumentLine documentLine)
+        {
+            if (documentLine == null)
+                throw new ArgumentNullException("documentLine");
+            if (!this.Document.Lines.Contains(documentLine))
+                throw new InvalidOperationException("Line belongs to wrong document");
+            VerifyAccess();
+
+            VisualLine l = GetVisualLine(documentLine.LineNumber);
+            if (l == null)
+            {
+                TextRunProperties globalTextRunProperties = CreateGlobalTextRunProperties();
+                VisualLineTextParagraphProperties paragraphProperties = CreateParagraphProperties(globalTextRunProperties);
+
+                while (_heightTree.GetIsCollapsed(documentLine.LineNumber))
+                {
+                    documentLine = documentLine.PreviousLine;
+                }
+
+                l = BuildVisualLine(documentLine,
+                                    globalTextRunProperties, paragraphProperties,
+                                    _elementGenerators.ToArray(), _lineTransformers.ToArray(),
+                                    _lastAvailableSize);
+                _allVisualLines.Add(l);
+                // update all visual top values (building the line might have changed visual top of other lines due to word wrapping)
+                foreach (var line in _allVisualLines)
+                {
+                    line.VisualTop = _heightTree.GetVisualPosition(line.FirstDocumentLine);
+                }
+            }
+            return l;
+        }
+        #endregion

         #region Visual Lines (fields and properties)

@@ -855,33 +860,34 @@
         }
         #endregion

-		#region Measure
-		/// <summary>
-		/// Additonal amount that allows horizontal scrolling past the end of the longest line.
-		/// This is necessary to ensure the caret always is visible, even when it is at the end of the longest line.
-		/// </summary>
-		private const double AdditionalHorizontalScrollAmount = 3;
-
-		private Size _lastAvailableSize;
-		private bool _inMeasure;
-
-		/// <inheritdoc/>
-		protected override Size MeasureOverride(Size availableSize)
-		{
-			// We don't support infinite available width, so we'll limit it to 32000 pixels.
-			if (availableSize.Width > 32000)
-				availableSize = availableSize.WithWidth(32000);
-
-			if (!_canHorizontallyScroll && !availableSize.Width.IsClose(_lastAvailableSize.Width))
+        #region Measure
+        /// <summary>
+        /// Additonal amount that allows horizontal scrolling past the end of the longest line.
+        /// This is necessary to ensure the caret always is visible, even when it is at the end of the longest line.
+        /// </summary>
+        private const double AdditionalHorizontalScrollAmount = 3;
+
+        private Size _lastAvailableSize;
+        private bool _inMeasure;
+
+        /// <inheritdoc/>
+        protected override Size MeasureOverride(Size availableSize)
+        {
+            // We don't support infinite available width, so we'll limit it to 32000 pixels.
+            if (availableSize.Width > 32000)
+                availableSize = availableSize.WithWidth(32000);
+
+            if (!_canHorizontallyScroll && !availableSize.Width.IsClose(_lastAvailableSize.Width))
             {
                 ClearVisualLines();
             }
-
-			_lastAvailableSize = availableSize;
-
-			foreach (var layer in Layers) {
-				layer.Measure(availableSize);
-			}
+
+            _lastAvailableSize = availableSize;
+
+            foreach (var layer in Layers)
+            {
+                layer.Measure(availableSize);
+            }

             MeasureInlineObjects();

@@ -937,14 +943,14 @@
             return new Size(Math.Min(availableSize.Width, maxWidth), desiredHeight);
         }

-		/// <summary>
-		/// Build all VisualLines in the visible range.
-		/// </summary>
-		/// <returns>Width the longest line</returns>
-		private double CreateAndMeasureVisualLines(Size availableSize)
-		{
-			TextRunProperties globalTextRunProperties = CreateGlobalTextRunProperties();
-			VisualLineTextParagraphProperties paragraphProperties = CreateParagraphProperties(globalTextRunProperties);
+        /// <summary>
+        /// Build all VisualLines in the visible range.
+        /// </summary>
+        /// <returns>Width the longest line</returns>
+        private double CreateAndMeasureVisualLines(Size availableSize)
+        {
+            TextRunProperties globalTextRunProperties = CreateGlobalTextRunProperties();
+            VisualLineTextParagraphProperties paragraphProperties = CreateParagraphProperties(globalTextRunProperties);

             //Debug.WriteLine("Measure availableSize=" + availableSize + ", scrollOffset=" + _scrollOffset);
             var firstLineInView = _heightTree.GetLineByVisualPosition(_scrollOffset.Y);
@@ -1013,59 +1019,64 @@
         private TextFormatter _formatter;
         internal TextViewCachedElements CachedElements;

-		private TextRunProperties CreateGlobalTextRunProperties()
-		{
-			var p = new GlobalTextRunProperties();
-			p.typeface = this.CreateTypeface();
-			p.fontRenderingEmSize = FontSize;
-			p.foregroundBrush = GetValue(TextElement.ForegroundProperty);
-			ExtensionMethods.CheckIsFrozen(p.foregroundBrush);
-			p.cultureInfo = CultureInfo.CurrentCulture;
-			return p;
-		}
-
-		private VisualLineTextParagraphProperties CreateParagraphProperties(TextRunProperties defaultTextRunProperties)
-		{
-			return new VisualLineTextParagraphProperties {
-				defaultTextRunProperties = defaultTextRunProperties,
-				textWrapping = _canHorizontallyScroll ? TextWrapping.NoWrap : TextWrapping.Wrap,
-				tabSize = Options.IndentationSize * WideSpaceWidth
-			};
-		}
-
-		private VisualLine BuildVisualLine(DocumentLine documentLine,
-								   TextRunProperties globalTextRunProperties,
-								   VisualLineTextParagraphProperties paragraphProperties,
-								   VisualLineElementGenerator[] elementGeneratorsArray,
-								   IVisualLineTransformer[] lineTransformersArray,
-								   Size availableSize)
-		{
-			if (_heightTree.GetIsCollapsed(documentLine.LineNumber))
-				throw new InvalidOperationException("Trying to build visual line from collapsed line");
-
-			//Debug.WriteLine("Building line " + documentLine.LineNumber);
-
-			VisualLine visualLine = new VisualLine(this, documentLine);
-			VisualLineTextSource textSource = new VisualLineTextSource(visualLine) {
-				Document = _document,
-				GlobalTextRunProperties = globalTextRunProperties,
-				TextView = this
-			};
-
-			visualLine.ConstructVisualElements(textSource, elementGeneratorsArray);
-
-			if (visualLine.FirstDocumentLine != visualLine.LastDocumentLine) {
-				// Check whether the lines are collapsed correctly:
-				double firstLinePos = _heightTree.GetVisualPosition(visualLine.FirstDocumentLine.NextLine);
-				double lastLinePos = _heightTree.GetVisualPosition(visualLine.LastDocumentLine.NextLine ?? visualLine.LastDocumentLine);
-				if (!firstLinePos.IsClose(lastLinePos)) {
-					for (int i = visualLine.FirstDocumentLine.LineNumber + 1; i <= visualLine.LastDocumentLine.LineNumber; i++) {
-						if (!_heightTree.GetIsCollapsed(i))
-							throw new InvalidOperationException("Line " + i + " was skipped by a VisualLineElementGenerator, but it is not collapsed.");
-					}
-					throw new InvalidOperationException("All lines collapsed but visual pos different - height tree inconsistency?");
-				}
-			}
+        private TextRunProperties CreateGlobalTextRunProperties()
+        {
+            var p = new GlobalTextRunProperties();
+            p.typeface = this.CreateTypeface();
+            p.fontRenderingEmSize = FontSize;
+            p.foregroundBrush = GetValue(TextElement.ForegroundProperty);
+            ExtensionMethods.CheckIsFrozen(p.foregroundBrush);
+            p.cultureInfo = CultureInfo.CurrentCulture;
+            return p;
+        }
+
+        private VisualLineTextParagraphProperties CreateParagraphProperties(TextRunProperties defaultTextRunProperties)
+        {
+            return new VisualLineTextParagraphProperties
+            {
+                defaultTextRunProperties = defaultTextRunProperties,
+                textWrapping = _canHorizontallyScroll ? TextWrapping.NoWrap : TextWrapping.Wrap,
+                tabSize = Options.IndentationSize * WideSpaceWidth
+            };
+        }
+
+        private VisualLine BuildVisualLine(DocumentLine documentLine,
+                                   TextRunProperties globalTextRunProperties,
+                                   VisualLineTextParagraphProperties paragraphProperties,
+                                   VisualLineElementGenerator[] elementGeneratorsArray,
+                                   IVisualLineTransformer[] lineTransformersArray,
+                                   Size availableSize)
+        {
+            if (_heightTree.GetIsCollapsed(documentLine.LineNumber))
+                throw new InvalidOperationException("Trying to build visual line from collapsed line");
+
+            //Debug.WriteLine("Building line " + documentLine.LineNumber);
+
+            VisualLine visualLine = new VisualLine(this, documentLine);
+            VisualLineTextSource textSource = new VisualLineTextSource(visualLine)
+            {
+                Document = _document,
+                GlobalTextRunProperties = globalTextRunProperties,
+                TextView = this
+            };
+
+            visualLine.ConstructVisualElements(textSource, elementGeneratorsArray);
+
+            if (visualLine.FirstDocumentLine != visualLine.LastDocumentLine)
+            {
+                // Check whether the lines are collapsed correctly:
+                double firstLinePos = _heightTree.GetVisualPosition(visualLine.FirstDocumentLine.NextLine);
+                double lastLinePos = _heightTree.GetVisualPosition(visualLine.LastDocumentLine.NextLine ?? visualLine.LastDocumentLine);
+                if (!firstLinePos.IsClose(lastLinePos))
+                {
+                    for (int i = visualLine.FirstDocumentLine.LineNumber + 1; i <= visualLine.LastDocumentLine.LineNumber; i++)
+                    {
+                        if (!_heightTree.GetIsCollapsed(i))
+                            throw new InvalidOperationException("Line " + i + " was skipped by a VisualLineElementGenerator, but it is not collapsed.");
+                    }
+                    throw new InvalidOperationException("All lines collapsed but visual pos different - height tree inconsistency?");
+                }
+            }

             visualLine.RunTransformers(textSource, lineTransformersArray);

@@ -1073,7 +1084,7 @@
             TextLineBreak lastLineBreak = null;
             var textOffset = 0;
             var textLines = new List<TextLine>();
-
+
             while (textOffset <= visualLine.VisualLengthWithEndOfLineMarker)
             {
                 var textLine = _formatter.FormatLine(
@@ -1083,38 +1094,41 @@
                     paragraphProperties,
                     lastLineBreak
                 );
-
+
                 textLines.Add(textLine);
                 textOffset += textLine.Length;

-				// exit loop so that we don't do the indentation calculation if there's only a single line
-				if (textOffset >= visualLine.VisualLengthWithEndOfLineMarker)
-					break;
-
-				if (paragraphProperties.firstLineInParagraph) {
-					paragraphProperties.firstLineInParagraph = false;
-
-					TextEditorOptions options = this.Options;
-					double indentation = 0;
-					if (options.InheritWordWrapIndentation) {
-						// determine indentation for next line:
-						int indentVisualColumn = GetIndentationVisualColumn(visualLine);
-						if (indentVisualColumn > 0 && indentVisualColumn < textOffset) {
-							indentation = textLine.GetDistanceFromCharacterHit(new CharacterHit(indentVisualColumn, 0));
-						}
-					}
-					indentation += options.WordWrapIndentation;
-					// apply the calculated indentation unless it's more than half of the text editor size:
-					if (indentation > 0 && indentation * 2 < availableSize.Width)
-						paragraphProperties.indent = indentation;
-				}
-
-				lastLineBreak = textLine.TextLineBreak;
-            }
-			visualLine.SetTextLines(textLines);
-			_heightTree.SetHeight(visualLine.FirstDocumentLine, visualLine.Height);
-			return visualLine;
-		}
+                // exit loop so that we don't do the indentation calculation if there's only a single line
+                if (textOffset >= visualLine.VisualLengthWithEndOfLineMarker)
+                    break;
+
+                if (paragraphProperties.firstLineInParagraph)
+                {
+                    paragraphProperties.firstLineInParagraph = false;
+
+                    TextEditorOptions options = this.Options;
+                    double indentation = 0;
+                    if (options.InheritWordWrapIndentation)
+                    {
+                        // determine indentation for next line:
+                        int indentVisualColumn = GetIndentationVisualColumn(visualLine);
+                        if (indentVisualColumn > 0 && indentVisualColumn < textOffset)
+                        {
+                            indentation = textLine.GetDistanceFromCharacterHit(new CharacterHit(indentVisualColumn, 0));
+                        }
+                    }
+                    indentation += options.WordWrapIndentation;
+                    // apply the calculated indentation unless it's more than half of the text editor size:
+                    if (indentation > 0 && indentation * 2 < availableSize.Width)
+                        paragraphProperties.indent = indentation;
+                }
+
+                lastLineBreak = textLine.TextLineBreak;
+            }
+            visualLine.SetTextLines(textLines);
+            _heightTree.SetHeight(visualLine.FirstDocumentLine, visualLine.Height);
+            return visualLine;
+        }

         private static int GetIndentationVisualColumn(VisualLine visualLine)
         {
@@ -1181,18 +1195,18 @@
                         foreach (var span in textLine.TextRuns)
                         {
                             var inline = span as InlineObjectRun;
-
+
                             if (inline?.VisualLine != null)
                             {
                                 Debug.Assert(_inlineObjects.Contains(inline));
-
+
                                 var distance = textLine.GetDistanceFromCharacterHit(new CharacterHit(offset));
-
+
                                 inline.Element.Arrange(new Rect(new Point(pos.X + distance, pos.Y), inline.Element.DesiredSize));

                                 Debug.WriteLine(distance);
                             }
-
+
                             offset += span.TextSourceLength;
                         }
                         pos = new Point(pos.X, pos.Y + textLine.Height);
@@ -1472,9 +1486,9 @@
                 var line = _formatter.FormatLine(
                     new SimpleTextSource("x", textRunProperties),
                     0, 32000,
-                    new VisualLineTextParagraphProperties {defaultTextRunProperties = textRunProperties},
+                    new VisualLineTextParagraphProperties { defaultTextRunProperties = textRunProperties },
                     null);
-
+
                 _wideSpaceWidth = Math.Max(1, line.WidthIncludingTrailingWhitespace);
                 _defaultBaseline = Math.Max(1, line.Baseline);
                 _defaultLineHeight = Math.Max(1, line.Height);
@@ -1831,7 +1845,7 @@
             add => AddHandler(PointerHoverStoppedEvent, value);
             remove => RemoveHandler(PointerHoverStoppedEvent, value);
         }
-
+

         private readonly PointerHoverLogic _hoverLogic;

@@ -1887,7 +1901,7 @@
         /// <inheritdoc/>
         protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
         {
-            base.OnPropertyChanged(change);
+            base.OnPropertyChanged(change);

             if (change.Property == TemplatedControl.ForegroundProperty
                      || change.Property == NonPrintableCharacterBrushProperty


fix crashing whereby we can reach render loop when visual lines is not valid.

--- src/AvaloniaEdit/Rendering/TextView.cs
+++ src/AvaloniaEdit/Rendering/TextView.cs
@@ -706,7 +706,6 @@
         /// </summary>
         private void ClearVisualLines()
         {
-            _visibleVisualLines = null;
             if (_allVisualLines.Count != 0)
             {
                 foreach (var visualLine in _allVisualLines)
@@ -714,6 +713,8 @@
                     DisposeVisualLine(visualLine);
                 }
                 _allVisualLines.Clear();
+
+                _visibleVisualLines = new ReadOnlyCollection<VisualLine>(_allVisualLines);
             }
         }

@@ -723,8 +724,7 @@
             {
                 throw new ArgumentException("Cannot dispose visual line because it is in construction!");
             }
-
-            _visibleVisualLines = null;
+
             visualLine.Dispose();
             RemoveInlineObjects(visualLine);
         }


really really fix pollset regression?

really really fix pollset regression?

--- ROS_Comm/PollSet.cs
+++ ROS_Comm/PollSet.cs
@@ -236,20 +236,9 @@
             {
                 if (!sockets_changed)
                     return;
-                foreach (SocketInfo si in socket_info.Values)
-                {
-                    bool dobreak = false;
-                    foreach(PollFD pfd in ufds)
-                    {
-                        if (pfd.sock == si.sock)
-                        {
-                            dobreak = true;
-                            break;
-                        }
-                    }
-                    if (dobreak)
-                        continue;
-                    ufds.Add(new PollFD { events = si.events, sock = si.sock, revents = 0 });
+                foreach (SocketInfo info in socket_info.Values.Where(info => !ufds.Exists(p => p.sock == info.sock)))
+                {
+                    ufds.Add(new PollFD {events = info.events, sock = info.sock, revents = 0});
                 }
                 List<PollFD> gtfo = ufds.Where(fd => !socket_info.ContainsKey(fd.sock)).ToList();
                 foreach (PollFD fd in gtfo)


Quaternions...

Quaternions...

THEY SPINNIN

--- ROS_Comm/tf_node.cs
+++ ROS_Comm/tf_node.cs
@@ -262,51 +262,6 @@
                 xy + wz, 1.0 - (xx + zz), yz - wx,
                 xz - wy, yz + wx, 1.0 - (xx + yy));
         }
-
-        public OILER getEuler()
-        {
-            return getEuler(1);
-        }
-
-        public OILER getEuler(int sol)
-        {
-            OILER out1 = new OILER(), out2 = new OILER();
-            if (Math.Abs(m_el[2].x) >= 1)
-            {
-                out1.yaw = out2.yaw = 0;
-                double delta = Math.Atan2(m_el[2].y, m_el[2].z);
-                if (m_el[2].x < 0)
-                {
-                    out1.pitch = out2.pitch = Math.PI/2.0;
-                    out1.roll = out2.roll = delta;
-                }
-                else
-                {
-                    out1.pitch = out2.pitch = -Math.PI/2.0;
-                    out1.roll = out2.roll = delta;
-                }
-            }
-            else
-            {
-                out1.pitch = -Math.Asin(m_el[2].x);
-                out2.pitch = Math.PI - out1.pitch;
-
-                out1.roll = Math.Atan2(m_el[2].y/Math.Cos(out1.pitch), m_el[2].z/Math.Cos(out1.pitch));
-                out2.roll = Math.Atan2(m_el[2].y/Math.Cos(out2.pitch), m_el[2].z/Math.Cos(out2.pitch));
-
-                out1.yaw = Math.Atan2(m_el[1].x/Math.Cos(out1.pitch), m_el[0].x/Math.Cos(out1.pitch));
-                out2.yaw = Math.Atan2(m_el[1].x/Math.Cos(out2.pitch), m_el[0].x/Math.Cos(out2.pitch));
-            }
-
-            return sol == 1 ? out1 : out2;
-        }
-
-        public struct OILER
-        {
-            //suck it, math nerds
-            public double pitch, roll;
-            public double yaw;
-        }
     }

     public class TransformAccum
@@ -533,6 +488,62 @@
         {
             return string.Format("({0},{1},{2},{3})", x, y, z, w);
         }
+
+        public emVector3 getRPY()
+        {
+            emVector3 ret = new emVector3();
+            double w2 = w * w;
+            double x2 = x * x;
+            double y2 = y * y;
+            double z2 = z * z;
+            double unitLength = length();    // Normalized == 1, otherwise correction divisor.
+            double abcd = w * x + y * z;
+            double eps = Math.E;
+            double pi = Math.PI;
+            if (abcd > (0.5 - eps) * unitLength)
+            {
+                ret.z = 2 * Math.Atan2(y, w);
+                ret.y = pi;
+                ret.x = 0;
+            }
+            else if (abcd < (-0.5 + eps) * unitLength)
+            {
+                ret.z = -2 * Math.Atan2(y, w);
+                ret.y = -pi;
+                ret.x = 0;
+            }
+            else
+            {
+                double adbc = w * z - x * y;
+                double acbd = w * y - x * z;
+                ret.z = Math.Atan2(2 * adbc, 1 - 2 * (z2 + x2));
+                ret.y = Math.Asin(2 * abcd / unitLength);
+                ret.x = Math.Atan2(2 * acbd, 1 - 2 * (y2 + x2));
+            }
+            return ret;
+        }
+
+        public static emQuaternion FromRPY(emVector3 rpy)
+        {
+            double halfroll = rpy.x / 2;
+            double halfpitch = rpy.y / 2;
+            double halfyaw = rpy.z / 2;
+
+            double sin_r2 = Math.Sin(halfroll);
+            double sin_p2 = Math.Sin(halfpitch);
+            double sin_y2 = Math.Sin(halfyaw);
+
+            double cos_r2 = Math.Cos(halfroll);
+            double cos_p2 = Math.Cos(halfpitch);
+            double cos_y2 = Math.Cos(halfyaw);
+
+            return new emQuaternion(
+                cos_r2 * cos_p2 * cos_y2 + sin_r2 * sin_p2 * sin_y2,
+                sin_r2 * cos_p2 * cos_y2 - cos_r2 * sin_p2 * sin_y2,
+                cos_r2 * sin_p2 * cos_y2 + sin_r2 * cos_p2 * sin_y2,
+                cos_r2 * cos_p2 * sin_y2 - sin_r2 * sin_p2 * cos_y2
+                );
+        }
     }

     public class emVector3


Ajustando leitura do retorno do bradesco.

--- src/Boleto.Net/Banco/Banco_Bradesco.cs
+++ src/Boleto.Net/Banco/Banco_Bradesco.cs
@@ -518,7 +518,7 @@
                 detalhe.ValorTitulo = valorTitulo / 100;

                 //Banco Cobrador ==> 166 a 168
-                detalhe.CodigoBanco = Utils.ToInt32(registro.Substring(165, 3));
+                detalhe.CodigoBanco = 237;

                 //Agência Cobradora ==> 169 a 173
                 detalhe.AgenciaCobradora = Utils.ToInt32(registro.Substring(168, 5));


(#65) Fixed broken tests

(#65) Fixed broken tests

--- test/RawRabbit.Tests/Common/BasicPropertiesProviderTests.cs
+++ test/RawRabbit.Tests/Common/BasicPropertiesProviderTests.cs
@@ -13,7 +13,7 @@
 			var provider = new BasicPropertiesProvider(new RawRabbitConfiguration());

 			/* Test */
-			var type = provider.GetProperties<First>().Type;
+			var type = provider.GetProperties<First>().Headers[PropertyHeaders.MessageType];

 			/* Assert */
 			Assert.Equal(expected: "RawRabbit.Tests.Common.First, RawRabbit.Tests", actual: type);
@@ -26,7 +26,7 @@
 			var provider = new BasicPropertiesProvider(new RawRabbitConfiguration());

 			/* Test */
-			var type = provider.GetProperties<Generic<First, Second>>().Type;
+			var type = provider.GetProperties<Generic<First, Second>>().Headers[PropertyHeaders.MessageType];

 			/* Assert */
 			Assert.Equal(expected: "RawRabbit.Tests.Common.Generic`2[[RawRabbit.Tests.Common.First, RawRabbit.Tests],[RawRabbit.Tests.Common.Second, RawRabbit.Tests]], RawRabbit.Tests", actual: type);


Get rid of 'hiding field' warning

Get rid of 'hiding field' warning

--- test/Serilog.Tests/Capturing/PropertyValueConverterTests.cs
+++ test/Serilog.Tests/Capturing/PropertyValueConverterTests.cs
@@ -24,7 +24,7 @@
         [Fact]
         public async Task MaximumDepthIsEffectiveAndThreadSafe()
         {
-            var _converter = new PropertyValueConverter(3, 1000, 1000, Enumerable.Empty<Type>(), Enumerable.Empty<IDestructuringPolicy>(), false);
+            var converter = new PropertyValueConverter(3, 1000, 1000, Enumerable.Empty<Type>(), Enumerable.Empty<IDestructuringPolicy>(), false);

             var barrier = new Barrier(participantCount: 3);

@@ -63,7 +63,7 @@
                 {
                     barrier.SignalAndWait();

-                    var propValue = _converter.CreatePropertyValue(logObject, true);
+                    var propValue = converter.CreatePropertyValue(logObject, true);

                     Assert.IsType<StructureValue>(propValue);


Adding safe getter method to access calibrated and non calibrated data

--- unityproject/app/Assets/Scripts/Calibration/AfterCalib3D.cs
+++ unityproject/app/Assets/Scripts/Calibration/AfterCalib3D.cs
@@ -32,18 +32,28 @@
     private float current_right_pupil_y;
 #endif
 #if USE_LEFT_EYE
-    public float left_pupil_x;
-    public float left_pupil_y;
+    private float left_pupil_x;
+    private float left_pupil_y;
 #endif
 #if USE_RIGHT_EYE
-    public float right_pupil_x;
-    public float right_pupil_y;
+    private float right_pupil_x;
+    private float right_pupil_y;
 #endif

     public void use_calibration(bool use)
     {
         this.useCalibration = use;
     }
+
+	public Vector2 get_cursor_vec()
+	{
+		if (this.enabled) {
+			return new Vector2 (this.left_pupil_x, this.left_pupil_y);
+		} else {
+			Debug.LogError ("You cannot use the coordinates as calibration is not done ..");
+			return Vector2.zero;
+		}
+	}

     // Use this for initialization
     public void load_calib_file_and_initialize (string participant_name, string working_dir)


Highlighted the Users tab when viewing and editing a user profile

--- App/StackExchange.DataExplorer/Controllers/UserController.cs
+++ App/StackExchange.DataExplorer/Controllers/UserController.cs
@@ -79,6 +79,8 @@
             if (user.Id == CurrentUser.Id || CurrentUser.IsAdmin)
             {
                 SetHeader(user.Login + " - Edit");
+                SelectMenuItem("Users");
+
                 return View(user);
             }
             else
@@ -99,6 +101,8 @@
             DBContext db = Current.DB;

             SetHeader(HtmlUtilities.Encode(user.Login));
+            SelectMenuItem("Users");
+
             order_by = order_by ?? "saved";

             ViewData["UserQueryHeaders"] = new SubHeader


:lipstick: Remove unnecessary private properties, use the cleaner syntax

--- CertiPay.Common.Notifications/Notifications/IEmailService.cs
+++ CertiPay.Common.Notifications/Notifications/IEmailService.cs
@@ -7,7 +7,6 @@
 using System.Net.Mail;
 using System.Threading;
 using System.Threading.Tasks;
-using CertiPay.Common.Notifications.Extensions;

 namespace CertiPay.Common.Notifications
 {
@@ -50,42 +49,24 @@

         private readonly SmtpClient _smtp;

-        private static TimeSpan _downloadTimeout = TimeSpan.FromMinutes(1);
-
-        private static IEnumerable<String> _testingDomains = new[] { "certipay.com", "certigy.com" };
-        private static bool _allowedTestingDomainsEnabled = !EnvUtil.IsProd;
-
-        /// <summary>
-        /// The length of time we'll allow for downloading attachments for email notifications
-        /// </summary>
-        public static TimeSpan DownloadTimeout
-        {
-            get { return _downloadTimeout; }
-            set { _downloadTimeout = value; }
-        }
+        /// <summary>
+        /// The length of time we'll allow for downloading attachments for email notifications.
+        ///
+        /// Defaults to one minute.
+        /// </summary>
+        public static TimeSpan DownloadTimeout { get; set; } = TimeSpan.FromMinutes(1);

         /// <summary>
         /// A list of domains that we will allow emails to go to from outside of the production environment
         /// </summary>
-        public static IEnumerable<String> AllowedTestingDomains
-        {
-            get { return _testingDomains; }
-            set { _testingDomains = value; }
-        }
+        public static IEnumerable<String> AllowedTestingDomains { get; set; } = new[] { "certipay.com", "certigy.com" };

         /// <summary>
         /// Determines if AllowedTestingDomains will be evaluated when sending emails.
         /// </summary>
         /// <remarks>Enabled by default in all environments except production.</remarks>
-        public static bool AllowedTestingDomainsEnabled
-        {
-            get { return _allowedTestingDomainsEnabled; }
-            set { _allowedTestingDomainsEnabled = value; }
-        }
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="smtp"></param>
+        public static Boolean AllowedTestingDomainsEnabled { get; set; } = !EnvUtil.IsProd;
+
         public EmailService(SmtpClient smtp)
         {
             this._smtp = smtp;
@@ -161,7 +142,7 @@
             FilterRecipients(message.CC);
             FilterRecipients(message.Bcc);

-            await _smtp
+            await _smtp
                 .SendMailAsync(message)
                 .ContinueWith(result =>
                 {
@@ -172,7 +153,7 @@

         public virtual void FilterRecipients(MailAddressCollection addresses)
         {
-            if (_allowedTestingDomainsEnabled)
+            if (AllowedTestingDomainsEnabled)
             {
                 // This is so we don't accidentally send customers emails from non-prod environments

@@ -229,7 +210,5 @@
                 msg.Subject
             };
         }
-
     }
-
 }


开放LifetimeScope。

开放LifetimeScope。

--- Components/Rabbit.Components.Data.Migrators/MigrationBase.cs
+++ Components/Rabbit.Components.Data.Migrators/MigrationBase.cs
@@ -27,7 +27,7 @@
         /// <summary>
         /// 生命周期。
         /// </summary>
-        public ILifetimeScope LifetimeScope { private get; set; }
+        public ILifetimeScope LifetimeScope { get; set; }

         /// <summary>
         /// 功能模型。


Use themed icon

Use themed icon

--- ConfigurationPage/CalibrationSettings/CalibrationControls.cs
+++ ConfigurationPage/CalibrationSettings/CalibrationControls.cs
@@ -48,7 +48,7 @@
 			buttonRow.AddChild(new HorizontalSpacer());

 			// configure button
-			var configureIcon = AggContext.StaticData.LoadIcon("fa-cog_16.png", IconColor.Raw);
+			var configureIcon = AggContext.StaticData.LoadIcon("fa-cog_16.png", IconColor.Theme);
 			configureButton = new IconButton(configureIcon, theme)
 			{
 				ToolTipText = "Configure".Localize(),


Minor internal changes in recursive optimizer.

--- Cottle/src/Parsers/Optimize/Optimizers/RecursiveOptimizer.cs
+++ Cottle/src/Parsers/Optimize/Optimizers/RecursiveOptimizer.cs
@@ -14,28 +14,31 @@
             // Evaluate constant invoke expressions using pure functions
             new DelegateOptimizer(expression =>
             {
-                if (expression.Type != ExpressionType.Invoke ||
-                    !Array.TrueForAll(expression.Arguments, RecursiveOptimizer.IsExpressionConstant) ||
-                    !RecursiveOptimizer.IsExpressionConstant(expression.Source) ||
-                    expression.Source.Value.Type != ValueContent.Function)
+                if (!(expression.Type == ExpressionType.Invoke &&
+                      Array.TrueForAll(expression.Arguments, RecursiveOptimizer.IsConstant) &&
+                      RecursiveOptimizer.IsConstant(expression.Source) &&
+                      expression.Source.Value.Type == ValueContent.Function &&
+                      expression.Source.Value.AsFunction is NativeFunction function &&
+                      function.Pure))
                     return expression;

-                if (!(expression.Source.Value.AsFunction is NativeFunction function) || !function.Pure)
-                    return expression;
+                using (var writer = new StringWriter())
+                {
+                    var arguments = expression.Arguments.Select(a => a.Value).ToList();

-                return new Expression
-                {
-                    Type = ExpressionType.Constant,
-                    Value = function.Execute(expression.Arguments.Select(a => a.Value).ToList(), new SimpleStore(),
-                        new StringWriter())
-                };
+                    return new Expression
+                    {
+                        Type = ExpressionType.Constant,
+                        Value = function.Execute(arguments, new SimpleStore(), writer)
+                    };
+                }
             }),

             // Converts constant map expressions to constant expressions
             new DelegateOptimizer(expression =>
             {
-                if (expression.Type != ExpressionType.Map ||
-                    !Array.TrueForAll(expression.Elements, RecursiveOptimizer.IsElementConstant))
+                if (!(expression.Type == ExpressionType.Map &&
+                      Array.TrueForAll(expression.Elements, RecursiveOptimizer.IsConstant)))
                     return expression;

                 var pairs = new KeyValuePair<Value, Value>[expression.Elements.Length];
@@ -79,10 +82,15 @@
             })
         });

-        private static readonly Predicate<ExpressionElement> IsElementConstant = e =>
-            RecursiveOptimizer.IsExpressionConstant(e.Key) && RecursiveOptimizer.IsExpressionConstant(e.Value);
+        private static bool IsConstant(Expression expression)
+        {
+            return expression.Type == ExpressionType.Constant;
+        }

-        private static readonly Predicate<Expression> IsExpressionConstant = e => e.Type == ExpressionType.Constant;
+        private static bool IsConstant(ExpressionElement element)
+        {
+            return RecursiveOptimizer.IsConstant(element.Key) && RecursiveOptimizer.IsConstant(element.Value);
+        }

         private readonly IEnumerable<IOptimizer> _optimizers;

@@ -116,15 +124,20 @@
             if (expression.Arguments != null)
             {
                 for (var i = 0; i < expression.Arguments.Length; ++i)
-                    expression.Arguments[i] = Optimize(expression.Arguments[i]);
+                {
+                    var argument = expression.Arguments[i];
+
+                    expression.Arguments[i] = Optimize(argument);
+                }
             }

             if (expression.Elements != null)
             {
                 for (var i = 0; i < expression.Elements.Length; ++i)
                 {
-                    expression.Elements[i] = new ExpressionElement(Optimize(expression.Elements[i].Key),
-                        Optimize(expression.Elements[i].Value));
+                    var element = expression.Elements[i];
+
+                    expression.Elements[i] = new ExpressionElement(Optimize(element.Key), Optimize(element.Value));
                 }
             }


hackable DB list

hackable DB list

--- DbShell.Driver.Common/AbstractDb/IDatabaseServerInterface.cs
+++ DbShell.Driver.Common/AbstractDb/IDatabaseServerInterface.cs
@@ -9,6 +9,8 @@
 {
     public class DatabaseOverviewInfo
     {
+        public string CustomData1; // to allow hacks :-)
+
         public string Name;
         public long RowSizeKB;
         public long LogSizeKB;


delete buffers and textures

delete buffers and textures

--- Demos/CSharpGL.Demos/OrderIndependentTransparencyRenderer.cs
+++ Demos/CSharpGL.Demos/OrderIndependentTransparencyRenderer.cs
@@ -133,6 +133,11 @@
         {
             this.buildListsRenderer.Dispose();
             this.resolve_lists.Dispose();
+
+            GL.DeleteTextures(linked_list_texture.Length, linked_list_texture);
+            GL.DeleteBuffers(linked_list_buffer.Length, linked_list_buffer);
+            GL.DeleteBuffers(atomic_counter_buffer.Length, atomic_counter_buffer);
+            GL.DeleteTextures(head_pointer_texture.Length, head_pointer_texture);
         }
     }
 }


work on #17

work on #17

Added missing method

--- FenixLib/FenixLib.Tests/Unit/IO/FntBitmapFontDecoderTests.cs
+++ FenixLib/FenixLib.Tests/Unit/IO/FntBitmapFontDecoderTests.cs
@@ -29,6 +29,7 @@
         private string[] knownFileMagics;
         private NativeFormatReader createNativeFormatReaderValue;
         private int parseBitsPerPixelValue;
+		private int getPixelDataStartValue;
         private FontEncoding encoding;

         // Tracks the number of times the ReadGlyphInfo functions is called
@@ -147,6 +148,11 @@
             return parseBitsPerPixelValue;
         }

+		protected override int GetPixelDataStart (int bpp)
+		{
+			return getPixelDataStartValue;
+		}
+
         protected override void ProcessFontInfoField ( int codePageType )
         {
             // do nothing


Update bone skin demo to use task for calculation

--- Source/Examples/WPF.SharpDX/BoneSkinDemo/MainViewModel.cs
+++ Source/Examples/WPF.SharpDX/BoneSkinDemo/MainViewModel.cs
@@ -13,6 +13,8 @@
 using Vector3 = global::SharpDX.Vector3;
 using Matrix = global::SharpDX.Matrix;
 using Vector4 = global::SharpDX.Vector4;
+using System.Threading.Tasks;
+using System.Threading;

 namespace BoneSkinDemo
 {
@@ -145,11 +147,11 @@
                 OnPropertyChanged();
                 if (enableAnimation)
                 {
-                    timer.Start();
+                    StartAnimation();
                 }
                 else
                 {
-                    timer.Stop();
+                    cts.Cancel();
                 }
             }
             get
@@ -164,7 +166,6 @@

         private readonly Matrix[] boneInternal = new Matrix[BoneMatricesStruct.NumberOfBones];
         private readonly List<BoneIds> boneParams = new List<BoneIds>();
-        private DispatcherTimer timer = new DispatcherTimer();
         private int frame = 0;
         private bool direction = false;

@@ -172,6 +173,8 @@
         private const int Theta = 24;
         private IList<SharpDX.Vector3> path;
         private int numSegmentPerBone;
+        private CancellationTokenSource cts = new CancellationTokenSource();
+        private SynchronizationContext context = SynchronizationContext.Current;
         public MainViewModel()
         {
             this.Title = "BoneSkin Demo";
@@ -255,14 +258,26 @@
             {
                 Instances.Add(Matrix.Translation(new Vector3(-5 + i * 4, 0, 10)));
             }
-
-            timer.Tick += Timer_Tick;
-            timer.Interval = TimeSpan.FromMilliseconds(30);
-            timer.Start();
+            StartAnimation();
         }

-
-        private void Timer_Tick(object sender, EventArgs e)
+        private void StartAnimation()
+        {
+            cts.Cancel();
+            cts.Dispose();
+            cts = new CancellationTokenSource();
+            var token = cts.Token;
+            Task.Run(() =>
+            {
+                while (!token.IsCancellationRequested)
+                {
+                    Timer_Tick();
+                    Task.Delay(20).Wait();
+                }
+            }, token);
+        }
+
+        private void Timer_Tick()
         {
             double angle = (0.05f*frame) * Math.PI / 180;
             var xAxis = new Vector3(1, 0, 0);
@@ -292,7 +307,11 @@
                     boneInternal[i] = rot * trans;
                 }
             }
-            Bones = new BoneMatricesStruct() { Bones = boneInternal.ToArray() };
+            var newBone =  new BoneMatricesStruct() { Bones = boneInternal.ToArray() };
+            context.Post((o) =>
+            {
+                Bones = newBone;
+            }, null);

             if (frame > 40 || frame < -40)
             {
@@ -326,8 +345,7 @@

         protected override void Dispose(bool disposing)
         {
-            timer.Stop();
-            timer.Tick -= this.Timer_Tick;
+            cts.Cancel(true);
             base.Dispose(disposing);
         }
     }


Implement Custom Search Terms Editor

Implement Custom Search Terms Editor

Switches the mount point search term editor to a reorderable list.

--- Source/Lizitt/Outfitter/Editor/OutfitSearchTermsEditor.cs
+++ Source/Lizitt/Outfitter/Editor/OutfitSearchTermsEditor.cs
@@ -21,33 +21,225 @@
  */
 using com.lizitt.u3d.editor;
 using UnityEditor;
+using UnityEditorInternal;
+using UnityEngine;

 namespace com.lizitt.outfitter.editor
 {
     [CustomEditor(typeof(OutfitSearchTerms))]
+    [CanEditMultipleObjects]
     public class OutfitSearchTermsEditor
         : Editor
     {
+        #region Menu Items
+
         private const string MenuItemName = "Outfit Search Terms";
         private const int MenuPriority = EditorUtil.AssetGroup + OutfitterEditor.MenuPriority + 2;

         [MenuItem(EditorUtil.AssetCreateMenu + MenuItemName, false, MenuPriority)]
         [MenuItem(EditorUtil.UnityAssetCreateMenu + MenuItemName, false, MenuPriority)]
-        static void CreateAsset()
+        private static void CreateAsset()
         {
             var item = EditorUtil.CreateAsset<OutfitSearchTerms>("", OutfitterEditor.AssetLabel);
             Selection.activeObject = item;
         }

+        #endregion
+
+        private const string MountListName = "m_MountTerms";
+        private const string ItemTypeName = "m_MountType";
+        private const string ItemTermName = "m_Term";
+
+        private struct Props
+        {
+            public SerializedProperty headTerm;
+            public SerializedProperty eyeTerm;
+            public SerializedProperty bodyTerm;
+            public SerializedProperty blendTerm;
+
+            public Props(SerializedObject sobj)
+            {
+                headTerm = sobj.FindProperty("m_HeadTerm");
+                eyeTerm = sobj.FindProperty("m_EyeTerm");
+                bodyTerm = sobj.FindProperty("m_BodyTerm");
+                blendTerm = sobj.FindProperty("m_BlendHeadTerm");
+            }
+        }
+
         public override void OnInspectorGUI()
         {
-            base.OnInspectorGUI();
+            serializedObject.Update();
+
+            var props = new Props(serializedObject);
+
+            EditorGUILayout.LabelField("Material Terms", EditorGUIUtil.BoldLabel);
+
+            EditorGUILayout.PropertyField(props.headTerm);
+            EditorGUILayout.PropertyField(props.eyeTerm);
+            EditorGUILayout.PropertyField(props.bodyTerm);

             EditorGUILayout.Separator();
-
-            EditorGUILayout.HelpBox("Terms are used to perform partial case-insenstive matches of"
-                + " object names in an outfit prototype.  The type of object is dependant on the term.",
-                    MessageType.Info, true);
+            EditorGUILayout.LabelField("Renderer Terms", EditorGUIUtil.BoldLabel);
+
+            EditorGUILayout.PropertyField(props.blendTerm);
+
+            DrawMountPointTerms();
+
+            if (UnityEngine.GUI.changed)
+            {
+                UnityEngine.Debug.Log("change");
+                serializedObject.ApplyModifiedProperties();
+            }
+
+            EditorGUILayout.Separator();
+
+            EditorGUILayout.HelpBox("Terms are used to perform partial, case-insenstive matches of"
+                + " object names in an outfit prototype.  The type of object is dependant on the"
+                + " term.",
+                MessageType.Info, true);
+        }
+
+        private ReorderableList m_List;
+
+        private void DrawMountPointTerms()
+        {
+            EditorGUILayout.Separator();
+            EditorGUILayout.LabelField("Mount Points", EditorGUIUtil.BoldLabel);
+
+            if (serializedObject.isEditingMultipleObjects)
+            {
+                EditorGUILayout.HelpBox("Can't edit mount point terms while in multi-edit mode.",
+                    MessageType.Warning, true);
+                return;
+            }
+
+            if (m_List == null)
+                CreateReorderableList();
+
+            m_List.DoLayoutList();
+        }
+
+        private void CreateReorderableList()
+        {
+            var list = new ReorderableList(serializedObject
+                , serializedObject.FindProperty(MountListName)
+                , true, true, true, true);
+
+            list.drawHeaderCallback = delegate(Rect rect)
+            {
+                EditorGUI.LabelField(rect, "Mount Point Terms");
+            };
+
+            list.drawElementCallback =
+                delegate(Rect position, int index, bool isActive, bool isFocused)
+                {
+                    var element = list.serializedProperty.GetArrayElementAtIndex(index);
+
+                    var typProp = element.FindPropertyRelative(ItemTypeName);
+                    var termProp = element.FindPropertyRelative(ItemTermName);
+
+                    GUIContent label;
+
+                    bool hasError = false;
+                    if (typProp.enumValueIndex == -1)
+                    {
+                        label = new GUIContent("Invalid Type", "Enum type value changed or removed?");
+                        hasError = true;
+                    }
+                    else
+                        label = new GUIContent(typProp.enumDisplayNames[typProp.enumValueIndex]);
+
+                    var rect = new Rect(position.x,
+                        position.y + EditorGUIUtility.standardVerticalSpacing,
+                        90, EditorGUIUtility.singleLineHeight);
+
+                    GUIStyle style = GUI.skin.label;
+
+                    if (hasError)
+                        style = EditorGUIUtil.RedLabel;
+
+                    EditorGUI.LabelField(rect, label, style);
+
+                    rect = new Rect(
+                        rect.xMax + 5, rect.y, position.width - rect.width - 5, rect.height);
+
+                    EditorGUI.PropertyField(rect, termProp, GUIContent.none);
+                };
+
+            GenericMenu.MenuFunction2 addItem = delegate(object typValue)
+            {
+                list.index = AddItem(list.serializedProperty, (int)typValue);
+            };
+
+            GenericMenu.MenuFunction addAllItems = delegate()
+            {
+                var stdNames = OutfitterEditorUtil.MountPointTypeNames;
+                var stdValues = OutfitterEditorUtil.MountPointTypeValues;
+
+                var idx = list.serializedProperty.arraySize;
+
+                for (int i = 0; i < stdNames.Length; i++)
+                {
+                    if (!IsInList(list.serializedProperty, stdValues[i]))
+                        AddItem(list.serializedProperty, stdValues[i]);
+                }
+
+                list.index = idx;  // Assumes never called if list is full.
+            };
+
+            list.onAddDropdownCallback = delegate(Rect rect, ReorderableList roList)
+            {
+                var menu = new GenericMenu();
+
+                var stdNames = OutfitterEditorUtil.MountPointTypeNames;
+                var stdValues = OutfitterEditorUtil.MountPointTypeValues;
+
+                for (int i = 0; i < stdNames.Length; i++)
+                {
+                    if (!IsInList(list.serializedProperty, stdValues[i]))
+                        menu.AddItem(new GUIContent(stdNames[i]), false, addItem, stdValues[i]);
+                }
+
+                if (menu.GetItemCount() == 0)
+                    menu.AddDisabledItem(new GUIContent("[None Available]"));
+                else
+                    menu.AddItem(new GUIContent("All"), false, addAllItems);
+
+                menu.ShowAsContext();
+            };
+
+            m_List = list;
+        }
+
+        private int AddItem(SerializedProperty listProp, int typValue)
+        {
+            int nidx = listProp.arraySize;
+
+            listProp.arraySize++;
+
+            var element = listProp.GetArrayElementAtIndex(nidx);
+            element.FindPropertyRelative(ItemTypeName).intValue = typValue;
+            element.FindPropertyRelative(ItemTermName).stringValue = ((MountPointType)typValue).ToString();
+
+            listProp.serializedObject.ApplyModifiedProperties();
+
+            return nidx;
+        }
+
+        private bool IsInList(SerializedProperty listProp, int typValue)
+        {
+            // Hack.
+            if (typValue == (int)MountPointType.Root)
+                return true;
+
+            for (int i = 0; i < listProp.arraySize; i++)
+            {
+                var element = listProp.GetArrayElementAtIndex(i);
+                if (element.FindPropertyRelative(ItemTypeName).intValue == typValue)
+                    return true;
+            }
+
+            return false;
         }
     }
 }


Change formatting of enum values

Change formatting of enum values

The last member now has a comma, to make for cleaner diffs when a new member is added.

Test changes in next commit.

--- Google.Api.Generator.Utils/Formatting/WhitespaceFormatter.cs
+++ Google.Api.Generator.Utils/Formatting/WhitespaceFormatter.cs
@@ -599,8 +599,13 @@
             node = node.WithOpenBraceToken(node.OpenBraceToken.WithLeadingTrivia(NewLine, _indentTrivia).WithTrailingNewLine());
             node = node.WithCloseBraceToken(node.CloseBraceToken.WithLeadingTrivia(_indentTrivia).WithTrailingNewLine());
             node = node.WithMembers(SeparatedList(
-                node.Members.SkipLast(1).Concat(node.Members.TakeLast(1).Select(x => x.WithTrailingNewLine())),
-                node.Members.SkipLast(1).Select(_ => Token(SyntaxKind.CommaToken).WithTrailingNewLine(count: 2))));
+                node.Members,
+                // Members before the final one have a comma and two new lines.
+                // The final member only has a single new line, but does still have the comma.
+                // The comma is optional, but means that there's no diff on that line when a new member is added.
+                node.Members
+                    .SkipLast(1).Select(_ => Token(SyntaxKind.CommaToken).WithTrailingNewLine(count: 2))
+                    .Concat(new[] { Token(SyntaxKind.CommaToken).WithTrailingNewLine(count: 1) })));
             return node;
         }


Refactored InGameInfo class name for consistency.

--- Steam.Models/SteamCommunity/SteamCommunityProfileModel.cs
+++ Steam.Models/SteamCommunity/SteamCommunityProfileModel.cs
@@ -26,7 +26,7 @@
         public string Summary { get; set; }
         public IReadOnlyCollection<SteamCommunityProfileMostPlayedGameModel> MostPlayedGames { get; set; }
         public string InGameServerIP { get; set; }
-        public InGameInfo InGameInfo { get; set; }
+        public InGameInfoModel InGameInfo { get; set; }
     }

     public class SteamCommunityProfileMostPlayedGameModel
@@ -41,7 +41,7 @@
         public string StatsName { get; set; }
     }

-    public class InGameInfo
+    public class InGameInfoModel
     {
         public string GameName { get; set; }
         public string GameLink { get; set; }


Code ready for presentation

Code ready for presentation

--- HowToBecomeADebuggingJedi/GalaxyFarFarAway/ForceUserTypes.cs
+++ HowToBecomeADebuggingJedi/GalaxyFarFarAway/ForceUserTypes.cs
@@ -1,4 +1,5 @@
-using System;
+//May the force be with you
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Diagnostics;
@@ -14,9 +15,12 @@

 #region Debugger Display Attributes
 [assembly: DebuggerDisplay("{Color} {LightsaberType}", Target = typeof(ForceUserWeapon), Name = "{LightsaberType}")]
- [assembly: DebuggerDisplay("Jedi {Name} with {MidiChlorians} MidiChlorians fights with {Weapon.Color} {Weapon.LightsaberType}", Target = typeof(JediKnight))]
- [assembly: DebuggerDisplay("Sith Lord {Name} with {MidiChlorians} MidiChlorians fights with {Weapon.Color} {Weapon.LightsaberType}", Target = typeof(SithLord))]
- [assembly: DebuggerDisplay("{Name}", Target = typeof(Human))]
+[assembly: DebuggerDisplay("Jedi {Name} with {MidiChlorians} MidiChlorians fights with {Weapon.Color} {Weapon.LightsaberType}", Target = typeof(JediKnight))]
+[assembly: DebuggerDisplay("Sith Lord {Name} with {MidiChlorians} MidiChlorians fights with {Weapon.Color} {Weapon.LightsaberType}", Target = typeof(SithLord))]
+[assembly: DebuggerDisplay("{Name}", Target = typeof(Human))]
+
+[assembly: DebuggerVisualizer(typeof(LightsaberVisualizer), typeof(VisualizerObjectSource), Target = typeof(ForceUserWeapon), Description = "Lightsaber weapon")]
+[assembly: DebuggerVisualizer(typeof(HumanVisualizer), typeof(VisualizerObjectSource), Target = typeof(Human), Description = "Force User")]
 #endregion Debugger Display Attributes

 namespace GalaxyFarFarAway
@@ -140,6 +144,9 @@

             //Parallel.Invoke(forceUsers.Select<IForceUser, Action>(user => () => Show(user.MidiChlorians)).ToArray());
             #endregion Multithreading
+
+            Console.WriteLine("Press enter to quit.");
+            Console.ReadLine();
         }

         #region BreakPoints
@@ -169,90 +176,6 @@
             }
         }
         #endregion BreakPoints
-
-        #region DebuggerDisplay Visualizers
-        public class LightsaberVisualizer : DialogDebuggerVisualizer
-        {
-            protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
-            {
-                var weapon = (ForceUserWeapon)objectProvider.GetObject();
-
-                var window = new Window
-                {
-                    Title = $"{weapon.Color} {weapon.LightsaberType}",
-                    Width = 400,
-                    Height = 300
-                };
-
-                var colorsMap = new Dictionary<ConsoleColor, string>
-                {
-                    [ConsoleColor.Cyan] = "CyanLightsaber.png",
-                    [ConsoleColor.Green] = "GreenLightsaber.jpg",
-                    [ConsoleColor.Magenta] = "PurpleLightsaber.png",
-                    [ConsoleColor.Red] = "RedLightsaber.png"
-                };
-
-                string imageName = null;
-
-                switch (weapon.LightsaberType)
-                {
-                    case LightsaberType.Lightsaber:
-                        imageName = colorsMap[weapon.Color];
-                        break;
-                    case LightsaberType.CrossgaurdLightsaber:
-                        imageName = "RedCrossgaurdLightsaber.png";
-                        break;
-                    case LightsaberType.DoubleLightsaber:
-                        imageName = "RedDoubleLightsaber.png";
-                        break;
-                }
-
-                if (null != imageName)
-                {
-                    window.Background = new ImageBrush(new BitmapImage(new Uri($@"pack://application:,,,/{typeof(LightsaberVisualizer).Assembly.GetName().Name};component/Images/{imageName}")));
-                    window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
-
-                    window.ShowDialog();
-                }
-            }
-        }
-
-        public class HumanVisualizer : DialogDebuggerVisualizer
-        {
-            protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
-            {
-                var human = (Human)objectProvider.GetObject();
-
-                var window = new Window
-                {
-                    Title = human.Name,
-                    Width = 400,
-                    Height = 300
-                };
-
-                var nameDictionary = new Dictionary<string, string>
-                {
-                    ["Yoda"] = "Yoda.jpg",
-                    ["Obi-Wan Kenobi"] = "ObiWan.jpg",
-                    ["Luke Skywalker"] = "LukeSkywalker.jpg",
-                    ["Mace Windu"] = "MaceWindu.jpg",
-                    ["Darth Vader"] = "DarthVader.png",
-                    ["Darth Maul"] = "DarthMaul.jpg",
-                    ["Kylo Ren"] = "KyloRen.jpg"
-                };
-
-                if (nameDictionary.ContainsKey(human.Name))
-                {
-                    var name = nameDictionary[human.Name];
-
-                    window.Background = new ImageBrush(new BitmapImage(new Uri($@"pack://application:,,,/{typeof(HumanVisualizer).Assembly.GetName().Name};component/Images/{name}")));
-                    window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
-
-                    window.ShowDialog();
-                }
-            }
-        }
-        #endregion Debuggerdisplay Visualizers

         #region Multithreading
         static async Task TrainMultiThreading(IForceUser user)
@@ -303,4 +226,88 @@
         }
         #endregion Multithreading
     }
+
+    #region DebuggerDisplay Visualizers
+    public class LightsaberVisualizer : DialogDebuggerVisualizer
+    {
+        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
+        {
+            var weapon = (ForceUserWeapon)objectProvider.GetObject();
+
+            var window = new Window
+            {
+                Title = $"{weapon.Color} {weapon.LightsaberType}",
+                Width = 400,
+                Height = 300
+            };
+
+            var colorsMap = new Dictionary<ConsoleColor, string>
+            {
+                [ConsoleColor.Cyan] = "CyanLightsaber.png",
+                [ConsoleColor.Green] = "GreenLightsaber.jpg",
+                [ConsoleColor.Magenta] = "PurpleLightsaber.png",
+                [ConsoleColor.Red] = "RedLightsaber.png"
+            };
+
+            string imageName = null;
+
+            switch (weapon.LightsaberType)
+            {
+                case LightsaberType.Lightsaber:
+                    imageName = colorsMap[weapon.Color];
+                    break;
+                case LightsaberType.CrossgaurdLightsaber:
+                    imageName = "RedCrossgaurdLightsaber.png";
+                    break;
+                case LightsaberType.DoubleLightsaber:
+                    imageName = "RedDoubleLightsaber.png";
+                    break;
+            }
+
+            if (null != imageName)
+            {
+                window.Background = new ImageBrush(new BitmapImage(new Uri($@"pack://application:,,,/{typeof(LightsaberVisualizer).Assembly.GetName().Name};component/Images/{imageName}")));
+                window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
+
+                window.ShowDialog();
+            }
+        }
+    }
+
+    public class HumanVisualizer : DialogDebuggerVisualizer
+    {
+        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
+        {
+            var human = (Human)objectProvider.GetObject();
+
+            var window = new Window
+            {
+                Title = human.Name,
+                Width = 400,
+                Height = 300
+            };
+
+            var nameDictionary = new Dictionary<string, string>
+            {
+                ["Yoda"] = "Yoda.jpg",
+                ["Obi-Wan Kenobi"] = "ObiWan.jpg",
+                ["Luke Skywalker"] = "LukeSkywalker.jpg",
+                ["Mace Windu"] = "MaceWindu.jpg",
+                ["Darth Vader"] = "DarthVader.png",
+                ["Darth Maul"] = "DarthMaul.jpg",
+                ["Kylo Ren"] = "KyloRen.jpg"
+            };
+
+            if (nameDictionary.ContainsKey(human.Name))
+            {
+                var name = nameDictionary[human.Name];
+
+                window.Background = new ImageBrush(new BitmapImage(new Uri($@"pack://application:,,,/{typeof(HumanVisualizer).Assembly.GetName().Name};component/Images/{name}")));
+                window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
+
+                window.ShowDialog();
+            }
+        }
+    }
+    #endregion Debuggerdisplay Visualizers
 }


Fix Registry Name

Fix Registry Name

--- Tulpep.NetworkAutoSwitch.ProxyService/ManageProxyState.cs
+++ Tulpep.NetworkAutoSwitch.ProxyService/ManageProxyState.cs
@@ -38,7 +38,7 @@
         public static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int dwBufferLength);
         public const int INTERNET_OPTION_SETTINGS_CHANGED = 39;
         public const int INTERNET_OPTION_REFRESH = 37;
-        public const string REGISTRY_KEY_IS = "\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";
+        public const string REGISTRY_KEY_IS = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";

         public static void SetProxyState(bool proxyEnabled)
         {


Make anonymity set refreshing itself

Make anonymity set refreshing itself

--- WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
@@ -28,6 +28,7 @@
 		private ObservableAsPropertyHelper<bool> _coinJoinInProgress;
 		private ObservableAsPropertyHelper<bool> _confirmed;
 		private ObservableAsPropertyHelper<string> _cluster;
+		private ObservableAsPropertyHelper<int> _anonymitySet;

 		private volatile bool _disposedValue = false;

@@ -51,6 +52,11 @@
 			_confirmed = Model
 				.WhenAnyValue(x => x.Confirmed)
 				.ToProperty(this, x => x.Confirmed, scheduler: RxApp.MainThreadScheduler)
+				.DisposeWith(Disposables);
+
+			_anonymitySet = Model
+				.WhenAnyValue(x => x.HdPubKey.AnonymitySet)
+				.ToProperty(this, x => x.AnonymitySet, scheduler: RxApp.MainThreadScheduler)
 				.DisposeWith(Disposables);

 			_cluster = Model
@@ -167,7 +173,7 @@

 		public uint OutputIndex => Model.Index;

-		public int AnonymitySet => Model.HdPubKey.AnonymitySet;
+		public int AnonymitySet => _anonymitySet?.Value ?? 1;

 		public string InCoinJoin => Model.CoinJoinInProgress ? "Yes" : "No";


Elevate timeout

Elevate timeout

--- WalletWasabi.Tests/UnitTests/BitcoinCore/P2pBasedTests.cs
+++ WalletWasabi.Tests/UnitTests/BitcoinCore/P2pBasedTests.cs
@@ -49,7 +49,7 @@
 				}
 				var batchTask = batch.SendBatchAsync();

-				var stxs = await eventAwaiter.WaitAsync(TimeSpan.FromSeconds(7));
+				var stxs = await eventAwaiter.WaitAsync(TimeSpan.FromSeconds(21));

 				await batchTask;
 				var hashes = await Task.WhenAll(txTasks);


oneline

oneline

--- WalletWasabi.Tests/UnitTests/TransactionProcessorTests.cs
+++ WalletWasabi.Tests/UnitTests/TransactionProcessorTests.cs
@@ -130,9 +130,7 @@
 			Assert.False(relevant);
 			Assert.Single(transactionProcessor.Coins, coin => coin.Unspent);
 			Assert.Single(transactionProcessor.Coins, coin => !coin.Unspent);
-			Assert.Equal(
-				2,
-				transactionProcessor.TransactionStore.GetTransactions().Count());
+			Assert.Equal(2, transactionProcessor.TransactionStore.GetTransactions().Count());
 		}

 		[Fact]


deleted unused mehtod in Chart & added DrawPoint method

--- WelderCalculator/WelderCalculator/Drawings/Chart/Chart.cs
+++ WelderCalculator/WelderCalculator/Drawings/Chart/Chart.cs
@@ -16,7 +16,6 @@
         {
             _graphics = graph;
             Layers = layers;
-            SetLayersVisibility();
         }

         public void Resize(int width, int height)
@@ -54,16 +53,9 @@
             }
         }

-        public void DrawPoint(Graphics graphics)
+        public void DrawPoint(Graphics graphics, Point point)
         {
-
         }

-        private void SetLayersVisibility()
-        {
-            int maxLayersWidth = Layers.GetActive().Max(l => l.Image.Width);
-            int maxLayersHigth = Layers.GetActive().Max(l => l.Image.Height);
-            Size = new Size(maxLayersWidth, maxLayersHigth);
-        }
     }
 }


Use volatile read/write operations to ensure thread safety.

--- WindowsUpdateManualInstaller/UpdateManagerAsyncWrapper.cs
+++ WindowsUpdateManualInstaller/UpdateManagerAsyncWrapper.cs
@@ -58,19 +58,22 @@
             threadQueue.Add(e);
         }

+        // TODO: Refactor these three similar methods into one method

         public async Task<List<UpdateManager.UpdateEntry>> GetAvailableUpdatesAsync()
         {
             List<UpdateManager.UpdateEntry> val = null;
             Exception ex = null;
+
             AddThreadAction(() =>
             {
-                try {
-                    val = updateManager.GetAvailableUpdates();
+                try
+                {
+                    Volatile.Write(ref val, updateManager.GetAvailableUpdates());
                 }
                 catch (Exception e)
                 {
-                    ex = e;
+                    Volatile.Write(ref ex, e);
                 }
                 finally
                 {
@@ -79,15 +82,18 @@
             });

             await waitSemaphore.WaitAsync();
-            if (ex != null)
-                throw ex;
+
+            Exception myEx = Volatile.Read(ref ex);
+            if (myEx != null)
+                throw myEx;
             else
-                return val;
+                return Volatile.Read(ref val);
         }

         public async Task DownloadUpdatesAsync(List<UpdateManager.UpdateEntry> list)
         {
             Exception ex = null;
+
             AddThreadAction(() =>
             {
                 try
@@ -96,7 +102,7 @@
                 }
                 catch (Exception e)
                 {
-                    ex = e;
+                    Volatile.Write(ref ex, e);
                 }
                 finally
                 {
@@ -105,23 +111,26 @@
             });

             await waitSemaphore.WaitAsync();
-            if (ex != null)
-                throw ex;
+
+            Exception myEx = Volatile.Read(ref ex);
+            if (myEx != null)
+                throw myEx;
         }

         public async Task<UpdateManager.InstallResult> InstallUpdatesAsync(List<UpdateManager.UpdateEntry> list)
         {
             UpdateManager.InstallResult val = null;
             Exception ex = null;
+
             AddThreadAction(() =>
             {
                 try
                 {
-                    val = updateManager.InstallUpdates(list);
+                    Volatile.Write(ref val, updateManager.InstallUpdates(list));
                 }
                 catch (Exception e)
                 {
-                    ex = e;
+                    Volatile.Write(ref ex, e);
                 }
                 finally
                 {
@@ -130,10 +139,12 @@
             });

             await waitSemaphore.WaitAsync();
-            if (ex != null)
-                throw ex;
+
+            Exception myEx = Volatile.Read(ref ex);
+            if (myEx != null)
+                throw myEx;
             else
-                return val;
+                return Volatile.Read(ref val);
         }


[Wpf] Fix CanvasCellViewBackend.QueueDraw()

--- Xwt.WPF/Xwt.WPFBackend.CellViews/CanvasCellViewBackend.cs
+++ Xwt.WPF/Xwt.WPFBackend.CellViews/CanvasCellViewBackend.cs
@@ -10,7 +10,8 @@
     class CanvasCellViewBackend: CellViewBackend, ICanvasCellViewBackend
     {
         public void QueueDraw()
-        {
+		{
+			CurrentElement.InvalidateVisual ();
         }
     }
 }


added portable note to collector

added portable note to collector

--- JumpKick.HttpLib/JumpKick.HttpLib/Collector/BaseCollector.cs
+++ JumpKick.HttpLib/JumpKick.HttpLib/Collector/BaseCollector.cs
@@ -20,6 +20,8 @@
             collection.platformid = "";
             collection.libversion = "";
 #if NETFX_CORE || SILVERLIGHT
+            collection.platformid = "portable";
+
 #else
             collection.platformid = Assembly.GetAssembly(typeof(BaseCollector)).GetName().Version.ToString();
             collection.libversion = Assembly.GetEntryAssembly().GetName().Version.ToString();


Fix fake client

Fix fake client

Fix fake client

--- Mindscape.Raygun4Net.NetCore.Tests/Model/FakeRaygunClient.cs
+++ Mindscape.Raygun4Net.NetCore.Tests/Model/FakeRaygunClient.cs
@@ -22,9 +22,9 @@
         {
         }

-        public RaygunMessage ExposeBuildMessage(Exception exception, [Optional] IList<string> tags, [Optional] IDictionary userCustomData)
+        public RaygunMessage ExposeBuildMessage(Exception exception, [Optional] IList<string> tags, [Optional] IDictionary userCustomData, [Optional] RaygunIdentifierMessage user)
         {
-            var task = BuildMessage(exception, tags, userCustomData);
+            var task = BuildMessage(exception, tags, userCustomData, user);

             task.Wait();