[OpusOptionCodeGenerator] Instead of writing a header containing the command line string, split all arguments onto separate lines, and replace command value separators (platform dependent) with a platform independent character to ease generation on all platforms

--- OpusOptionCodeGenerator/Program.cs
+++ OpusOptionCodeGenerator/Program.cs
@@ -9,6 +9,22 @@
     {
         private static readonly string MajorHorizontalRule = new string('=', 80);
         private static readonly string MinorHorizontalRule = new string('-', 80);
+
+        private static char CommandSeparator;
+        private static char HeaderReplacementCommandSeparator;
+        static Program()
+        {
+            var isWindows = System.IO.Path.DirectorySeparatorChar == '\\';
+            if (isWindows)
+            {
+                CommandSeparator = ';';
+            }
+            else
+            {
+                CommandSeparator = ':';
+            }
+            HeaderReplacementCommandSeparator = '&';
+        }

         private static void
         Log(
@@ -586,17 +602,17 @@
                 writer.NewLine = "\n";

                 WriteLine(writer, 0, "// Automatically generated file from OpusOptionCodeGenerator. DO NOT EDIT.");
-                WriteLine(writer, 0, "// Command line:");
-                Write(writer, 0, "//");
+                WriteLine(writer, 0, "// Command line arguments:");
                 foreach (var arg in parameters.args)
                 {
                     if (Parameters.excludedFlagsFromHeaders.Contains(arg))
                     {
                         continue;
                     }
-                    Write(writer, 0, " {0}", arg);
-                }
-                Write(writer, 0, writer.NewLine);
+                    WriteLine(writer, 0, "//     {0}", arg.Replace(CommandSeparator, HeaderReplacementCommandSeparator));
+                }
+                // empty line to match the delegates file
+                WriteLine(writer, 0, string.Empty);
                 WriteLine(writer, 0, "namespace {0}", parameters.outputNamespace);
                 WriteLine(writer, 0, "{");
                 WriteLine(writer, 1, "public partial class {0}", parameters.outputClassName);
@@ -847,17 +863,15 @@

                 // write header
                 WriteLine(builder, 0, "// Automatically generated file from OpusOptionCodeGenerator.");
-                WriteLine(builder, 0, "// Command line:");
-                Write(builder, 0, "//");
+                WriteLine(builder, 0, "// Command line arguments:");
                 foreach (var arg in parameters.args)
                 {
                     if (Parameters.excludedFlagsFromHeaders.Contains(arg))
                     {
                         continue;
                     }
-                    Write(builder, 0, " {0}", arg);
-                }
-                Write(builder, 0, "\n");
+                    WriteLine(builder, 0, "//     {0}", arg.Replace(CommandSeparator, HeaderReplacementCommandSeparator));
+                }
                 if (null != layout && layout.header.Length != 0 && !builder.ToString().Equals(layout.header.ToString()))
                 {
                     var message = new System.Text.StringBuilder();
@@ -897,6 +911,7 @@
                         }
                     }
                 }
+                // this causes an extra newline after the header
                 WriteLine(writer, 0, builder.ToString());

                 // open namespace


Fix AssertionFixture.cs namespace.

Fix AssertionFixture.cs namespace.

--- Telerik.JustMock.Tests/AssertionFixture.cs
+++ Telerik.JustMock.Tests/AssertionFixture.cs
@@ -38,7 +38,7 @@
 using AssertionException = Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException;
 #endif

-namespace Telerik.JustMock.MSTest.Tests
+namespace Telerik.JustMock.Tests
 {
 	/// <summary>
 	/// Validates Mock.Assert capabilities


Fixed XML docs

Fixed XML docs

--- PInvoke/Gdi32/WinGdi.BITMAPINFO.cs
+++ PInvoke/Gdi32/WinGdi.BITMAPINFO.cs
@@ -1386,7 +1386,7 @@
 			/// Represents the <see langword="null"/> equivalent of this class instances.
 			public static new readonly SafeBITMAPINFO Null = new(IntPtr.Zero, false);

-			/// Performs an implicit conversion from <see cref=BITMAPINFO"/> to <see cref="SafeBITMAPINFO"/>.
+			/// Performs an implicit conversion from <see cref="BITMAPINFO"/> to <see cref="SafeBITMAPINFO"/>.
 			/// <param name="bi">The <see cref="BITMAPINFO"/> value.</param>
 			/// <returns>The resulting <see cref="SafeBITMAPINFO"/> instance from the conversion.</returns>
 			public static implicit operator SafeBITMAPINFO(in BITMAPINFO bi) => new(bi);


Tag version 0.3.0.0.

Tag version 0.3.0.0.

--- POGOLib/Properties/AssemblyInfo.cs
+++ POGOLib/Properties/AssemblyInfo.cs
@@ -35,5 +35,5 @@
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]

-[assembly: AssemblyVersion("0.2.0.0")]
-[assembly: AssemblyFileVersion("0.2.0.0")]+[assembly: AssemblyVersion("0.3.0.0")]
+[assembly: AssemblyFileVersion("0.3.0.0")]


Update InputStateTester.cs to compile with updated App framework.

--- Tests/Input/InputState/InputStateTester.cs
+++ Tests/Input/InputState/InputStateTester.cs
@@ -10,23 +10,27 @@

 namespace Tests.InputStateTester
 {
-    class InputStateTester : AgateApplication
-    {
-        #region IAgateTest Members
+	class InputStateTester : AgateApplication
+	{
+		#region IAgateTest Members

-        public string Name { get { return "Input State Tester"; } }
-        public string Category { get { return "Input"; } }
+		public string Name { get { return "Input State Tester"; } }
+		public string Category { get { return "Input"; } }

-        #endregion
+		#endregion

-        public void Main(string[] args)
-        {
-            Run(args);
-        }
+		public void Main(string[] args)
+		{
+			Run(args);
+		}

-        protected override void Render(double time_ms)
-        {
-            base.Render(time_ms);
-        }
-    }
+		protected override void Update(double time_ms)
+		{
+			base.Update(time_ms);
+		}
+		protected override void Render()
+		{
+			base.Render();
+		}
+	}
 }


LocalMachine improve "pGina created" check

--- Plugins/LocalMachine/PluginImpl.cs
+++ Plugins/LocalMachine/PluginImpl.cs
@@ -205,10 +205,14 @@
             UserInformation userInfo = properties.GetTrackedSingle<UserInformation>();

             // is this a pgina user?
-            if (LocalAccount.UserExists(userInfo.Username) && !userInfo.Description.Contains("pGina created"))
-            {
-                m_logger.InfoFormat("User {0} is'nt a pGina created user. I'm not executing Gateway stage", userInfo.Username);
-                return new BooleanResult() { Success = true };
+            Abstractions.WindowsApi.pInvokes.structenums.USER_INFO_4 userinfo4 = new Abstractions.WindowsApi.pInvokes.structenums.USER_INFO_4();
+            if (Abstractions.WindowsApi.pInvokes.UserGet(userInfo.Username, ref userinfo4)) //true if user exists
+            {
+                if (!userinfo4.comment.Contains("pGina created"))
+                {
+                    m_logger.InfoFormat("User {0} is'nt a pGina created user. I'm not executing Gateway stage", userInfo.Username);
+                    return new BooleanResult() { Success = true };
+                }
             }

             // Add user to all mandatory groups


More reliable comparison on Channel.Id

More reliable comparison on Channel.Id

--- PokemonGoRaidBot/CommandHandler.cs
+++ PokemonGoRaidBot/CommandHandler.cs
@@ -188,6 +188,7 @@
                 var pokemon = post?.Pokemon;

                 var mentionPost = posts.OrderByDescending(x => x.EndDate)
+                    .FirstOrDefault(x => x.FromChannel.Id == message.Channel.Id
                         && x.Responses.Where(xx => xx.Username == mentionedUser.Username).Count() > 0
                         && x.Pokemon.Name == (pokemon ?? x.Pokemon).Name);

@@ -223,6 +224,7 @@
             string response = string.Format("__**{0}**__ posted by {1} in <#{2}>{3}",
                         post.Pokemon.Name,
                         post.User,
+                        post.FromChannel.Id,
                         !post.HasEndDate ? "" : string.Format(", ends around {0:h: mm tt}", post.EndDate));

             response += MessageParser.MakeResponseString(post);
@@ -248,6 +250,7 @@
         {
             var existing = posts.OrderBy(x => x.Pokemon.Name == (post.Pokemon == null ? "" : post.Pokemon.Name) ? 0 : 1)//pokemon name match takes priority if the user responded to multiple raids in the channel
                 .FirstOrDefault(x =>
+                    x.FromChannel.Id == post.FromChannel.Id//Posted in the same channel
                     && ((post.Pokemon != null && x.Pokemon.Name == post.Pokemon.Name)//Either pokemon matches OR
                         || (post.Pokemon == null && x.Responses.Where(xx => xx.Username == post.User).Count() > 0))//User already in the thread
                 );


Explanation on wtf thats doing

Explanation on wtf thats doing

--- Proto/Assets/Scripts/UI/ClockUI.cs
+++ Proto/Assets/Scripts/UI/ClockUI.cs
@@ -29,6 +29,7 @@

     private void Update()
     {
+        //This calculates the angle the joystick is in (instead of simple x, y coords)
         var angle = Mathf.Atan2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")) * Mathf.Rad2Deg;
         curTime = angle / 360 * 60;
         curTime = curTime < 0 ? 60 + curTime : curTime;


Me makes better

Me makes better

--- PythagorasTree/PythagorasWindow.cs
+++ PythagorasTree/PythagorasWindow.cs
@@ -12,6 +12,7 @@
 // For more information, please refer to <http://unlicense.org>

 using System;
+using System.Collections.Generic;
 using System.Drawing;
 using System.Linq;
 using OpenTK;
@@ -33,8 +34,7 @@
         private int _moveFocusY;
         private float _verticalScale = 3;
         private float _zoom = 4000;
-
-
+
         public PythagorasWindow() : base(800, 600)
         {
             Title = "Pythagoras tree";
@@ -117,6 +117,8 @@
             _verticalScale = _zoom;
         }

+        public IEnumerable<Pythagoras> _drawThis;
+
         private void CalcData()
         {
             _iterations = 10 + (int) (2000/_zoom);
@@ -125,6 +127,8 @@
             if (_iterations > 20) _iterations = 20;

             PythagorasSets.GenerateSets(_iterations, SIZE);
+
+            _drawThis = PythagorasSets.GetSets(_iterations, SIZE).SelectMany(p => p);
         }

         #endregion
@@ -207,6 +211,22 @@
                             new Vector2(SIZE, 0)
                         }, vpLeft, vpRight, Color.FromArgb(100, 0, 0), true);

+
+                    var r = 100 - 50*0;//iteration;
+
+                    var g = -r;
+                    if (r < 0) r = 0;
+                    if (g < 0) g = 0;
+                    if (g > 255) g = 255;
+                    var c = Color.FromArgb(r, g, 0);
+
+                    if(_drawThis != null)
+                        foreach (var py in _drawThis)
+                        {
+                            RenderSquare(py.LeftSquare, vpLeft, vpRight, c, false);
+                            RenderSquare(py.RightSquare, vpLeft, vpRight, c, false);
+                        }
+                    /*
                     var iteration = 0;
                     foreach (var set in PythagorasSets.GetSets(12, SIZE))
                     {
@@ -231,7 +251,7 @@
                         }

                         iteration++;
-                    }
+                    }*/
                 }
                 GL.PopMatrix();
             }


Use ticket field label instead of capitalized name to display the column headers.

git-svn-id: f68c6b3b1dcd5d00a2560c384475aaef3bc99487@1164 af82e41b-90c4-0310-8c96-b1721e28e2e2

--- templates/query.cs
+++ templates/query.cs
@@ -162,7 +162,12 @@
    <th<?cs if:header.order ?> class="<?cs var:header.order ?>"<?cs /if ?>>
     <a href="<?cs var:header.href ?>" title="Sort by <?cs
       var:header.name ?> (<?cs if:header.order == 'asc' ?>descending<?cs
-      else ?>ascending<?cs /if ?>)"><?cs var:header.name ?>
+      else ?>ascending<?cs /if ?>)"><?cs
+       each:property = ticket.properties ?><?cs
+        if:property.name == header.name ?><?cs
+         var:property.label ?><?cs
+        /if ?><?cs
+       /each ?>
    	<?cs
   /if ?>
  <?cs /each ?>


Removed old Throw statement (cruft left over from git stash apply)

--- Realm.Shared/Schema/RealmSchema.cs
+++ Realm.Shared/Schema/RealmSchema.cs
@@ -126,7 +126,7 @@
                 if (Count == 0)
                 {
                     throw new InvalidOperationException(
-                        "No RealmObjects. Has linker stripped them? See https://realm.io/docs/xamarin/latest/#linker-stripped-schema");                    throw new InvalidOperationException("Cannot build an empty ObjectSchema");
+                        "No RealmObjects. Has linker stripped them? See https://realm.io/docs/xamarin/latest/#linker-stripped-schema");
                 }
                 Contract.EndContractBlock();


fill in left-hand diff when lines are added

--- src/SideBySideDiffs/MainWindow.xaml.cs
+++ src/SideBySideDiffs/MainWindow.xaml.cs
@@ -148,8 +148,9 @@

                 if (section.LeftDiff.Count > section.RightDiff.Count)
                 {
-                    var lastAdd = section.RightDiff.Last(x => x.Style == DiffContext.Added);
-                    var lastIndex = section.RightDiff.IndexOf(lastAdd);
+                    var lastAdd = section.RightDiff.LastOrDefault(x => x.Style == DiffContext.Added);
+                    // magic number 3 here is the number of context rows
+                    var lastIndex = lastAdd == null ? 2 : section.RightDiff.IndexOf(lastAdd);
                     for (int i = 0; i < missingRowCount; i++)
                     {
                         var missing = new DiffLineViewModel();
@@ -161,7 +162,17 @@
                 }
                 else
                 {
-                    // TODO: fill in some extra empty rows in the left diff
+                    var lastRemove = section.LeftDiff.LastOrDefault(x => x.Style == DiffContext.Deleted);
+                    // magic number 3 here is the number of context rows
+                    var lastIndex = lastRemove == null ? 2 : section.LeftDiff.IndexOf(lastRemove);
+                    for (int i = 0; i < missingRowCount; i++)
+                    {
+                        var missing = new DiffLineViewModel();
+                        missing.Style = DiffContext.Blank;
+                        missing.Text = "";
+                        missing.PrefixForStyle = "";
+                        section.LeftDiff.Insert(lastIndex + 1, missing);
+                    }
                 }


Fix issue that prevented deletion of invalid elements.

--- src/SilDev/Investment/ValueItemHost.cs
+++ src/SilDev/Investment/ValueItemHost.cs
@@ -5,7 +5,7 @@
 // ==============================================
 //
 // Filename: ValueItemHost.cs
-// Version:  2019-12-12 22:07
+// Version:  2019-12-12 22:25
 //
 // Copyright (c) 2019, Si13n7 Developments (r)
 // All rights reserved.
@@ -216,8 +216,10 @@
                 _items.Clear();
                 return;
             }
+            if (!_items.Any())
+                return;
             var keys = Enum.GetNames(typeof(TKey));
-            if (_items.Count > 0 || _items.Keys.All(x => keys.Any(y => y == x)))
+            if (_items.Keys.All(x => keys.Any(y => y == x)))
                 return;
             var items = _items;
             _items.Clear();


バージョン表記を変更

バージョン表記を変更

--- src/Sitrine/Properties/AssemblyInfo.cs
+++ src/Sitrine/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("Sitrine")]
-[assembly: AssemblyCopyright("Copyright ©  2013")]
+[assembly: AssemblyCopyright("Copyright © 2013 Tomona Nanase")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

@@ -32,5 +32,5 @@
 // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
 // 既定値にすることができます:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("0.1")]
+[assembly: AssemblyFileVersion("0.1")]


use inner type's namespace instead of list's namespace

--- src/SoapCore/Meta/MetaWCFBodyWriter.cs
+++ src/SoapCore/Meta/MetaWCFBodyWriter.cs
@@ -121,16 +121,13 @@
 			if (type.IsArray || typeof(IEnumerable).IsAssignableFrom(type))
 			{
 				var collectionDataContractAttribute = type.GetCustomAttribute<CollectionDataContractAttribute>();
-				if (collectionDataContractAttribute != null)
-				{
-					if (collectionDataContractAttribute.IsNamespaceSetExplicitly)
-					{
-						return collectionDataContractAttribute.Namespace;
-					}
-					else
-					{
-						type = type.IsArray ? type.GetElementType() : GetGenericType(type);
-					}
+				if (collectionDataContractAttribute != null && collectionDataContractAttribute.IsNamespaceSetExplicitly)
+				{
+					return collectionDataContractAttribute.Namespace;
+				}
+				else
+				{
+					type = type.IsArray ? type.GetElementType() : GetGenericType(type);
 				}
 			}

@@ -1192,7 +1189,7 @@
 						writer.WriteAttributeString("name", name);
 						writer.WriteAttributeString("nillable", "true");
 						writer.WriteAttributeString("type", $"{ns}:ArrayOf{sysType.name}");
-
+
 						_arrayToBuild.Enqueue(type);
 					}
 					else


both parameter null validation

both parameter null validation

--- src/Swan.Lite/Extensions.Enumerable.cs
+++ src/Swan.Lite/Extensions.Enumerable.cs
@@ -14,9 +14,8 @@
         /// </summary>
         /// <returns> An <see cref="IEnumerable{TSource}"/> that contains the elements from non-null input sequences, excluding duplicates. </returns>
         public static IEnumerable<TSource> UnionExcludingNulls<TSource>(this IEnumerable<TSource> @this, IEnumerable<TSource> second)
-        {
-            if (@this == null) return second ?? Enumerable.Empty<TSource>();
-            return second == null ? @this : @this.Union(second);
-        }
+            => Enumerable.Union(
+                @this ?? Enumerable.Empty<TSource>(),
+                second ?? Enumerable.Empty<TSource>());
     }
 }


Remove \\clrmain hack

Remove \\clrmain hack

--- src/TraceEvent/Symbols/SymbolReader.cs
+++ src/TraceEvent/Symbols/SymbolReader.cs
@@ -2540,12 +2540,6 @@
                         return tfexe;
                 }
             }
-#if !PUBLIC_ONLY
-            // If we can get \\clrmain we keep a copy there.
-            string standAloneTF = @"\\clrmain\tools\StandAloneTF";
-            if (SymbolPath.ComputerNameExists("clrmain", 1000) && Directory.Exists(standAloneTF))
-                return Path.Combine(standAloneTF, "tf.exe");
-#endif
             return null;
         }


#5 switched ScenarioAttribute to using ScenarioCommand instead of TheoryCommand

--- src/Xbehave.Net40/ScenarioAttribute.cs
+++ src/Xbehave.Net40/ScenarioAttribute.cs
@@ -61,8 +61,8 @@
             // TODO: address this - see http://stackoverflow.com/a/346772/49241
             return scenarioCommands.SelectMany(scenarioCommand =>
             {
-                var theoryCommand = scenarioCommand as TheoryCommand;
-                var args = theoryCommand == null ? new object[0] : theoryCommand.Parameters;
+                var commandWithArguments = scenarioCommand as ScenarioCommand;
+                var args = commandWithArguments == null ? new object[0] : commandWithArguments.Parameters;
                 return CurrentScenario.ExtractCommands(method, args, backgroundCommands.Concat(new[] { scenarioCommand }));
             });
         }
@@ -97,7 +97,7 @@
             var parameters = method.MethodInfo.GetParameters();
             if (!parameters.Any())
             {
-                return new[] { new TheoryCommand(method, new object[0]) };
+                return new[] { new ScenarioCommand(method, new object[0]) };
             }

             var commands = new List<ITestCommand>();
@@ -150,7 +150,7 @@
                         }
                     }

-                    commands.Add(new TheoryCommand(closedTypeMethod, argumentList.Concat(generatedArguments).ToArray(), typeArguments));
+                    commands.Add(new ScenarioCommand(closedTypeMethod, argumentList.Concat(generatedArguments).ToArray(), typeArguments));
                 }

                 if (commands.Count == 0)


Removed WIP changes to implement mixed long and short multiple valued arguments

--- Utility.CommandLine.Arguments/Arguments.cs
+++ Utility.CommandLine.Arguments/Arguments.cs
@@ -416,7 +416,7 @@
                     }

                     // set the target properties' value to the converted value from the argument string
-                    AppendPropertyValue(property, convertedValue);
+                    property.SetValue(null, convertedValue);
                 }
             }

@@ -440,23 +440,6 @@
         #endregion Public Methods

         #region Private Methods
-
-        /// <summary>
-        ///     Appends the value of the specified property with the specified value.
-        /// </summary>
-        /// <remarks>Assumes that only static properties are to be set.</remarks>
-        /// <param name="property">The property for which the value is to be set.</param>
-        /// <param name="value">The value to set.</param>
-        private static void AppendPropertyValue(PropertyInfo property, object value)
-        {
-            object currentValue = property.GetValue(null);
-
-            if (property.GetType() != typeof(bool))
-            {
-            }
-
-            property.SetValue(null, value);
-        }

         /// <summary>
         ///     Converts the specified value for the specified argument to the specified Type.


Update version

Update version

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


check balance fix

check balance fix

--- WWWOnionWallet/Helper/OnionPriceChecker.cs
+++ WWWOnionWallet/Helper/OnionPriceChecker.cs
@@ -43,16 +43,19 @@

         public static decimal GetAddressBalance(string address)
         {
-            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://explorer.deeponion.org/ext/getbalance/" + address);
-            request.ContentType = "text/html; charset=utf-8";
-
             try
             {
+                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://explorer.deeponion.org/ext/getbalance/" + address);
+
                 HttpWebResponse response = request.GetResponse() as HttpWebResponse;
                 using (Stream responseStream = response.GetResponseStream())
                 {
                     StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
-                    return decimal.Parse(reader.ReadToEnd());
+                    string resultString = reader.ReadToEnd();
+
+                    decimal result = 0;
+                    decimal.TryParse(resultString.Replace(".",","), out result);
+                    return result;
                 }
             }
             catch (Exception ex)


Line spacing tweak

Line spacing tweak

--- examples/list_apps/Program.cs
+++ examples/list_apps/Program.cs
@@ -41,7 +41,6 @@
             };
         }

-
         static void Main(string[] args)
         {
             using (var service = new Service(SdkHelper.Splunk.Scheme, SdkHelper.Splunk.Host, SdkHelper.Splunk.Port, new Namespace(user: "nobody", app: "search")))


Add comments

Add comments

--- WpfSample/ResolutionWpf/MainWindow.xaml.cs
+++ WpfSample/ResolutionWpf/MainWindow.xaml.cs
@@ -42,6 +42,8 @@
         {
             InitializeComponent();

+            // WindowStyle="None" のときにウィンドウを最大化すると、左上のスクリーン座標は (-8, -8) となります (枠の幅が 8)。
+            // さらに AllowsTransparency="True" の場合、(-8, -8) からウィンドウが描画されます。
             MouseMove += (o, e) =>
             {
                 MouseOnWindow = e.GetPosition(this);


BitmapSourceExtensionMethods: catch Exception in GetPixels()

- Return null, if fail, and set error message to Message.

--- WpfUtility/BitmapSourceExtensionMethods.cs
+++ WpfUtility/BitmapSourceExtensionMethods.cs
@@ -4,10 +4,13 @@
 using System.Text;
 using System.Windows;
 using System.Windows.Media.Imaging;
+using TakeAshUtility;

 namespace WpfUtility {

     public static class BitmapSourceExtensionMethods {
+
+        public static string Message { get; private set; }

         public static int GetStride(this BitmapSource source) {
             if (source == null) {
@@ -16,14 +19,31 @@
             return source.PixelWidth * source.Format.ToBytesPerPixel();
         }

+        /// <summary>
+        /// Get pixels from BitmapSource as byte[].
+        /// </summary>
+        /// <param name="source">BitmapSource</param>
+        /// <returns>
+        /// <list type="bullet">
+        /// <item>byte[], if success.</item>
+        /// <item>null, if fail, and set error message to Message.</item>
+        /// </list>
+        /// </returns>
         public static byte[] GetPixels(this BitmapSource source) {
+            Message = null;
             if (source == null) {
                 return null;
             }
             var stride = source.GetStride();
-            var pixels = new byte[stride * source.PixelHeight];
-            source.CopyPixels(pixels, stride, 0);
-            return pixels;
+            try {
+                var pixels = new byte[stride * source.PixelHeight];
+                source.CopyPixels(pixels, stride, 0);
+                return pixels;
+            }
+            catch (Exception ex) {
+                Message = ex.GetAllMessages();
+                return null;
+            }
         }

         /// <summary>


Take 2: Made BCVRefTests with invalid references to actually have references that are invalid.

--- SIL.Scripture.Tests/BCVRefTests.cs
+++ SIL.Scripture.Tests/BCVRefTests.cs
@@ -622,7 +622,8 @@
 		/// </summary>
 		/// ------------------------------------------------------------------------------------
 		[TestCase(-1, 2, 3)]
-		[TestCase(1, 3, 2)]
+		[TestCase(1, 3, 0)]
+		[TestCase(1, 1, -1)]
 		[TestCase(1, -3, 2)]
 		public void EqualityOperator_InvalidEquivalentReferences(int book, int chapter, int verse)
 		{


Contents.cs: Implement ToString().

Contents.cs: Implement ToString().

--- AIWolfLib/Contents.cs
+++ AIWolfLib/Contents.cs
@@ -141,5 +141,31 @@
                 Error.Warning("Force topic to be DUMMY.");
             }
         }
+
+        public override string ToString()
+        {
+            switch (Topic)
+            {
+                case Topic.DUMMY:
+                case Topic.Skip:
+                case Topic.Over:
+                    return Topic.ToString();
+                case Topic.ESTIMATE:
+                case Topic.COMINGOUT:
+                    return Topic + " : target=" + Target + " role=" + Role;
+                case Topic.DIVINED:
+                case Topic.INQUESTED:
+                    return Topic + " : target=" + Target + " species=" + Species;
+                case Topic.GUARDED:
+                case Topic.VOTE:
+                case Topic.ATTACK:
+                    return Topic + " : target=" + Target;
+                case Topic.AGREE:
+                case Topic.DISAGREE:
+                    return Topic + " : talk/whisper=" + Talk;
+                default:
+                    return "";
+            }
+        }
     }
 }


メソッドに説明を追加．

メソッドに説明を追加．

内容はざっくり．

--- AbaqusModel/Parser.cs
+++ AbaqusModel/Parser.cs
@@ -152,6 +152,11 @@
             }
         }

+        /// <summary>
+        /// 要素集合のパース
+        /// 登録先はcurrent_part
+        /// </summary>
+        /// <param name="cmd"></param>
         private void parse_elset(Command cmd)
         {
             if (cmd.keyword != "ELSET") throw new ArgumentException(cmd.keyword + " is not ELSET");
@@ -210,6 +215,10 @@
         }

+        /// <summary>
+        /// 節点集合のパース
+        /// </summary>
+        /// <param name="cmd">コマンド</param>
         private void parse_nset(Command cmd)
         {
             if( ! cmd.Is("NSET")) throw new ArgumentException(cmd.keyword + " is not NSET");
@@ -231,17 +240,32 @@
             }
        }

+        /// <summary>
+        ///  パートのパース
+        /// </summary>
+        /// <param name="cmd"></param>
         private void parse_part(Command cmd)
         {
             var name = cmd.parameters["NAME"].ToUpper();
             current_part = new Part(name);
             model.parts.Add(current_part);
         }
+
+        /// <summary>
+        ///  パート定義終了．
+        ///  current_partをモデルに戻す為に必要．
+        /// </summary>
+        /// <param name="cmd">コマンド</param>
         private void parse_end_part(Command cmd)
         {
             current_part = model;
         }

+        /// <summary>
+        ///   インスタンスのパース.
+        ///   ALLへの登録も同時に行う．
+        /// </summary>
+        /// <param name="cmd"></param>
         private void parse_instance(Command cmd)
         {
             var name = cmd.parameters["NAME"].ToUpper();
@@ -285,6 +309,12 @@
         {
         }

+
+        /// <summary>
+        ///  システムの登録．
+        ///  節点定義で位置を変化させるもの．
+        /// </summary>
+        /// <param name="cmd">コマンド</param>
         private void parse_system(Command cmd)
         {
             system.Children.Clear();


Projects now need to be marked as executable

Projects now need to be marked executable to be allowed
to be set as the startup project, even if they are able
to be executed.

Fixes #24

--- AddinProjectFlavor.cs
+++ AddinProjectFlavor.cs
@@ -73,6 +73,11 @@
 			return true;
 		}

+		protected override ProjectFeatures OnGetSupportedFeatures ()
+		{
+			return base.OnGetSupportedFeatures () | ProjectFeatures.Execute;
+		}
+
 		protected override IList<string> OnGetCommonBuildActions ()
 		{
 			var list = new List<string> (base.OnGetCommonBuildActions ());


Fix System.FormatException (#2228)

Fix System.FormatException (#2228)

--- ArchiSteamFarm/Bot.cs
+++ ArchiSteamFarm/Bot.cs
@@ -3241,7 +3241,7 @@
 					}

 					if (inventory.Count == 0) {
-						ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsEmpty), nameof(inventory));
+						ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsEmpty, nameof(inventory)));

 						return;
 					}


Fixed sample frequency change issues

Fixed sample frequency change issues

--- Assets/Instruments.cs
+++ Assets/Instruments.cs
@@ -12,7 +12,7 @@
         public InstrumentInstance(SerializationInfo info, StreamingContext context) {
             relativeVolume = 0xF;
             note = VirtualKeyboard.Note.None;
-            m_SampleTimer = 0;
+            m_SampleFreq = m_SampleTimer = 0;
             waveTableSampleRate = vibratoDepth = vibratoSpeed = octave = portamentoSpeed = m_LastSample = m_IrqTimer = m_PortamentoTimer = m_VolumeOffset = m_PWMTimer = m_PWM = 0;
             samplePlayback = m_AutoPortamento = m_UpdatedFrequency = m_PWMDir = m_PWMFlipFlop = false;
             volumeTable = new int [ ] { 0xF, 0xE, 0xD, 0xC };
@@ -99,7 +99,7 @@

         //not serialized
         private int m_IrqTimer, m_PortamentoTimer, m_VolumeOffset, m_PWMTimer, m_PWM, m_LastSample;
-        private float m_SampleTimer;
+        private float m_SampleTimer, m_SampleFreq;
         private bool m_AutoPortamento, m_UpdatedFrequency, m_PWMDir, m_PWMFlipFlop;

         public void SetAutoPortamento(InstrumentInstance prev, int speed) {
@@ -165,11 +165,16 @@
                 return;
             }

-            float freq = ( PSGWrapper.CalculateNoteFreq ( ( int ) note + GetNoteOffset ( ), octave ) + GetFreqOffset ( ) );
-            float divider = SAMPLE_RATE / freq;
+            if ( m_SampleTimer <= 0 ) {
+                m_SampleFreq = ( PSGWrapper.CalculateNoteFreq ( ( int ) note + GetNoteOffset ( ), octave ) + GetFreqOffset ( ) );
+                m_SampleTimer = SAMPLE_RATE / m_SampleFreq;
+            }
+
+            float divider = SAMPLE_RATE / m_SampleFreq;
             float phase = ( m_SampleTimer % divider ) / divider;
             float attn = 0;
             int smp = 0;
+
             switch (customWaveform) {
                 case Wave.Pulse:
                     attn = phase < ((float)m_PWM / (float)PWM_STEPS) ? 0 : LINEAR_STEPS;
@@ -177,7 +182,7 @@
                     break;

                 case Wave.Saw:
-                    attn = Mathf.Ceil(phase * LINEAR_STEPS );
+                    attn = Mathf.Ceil( phase * LINEAR_STEPS );
                     smp = ( int ) attn;
                     break;

@@ -200,12 +205,12 @@
                     break;

                 case Wave.Sine:
-                    attn = ( 1f + Mathf.Sin ( 2 * Mathf.PI * freq * m_SampleTimer / SAMPLE_RATE ) ) * 0.5f * LINEAR_STEPS;
-                    smp = ( int ) attn;
-                    break;
-            }
-
-            m_SampleTimer++;
+                    attn = ( 1f + Mathf.Sin ( 2 * Mathf.PI * m_SampleFreq * m_SampleTimer / SAMPLE_RATE ) ) * 0.5f * LINEAR_STEPS;
+                    smp = ( int ) attn;
+                    break;
+            }
+
+            m_SampleTimer--;

             if ( m_LastSample != LINEAR_VOLUME_TABLE [ smp ] ) {
                 attn = Math.Max ( 0, LINEAR_VOLUME_TABLE [ smp ] - ( 0xF - GetCurrentVol ( ) ) );


Fix command formula bug

Fix command formula bug

--- ScadaServer/ScadaServerSvc/Comm.cs
+++ ScadaServer/ScadaServerSvc/Comm.cs
@@ -812,6 +812,7 @@
                             // передача команды ТУ подключенным клиентам
                             if (passToClients)
                             {
+                                ctrlCmd.PrepareCmdData();
                                 foreach (ClientInfo cl in clients)
                                     if (cl.UserRoleID == BaseValues.Roles.App)
                                         cl.CmdList.Add(ctrlCmd);


Fix contacts initializing bug

Fix contacts initializing bug

--- Assets/Scripts/Hub.cs
+++ Assets/Scripts/Hub.cs
@@ -10,7 +10,7 @@

     // Use this for initialization
-    void Start () {
+    void Awake () {
         rnd = new System.Random(System.Guid.NewGuid().GetHashCode());
         contacts = rnd.Next(2, 7);
     }


This function releases the focus of text fields and dropdowns.

--- Scripts/Editor/NodeEditorAction.cs
+++ Scripts/Editor/NodeEditorAction.cs
@@ -207,12 +207,7 @@
                         } else if (!IsHoveringNode) {
                             // If click outside node, release field focus
                             if (!isPanning) {
-                                // I've got no idea which of these do what, so we'll just reset all of it.
-                                GUIUtility.hotControl = 0;
-                                GUIUtility.keyboardControl = 0;
-                                EditorGUIUtility.editingTextField = false;
-                                EditorGUIUtility.keyboardControl = 0;
-                                EditorGUIUtility.hotControl = 0;
+                                EditorGUI.FocusTextInControl(null);
                             }
                             if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets();
                         }


TSI-1815 Setting feed item's published date/time instead of last updated date/time (TSI-1850)

--- Sdl.Web.Common/Models/ViewModel.cs
+++ Sdl.Web.Common/Models/ViewModel.cs
@@ -126,10 +126,10 @@
         /// <param name="title">The title.</param>
         /// <param name="content">The content. Can be a string or a <see cref="RichText"/> instance.</param>
         /// <param name="link">The link.</param>
-        /// <param name="lastUpdated">The date/time this item was last updated. If <c>null</c>, the current date/time is used.</param>
+        /// <param name="publishDate">The date/time this item was published/created. If <c>null</c>, publish date is not included in the feed.</param>
         /// <param name="localization">The context <see cref="Localization"/>.</param>
         /// <returns>The syndication feed item.</returns>
-        protected SyndicationItem CreateSyndicationItem(string title, object content, Link link, DateTime? lastUpdated, Localization localization)
+        protected SyndicationItem CreateSyndicationItem(string title, object content, Link link, DateTime? publishDate, Localization localization)
         {
             SyndicationItem result = new SyndicationItem
             {
@@ -148,9 +148,9 @@
                 result.Links.Add(syndicationLink);
             }

-            if (lastUpdated.HasValue)
+            if (publishDate.HasValue)
             {
-                result.LastUpdatedTime = lastUpdated.Value;
+                result.PublishDate = publishDate.Value;
             }

             return result;


old resize fix

old resize fix

--- Serenity.Script.Core/Q/Q.Layout.cs
+++ Serenity.Script.Core/Q/Q.Layout.cs
@@ -53,9 +53,8 @@
                 Window.Instance.As<dynamic>().Metronic.addResizeHandler(layout);
             else
             {
+                jQuery.Window.Resize(layout);
             }
-                //jQuery.Window.Resize(layout);
-

             layout(null);
         }


Added feature "AllowOutputDllCopy" to inhibit the target copy when depending on a dll

--- Sharpmake/Project.Configuration.cs
+++ Sharpmake/Project.Configuration.cs
@@ -472,6 +472,20 @@
             public bool ExecuteTargetCopy = false;

             /// <summary>
+            /// Gets or sets whether the configuration output dll file will be copied in the target path of the projects depending on it.
+            /// </summary>
+            /// <remarks>
+            /// This setting only apply with <see cref="OutputType.Dll"/>
+            /// This setting is usefull for dlls that are dynamically loaded:
+            /// The dll do not need to be put along the executable.
+            /// <para>
+            /// The default is <c>true</c>. Setting this to <c>false</c> will prevent the generators
+            /// to copy the library artifact in the exe directory.
+            /// </para>
+            /// </remarks>
+            public bool AllowOutputDllCopy = true;
+
+            /// <summary>
             /// Gets or sets whether dependent projects will copy their dll debugging database to the
             /// target path of their dependency projects. The default value is <c>true</c>.
             /// </summary>
@@ -2738,7 +2752,6 @@
                 public bool IsResolved { get; private set; } = false;
                 public IEnumerable<Info> ProjectsInfos => _projectsInfos;
                 private List<Info> _projectsInfos = new List<Info>();
-
             }

             public ProjectReferencesByPathContainer ProjectReferencesByPath = new ProjectReferencesByPathContainer();
@@ -3072,6 +3085,7 @@

                                 string dependencyDllFullPath = Path.Combine(dependency.TargetPath, dependency.TargetFileFullNameWithExtension);
                                 if ((Output == OutputType.Exe || ExecuteTargetCopy)
+                                    && dependency.AllowOutputDllCopy
                                     && dependencySetting.HasFlag(DependencySetting.LibraryFiles)
                                     && dependency.TargetPath != TargetPath)
                                 {


Make ListFilter default constructor protected

Closes #515

--- ShopifySharp/Filters/ListFilter.cs
+++ ShopifySharp/Filters/ListFilter.cs
@@ -25,9 +25,15 @@
         /// </summary>
         [JsonProperty("fields")]
         public string Fields { get; set; }
-
-        internal ListFilter()
+
+        /// <remarks>
+        /// This constructor is protected to prevent developers from using `new ListFilter()`, but to make creating your
+        /// own ListFilter easier.
+        /// https://github.com/nozzlegear/shopifysharp/issues/515
+        /// </remarks>
+        protected ListFilter()
         {
+
         }

         public ListFilter(string pageInfo, int? limit, string fields = null)


rename SqlBuilder.CreateField -> CreateColumn and Quote

--- Signum.Engine/Engine/SqlBuilder.cs
+++ Signum.Engine/Engine/SqlBuilder.cs
@@ -39,7 +39,7 @@
         {
             return new SqlPreCommandSimple("CREATE TABLE {0}(\r\n{1}\r\n)".FormatWith(
                 t.Name,
-                t.Columns.Values.Select(c => SqlBuilder.CreateField(c)).ToString(",\r\n").Indent(2)));
+                t.Columns.Values.Select(c => SqlBuilder.CreateColumn(c)).ToString(",\r\n").Indent(2)));
         }

         public static SqlPreCommand DropTable(ObjectName tableName)
@@ -67,7 +67,7 @@

         public static SqlPreCommand AlterTableAddColumn(ITable table, IColumn column)
         {
-            return new SqlPreCommandSimple("ALTER TABLE {0} ADD {1}".FormatWith(table.Name, CreateField(column)));
+            return new SqlPreCommandSimple("ALTER TABLE {0} ADD {1}".FormatWith(table.Name, CreateColumn(column)));
         }

         public static bool IsNumber(SqlDbType sqlDbType)
@@ -120,15 +120,15 @@

         public static SqlPreCommand AlterTableAlterColumn(ITable table, IColumn column)
         {
-            return new SqlPreCommandSimple("ALTER TABLE {0} ALTER COLUMN {1}".FormatWith(table.Name, CreateField(column)));
-        }
-
-        public static string CreateField(IColumn c)
-        {
-            return CreateField(c.Name, c.SqlDbType, c.UserDefinedTypeName, c.Size, c.Scale, c.Nullable, c.PrimaryKey, c.IdentityBehaviour, c.Default);
-        }
-
-        public static string CreateField(string name, SqlDbType type, string udtTypeName, int? size, int? scale, bool nullable, bool primaryKey, bool identity, string @default)
+            return new SqlPreCommandSimple("ALTER TABLE {0} ALTER COLUMN {1}".FormatWith(table.Name, CreateColumn(column)));
+        }
+
+        public static string CreateColumn(IColumn c)
+        {
+            return CreateColumn(c.Name, c.SqlDbType, c.UserDefinedTypeName, c.Size, c.Scale, c.Nullable, c.PrimaryKey, c.IdentityBehaviour, c.Default);
+        }
+
+        public static string CreateColumn(string name, SqlDbType type, string udtTypeName, int? size, int? scale, bool nullable, bool primaryKey, bool identity, string @default)
         {
             Connector.Current.FixType(ref type, ref size, ref scale);

@@ -138,8 +138,16 @@
                 GetSizeScale(size, scale),
                 identity && @default == null ? "IDENTITY " : "",
                 nullable ? "NULL" : "NOT NULL",
-                @default != null ? " DEFAULT " + @default : "",
+                @default != null ? " DEFAULT " +  Quote(type, @default) : "",
                 primaryKey ? " PRIMARY KEY" : "");
+        }
+
+        static string Quote(SqlDbType type, string @default)
+        {
+            if (IsString(type) && !(@default.StartsWith("'") && @default.StartsWith("'")))
+                return "'" + @default + "'";
+
+            return @default;
         }

         public static string GetSizeScale(int? size, int? scale)


Update comments

Update comments

--- Source/Bio.Core/ProteinAlphabet.cs
+++ Source/Bio.Core/ProteinAlphabet.cs
@@ -64,12 +64,12 @@
         private readonly Dictionary<byte, byte> aminoAcidValueMap = new Dictionary<byte, byte>();

         /// <summary>
-        /// Symbol to three amino acid abbreviation.
+        /// Symbol to three-letter amino acid abbreviation.
         /// </summary>
         private readonly Dictionary<byte, string> abbreviationMap1to3 = new Dictionary<byte, string>();

         /// <summary>
-        /// Symbol to three amino acid abbreviation.
+        /// Three-letter amino acid abbreviation to symbol.
         /// </summary>
         private readonly Dictionary<string, byte> abbreviationMap3to1 = new Dictionary<string, byte>();


Fix modifiers for performance_background_width

--- osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs
+++ osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs
@@ -25,7 +25,7 @@
         private const int performance_width = 80;

         private const float performance_background_shear = 0.45f;
-        private readonly float performance_background_width = performance_width + (height / 4f * MathF.Tan(performance_background_shear));
+        private static readonly float performance_background_width = performance_width + (height / 4f * MathF.Tan(performance_background_shear));

         protected readonly ScoreInfo Score;


Remove unneeded virtual qualifiers

Remove unneeded virtual qualifiers

--- osu.Framework/Graphics/Containers/Container.cs
+++ osu.Framework/Graphics/Containers/Container.cs
@@ -99,7 +99,7 @@
         /// borders are only drawn correctly on top of quad-shaped children using our sprite
         /// shaders.
         /// </remarks>
-        public virtual float BorderThickness
+        public float BorderThickness
         {
             get { return borderThickness; }
             set
@@ -286,7 +286,7 @@
                 Add(d);
         }

-        public virtual bool Remove(T drawable)
+        public bool Remove(T drawable)
         {
             if (drawable == null)
                 return false;


Minor fixes to xmldocs

Minor fixes to xmldocs

--- osu.Framework/Graphics/Pooling/DrawablePool.cs
+++ osu.Framework/Graphics/Pooling/DrawablePool.cs
@@ -30,7 +30,7 @@
         private readonly Stack<T> pool = new Stack<T>();

         /// <summary>
-        /// create a new pool instance.
+        /// Create a new pool instance.
         /// </summary>
         /// <param name="initialSize">The number of drawables to be prepared for initial consumption.</param>
         /// <param name="maximumSize">An optional maximum size after which the pool will no longer be expanded.</param>
@@ -76,7 +76,7 @@
         /// Get a drawable from this pool.
         /// </summary>
         /// <param name="setupAction">An optional action to be performed on this drawable immediately after retrieval. Should generally be used to prepare the drawable into a usable state.</param>
-        /// <returns></returns>
+        /// <returns>The drawable.</returns>
         public T Get(Action<T> setupAction = null)
         {
             if (!pool.TryPop(out var drawable))


Refactor

Refactor

--- osu.Framework/Input/Bindings/KeyCombination.cs
+++ osu.Framework/Input/Bindings/KeyCombination.cs
@@ -26,9 +26,7 @@
         /// <param name="keys">The keys.</param>
         public KeyCombination(IEnumerable<InputKey> keys)
         {
-            var sorted = keys?.OrderBy(k => (int)k).ToArray();
-
-            Keys = sorted?.Length > 0 ? sorted : new [] { InputKey.None };
+            Keys = keys?.Any() == true ? keys.OrderBy(k => (int)k).ToArray() : new [] { InputKey.None };
         }

         /// <summary>


Add assert and xmldoc for behavior implications.

--- osu.Framework/Input/Bindings/KeyCombination.cs
+++ osu.Framework/Input/Bindings/KeyCombination.cs
@@ -4,6 +4,7 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.Immutable;
+using System.Diagnostics;
 using System.Linq;
 using System.Runtime.CompilerServices;
 using osu.Framework.Input.States;
@@ -45,7 +46,7 @@
         }

         /// <summary>
-        /// Construct a new instance.
+        /// Construct a new instance from string representation provided by <see cref="ToString"/>.
         /// </summary>
         /// <param name="keys">A comma-separated (KeyCode in integer) string representation of the keys.</param>
         /// <remarks>This constructor is not optimized. Hot paths are assumed to use <see cref="FromInputState(InputState, Vector2?)"/>.</remarks>
@@ -71,6 +72,8 @@
         /// <returns>Whether the pressedKeys keys are valid.</returns>
         public bool IsPressed(KeyCombination pressedKeys, KeyCombinationMatchingMode matchingMode)
         {
+            Debug.Assert(!pressedKeys.Keys.Contains(InputKey.None)); // Having None in pressed keys will break IsPressed
+
             if (Keys == pressedKeys.Keys) // Fast test for reference equality of underlying array
                 return true;

@@ -134,6 +137,10 @@

         public static implicit operator KeyCombination(InputKey[] keys) => new KeyCombination(keys);

+        /// <summary>
+        /// Get a string representation can be used with <see cref="KeyCombination(string)"/>.
+        /// </summary>
+        /// <returns>The string representation.</returns>
         public override string ToString() => string.Join(",", Keys.Select(k => (int)k));

         public string ReadableString() => string.Join(" ", Keys.Select(getReadableKey));
@@ -439,6 +446,7 @@
                     keys.Add(FromJoystickButton(joystickButton));
             }

+            Debug.Assert(!keys.Contains(InputKey.None)); // Having None in pressed keys will break IsPressed
             keys.Sort();
             return new KeyCombination(keys.ToImmutable());
         }


Tidy similar methods.

Tidy similar methods.

--- osu.Framework/Input/PassThroughInputManager.cs
+++ osu.Framework/Input/PassThroughInputManager.cs
@@ -56,39 +56,21 @@

         List<InputState> pendingParentStates = new List<InputState>();

-        protected override bool OnMouseMove(InputState state)
+        private bool acceptState(InputState state)
         {
-            if (!UseParentState) return false;
-            pendingParentStates.Add(state);
-            return base.OnMouseMove(state);
+            if (UseParentState)
+                pendingParentStates.Add(state);
+            return false;
         }

-        protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
-        {
-            if (!UseParentState) return false;
-            pendingParentStates.Add(state);
-            return base.OnMouseDown(state, args);
-        }
+        protected override bool OnMouseMove(InputState state) => acceptState(state);

-        protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
-        {
-            if (!UseParentState) return false;
-            pendingParentStates.Add(state);
-            return base.OnMouseUp(state, args);
-        }
+        protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => acceptState(state);

-        protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
-        {
-            if (!UseParentState) return false;
-            pendingParentStates.Add(state);
-            return base.OnKeyDown(state, args);
-        }
+        protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) => acceptState(state);

-        protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
-        {
-            if (!UseParentState) return false;
-            pendingParentStates.Add(state);
-            return base.OnKeyUp(state, args);
-        }
+        protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) => acceptState(state);
+
+        protected override bool OnKeyUp(InputState state, KeyUpEventArgs args) => acceptState(state);
     }
 }


Tidy up nullability and casting

Tidy up nullability and casting

--- osu.Game.Rulesets.Osu/Skinning/FollowCircle.cs
+++ osu.Game.Rulesets.Osu/Skinning/FollowCircle.cs
@@ -12,7 +12,7 @@
 {
     public abstract class FollowCircle : CompositeDrawable
     {
-        [Resolved(canBeNull: true)]
+        [Resolved]
         protected DrawableHitObject? ParentObject { get; private set; }

         protected FollowCircle()
@@ -23,11 +23,7 @@
         [BackgroundDependencyLoader]
         private void load()
         {
-            if (ParentObject != null)
-            {
-                var slider = (DrawableSlider)ParentObject;
-                slider.Tracking.BindValueChanged(OnTrackingChanged, true);
-            }
+            ((DrawableSlider?)ParentObject)?.Tracking.BindValueChanged(OnTrackingChanged, true);
         }

         protected override void LoadComplete()


Implement now abstract method

Implement now abstract method

--- osu.Game.Rulesets.Osu/UI/DrawableOsuRuleset.cs
+++ osu.Game.Rulesets.Osu/UI/DrawableOsuRuleset.cs
@@ -59,6 +59,8 @@
             where TDrawable : DrawableHitObject, new()
             => new OsuDrawablePool<TDrawable>(Playfield.CheckHittable, Playfield.OnHitObjectLoaded, initialSize, maximumSize);

+        public override DrawableHitObject<OsuHitObject> CreateDrawableRepresentation(OsuHitObject h) => null;
+
         protected override HitObjectLifetimeEntry CreateLifetimeEntry(OsuHitObject hitObject) => new OsuHitObjectLifetimeEntry(hitObject);

         public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; // always show the gameplay cursor


Check if the header exists and replace it rather than add it again (#299)

--- SpotifyAPI.Web/SpotifyWebClient.cs
+++ SpotifyAPI.Web/SpotifyWebClient.cs
@@ -39,10 +39,7 @@
         {
             if (headers != null)
             {
-                foreach (KeyValuePair<string, string> headerPair in headers)
-                {
-                    _client.DefaultRequestHeaders.TryAddWithoutValidation(headerPair.Key, headerPair.Value);
-                }
+                AddHeaders(headers);
             }
             using (HttpResponseMessage response = Task.Run(() => _client.GetAsync(url)).Result)
             {
@@ -58,10 +55,7 @@
         {
             if (headers != null)
             {
-                foreach (KeyValuePair<string, string> headerPair in headers)
-                {
-                    _client.DefaultRequestHeaders.TryAddWithoutValidation(headerPair.Key, headerPair.Value);
-                }
+                AddHeaders(headers);
             }
             using (HttpResponseMessage response = await _client.GetAsync(url).ConfigureAwait(false))
             {
@@ -101,10 +95,7 @@
         {
             if (headers != null)
             {
-                foreach (KeyValuePair<string, string> headerPair in headers)
-                {
-                    _client.DefaultRequestHeaders.TryAddWithoutValidation(headerPair.Key, headerPair.Value);
-                }
+                AddHeaders(headers);
             }

             HttpRequestMessage message = new HttpRequestMessage(new HttpMethod(method), url)
@@ -125,10 +116,7 @@
         {
             if (headers != null)
             {
-                foreach (KeyValuePair<string, string> headerPair in headers)
-                {
-                    _client.DefaultRequestHeaders.TryAddWithoutValidation(headerPair.Key, headerPair.Value);
-                }
+                AddHeaders(headers);
             }

             HttpRequestMessage message = new HttpRequestMessage(new HttpMethod(method), url)
@@ -174,6 +162,18 @@
                 }
             }
             return newHeaders;
+        }
+
+        private void AddHeaders(Dictionary<string,string> headers)
+        {
+            foreach (KeyValuePair<string, string> headerPair in headers)
+            {
+                if (_client.DefaultRequestHeaders.Contains(headerPair.Key))
+                {
+                    _client.DefaultRequestHeaders.Remove(headerPair.Key);
+                }
+                _client.DefaultRequestHeaders.TryAddWithoutValidation(headerPair.Key, headerPair.Value);
+            }
         }

         private static HttpClientHandler CreateClientHandler(ProxyConfig proxyConfig = null)


Reformatted white spaces of GuardClauseAssertion.

--- Src/Idioms/GuardClauseAssertion.cs
+++ Src/Idioms/GuardClauseAssertion.cs
@@ -19,7 +19,7 @@
         private readonly IBehaviorExpectation behaviorExpectation;

         /// <summary>
-        /// Initializes a new instance of the <see cref="GuardClauseAssertion"/> class.
+        /// Initializes a new instance of the <see cref="GuardClauseAssertion" /> class.
         /// </summary>
         /// <param name="builder">
         /// A composer which can create instances required to implement the idiomatic unit test.
@@ -37,7 +37,7 @@
         }

         /// <summary>
-        /// Initializes a new instance of the <see cref="GuardClauseAssertion"/> class.
+        /// Initializes a new instance of the <see cref="GuardClauseAssertion" /> class.
         /// </summary>
         /// <param name="builder">
         /// A composer which can create instances required to implement the idiomatic unit test.
@@ -70,7 +70,7 @@
         /// <remarks>
         /// <para>
         /// GuardClauseAssertion contains an appropriate default implementation of
-        /// <see cref="IBehaviorExpectation"/>, but a custom behavior can also be supplied via one
+        /// <see cref="IBehaviorExpectation" />, but a custom behavior can also be supplied via one
         /// of the constructor overloads. In any case, this property exposes the behavior
         /// expectation.
         /// </para>
@@ -127,7 +127,7 @@

             var isReturnValueIterator =
                 typeof(System.Collections.IEnumerable).IsAssignableFrom(methodInfo.ReturnType) ||
-                typeof(System.Collections.IEnumerator).IsAssignableFrom(methodInfo.ReturnType);
+                    typeof(System.Collections.IEnumerator).IsAssignableFrom(methodInfo.ReturnType);

             var isReturnValueNonDeferred = IsNonDeferredEnumerable(methodInfo.ReturnType);
             var isReturnValueDeferable = isReturnValueIterator && !isReturnValueNonDeferred;
@@ -138,20 +138,20 @@
             this.Verify(method, isReturnValueDeferable, isReturnValueTask);
         }

-        static bool IsNonDeferredEnumerable(Type t)
+        private static bool IsNonDeferredEnumerable(Type t)
         {
             var nonGenericCollectionTypes = new[]
             {
                 typeof(System.Collections.ICollection),
                 typeof(System.Collections.IList),
-                typeof(System.Collections.IDictionary),
+                typeof(System.Collections.IDictionary)
             };

             var genericCollectionTypeGtds = new[]
             {
                 typeof(IList<>),
                 typeof(ICollection<>),
-                typeof(IDictionary<,>),
+                typeof(IDictionary<,>)
             };

             var isGeneric = t.IsGenericType;
@@ -169,7 +169,7 @@
                 nonGenericCollectionTypes.Any(gt => gt.IsAssignableFrom(t)) ||
                 (isGeneric && (genericCollectionTypeGtds.Any(gtd => gtdInterfaces.Contains(gtd))));
         }
-
+
         /// <summary>
         /// Verifies that a property has appropriate Guard Clauses in place.
         /// </summary>
@@ -199,17 +199,17 @@
         private static bool IsMatched(MethodBase resolved, MethodBase method, AutoGenericType autoGenericType)
         {
             return resolved.Name == method.Name &&
-                   resolved.GetParameters()
-                                 .Select(pi => pi.ParameterType)
-                                 .SequenceEqual(autoGenericType.ResolveGenericParameters(method.GetParameters()));
+                resolved.GetParameters()
+                    .Select(pi => pi.ParameterType)
+                    .SequenceEqual(autoGenericType.ResolveGenericParameters(method.GetParameters()));
         }

         private IMethod CreateMethod(MethodInfo methodInfo)
         {
             var owner = this.CreateOwner(methodInfo);
             return owner != null
-                       ? (IMethod)new InstanceMethod(methodInfo, owner)
-                       : new StaticMethod(methodInfo);
+                ? (IMethod)new InstanceMethod(methodInfo, owner)
+                : new StaticMethod(methodInfo);
         }

         private object CreateOwner(PropertyInfo property)
@@ -280,7 +280,8 @@
             return from pi in method.Parameters
                    where !pi.IsOut
                    let expansion = new IndexedReplacement<object>(pi.Position, arguments)
-                   select new MethodInvokeCommand(method, expansion, pi) into command
+                   select new MethodInvokeCommand(method, expansion, pi)
+                   into command
                    select new ReflectionExceptionUnwrappingCommand(command);
         }

@@ -327,11 +328,11 @@
         private PropertyInfo ResolveUnclosedGenericType(PropertyInfo propertyInfo)
         {
             return propertyInfo.ReflectedType.ContainsGenericParameters
-                       ? new AutoGenericType(this.Builder, propertyInfo.ReflectedType)
-                             .Value
-                             .GetProperties()
-                             .Single(pi => pi.Name == propertyInfo.Name)
-                       : propertyInfo;
+                ? new AutoGenericType(this.Builder, propertyInfo.ReflectedType)
+                    .Value
+                    .GetProperties()
+                    .Single(pi => pi.Name == propertyInfo.Name)
+                : propertyInfo;
         }

         private MethodInfo ResolveUnclosedGenericType(MethodInfo methodInfo)
@@ -354,12 +355,12 @@
         private MethodInfo ResolveUnclosedGenericMethod(MethodInfo methodInfo)
         {
             return methodInfo.ContainsGenericParameters
-                       ? new AutoGenericMethod(this.Builder, methodInfo)
-                             .Value
-                       : methodInfo;
-        }
-
-        class TaskReturnMethodInvokeCommand : IGuardClauseCommand
+                ? new AutoGenericMethod(this.Builder, methodInfo)
+                    .Value
+                : methodInfo;
+        }
+
+        private class TaskReturnMethodInvokeCommand : IGuardClauseCommand
         {
             private const string message = @"A Guard Clause test was performed on a method that returns a Task, Task<T> (possibly in an 'async' method), but the test failed. See the inner exception for more details. However, because of the async nature of the task, this test failure may look like a false positive. Perhaps you already have a Guard Clause in place, but inside the Task or inside a method marked with the 'async' keyword (if you're using C#); if this is the case, the Guard Clause is dormant, and will first be triggered when a client accesses the Result of the Task. This doesn't adhere to the Fail Fast principle, so should be addressed.
 See https://github.com/AutoFixture/AutoFixture/issues/268 for more details.";
@@ -456,8 +457,8 @@
                 get
                 {
                     return this.unclosedGenericType
-                               .GetGenericTypeDefinition()
-                               .MakeGenericType(this.GetTypedArguments());
+                        .GetGenericTypeDefinition()
+                        .MakeGenericType(this.GetTypedArguments());
                 }
             }

@@ -465,39 +466,39 @@
             {
                 return parameterInfos.Select(
                     pi => pi.ParameterType.IsByRef
-                              ? this.ResolveGenericParameter(pi.ParameterType.GetElementType()).MakeByRefType()
-                              : this.ResolveGenericParameter(pi.ParameterType));
+                        ? this.ResolveGenericParameter(pi.ParameterType.GetElementType()).MakeByRefType()
+                        : this.ResolveGenericParameter(pi.ParameterType));
             }

             private Type ResolveGenericParameter(Type parameterType)
             {
                 return this.IsGenericTypeParameter(parameterType)
-                           ? this.autoGenericArguments[parameterType.Name].Value
-                           : parameterType;
+                    ? this.autoGenericArguments[parameterType.Name].Value
+                    : parameterType;
             }

             private bool IsGenericTypeParameter(Type parameterType)
             {
                 return parameterType.IsGenericParameter
-                       && this.autoGenericArguments.Contains(parameterType.Name);
+                    && this.autoGenericArguments.Contains(parameterType.Name);
             }

             private Type[] GetTypedArguments()
             {
                 return this.unclosedGenericType
-                           .GetGenericArguments()
-                           .Select(t =>
-                           {
-                               if (!t.IsGenericParameter)
-                               {
-                                   return t;
-                               }
-
-                               var autoGenericArgument = new AutoGenericArgument(this.specimenBuilder, t);
-                               this.autoGenericArguments.Add(autoGenericArgument);
-                               return autoGenericArgument.Value;
-                           })
-                           .ToArray();
+                    .GetGenericArguments()
+                    .Select(t =>
+                    {
+                        if (!t.IsGenericParameter)
+                        {
+                            return t;
+                        }
+
+                        var autoGenericArgument = new AutoGenericArgument(this.specimenBuilder, t);
+                        this.autoGenericArguments.Add(autoGenericArgument);
+                        return autoGenericArgument.Value;
+                    })
+                    .ToArray();
             }
         }

@@ -517,18 +518,18 @@
                 get
                 {
                     return this.unclosedGenericMethod
-                               .MakeGenericMethod(this.GetTypedArguments());
+                        .MakeGenericMethod(this.GetTypedArguments());
                 }
             }

             private Type[] GetTypedArguments()
             {
                 return this.unclosedGenericMethod
-                           .GetGenericArguments()
-                           .Select(t => t.IsGenericParameter
-                                            ? new AutoGenericArgument(this.specimenBuilder, t).Value
-                                            : t)
-                           .ToArray();
+                    .GetGenericArguments()
+                    .Select(t => t.IsGenericParameter
+                        ? new AutoGenericArgument(this.specimenBuilder, t).Value
+                        : t)
+                    .ToArray();
             }
         }

@@ -593,24 +594,24 @@
             private Type GetConstraintType()
             {
                 return this.GenericArgument
-                           .GetGenericParameterConstraints()
-                           .Where(t => !t.IsInterface)
-                           .SingleOrDefault();
+                    .GetGenericParameterConstraints()
+                    .Where(t => !t.IsInterface)
+                    .SingleOrDefault();
             }

             private bool HasClassConstraint()
             {
                 return (this.GenericArgument.GenericParameterAttributes
-                        & GenericParameterAttributes.ReferenceTypeConstraint)
-                       == GenericParameterAttributes.ReferenceTypeConstraint;
+                    & GenericParameterAttributes.ReferenceTypeConstraint)
+                    == GenericParameterAttributes.ReferenceTypeConstraint;
             }

             private Type[] GetInterfaces()
             {
                 return this.GenericArgument
-                           .GetGenericParameterConstraints()
-                           .Where(t => t.IsInterface)
-                           .ToArray();
+                    .GetGenericParameterConstraints()
+                    .Where(t => t.IsInterface)
+                    .ToArray();
             }
         }

@@ -710,7 +711,7 @@
                 }

                 var message = "Cannot create a dummy type because the base type '{0}' does not have any accessible " +
-                              "constructor.";
+                    "constructor.";

                 throw new ArgumentException(string.Format(
                     CultureInfo.CurrentCulture,
@@ -794,8 +795,8 @@
             private IEnumerable<MethodInfo> GetAbstractMethods()
             {
                 return this.typeBuilder.BaseType
-                           .GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
-                           .Where(m => m.IsAbstract);
+                    .GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
+                    .Where(m => m.IsAbstract);
             }

             private void ImplementMethod()
@@ -834,7 +835,7 @@
                 }

                 dummyType.GetField(specimenBuilderFieldName, BindingFlags.Static | BindingFlags.NonPublic)
-                         .SetValue(null, this.specimenBuilder);
+                    .SetValue(null, this.specimenBuilder);
             }
         }
     }


Version Bump

Version Bump

--- Syndll2/Properties/AssemblyInfo.cs
+++ Syndll2/Properties/AssemblyInfo.cs
@@ -11,9 +11,9 @@
 [assembly: ComVisible(false)]
 [assembly: Guid("a7fe65a7-0b61-4ea1-81c0-adc5a037ea17")]

-[assembly: AssemblyVersion("0.11.0")]
-[assembly: AssemblyFileVersion("0.11.0.41")]
-[assembly: AssemblyInformationalVersion("0.11.0-beta")]
+[assembly: AssemblyVersion("0.11.1")]
+[assembly: AssemblyFileVersion("0.11.1.42")]
+[assembly: AssemblyInformationalVersion("0.11.1-beta")]

 [assembly: InternalsVisibleTo("Syndll2.Tests, PublicKey=" +
 "00240000048000009400000006020000002400005253413100040000010001000f0f0c410cd366" +


WriteAutoOutlineAsync() with defaults

WriteAutoOutlineAsync() with defaults

--- amdl2maml/Converter/Writers/TopicWriter.cs
+++ amdl2maml/Converter/Writers/TopicWriter.cs
@@ -286,8 +286,8 @@
         internal virtual async Task WriteStartIntroductionAsync(Block block)
         {
             await WriteStartElementAsync("introduction");
-            if (block.Tag == BlockTag.SETextHeader)
-                await WriteElementStringAsync("autoOutline", null);
+            await WriteAutoOutlineAsync(block);
+
             topicState = TopicState.Introduction;
         }

@@ -585,11 +585,20 @@
             await WriteAttributeStringAsync("address", title);
             await WriteTitleAsync(block);
             await WriteStartElementAsync("content");
-
+            await WriteAutoOutlineAsync(block);
+
+            return SectionState.Content;
+        }
+
+        private async Task WriteAutoOutlineAsync(Block block)
+        {
             if (block.Tag == BlockTag.SETextHeader)
-                await WriteElementStringAsync("autoOutline", null);
-
-            return SectionState.Content;
+            {
+                await WriteStartElementAsync("autoOutline");
+                await WriteAttributeStringAsync("lead", "none");
+                await WriteAttributeStringAsync("excludeRelatedTopics", "true");
+                await WriteEndElementAsync(); //autoOutline
+            }
         }

         internal async Task WriteTitleAsync(Block block)


Fixing failing test

Fixing failing test

--- Tests/DbgEngTest/NativeDumpTest.cs
+++ Tests/DbgEngTest/NativeDumpTest.cs
@@ -12,6 +12,8 @@
     public class NativeDumpTest : TestBase
     {
         private const string DefaultDumpFile = "NativeDumpTest.x64.dmp";
+
+        private const string DefaultModuleName = "NativeDumpTest_x64";

         private const string DefaultSymbolPath = @"srv*;.\";

@@ -43,7 +45,7 @@
         [TestMethod]
         public void CurrentThreadContainsNativeDumpTestMainFunction()
         {
-            Assert.AreNotEqual(GetFrame("NativeDumpTest!main"), null);
+            Assert.AreNotEqual(GetFrame(DefaultModuleName + "!main"), null);
         }

         [TestMethod]


Oops.

Oops.

--- ThinMvvm.WindowsRuntime/AppBase.cs
+++ ThinMvvm.WindowsRuntime/AppBase.cs
@@ -82,8 +82,6 @@
             // just ensure that the window is active
             if ( Window.Current.Content == null )
             {
-                RootFrame = CreateRootFrame();
-
                 if ( e.PreviousExecutionState == ApplicationExecutionState.Terminated )
                 {
                     ReloadState();


More solid closure detection in WeakDelegate.

--- ThinMvvm/Internals/WeakDelegate.cs
+++ ThinMvvm/Internals/WeakDelegate.cs
@@ -3,6 +3,7 @@

 using System;
 using System.Reflection;
+using System.Runtime.CompilerServices;

 namespace ThinMvvm.Internals
 {
@@ -11,8 +12,6 @@
     /// </summary>
     internal sealed class WeakDelegate
     {
-        private const string ClosureMethodToken = "<";
-
         private readonly MethodInfo _method;
         private readonly WeakReference<object> _targetRef;

@@ -29,7 +28,9 @@
         {
             _method = wrapped.GetMethodInfo();
             _targetRef = wrapped.Target == null ? null : new WeakReference<object>( wrapped.Target );
-            _targetStrongRef = _method.Name.Contains( ClosureMethodToken ) ? wrapped.Target : null;
+            _targetStrongRef =
+                _method.DeclaringType.GetTypeInfo().GetCustomAttribute<CompilerGeneratedAttribute>() == null ?
+                null : wrapped.Target;
         }

         /// <summary>


add method to read color temp from text resource.

2006-12-01  Larry Ewing  <lewing@novell.com>

	* src/Cms.cs: add method to read color temp from text resource.

--- src/Cms.cs
+++ src/Cms.cs
@@ -3,8 +3,14 @@
 //

 using System;
+using System.IO;
 using System.Collections;
+using System.Reflection;
 using System.Runtime.InteropServices;
+
+#if ENABLE_NUNIT
+using NUnit.Framework;
+#endif

 namespace Cms {
 	public enum Format : uint {
@@ -70,16 +76,72 @@
 			this.Y = Y;
 		}

+		public static ColorCIExyY WhitePointFromTemperatureBroked (int temp)
+		{
+			ColorCIExyY wp;
+			const int line_size = 0x1e;
+
+			using (Stream stream = Assembly.GetExecutingAssembly ().GetManifestResourceStream ("color_table.txt")) {
+				stream.Position = (temp - 1000) * line_size;
+				byte [] buffer = new byte [line_size];
+				stream.Read (buffer, 0, buffer.Length);
+				System.Console.WriteLine (System.Text.Encoding.UTF8.GetString (buffer));
+
+				int ptemp = int.Parse (System.Text.Encoding.UTF8.GetString (buffer, 0, 5));
+				if (ptemp != temp)
+					throw new System.Exception (String.Format ("{0} != {1}", ptemp, temp));
+
+				double x = double.Parse (System.Text.Encoding.UTF8.GetString (buffer, 6, 10));
+				double y = double.Parse (System.Text.Encoding.UTF8.GetString (buffer, 18, 10));
+				wp = new ColorCIExyY (x, y, 1.0);
+				return wp;
+			}
+		}
+
+		public static ColorCIExyY WhitePointFromTemperature (int temp)
+		{
+			try {
+				return WhitePointFromTemperatureResource (temp, "color_table.txt");
+			} catch {
+				return WhitePointFromTemperatureCIE (temp);
+			}
+		}
+
 		[DllImport("liblcms-1.0.0.dll")]
 		static extern bool cmsWhitePointFromTemp(int TempSrc,  out ColorCIExyY white_point);

-		public static ColorCIExyY WhitePointFromTemperature (int temp)
+		public static ColorCIExyY WhitePointFromTemperatureCIE (int temp)
 		{
 			ColorCIExyY wp;
 			cmsWhitePointFromTemp (temp, out wp);
 			return wp;
 		}

+		public static ColorCIExyY WhitePointFromTemperatureResource (int temp, string name)
+		{
+			ColorCIExyY wp;
+			const int line_size = 0x1e;
+
+			using (Stream stream = Assembly.GetExecutingAssembly ().GetManifestResourceStream (name)) {
+				StreamReader reader = new StreamReader (stream, System.Text.Encoding.ASCII);
+				string line = null;
+				for (int i = 0; i <= temp - 1000; i++) {
+					line = reader.ReadLine ();
+				}
+
+				//System.Console.WriteLine (line);
+				string [] subs = line.Split ('\t');
+				int ptemp = int.Parse (subs [0]);
+				if (ptemp != temp)
+					throw new System.Exception (String.Format ("{0} != {1}", ptemp, temp));
+
+				double x = double.Parse (subs [1]);
+				double y = double.Parse (subs [2]);
+				wp = new ColorCIExyY (x, y, 1.0);
+				return wp;
+			}
+		}
+
 		[DllImport("liblcms-1.0.0.dll")]
 		static extern void cmsxyY2XYZ (out ColorCIEXYZ dest, ref ColorCIExyY src);

@@ -105,6 +167,34 @@
 		{
 			return String.Format ("(x={0}, y={1}, Y={2})", x, y, Y);
 		}
+
+#if ENABLE_NUNIT
+		[TestFixture]
+		public class Tests {
+			[Test]
+			public void TestTempTable1000 ()
+			{
+				ColorCIExyY wp = WhitePointFromTemperature (1000);
+				Assert.AreEqual (0.652756059, wp.x);
+				Assert.AreEqual (0.344456906, wp.y);
+			}
+
+			[Test]
+			public void TestTempReader ()
+			{
+				for (int i = 1000; i <= 25000; i += 10000)
+					WhitePointFromTemperature (i);
+			}
+
+			[Test]
+			public void TestTempTable10000 ()
+			{
+				ColorCIExyY wp = WhitePointFromTemperature (10000);
+				Assert.AreEqual (0.280635904, wp.x);
+				Assert.AreEqual (0.288290916, wp.y);
+			}
+		}
+#endif
 	}

 	public struct ColorCIEXYZ {


Add `maskE0` and get rid of a branch

Add `maskE0` and get rid of a branch

--- src/csharp/Intel/Iced/Intel/Decoder.cs
+++ src/csharp/Intel/Iced/Intel/Decoder.cs
@@ -85,6 +85,7 @@
 		internal readonly uint invalidCheckMask;// All 1s if we should check for invalid instructions, else 0
 		internal readonly uint is64bMode_and_W;// StateFlags.W if 64-bit mode, 0 if 16/32-bit mode
 		internal readonly uint reg15Mask;// 7 in 16/32-bit mode, 15 in 64-bit mode
+		readonly uint maskE0;
 		readonly uint rexMask;
 		internal readonly CodeSize defaultCodeSize;
 		internal readonly OpSize defaultOperandSize;
@@ -172,6 +173,7 @@
 				defaultInvertedOperandSize = OpSize.Size16;
 				defaultAddressSize = OpSize.Size64;
 				defaultInvertedAddressSize = OpSize.Size32;
+				maskE0 = 0xE0;
 				rexMask = 0xF0;
 			}
 			else if (bitness == 32) {
@@ -181,6 +183,7 @@
 				defaultInvertedOperandSize = OpSize.Size16;
 				defaultAddressSize = OpSize.Size32;
 				defaultInvertedAddressSize = OpSize.Size16;
+				maskE0 = 0;
 				rexMask = 0;
 			}
 			else {
@@ -191,6 +194,7 @@
 				defaultInvertedOperandSize = OpSize.Size32;
 				defaultAddressSize = OpSize.Size16;
 				defaultInvertedAddressSize = OpSize.Size32;
+				maskE0 = 0;
 				rexMask = 0;
 			}
 			is64bMode_and_W = is64bMode ? (uint)StateFlags.W : 0;
@@ -522,7 +526,6 @@
 #if DEBUG
 			state.flags |= (StateFlags)((uint)EncodingKind.VEX << (int)StateFlags.EncodingShift);
 #endif
-			uint b1 = state.modrm;
 			uint b2 = ReadByte();

 			Static.Assert((int)StateFlags.W == 0x80 ? 0 : -1);
@@ -539,18 +542,13 @@
 			state.mandatoryPrefix = (MandatoryPrefixByte)(b2 & 3);

 			b2 = (~b2 >> 3) & 0x0F;
-			if (is64bMode) {
-				state.vvvv = b2;
-				state.vvvv_invalidCheck = b2;
-				uint b1x = ~b1;
-				state.extraRegisterBase = (b1x >> 4) & 8;
-				state.extraIndexRegisterBase = (b1x >> 3) & 8;
-				state.extraBaseRegisterBase = (b1x >> 2) & 8;
-			}
-			else {
-				state.vvvv_invalidCheck = b2;
-				state.vvvv = b2 & 0x07;
-			}
+			state.vvvv_invalidCheck = b2;
+			state.vvvv = b2 & reg15Mask;
+			uint b1 = state.modrm;
+			uint b1x = ~b1 & maskE0;
+			state.extraRegisterBase = (b1x >> 4) & 8;
+			state.extraIndexRegisterBase = (b1x >> 3) & 8;
+			state.extraBaseRegisterBase = (b1x >> 2) & 8;

 			OpCodeHandler[] handlers;
 			var b = ReadByte();
@@ -585,7 +583,6 @@
 #if DEBUG
 			state.flags |= (StateFlags)((uint)EncodingKind.XOP << (int)StateFlags.EncodingShift);
 #endif
-			uint b1 = state.modrm;
 			uint b2 = ReadByte();

 			Static.Assert((int)StateFlags.W == 0x80 ? 0 : -1);
@@ -602,18 +599,13 @@
 			state.mandatoryPrefix = (MandatoryPrefixByte)(b2 & 3);

 			b2 = (~b2 >> 3) & 0x0F;
-			if (is64bMode) {
-				state.vvvv = b2;
-				state.vvvv_invalidCheck = b2;
-				uint b1x = ~b1;
-				state.extraRegisterBase = (b1x >> 4) & 8;
-				state.extraIndexRegisterBase = (b1x >> 3) & 8;
-				state.extraBaseRegisterBase = (b1x >> 2) & 8;
-			}
-			else {
-				state.vvvv_invalidCheck = b2;
-				state.vvvv = b2 & 0x07;
-			}
+			state.vvvv_invalidCheck = b2;
+			state.vvvv = b2;
+			uint b1 = state.modrm;
+			uint b1x = ~b1 & maskE0;
+			state.extraRegisterBase = (b1x >> 4) & 8;
+			state.extraIndexRegisterBase = (b1x >> 3) & 8;
+			state.extraBaseRegisterBase = (b1x >> 2) & 8;

 			OpCodeHandler[] handlers;
 			var b = ReadByte();