Modifyd Property.Clone to solve bug

Modifyd Property.Clone to solve bug

--- Uiml/Property.cs
+++ Uiml/Property.cs
@@ -73,7 +73,10 @@
 			prop.m_hasToBeSet = m_hasToBeSet;
 			prop.m_class_name = m_class_name;
 			prop.m_part_name = m_part_name;
-			prop.m_subprop = m_subprop;
+
+            if(m_subprop != null)
+			prop.m_subprop = ((IUimlElement)m_subprop).Clone();
+
             prop.m_value = m_value;
 			//if(m_subprop != null  && m_subprop is Constant)
 			//	prop.SubProp = ((Constant)m_subprop).Clone();


made it so debug doesnt do the fast toggle thing

--- Plaper/Plaper/Game1.cs
+++ Plaper/Plaper/Game1.cs
@@ -194,7 +194,7 @@
             //check that state is initalized then call current state's update
             State.getState()?.Update(gameTime, this);

-            if(Plaper.keyboardState.IsKeyDown(Keys.D)) {
+            if(!Plaper.keyboardState.IsKeyDown(Keys.D) && Plaper.lastKeyboardState.IsKeyDown(Keys.D)) {
                 Plaper.debugMode = !Plaper.debugMode;
             }


fix(dokan): ReadFile fills the entire buffer

Dokan does not handle partial reads; must fill the buffer with the entire bytes requested.

--- IpfsMount/IpfsDokan.cs
+++ IpfsMount/IpfsDokan.cs
@@ -187,7 +187,7 @@
         #region File Operations
         public NtStatus ReadFile(string fileName, byte[] buffer, out int bytesRead, long offset, DokanFileInfo info)
         {
-            Console.WriteLine("ReadFile NYI, buffer size {0}", buffer.Length);
+            Console.WriteLine("ReadFile, buffer size {0}, offset {1}", buffer.Length, offset);
             var file = (IpfsFile)info.Context;

             // TODO: Not very efficient.  Maybe access the merkle dags.
@@ -200,13 +200,22 @@
                     offset -= data.Read(buffer, 0, n);
                 }

-                // Fill the buffer
-                bytesRead = data.Read(buffer, 0, buffer.Length);
-                return DokanResult.Success;
-            }
-
-            throw new NotImplementedException();
-        }
+                // Fill the entire buffer
+                bytesRead = 0;
+                int bufferOffset = 0;
+                int remainingBytes = buffer.Length;
+                while (remainingBytes > 0)
+                {
+                    int n = data.Read(buffer, bufferOffset, remainingBytes);
+                    if (n < 1)
+                        break;
+                    bufferOffset += n;
+                    remainingBytes -= n;
+                    bytesRead += n;
+                }
+                return DokanResult.Success;
+            }
+       }

         public NtStatus LockFile(string fileName, long offset, long length, DokanFileInfo info)
         {


修正属性选择器，属性名支持"-"

修正属性选择器，属性名支持"-"

git-svn-id: deaf5729afa9d9459d700df0b32929dbfb02527c@92536 2327b42d-5241-43d6-9e2a-de5ac946f064

--- Ivony.Html/Regulars.cs
+++ Ivony.Html/Regulars.cs
@@ -24,9 +24,9 @@
     public const string relativeExpressionPatternNoGroup = @"((\p{Zs}+~\p{Zs}+)|(\p{Zs}+\+\p{Zs}+)|(\p{Zs}+\>\p{Zs}+)|\p{Zs}+)";

     /// 匹配CSS属性选择器的正则表达式
-    public static readonly string attributeExpressionPattern = string.Format( CultureInfo.InvariantCulture, @"\[(?<name>\w+)((?<separator>(\|=)|(\*=)|(\~=)|(\$=)|(\!=)|(\^=)|=)(?<value>{0}|[^'""\]]*))?\]", quoteTextPattern );
+    public static readonly string attributeExpressionPattern = string.Format( CultureInfo.InvariantCulture, @"\[(?<name>[\w-]+)((?<separator>(\|=)|(\*=)|(\~=)|(\$=)|(\!=)|(\^=)|=)(?<value>{0}|[^'""\]]*))?\]", quoteTextPattern );
     /// 匹配CSS属性选择器的正则表达式，这是不带分组名的版本，用于组合其他正则
-    public static readonly string attributeExpressionPatternNoGroup = string.Format( CultureInfo.InvariantCulture, @"\[\w+(((\|=)|(\*=)|(\~=)|(\$=)|(\!=)|(\^=)|=)({0}|[^'""\]]*))?\]", quoteTextPattern );
+    public static readonly string attributeExpressionPatternNoGroup = string.Format( CultureInfo.InvariantCulture, @"\[[\w-]+(((\|=)|(\*=)|(\~=)|(\$=)|(\!=)|(\^=)|=)({0}|[^'""\]]*))?\]", quoteTextPattern );

     /// 匹配CSS伪类选择器的正则表达式
     public static readonly string pseudoClassPattern = string.Format( CultureInfo.InvariantCulture, @":(?<name>[\w-]+)(\((?<args>{0}|([^'""\(\)]+|(?<-open>\))|(?<open>\())*)(?(open)(?!))\))?", quoteTextPattern );


Review findings

Review findings

TABS

--- src/Flurl.Http/FlurlRequest.cs
+++ src/Flurl.Http/FlurlRequest.cs
@@ -25,22 +25,22 @@
 		/// </summary>
 		Url Url { get; set; }

-        /// <summary>
-        /// Creates and asynchronously sends an HttpRequestMethod.
-        /// Mainly used to implement higher-level extension methods (GetJsonAsync, etc).
-        /// </summary>
-        /// <param name="verb">The HTTP method used to make the request.</param>
-        /// <param name="content">Contents of the request body.</param>
-        /// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
-        /// <param name="completionOption">The HttpCompletionOption used in the request. Optional.</param>
-        /// <returns>A Task whose result is the received HttpResponseMessage.</returns>
-        Task<HttpResponseMessage> SendAsync(HttpMethod verb, HttpContent content = null, CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead);
-    }
-
-    /// <summary>
-    /// A chainable wrapper around HttpClient and Flurl.Url.
-    /// </summary>
-    public class FlurlRequest : IFlurlRequest
+		/// <summary>
+		/// Creates and asynchronously sends an HttpRequestMethod.
+		/// Mainly used to implement higher-level extension methods (GetJsonAsync, etc).
+		/// </summary>
+		/// <param name="verb">The HTTP method used to make the request.</param>
+		/// <param name="content">Contents of the request body.</param>
+		/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
+		/// <param name="completionOption">The HttpCompletionOption used in the request. Optional.</param>
+		/// <returns>A Task whose result is the received HttpResponseMessage.</returns>
+		Task<HttpResponseMessage> SendAsync(HttpMethod verb, HttpContent content = null, CancellationToken cancellationToken = default(CancellationToken), HttpCompletionOption completionOption = HttpCompletionOption.ResponseContentRead);
+	}
+
+	/// <summary>
+	/// A chainable wrapper around HttpClient and Flurl.Url.
+	/// </summary>
+	public class FlurlRequest : IFlurlRequest
 	{
 		private FlurlHttpSettings _settings;
 		private IFlurlClient _client;
@@ -116,13 +116,13 @@
 			await HandleEventAsync(Settings.BeforeCall, Settings.BeforeCallAsync, call).ConfigureAwait(false);
 			request.RequestUri = Url.ToUri(); // in case it was modifed in the handler above

-            var cancellationTokenWithTimeout = cancellationToken;
-            CancellationTokenSource timeoutTokenSource = null;
-
-            if (Settings.Timeout.HasValue) {
-                timeoutTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
-                timeoutTokenSource.CancelAfter(Settings.Timeout.Value);
-                cancellationTokenWithTimeout = timeoutTokenSource.Token;
+			var cancellationTokenWithTimeout = cancellationToken;
+			CancellationTokenSource timeoutTokenSource = null;
+
+			if (Settings.Timeout.HasValue) {
+				timeoutTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
+				timeoutTokenSource.CancelAfter(Settings.Timeout.Value);
+				cancellationTokenWithTimeout = timeoutTokenSource.Token;
 			}

 			call.StartedUtc = DateTime.UtcNow;
@@ -134,8 +134,8 @@
 				if (Settings.CookiesEnabled)
 					WriteRequestCookies(request);

-                call.Response = await Client.HttpClient.SendAsync(request, completionOption, cancellationTokenWithTimeout).ConfigureAwait(false);
-                call.Response.RequestMessage = request;
+				call.Response = await Client.HttpClient.SendAsync(request, completionOption, cancellationTokenWithTimeout).ConfigureAwait(false);
+				call.Response.RequestMessage = request;

 				if (call.Succeeded)
 					return call.Response;
@@ -147,12 +147,12 @@
 			}
 			finally {
 				request.Dispose();
-                timeoutTokenSource?.Dispose();
-
-                if (Settings.CookiesEnabled)
+				timeoutTokenSource?.Dispose();
+
+				if (Settings.CookiesEnabled)
 					ReadResponseCookies(call.Response);

-                call.EndedUtc = DateTime.UtcNow;
+				call.EndedUtc = DateTime.UtcNow;
 				await HandleEventAsync(Settings.AfterCall, Settings.AfterCallAsync, call).ConfigureAwait(false);
 			}
 		}


Version 2.0

Version 2.0

--- MoaiUtils/Common/Properties/SharedAssemblyInfo.cs
+++ MoaiUtils/Common/Properties/SharedAssemblyInfo.cs
@@ -1,8 +1,8 @@
 using System.Reflection;
 using System.Runtime.InteropServices;

-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("2.0.0.0")]
+[assembly: AssemblyFileVersion("2.0.0.0")]

 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]


refactored most of the ConcatTest code, still needs to remove comments after a couple more test runs.

--- RopeTest/ConcatTest.cs
+++ RopeTest/ConcatTest.cs
@@ -22,7 +22,7 @@

         // Filepaths
         //string warPeacePath = @"C:\Users\v-elmacc\Documents\RopeProject\warandpeace.txt";
-        StreamReader readFile = new StreamReader(@"C:\Users\v-elmacc\Documents\RopeProject\warandpeace.txt");
+        //StreamReader readFile = new StreamReader(@"C:\Users\v-elmacc\Documents\RopeProject\warandpeace.txt"); // Probably don't need this line. Run and make sure
         string warPeace = File.ReadAllText(@"C:\Users\v-elmacc\Documents\RopeProject\warandpeace.txt");

         string foxSentence = "The quick brown fox jumps over the lazy dog.";
@@ -38,7 +38,7 @@
         // Method to Concatenate Ropes.
         public void RopeConcatTestCreateRopes()
         {
-            //Lists to calculate averages.
+            //Lists to calculate averages. See if you can declare these once and reset?
             List<int> lengths = new List<int>();
             List<double> memallocs = new List<double>();
             List<double> runtimes = new List<double>();
@@ -77,8 +77,8 @@
                     */

                     //these should be faster than converting to charArray, and then you can just read the file in the very beginning and not count that in the time & memory!
-                    Rope.Rope<string> ropeWarPeace = new Rope.Rope<string>(warPeace.Split(" ".ToCharArray()), 0 , warPeace.Length); //splits on word, can split on sentence too.
-                    Rope.Rope<string> ropeFoxSentence = new Rope.Rope<string>(foxSentence.Split(" ".ToCharArray()), 0, foxSentence.Length);
+                    Rope.Rope<string> ropeWarPeace = new Rope.Rope<string>(warPeace.Split(" ".ToCharArray())); //splits on word, can split on sentence too.
+                    Rope.Rope<string> ropeFoxSentence = new Rope.Rope<string>(foxSentence.Split(" ".ToCharArray()));

                     // Concatenate Ropes.
                     //Rope.Rope<char> ropeConcat = Rope.Rope<char>.Concat(ropeWarPeace, ropeFoxSentence);
@@ -147,10 +147,10 @@
                     // Read in Strings.

                     // Long
-                    string warPeace = File.ReadAllText(warPeacePath);
+                   //string warPeace = File.ReadAllText(warPeacePath);

                     // Short
-                    string foxSentence = "The quick brown fox jumps over the lazy dog.";
+                    //string foxSentence = "The quick brown fox jumps over the lazy dog.";

                     // Concatenate strings
                     string stringConcat = warPeace + foxSentence;
@@ -215,10 +215,10 @@
                     //Read in Strings.

                     // Long
-                    string warPeace = File.ReadAllText(warPeacePath);
+                    //string warPeace = File.ReadAllText(warPeacePath);

                     // Short
-                    string foxSentence = "The quick brown fox jumps over the lazy dog.";
+                    //string foxSentence = "The quick brown fox jumps over the lazy dog.";

                     // Create new stringbuilder.
                     StringBuilder combinedSB = new StringBuilder(warPeace);
@@ -284,10 +284,10 @@
                     // Read in strings.

                     // Long
-                    string warPeace = File.ReadAllText(warPeacePath);
+                    //string warPeace = File.ReadAllText(warPeacePath);

                     // Short
-                    string foxSentence = "The quick brown fox jumps over the lazy dog.";
+                    //string foxSentence = "The quick brown fox jumps over the lazy dog.";

                     // Create new BigList
                     BigList<char> combinedBL = new BigList<char>(warPeace);


Updated ChannelOpenPacket.

Updated ChannelOpenPacket.

--- tibiaapi/Packets/Incoming/ChannelOpenPacket.cs
+++ tibiaapi/Packets/Incoming/ChannelOpenPacket.cs
@@ -6,6 +6,10 @@
     {
         public ChatChannel ChannelId { get; set; }
         public string ChannelName { get; set; }
+        public ushort NumberOfParticipants { get; set; }
+        public string[] Participants { get; set; }
+        public ushort NumberOfInvitees { get; set; }
+        public string[] Invitees { get; set; }

         public ChannelOpenPacket(Objects.Client c)
             : base(c)
@@ -27,6 +31,20 @@
             ChannelId = (ChatChannel)msg.GetUInt16();
             ChannelName = msg.GetString();

+            if (Client.VersionNumber >= 872)
+            {
+                NumberOfParticipants = msg.GetUInt16();
+                for (ushort p = 0; p < NumberOfParticipants; p++)
+                {
+                    Participants[p] = msg.GetString();
+                }
+                NumberOfInvitees = msg.GetUInt16();
+                for (ushort i = 0; i < NumberOfInvitees; i++)
+                {
+                    Invitees[i] = msg.GetString();
+                }
+            }
+
             return true;
         }

@@ -35,13 +53,42 @@
             msg.AddByte((byte)Type);
             msg.AddUInt16((ushort)ChannelId);
             msg.AddString(ChannelName);
+
+            if (Client.VersionNumber >= 872)
+            {
+                msg.AddUInt16(NumberOfParticipants);
+                for (ushort p = 0; p < NumberOfParticipants; p++)
+                {
+                    msg.AddString(Participants[p]);
+                }
+                msg.AddUInt16(NumberOfInvitees);
+                for (ushort i = 0; i < NumberOfInvitees; i++)
+                {
+                    msg.AddString(Invitees[i]);
+                }
+            }
         }

-        public static bool Send(Objects.Client client, ChatChannel channel, string name)
+        public static bool Send(Objects.Client client, ChatChannel channel, string name, string[] participants, string[] invitees)
         {
             ChannelOpenPacket p = new ChannelOpenPacket(client);
             p.ChannelId = channel;
             p.ChannelName = name;
+
+            if (client.VersionNumber >= 872)
+            {
+                p.NumberOfParticipants = (ushort)(participants.Length);
+                for (ushort n = 0; n < p.NumberOfParticipants; n++)
+                {
+                    p.Participants[n] = participants[n];
+                }
+                p.NumberOfInvitees = (ushort)(invitees.Length);
+                for (ushort i = 0; i < p.NumberOfInvitees; i++)
+                {
+                    p.Invitees[i] = invitees[i];
+                }
+            }
+
             return p.Send();
         }
     }


More errors

More errors

--- CMD/Program.cs
+++ CMD/Program.cs
@@ -45,7 +45,7 @@
              .Required();

             var result = p.Parse(args);
-
+
             if (result.HasErrors == false)
             {
                 MetaMorpheusEngine.FinishedSingleEngineHandler += MyEngine_finishedSingleEngineHandler;
@@ -98,7 +98,9 @@
                 EverythingRunnerEngine a = new EverythingRunnerEngine(taskList, startingRawFilenameList, startingXmlDbFilenameList);
                 a.Run();
             }
-            Console.WriteLine("Error Text:" +result.ErrorText);
+            Console.WriteLine("Error Text:" + result.ErrorText);
+            Console.WriteLine("EmptyArgs:" + result.EmptyArgs);
+            Console.WriteLine("EmptyArgs:" + string.Join(" , ", result.Errors.Select(b => b.Option.Description)));
             Console.WriteLine("Usage:");
             Console.WriteLine("\t-t --tasks     List of task poml files");
             Console.WriteLine("\t-s --spectra   List of spectra files");


Update TcpTransport.cs

Update TcpTransport.cs

--- src/Hprose.RPC/TcpTransport.cs
+++ src/Hprose.RPC/TcpTransport.cs
@@ -187,6 +187,7 @@
                     var netStream = tcpClient.GetStream();
                     await netStream.WriteAsync(header, 0, 12);
                     await stream.CopyToAsync(netStream);
+                    stream.Dispose();
                 }
                 catch (Exception e) {
                     foreach (var i in sended.Keys) {


Only load photo dates when needed.

Only load photo dates when needed.

Makes import preparation massively faster. Scrolling in iconview a bit
slower though.

--- src/Import/FileImportSource.cs
+++ src/Import/FileImportSource.cs
@@ -139,22 +139,28 @@
         {
             DefaultVersion = new ImportInfoVersion () {
                 BaseUri = original.GetBaseUri (),
-                        Filename = original.GetFilename ()
+                Filename = original.GetFilename ()
             };
-
-            try {
-                using (FSpot.ImageFile img = FSpot.ImageFile.Create (original)) {
-                    Time = img.Date;
-                }
-            } catch (Exception) {
-                Time = DateTime.Now;
-            }
         }

         public IBrowsableItemVersion DefaultVersion { get; private set; }
         public SafeUri DestinationUri { get; set; }

-        public System.DateTime Time { get; private set; }
+        private DateTime? time = null;
+        public System.DateTime Time {
+            get {
+                if (!time.HasValue) {
+                    try {
+                        using (FSpot.ImageFile img = FSpot.ImageFile.Create (DefaultVersion.Uri)) {
+                            time = img.Date;
+                        }
+                    } catch (Exception) {
+                        time = DateTime.Now;
+                    }
+                }
+                return time.Value;
+            }
+        }

         public Tag [] Tags { get { throw new NotImplementedException (); } }
         public string Description { get { throw new NotImplementedException (); } }


update format string for float and double to string that will roundtrip

--- OBeautifulCode.String.Recipes/StringExtensions.cs
+++ OBeautifulCode.String.Recipes/StringExtensions.cs
@@ -1046,7 +1046,7 @@
         public static string ToStringInvariantPreferred(
             this float value)
         {
-            var result = value.ToString(CultureInfo.InvariantCulture);
+            var result = value.ToString("G9", CultureInfo.InvariantCulture);

             return result;
         }
@@ -1095,7 +1095,7 @@
         public static string ToStringInvariantPreferred(
             this double value)
         {
-            var result = value.ToString(CultureInfo.InvariantCulture);
+            var result = value.ToString("G17", CultureInfo.InvariantCulture);

             return result;
         }


Add AggressiveInlining to Single.GetHashCode (#25633)

--- src/System.Private.CoreLib/shared/System/Single.cs
+++ src/System.Private.CoreLib/shared/System/Single.cs
@@ -214,6 +214,7 @@
             return IsNaN(obj) && IsNaN(m_value);
         }

+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public override int GetHashCode()
         {
             var bits = Unsafe.As<float, int>(ref Unsafe.AsRef(in m_value));


Method made public

Method made public

--- PART/Source/Core/Engine/Part/ReadSubMethodInfo.cs
+++ PART/Source/Core/Engine/Part/ReadSubMethodInfo.cs
@@ -105,7 +105,7 @@
             return false;
         }

-        private Guid CprToUuid(string cprNumber)
+        public static Guid CprToUuid(string cprNumber)
         {
             var uuid = Manager.Part.GetUuid(BrokerContext.Current.UserToken, BrokerContext.Current.ApplicationToken, cprNumber);
             if (StandardReturType.IsSucceeded(uuid.StandardRetur))


only allows the ApiMethodName attribute to be defined on classes.

--- src/IF.Lastfm.Core/Api/Helpers/ApiNameAttribute.cs
+++ src/IF.Lastfm.Core/Api/Helpers/ApiNameAttribute.cs
@@ -12,6 +12,7 @@
         }
     }

+    [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
     public class ApiMethodNameAttribute : ApiNameAttribute
     {
         public ApiMethodNameAttribute(string name) : base(name) { }


Added unit tests for WildcardQuery queries.

--- src/LuceneQueryToSql.Tests/SqlQueryBuilderTests.cs
+++ src/LuceneQueryToSql.Tests/SqlQueryBuilderTests.cs
@@ -51,6 +51,46 @@
             Assert.AreEqual(1, parameterizedSql.UserInputVariables.Count);
         }

+
+        [Test]
+        public void BuildWildcardQuery_ValidInput_ValidSql()
+        {
+            // Arrange
+            var sqlQueryBuilder = new SqlQueryBuilder();
+
+            // Act
+            var parameterizedSql = sqlQueryBuilder.BuildSqlWhereClause("Ab?Cd*");
+
+            // Assert
+            Assert.AreEqual("{{COLUMN}} LIKE '%' + @field1 + '%'", parameterizedSql.Sql);
+        }
+
+        [Test]
+        public void BuildWildcardQuery_ValidInput_ValidNumParameters()
+        {
+            // Arrange
+            var sqlQueryBuilder = new SqlQueryBuilder();
+
+            // Act
+            var parameterizedSql = sqlQueryBuilder.BuildSqlWhereClause("Ab?Cd*");
+
+            // Assert
+            Assert.AreEqual(1, parameterizedSql.UserInputVariables.Count);
+        }
+
+        [Test]
+        public void BuildWildcardQuery_ValidInput_ValidParameter()
+        {
+            // Arrange
+            var sqlQueryBuilder = new SqlQueryBuilder();
+
+            // Act
+            var parameterizedSql = sqlQueryBuilder.BuildSqlWhereClause("Ab?Cd*");
+
+            // Assert
+            Assert.AreEqual("AB_CD%", parameterizedSql.UserInputVariables["field1"]);
+        }
+
         [Test]
         public void BuildTermQuery_ValidInput_ValidParameter()
         {


(Legacy): CMP images.

(Legacy): CMP images.

--- Legacy/Ark/ImageCMP.cs
+++ Legacy/Ark/ImageCMP.cs
@@ -23,6 +23,8 @@
 // IN THE SOFTWARE.
 //

+using System;
+using System.Collections.Generic;
 using System.ComponentModel.Composition;
 using System.IO;
 using System.Windows.Media;
@@ -34,8 +36,8 @@
     internal class CmpMetaData : ImageMetaData
     {
         public bool     HasAlpha;
-        public uint     AWidth;
-        public uint     AHeight;
+        public int      AWidth;
+        public int      AHeight;
         public uint[]   FreqTable;
         public int      DataOffset;
     }
@@ -54,7 +56,7 @@
             var header = file.ReadHeader (5);
             uint width  = header.ToUInt16 (0);
             uint height = header.ToUInt16 (2);
-            bool has_alpha = header[4];
+            bool has_alpha = header[4] != 0;
             int aw = 0, ah = 0;
             if (has_alpha)
             {
@@ -84,7 +86,7 @@
         {
             var reader = new CmpReader (file, (CmpMetaData)info);
             var pixels = reader.Unpack();
-            return ImageData.Create (info, reader.Format, null, pixels);
+            return ImageData.Create (info, reader.Format, null, pixels, reader.Stride);
         }

         public override void Write (Stream file, ImageData image)
@@ -97,18 +99,115 @@
     {
         IBinaryStream   m_input;
         CmpMetaData     m_info;
+        int             m_stride;

         public PixelFormat Format { get; private set; }
+        public int         Stride { get { return m_stride; } }

         public CmpReader (IBinaryStream input, CmpMetaData info)
         {
             m_input = input;
             m_info = info;
-        }
-
-        public byte[] Unpack ()
+            m_stride = (int)info.Width * 2;
+            Format = PixelFormats.Bgr555;
+        }
+
+        public Array Unpack ()
         {
             m_input.Position = m_info.DataOffset;
+            int plane_size = (int)m_info.Width * (int)m_info.Height;
+            var planes = new byte[plane_size * 3];
+            using (var bits = new MsbBitStream (m_input.AsStream, true))
+                UnpackHuffman (bits, planes);
+
+            int rsrc = 0;
+            int gsrc = plane_size;
+            int bsrc = plane_size * 2;
+            int width = m_stride / 2;
+            var output = new ushort[width * (int)m_info.Height];
+            int dst_row = output.Length - width;
+            while (dst_row >= 0)
+            {
+                int dst = dst_row;
+                for (int x = (int)m_info.Width; x > 0; --x)
+                {
+                    int color = planes[bsrc++] << 10 | planes[gsrc++] << 5 | planes[rsrc++];
+                    output[dst++] = (ushort)color;
+                }
+                dst_row -= width;
+            }
+            return output;
+        }
+
+        void UnpackHuffman (MsbBitStream input, byte[] output)
+        {
+            var root = BuildHuffmanTree (m_info.FreqTable);
+            int dst = 0;
+            byte last_symbol = 0;
+            while (dst < output.Length)
+            {
+                var node = root;
+                while (node.Symbol > 0x1F)
+                {
+                    if (input.GetNextBit() != 0)
+                        node = node.Left;
+                    else
+                        node = node.Right;
+                }
+                byte symbol = (byte)(last_symbol + node.Symbol);
+                if (symbol > 0x1F)
+                    symbol -= 0x20;
+                output[dst++] = symbol;
+                last_symbol = symbol;
+            }
+        }
+
+        class Node
+        {
+            public byte Symbol;
+            public uint Freq;
+            public Node Left;
+            public Node Right;
+        }
+
+        Node BuildHuffmanTree (uint[] freq_table)
+        {
+            var tree = new List<Node> (256);
+            for (byte i = 0; i < 32; ++i)
+            {
+                tree.Add (new Node { Symbol = i, Freq = freq_table[i] });
+            }
+            for (byte i = 32; i < 255; ++i)
+            {
+                tree.Add (new Node { Symbol = i });
+            }
+            while (tree.Count > 1)
+            {
+                Node[] child = { null, null };
+
+                for (int i = 0; i < 2; i++)
+                {
+                    Node last_node = null;
+                    uint min_freq = uint.MaxValue;
+                    foreach (var node in tree)
+                    {
+                        if (node.Freq <= min_freq)
+                        {
+                            min_freq = node.Freq;
+                            last_node = node;
+                        }
+                    }
+                    child[i] = last_node;
+                    tree.Remove (last_node);
+                }
+                tree.Add (new Node {
+                    Symbol = 0xFF,
+                    Freq = child[0].Freq + child[1].Freq,
+                    Left = child[0],
+                    Right = child[1]
+                });
+            }
+            return tree[0];
         }
     }
 }


fix: send coverallsreport bad request 400

--- src/MiniCover.Reports/Coveralls/CoverallsReport.cs
+++ src/MiniCover.Reports/Coveralls/CoverallsReport.cs
@@ -151,8 +151,13 @@

             using (var client = new HttpClient())
             {
-                using (var formData = new MultipartFormDataContent())
+                var boundary = Guid.NewGuid().ToString();
+
+                using (var formData = new MultipartFormDataContent(boundary))
                 {
+                    formData.Headers.Remove("Content-Type");
+                    formData.Headers.TryAddWithoutValidation("Content-Type", $"multipart/form-data; boundary={boundary}");
+
                     formData.Add(stringContent, "json_file", "coverage.json");

                     var response = await client.PostAsync(coverallsJobsUrl, formData);


chore: removed console logs

chore: removed console logs

--- src/NSwag.Commands/Commands/IsolatedCommandBase.cs
+++ src/NSwag.Commands/Commands/IsolatedCommandBase.cs
@@ -49,15 +49,10 @@
             var bindingRedirects = GetBindingRedirects();
             var assemblies = GetAssemblies(assemblyDirectory);

-            Console.WriteLine($"LoadDefaultNugetCaches: {LoadDefaultNugetCaches}");
-
             if (LoadDefaultNugetCaches)
             {
                 var defaultNugetPackages = LoadDefaultNugetCache();
                 ReferencePaths = ReferencePaths.Concat(defaultNugetPackages).ToArray();
-
-                Console.WriteLine("Loaded Reference Paths");
-                Console.WriteLine(string.Join(", ", ReferencePaths));
             }

             using (var isolated = new AppDomainIsolation<IsolatedCommandAssemblyLoader<TResult>>(assemblyDirectory, AssemblyConfig, bindingRedirects, assemblies))


changing the short name to lowercase and hyphenated

--- src/OhioTrackStats.API.ServiceModel/Types/Event.cs
+++ src/OhioTrackStats.API.ServiceModel/Types/Event.cs
@@ -5,7 +5,7 @@
     public class Event : BaseModel
     {
         public string Name { get; set; }
-        public string ShortName => this.Name.RemoveAllWhiteSpace();
+        public string ShortName => this.Name.ToLower().Replace(" ", "-");
         public bool IsMale { get; set; }
         public bool IsFemale { get; set; }
         public bool IsRunning { get; set; }


Register SiloClusteringValidator later so other validator will be called before (#4211)

--- src/Orleans.Runtime/Hosting/DefaultSiloServices.cs
+++ src/Orleans.Runtime/Hosting/DefaultSiloServices.cs
@@ -47,6 +47,8 @@
         {
             services.AddOptions();

+            services.AddTransient<IConfigurationValidator, EndpointOptionsValidator>();
+
             // Options logging
             services.TryAddSingleton(typeof(IOptionFormatter<>), typeof(DefaultOptionsFormatter<>));
             services.TryAddSingleton(typeof(IOptionFormatterResolver<>), typeof(DefaultOptionsFormatterResolver<>));
@@ -127,7 +129,6 @@
             services.TryAddSingleton<MembershipOracle>();
             services.TryAddFromExisting<IMembershipOracle, MembershipOracle>();
             services.TryAddFromExisting<ISiloStatusOracle, MembershipOracle>();
-            services.AddTransient<IConfigurationValidator, SiloClusteringValidator>();

             services.TryAddSingleton<ClientObserverRegistrar>();
             services.TryAddSingleton<SiloProviderRuntime>();
@@ -261,7 +262,9 @@
             services.ConfigureFormatter<LoadSheddingOptions>();
             services.ConfigureFormatter<EndpointOptions>();

-            services.AddTransient<IConfigurationValidator, EndpointOptionsValidator>();
+            // This validator needs to construct the IMembershipOracle and the IMembershipTable
+            // so move it in the end so other validator are called first
+            services.AddTransient<IConfigurationValidator, SiloClusteringValidator>();
         }
     }
 }


ArrayConvert.RegulateAsInt8メソッドのオーバーロードを追加

--- src/ArrayConvert.cs
+++ src/ArrayConvert.cs
@@ -106,10 +106,20 @@
         #endregion

         #region RegulateAsInt8
+        public static void RegulateAsInt8(short[] src, byte[] dst)
+        {
+            ArrayConvert.RegulateAsInt8(src, 0, src.Length, dst);
+        }
+
         public static void RegulateAsInt8(short[] src, int offset, int count, byte[] dst)
         {
             for (int i = offset, j = 0, length = offset + count; i < length; i++, j++)
                 dst[j] = (byte)Math.Round((src[i] / 65536.0 + 0.5) * 255);
+        }
+
+        public static void RegulateAsInt8(float[] src, byte[] dst)
+        {
+            ArrayConvert.RegulateAsInt8(src, 0, src.Length, dst);
         }

         public static void RegulateAsInt8(float[] src, int offset, int count, byte[] dst)
@@ -129,6 +139,11 @@
             }
         }

+        public static void RegulateAsInt8(double[] src, byte[] dst)
+        {
+            ArrayConvert.RegulateAsInt8(src, 0, src.Length, dst);
+        }
+
         public static void RegulateAsInt8(double[] src, int offset, int count, byte[] dst)
         {
             for (int i = offset, j = 0, length = offset + count; i < length; i++, j++)


Initiated development of version 0.3

Initiated development of version 0.3

--- src/AssemblyInfo.cs
+++ src/AssemblyInfo.cs
@@ -1,7 +1,7 @@
 using System.Reflection;

 [assembly: AssemblyTitle("Land Use Extension")]
-[assembly: AssemblyVersion("0.2.*")]
+[assembly: AssemblyVersion("0.3.*")]
 [assembly: AssemblyDescription("Land Use Extension for LANDIS-II")]
 [assembly: AssemblyCopyright("2014 University of Notre Dame")]


Added workaround for responses without header content.

--- src/AvaTaxClient.cs
+++ src/AvaTaxClient.cs
@@ -284,10 +284,17 @@

                 // Read the result
                 if (result.IsSuccessStatusCode) {
+                    string contentType = null;
+                    string filename = null;
+                    if (result.Content.Headers.ContentLength > 0)
+                    {
+                        contentType = result.Content.Headers.GetValues("Content-Type").FirstOrDefault();
+                        GetDispositionFilename(result.Content.Headers.GetValues("Content-Disposition").FirstOrDefault());
+                    }
                     var fr = new FileResult()
                     {
-                        ContentType = result.Content.Headers.GetValues("Content-Type").FirstOrDefault(),
-                        Filename = GetDispositionFilename(result.Content.Headers.GetValues("Content-Disposition").FirstOrDefault()),
+                        ContentType = contentType,
+                        Filename = filename,
                         Data = await result.Content.ReadAsByteArrayAsync().ConfigureAwait(false)
                     };


ignore customdata for forms / columns, e.g. loginrequest

--- src/Serenity.Net.Services/Models/ServiceRequest.cs
+++ src/Serenity.Net.Services/Models/ServiceRequest.cs
@@ -1,5 +1,6 @@

 using Newtonsoft.Json;
+using Serenity.ComponentModel;
 using System.Collections.Generic;

 namespace Serenity.Services
@@ -13,6 +14,7 @@
         /// Another option could be to add a [JsonExtensionData] but that could open
         /// way to the side effect ignoring typos.
         /// </summary>
+        [Ignore]
         public Dictionary<string, object> CustomData { get; set; }
     }
 }


add UTD parse seller and buyer functions to COM API

--- src/ComDiadocApi.cs
+++ src/ComDiadocApi.cs
@@ -136,6 +136,10 @@
 		Torg12SellerTitleInfo ParseTorg12SellerTitleXmlFromFile(string fileName);
 		AcceptanceCertificateSellerTitleInfo ParseAcceptanceCertificateSellerTitleXml(byte[] xmlContent);
 		AcceptanceCertificateSellerTitleInfo ParseAcceptanceCertificateSellerTitleXmlFromFile(string fileName);
+		UniversalTransferDocumentSellerTitleInfo ParseUniversalTransferDocumentSellerTitleXml(byte[] xmlContent);
+		UniversalTransferDocumentSellerTitleInfo ParseUniversalTransferDocumentSellerTitleXmlFromFile(string fileName);
+		UniversalTransferDocumentBuyerTitleInfo ParseUniversalTransferDocumentBuyerTitleXml(byte[] xmlContent);
+		UniversalTransferDocumentBuyerTitleInfo ParseUniversalTransferDocumentBuyerTitleXmlFromFile(string fileName);

 		GeneratedFile GenerateRevocationRequestXml(string authToken, string boxId, string messageId, string attachmentId,
 			[MarshalAs(UnmanagedType.IDispatch)] object revocationRequestInfo);
@@ -738,6 +742,26 @@
 			return ParseAcceptanceCertificateSellerTitleXml(File.ReadAllBytes(fileName));
 		}

+		public UniversalTransferDocumentSellerTitleInfo ParseUniversalTransferDocumentSellerTitleXml(byte[] xmlContent)
+		{
+			return diadoc.ParseUniversalTransferDocumentSellerTitleXml(xmlContent);
+		}
+
+		public UniversalTransferDocumentSellerTitleInfo ParseUniversalTransferDocumentSellerTitleXmlFromFile(string fileName)
+		{
+			return ParseUniversalTransferDocumentSellerTitleXml(File.ReadAllBytes(fileName));
+		}
+
+		public UniversalTransferDocumentBuyerTitleInfo ParseUniversalTransferDocumentBuyerTitleXml(byte[] xmlContent)
+		{
+			return diadoc.ParseUniversalTransferDocumentBuyerTitleXml(xmlContent);
+		}
+
+		public UniversalTransferDocumentBuyerTitleInfo ParseUniversalTransferDocumentBuyerTitleXmlFromFile(string fileName)
+		{
+			return ParseUniversalTransferDocumentBuyerTitleXml(File.ReadAllBytes(fileName));
+		}
+
 		#endregion
 	}
 }


Bug fixing #23

Bug fixing #23

--- src/CompoundFile.cs
+++ src/CompoundFile.cs
@@ -912,7 +912,7 @@
             }

             // Update FAT marking unallocated sectors ----------
-            for (int i = nth_sector_to_remove; i < sectorChain.Count - 1; i++)
+            for (int i = nth_sector_to_remove; i < sectorChain.Count; i++)
             {
                 Int32 currentId = sectorChain[i].Id;

@@ -966,7 +966,7 @@
             }

             // Update miniFAT                ---------------------------------------
-            for (int i = nth_sector_to_remove; i < sectorChain.Count - 1; i++)
+            for (int i = nth_sector_to_remove; i < sectorChain.Count; i++)
             {
                 Int32 currentId = sectorChain[i].Id;

@@ -975,9 +975,15 @@
             }

             // Write End of Chain in MiniFAT ---------------------------------------
-            miniFATView.Seek(sectorChain[(sectorChain.Count - 1) - nth_sector_to_remove].Id * SIZE_OF_SID, SeekOrigin.Begin);
-            miniFATView.Write(BitConverter.GetBytes(Sector.ENDOFCHAIN), 0, 4);
-
+            //miniFATView.Seek(sectorChain[(sectorChain.Count - 1) - nth_sector_to_remove].Id * SIZE_OF_SID, SeekOrigin.Begin);
+            //miniFATView.Write(BitConverter.GetBytes(Sector.ENDOFCHAIN), 0, 4);
+
+            // Write End of Chain in MiniFAT ---------------------------------------
+            if (nth_sector_to_remove > 0 && sectorChain.Count > 0)
+            {
+                miniFATView.Seek(sectorChain[nth_sector_to_remove - 1].Id * 4, SeekOrigin.Begin);
+                miniFATView.Write(BitConverter.GetBytes(Sector.ENDOFCHAIN), 0, 4);
+            }

             // Update sector chains           ---------------------------------------
             AllocateSectorChain(miniStreamView.BaseSectorChain);


Convert property info flags to uint / option name change

--- src/MICore/MICommandFactory.cs
+++ src/MICore/MICommandFactory.cs
@@ -941,7 +941,7 @@

         public override async Task<Results> VarListChildren(string variableReference, enum_DEBUGPROP_INFO_FLAGS dwFlags, ResultClass resultClass = ResultClass.done)
         {
-            string command = string.Format("-var-list-children --simple-values \"{0}\" --propInfoFlags {1}", variableReference, dwFlags);
+            string command = string.Format("-var-list-children --simple-values \"{0}\" --propertyInfoFlags {1}", variableReference, (uint)dwFlags);
             Results results = await _debugger.CmdAsync(command, resultClass);

             return results;


* REFACTORE cross correlation adjustment

--- MatchingWindow.xaml.cs
+++ MatchingWindow.xaml.cs
@@ -201,13 +201,8 @@
             foreach (Match matchFE in matches) {
                 Match match = matchFE; // needed as reference for async task
                 Task.Factory.StartNew(() => {
-                    TimeSpan offset = CrossCorrelation.Calculate(
-                        match.Track1.CreateAudioStream(), new Interval(match.Track1Time.Ticks, match.Track1Time.Ticks + TimeUtil.SECS_TO_TICKS),
-                        match.Track2.CreateAudioStream(), new Interval(match.Track2Time.Ticks, match.Track2Time.Ticks + TimeUtil.SECS_TO_TICKS),
-                        progressMonitor);
-                    Debug.WriteLine("CC: " + match + ": " + offset);
+                    CrossCorrelation.Adjust(match, progressMonitor);
                     Dispatcher.BeginInvoke((Action)delegate {
-                        match.Track2Time += offset;
                         matchGrid.Items.Refresh();
                         multiTrackViewer.RefreshAdornerLayer();
                     });


fix: 修复删除角色成员时未提交事务的缺陷。 :bug:

fix: 修复删除角色成员时未提交事务的缺陷。 :bug:

--- src/Membership/RoleProvider.cs
+++ src/Membership/RoleProvider.cs
@@ -422,6 +422,9 @@
 						Condition.Equal("MemberType", member.MemberType));
 				}

+				//提交事务
+				transaction.Commit();
+
 				return count;
 			}
 		}


Fix Query Mcpe version

Fix Query Mcpe version

--- src/MiNET/MiNET/MiNetServer.cs
+++ src/MiNET/MiNET/MiNetServer.cs
@@ -817,10 +817,10 @@
 						var data = new Dictionary<string, string>
 						{
 							{"splitnum", "" + (char) 128},
-							{"hostname", "Minecraft PE Server"},
+							{"hostname", Config.GetProperty("motd", "MiNET: MCPE Server")},
 							{"gametype", "SMP"},
 							{"game_id", "MINECRAFTPE"},
-							{"version", "0.15.0"},
+							{"version", McpeProtocolInfo.GameVersion},
 							{"server_engine", "MiNET v1.0.0"},
 							{"plugins", "MiNET v1.0.0"},
 							{"map", "world"},
@@ -1199,4 +1199,4 @@
 		Proxy,
 		Full,
 	}
-}+}


better db seeding for dev

better db seeding for dev

--- src/Host/Startup.cs
+++ src/Host/Startup.cs
@@ -13,16 +13,20 @@
 using Host.Configuration;
 using System.Linq;
 using IdentityServer4.EntityFramework.Mappers;
+using IdentityServer4.EntityFramework.Interfaces;
+using Microsoft.AspNetCore.Hosting;

 namespace Host
 {
     public class Startup
     {
         private readonly IConfiguration _config;
+        private readonly IHostingEnvironment _env;

-        public Startup(IConfiguration config)
+        public Startup(IConfiguration config, IHostingEnvironment env)
         {
             _config = config;
+            _env = env;
         }

         public IServiceProvider ConfigureServices(IServiceCollection services)
@@ -54,6 +58,12 @@

             services.AddMvc();

+            // only want this during testing
+            if (_env.IsDevelopment())
+            {
+                EnsureSeedData(services);
+            }
+
             return services.BuildServiceProvider(validateScopes: true);
         }

@@ -63,19 +73,23 @@

             app.UseIdentityServer();

-            //app.Use(async (ctx, next) =>
-            //{
-            //    // we don't want this to run on every request, so this was
-            //    // just a quick and dirty way to get the test database populated
-            //    EnsureSeedData(ctx.RequestServices.GetRequiredService<ConfigurationDbContext>());
-            //    await next();
-            //});
-
             app.UseStaticFiles();
             app.UseMvcWithDefaultRoute();
         }

-        private static void EnsureSeedData(ConfigurationDbContext context)
+        private static void EnsureSeedData(IServiceCollection services)
+        {
+            var sp = services.BuildServiceProvider();
+            using (var scope = sp.GetRequiredService<IServiceScopeFactory>().CreateScope())
+            {
+                using (var context = scope.ServiceProvider.GetService<IConfigurationDbContext>())
+                {
+                    EnsureSeedData(context);
+                }
+            }
+        }
+
+        private static void EnsureSeedData(IConfigurationDbContext context)
         {
             if (!context.Clients.Any())
             {


modify: MidiEvent#ToStringをexpression-bodiedな記述に修正


* rename Router.Find to Router.TryFind * change Router.TryFind signature: now returns bool, has 'out' HttpRequestHandler param

--- Core/Router.cs
+++ Core/Router.cs
@@ -27,7 +27,7 @@
             _routes = new List<Route>();
         }

-        public HttpRequestHandler Find(string path)
+        public bool TryFind(string path, out HttpRequestHandler handler)
         {
             /*
              * It should be possible to have routes with
@@ -46,17 +46,19 @@
             List<Dictionary<string, string>> validParams
                 = new List<Dictionary<string, string>>();

-            var handler = _routes
+            var rhandler = _routes
                 .Where(r => r.TryMatch(path, validParams.Add))
                 .ToList()
                 .Zip(validParams, (r, pr) => new { Route = r, Params = pr })
                 .OrderBy(hwp => hwp.Params.Count > 0)
-                .First()
+                .FirstOrDefault()
                 ;

-            return new HttpRequestHandler(
-                (req, res) => handler.Route.Handler(req, res, handler.Params)
+            handler = new HttpRequestHandler(
+                (req, res) => rhandler.Route.Handler(req, res, rhandler.Params)
                 );
+
+            return rhandler != default(object);
         }

         /// <summary>


watch serial port creation/deletion using wmi

--- SerialTool/MainForm.cs
+++ SerialTool/MainForm.cs
@@ -15,8 +15,34 @@
         public MainForm()
         {
             InitializeComponent();
-        }
-
+
+            string query = "SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance isa \"WIN32_SerialPort\"";
+            ManagementEventWatcher watcher = new ManagementEventWatcher(query);
+            watcher.EventArrived += Watcher_SerialPortCreation;
+            watcher.Start();
+
+            query = "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance isa \"WIN32_SerialPort\"";
+            watcher = new ManagementEventWatcher(query);
+            watcher.EventArrived += Watcher_SerialPortDeletion;
+            watcher.Start();
+        }
+
+        private void Watcher_SerialPortCreation(object sender, EventArrivedEventArgs e)
+        {
+            Invoke((MethodInvoker)delegate {
+                ManagementBaseObject target = (ManagementBaseObject)e.NewEvent.Properties["TargetInstance"].Value;
+                serialPortName.Items.Add(target.Properties["DeviceId"].Value.ToString());
+            });
+        }
+
+        private void Watcher_SerialPortDeletion(object sender, EventArrivedEventArgs e)
+        {
+            Invoke((MethodInvoker)delegate {
+                ManagementBaseObject target = (ManagementBaseObject)e.NewEvent.Properties["TargetInstance"].Value;
+                serialPortName.Items.Remove(target.Properties["DeviceId"].Value.ToString());
+            });
+        }
+
         private void ShowSerialPorts()
         {
             serialPortName.Items.Clear();
@@ -33,14 +59,7 @@

         private async void SendButton_Click(object sender, EventArgs e)
         {
-            try
-            {
-                await SendAsync().ConfigureAwait(true);
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show(ex.Message);
-            }
+            await SendAsync().ConfigureAwait(true);
         }

         private async Task SendAsync()
@@ -56,16 +75,29 @@
                 MessageBox.Show(this, "Nothing to send.", this.Text);
                 sendButton.Enabled = true;
                 return;
-            }
-
-            // this will run in a worker thread
-            await Task.Run(delegate {
-                port.WriteTimeout = timeOut.Checked ? (int)timeOutValue.Value * 1000
-                    : SerialPort.InfiniteTimeout;
-                startTickCount = Environment.TickCount;
-                port.Write(data, 0, data.Length);
-                endTickCount = Environment.TickCount;
-            });
+            }
+
+            // this will run in a worker thread
+            try
+            {
+                await Task.Run(delegate {
+                    port.WriteTimeout = timeOut.Checked ? (int)timeOutValue.Value * 1000
+                        : SerialPort.InfiniteTimeout;
+                    startTickCount = Environment.TickCount;
+                    port.Write(data, 0, data.Length);
+                    endTickCount = Environment.TickCount;
+                }).ConfigureAwait(true);
+            }
+            catch (TimeoutException ex)
+            {
+                MessageBox.Show(this, ex.Message);
+                sendButton.Enabled = true;
+            }
+            catch (InvalidOperationException ex)
+            {
+                MessageBox.Show(this, ex.Message);
+                CloseSerialPort();
+            }

             // caller's context gets resumed at this point
             if (endTickCount != 0)


skip SetDateTimeMax test on 32b Unix platforms (#34595)

* skip SetDateTimeMax test on 32b Unix platforms

* s/OsHasMaxTime/SupportsLongMaxDateTime/g

--- src/System.IO.FileSystem/tests/File/GetSetTimes.cs
+++ src/System.IO.FileSystem/tests/File/GetSetTimes.cs
@@ -4,6 +4,7 @@

 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Threading.Tasks;
 using Xunit;

@@ -11,6 +12,10 @@
 {
     public class File_GetSetTimes : StaticGetSetTimes
     {
+        // OSX has the limitation of setting upto 2262-04-11T23:47:16 (long.Max) date.
+        // 32bit Unix has time_t up to ~ 2038.
+        private static bool SupportsLongMaxDateTime => PlatformDetection.IsWindows || (RuntimeInformation.ProcessArchitecture != Architecture.Arm && RuntimeInformation.ProcessArchitecture != Architecture.X86 && !PlatformDetection.IsOSX);
+
         public override string GetExistingItem()
         {
             string path = GetTestFilePath();
@@ -144,8 +149,7 @@
             Assert.Equal(ticks, dateTime.Ticks);
         }

-        [Fact]
-        [PlatformSpecific(~TestPlatforms.OSX)] // OSX has the limitation of setting upto 2262-04-11T23:47:16 (long.Max) date.
+        [ConditionalFact(nameof(SupportsLongMaxDateTime))]
         public void SetDateTimeMax()
         {
             string file = GetTestFilePath();


Cambiada implementación de guardado de texto para usar streams de WinRT en lugar de los de .NET

--- Service/DataService.cs
+++ Service/DataService.cs
@@ -45,23 +45,27 @@
             StorageFile targetFile =
                 await ApplicationData.Current.LocalFolder.CreateFileAsync(filename, CreationCollisionOption.OpenIfExists);

-            using (Stream stream = await targetFile.OpenStreamForWriteAsync())
-            {
-                StreamWriter writer = new StreamWriter(stream, Encoding.UTF8);
-                await writer.WriteAsync(text);
-                await writer.FlushAsync();
-            }
+            var inputStream = await targetFile.OpenAsync(FileAccessMode.ReadWrite);
+            var writeStream = inputStream.GetOutputStreamAt(0);
+
+            DataWriter writer = new DataWriter(writeStream);
+            writer.WriteString(text);
+            await writer.StoreAsync();
+            await writer.FlushAsync();
         }

         async public Task<string> ReadTextFromFile(string filename)
         {
             string fileText = String.Empty;
             StorageFile targetFile = await ApplicationData.Current.LocalFolder.GetFileAsync(filename);
-            using (IInputStream stream = await targetFile.OpenSequentialReadAsync())
-            {
-                StreamReader reader = new StreamReader(stream.AsStreamForRead());
-                fileText = await reader.ReadToEndAsync();
-            }
+
+            var inputStream = await targetFile.OpenAsync(FileAccessMode.Read);
+            var readStream = inputStream.GetInputStreamAt(0);
+
+            DataReader reader = new DataReader(readStream);
+            uint fileLength = await reader.LoadAsync((uint)inputStream.Size);
+            fileText = reader.ReadString(fileLength);
+
             return fileText;
         }
     }


U4-2691 - fix issue with alt template and internal redirects

--- src/Umbraco.Web/Routing/PublishedContentRequest.cs
+++ src/Umbraco.Web/Routing/PublishedContentRequest.cs
@@ -140,12 +140,35 @@

             // unless a template has been set already by the finder,
             // template should be null at that point.
-            var initial = IsInitialPublishedContent;
+
+            // IsInternalRedirect if IsInitial, or already IsInternalRedirect
+            var isInternalRedirect = IsInitialPublishedContent || IsInternalRedirectPublishedContent;
+
+            // redirecting to self
+            if (content.Id == PublishedContent.Id) // neither can be null
+            {
+                // no need to set PublishedContent, we're done
+                IsInternalRedirectPublishedContent = isInternalRedirect;
+                return;
+            }
+
+            // else
+
+            // save
             var template = _template;
+            var renderingEngine = RenderingEngine;
+
+            // set published content - this resets the template, and sets IsInternalRedirect to false
             PublishedContent = content;
-            IsInternalRedirectPublishedContent = (initial && !IsInitialPublishedContent);
-            if (IsInternalRedirectPublishedContent && UmbracoSettings.For<WebRouting>().InternalRedirectPreservesTemplate)
+		    IsInternalRedirectPublishedContent = isInternalRedirect;
+
+            // must restore the template if it's an internal redirect & the config option is set
+            if (isInternalRedirect && UmbracoSettings.For<WebRouting>().InternalRedirectPreservesTemplate)
+            {
+                // restore
                 _template = template;
+                RenderingEngine = renderingEngine;
+            }
         }

         /// <summary>
@@ -179,9 +202,11 @@
         }

         /// <summary>
-        /// Gets or sets a value indicating whether the current published has been obtained from the
-        /// initial published content following internal redirections exclusively.
-        /// </summary>
+        /// Gets or sets a value indicating whether the current published content has been obtained
+        /// from the initial published content following internal redirections exclusively.
+        /// </summary>
+        /// <remarks>Used by PublishedContentRequestEngine.FindTemplate() to figure out whether to
+        /// apply the internal redirect or not, when content is not the initial content.</remarks>
         public bool IsInternalRedirectPublishedContent { get; private set; }

         /// <summary>


That safeguard unfortunately broke all the tests

--- src/Umbraco.Web/Templates/HtmlImageSourceParser.cs
+++ src/Umbraco.Web/Templates/HtmlImageSourceParser.cs
@@ -53,9 +53,6 @@
         /// <remarks>Umbraco image tags are identified by their data-udi attributes</remarks>
         public string EnsureImageSources(string text)
         {
-            if (_umbracoContextAccessor.UmbracoContext == null)
-                throw new InvalidOperationException("Could not parse image sources, there is no current UmbracoContext");
-
             if(_getMediaUrl == null)
                 _getMediaUrl = (guid) => _umbracoContextAccessor.UmbracoContext.UrlProvider.GetMediaUrl(guid);


Fix: Nullref in grade token at startup

Fix: Nullref in grade token at startup


// TODO

// TODO

--- MrAdvice/Invocation.cs
+++ MrAdvice/Invocation.cs
@@ -76,6 +76,7 @@
                     adviceContext = new PropertyAdviceContext(advice.PropertyAdvice, aspectInfo.PointcutProperty, aspectInfo.IsPointcutPropertySetter, adviceValues, adviceContext);
             }

+            // TODO: link this task to return value (if this latter is a task)
             adviceContext.Invoke();
             return adviceValues.ReturnValue;
         }


Ensure we don't miss log lines during file rotation

--- src/LogsearchShipper.Core/NxLog/NxLogFileWatcher.cs
+++ src/LogsearchShipper.Core/NxLog/NxLogFileWatcher.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using System.Threading;
@@ -8,6 +9,7 @@
 {
 	public class NxLogFileWatcher
 	{
+		private const int MaxReadFails = 5;
 		private static readonly ILog _log = LogManager.GetLogger(typeof (NxLogFileWatcher));
 		private readonly NxLogProcessManager _nxLogProcessManager;

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

 			while (!_nxLogProcessManager.NxLogProcess.HasExited) // reading the old data
 			{
-				string[] lines = ReadAllLines();
+				string[] lines = ReadNewLinesAddedToLogFile();
 				foreach (string line in lines)
 				{
 					NxLogOutputParser.NxLogEvent logEvent = _nxLogOutputParser.Parse(line.Trim());
@@ -40,60 +42,67 @@
 			}
 		}

-		public string[] ReadAllLines()
+		public string[] ReadNewLinesAddedToLogFile()
+		{
+			var lines = FaultTolerantReadAllTextFromFile(_nxLogProcessManager.NxLogFile);
+
+			if (offset > lines.Count)
+			{
+				//The log file has rotated; so we need to grab some lines from the old file
+				var linesFromOldLogFile = FaultTolerantReadAllTextFromFile(_nxLogProcessManager.NxLogFile + ".1");
+				lines.InsertRange(0, linesFromOldLogFile.Skip(offset).ToList());
+
+				//And reset the offset
+				offset = 0;
+			}
+
+			var linesToReturn = lines.Skip(offset).ToList();
+			offset = lines.Count;
+
+			return linesToReturn.ToArray();
+		}
+
+		private static List<string> FaultTolerantReadAllTextFromFile(string logFile)
 		{
 			string textReadFromLogFile = "";
-			const int maxReadFails = 5;
-
 			try
 			{
-			 using (var fs = new FileStream(_nxLogProcessManager.NxLogFile,
-				 FileMode.Open,
-				 FileAccess.Read,
-				 FileShare.ReadWrite))
-			 {
-				 using (var sr = new StreamReader(fs))
-				 {
-					 int failCounter = 0;
-					 while (textReadFromLogFile.Length == 0 && failCounter < maxReadFails)
-					 {
-						 try
-						 {
-							 textReadFromLogFile = sr.ReadToEnd();
-						 }
-						 catch (IOException ex)
-						 {
-							 failCounter++;
-							 if (failCounter == maxReadFails)
-							 {
-								 _log.WarnFormat("Failed to read log lines from {0} due to {1}", _nxLogProcessManager.NxLogFile, ex.Message);
-							 }
-							 else
-							 {
-								 Thread.Sleep(TimeSpan.FromMilliseconds(1));
-							 }
-						 }
-					 }
-				 }
-			 }
+				using (var fs = new FileStream(logFile,
+					FileMode.Open,
+					FileAccess.Read,
+					FileShare.ReadWrite))
+				{
+					using (var sr = new StreamReader(fs))
+					{
+						int failCounter = 0;
+						while (textReadFromLogFile.Length == 0 && failCounter < MaxReadFails)
+						{
+							try
+							{
+								textReadFromLogFile = sr.ReadToEnd();
+							}
+							catch (IOException ex)
+							{
+								failCounter++;
+								if (failCounter == MaxReadFails)
+								{
+									_log.WarnFormat("Failed to read log lines from {0} due to {1}", logFile, ex.Message);
+								}
+								else
+								{
+									Thread.Sleep(TimeSpan.FromMilliseconds(1));
+								}
+							}
+						}
+					}
+				}
 			}
 			catch (FileNotFoundException fnfe)
 			{
-			  //Ignore - will try again later
+				textReadFromLogFile = ""; //treat a missing file as one containing no data
 			}

-			if (textReadFromLogFile.Length == 0)
-			{
-				return new string[] {};
-			}
-
-			string[] lines = textReadFromLogFile.Split(new[] {"\r\n"}, StringSplitOptions.RemoveEmptyEntries);
-			if (offset > lines.Length) offset = 0;
-
-			var linesToReturn = lines.Skip(offset).ToList();
-			offset = lines.Length;
-
-			return linesToReturn.ToArray();
+			return textReadFromLogFile.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).ToList();
 		}
 	}
 }


Update MessageDialog.cs

Update MessageDialog.cs

Fix DefaultButtonFocus error

--- src/MahApps.Metro/Controls/Dialogs/MessageDialog.cs
+++ src/MahApps.Metro/Controls/Dialogs/MessageDialog.cs
@@ -169,19 +169,7 @@
             this.SetCurrentValue(NegativeButtonTextProperty, this.DialogSettings.NegativeButtonText);
             this.SetCurrentValue(FirstAuxiliaryButtonTextProperty, this.DialogSettings.FirstAuxiliaryButtonText);
             this.SetCurrentValue(SecondAuxiliaryButtonTextProperty, this.DialogSettings.SecondAuxiliaryButtonText);
-
-            var defaultButtonFocus = this.DialogSettings.DefaultButtonFocus;
-
-            //Ensure it's a valid option
-            if (!this.IsApplicable(defaultButtonFocus))
-            {
-                defaultButtonFocus = this.ButtonStyle == MessageDialogStyle.Affirmative
-                    ? MessageDialogResult.Affirmative
-                    : MessageDialogResult.Negative;
-            }
-
-            this.SetCurrentValue(DefaultButtonFocusProperty, defaultButtonFocus);
-
+
             this.ApplyDefaultButtonFocus();
         }

@@ -398,7 +386,7 @@
         {
             return value switch
             {
-                MessageDialogResult.Affirmative => this.ButtonStyle == MessageDialogStyle.Affirmative,
+                MessageDialogResult.Affirmative => true,
                 MessageDialogResult.Negative => this.ButtonStyle != MessageDialogStyle.Affirmative,
                 MessageDialogResult.FirstAuxiliary => this.ButtonStyle is MessageDialogStyle.AffirmativeAndNegativeAndSingleAuxiliary or MessageDialogStyle.AffirmativeAndNegativeAndDoubleAuxiliary,
                 MessageDialogResult.SecondAuxiliary => this.ButtonStyle == MessageDialogStyle.AffirmativeAndNegativeAndDoubleAuxiliary,
@@ -406,4 +394,4 @@
             };
         }
     }
-}+}


Inbound/outbound peer connection count (#2866)

* Inbound/outbound peer connection count

* Lambda calculation refactor

--- src/Stratis.Bitcoin/Connection/ConnectionManager.cs
+++ src/Stratis.Bitcoin/Connection/ConnectionManager.cs
@@ -223,9 +223,7 @@

         private void AddComponentStats(StringBuilder builder)
         {
-            builder.AppendLine();
-            builder.AppendLine($"======Connection====== agent {this.Parameters.UserAgent}");
-
+            var peerBuilder = new StringBuilder();
             foreach (INetworkPeer peer in this.ConnectedPeers)
             {
                 var chainHeadersBehavior = peer.Behavior<ConsensusManagerBehavior>();
@@ -234,12 +232,18 @@
                 peerHeights += $"/{(chainHeadersBehavior.BestSentHeader != null ? chainHeadersBehavior.BestSentHeader.Height.ToString() : peer.PeerVersion?.StartHeight.ToString() ?? "-")}";

                 string agent = peer.PeerVersion != null ? peer.PeerVersion.UserAgent : "[Unknown]";
-                builder.AppendLine(
+                peerBuilder.AppendLine(
                     "Peer:" + (peer.RemoteSocketEndpoint + ", ").PadRight(LoggingConfiguration.ColumnLength + 15) +
                     (" connected:" + (peer.Inbound ? "inbound" : "outbound") + ",").PadRight(LoggingConfiguration.ColumnLength + 7)
                     + peerHeights.PadRight(LoggingConfiguration.ColumnLength + 7)
                     + " agent:" + agent);
             }
+
+            int inbound = this.ConnectedPeers.Count(x => x.Inbound);
+
+            builder.AppendLine();
+            builder.AppendLine($"======Connection====== agent {this.Parameters.UserAgent} [in:{inbound} out:{this.ConnectedPeers.Count() - inbound}]");
+            builder.AppendLine(peerBuilder.ToString());
         }

         private string ToKBSec(ulong bytesPerSec)


Clean up test helpers and remove self-reflective code

--- src/Workspaces/MSBuildTest/MSBuildWorkspaceTests.cs
+++ src/Workspaces/MSBuildTest/MSBuildWorkspaceTests.cs
@@ -137,17 +137,6 @@
             }
         }

-        private static MetadataReference GetMetadataReference(Project project, string name)
-        {
-            return project.MetadataReferences.OfType<PortableExecutableReference>().SingleOrDefault(mr => mr.FilePath.Contains(name));
-        }
-
-        private static MetadataReference GetMetadataReferenceByAlias(Project project, string aliasName)
-        {
-            return project.MetadataReferences.OfType<PortableExecutableReference>().SingleOrDefault(mr =>
-            !mr.Properties.Aliases.IsDefault && mr.Properties.Aliases.Contains(aliasName));
-        }
-
         [ConditionalFact(typeof(VisualStudioMSBuildInstalled)), Trait(Traits.Feature, Traits.Features.MSBuildWorkspace)]
         [WorkItem(546171, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/546171")]
         public async Task Test_SharedMetadataReferencesWithAliases()
@@ -203,11 +192,20 @@
             }
         }

-        private Metadata GetMetadata(MetadataReference mref)
-        {
-            var fnGetMetadata = mref.GetType().GetMethod("GetMetadata", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy);
-            return fnGetMetadata?.Invoke(mref, null) as Metadata;
-        }
+        private static MetadataReference GetMetadataReference(Project project, string name)
+            => project.MetadataReferences
+                .OfType<PortableExecutableReference>()
+                .SingleOrDefault(mr => mr.FilePath.Contains(name));
+
+        private static MetadataReference GetMetadataReferenceByAlias(Project project, string aliasName)
+            => project.MetadataReferences
+                .OfType<PortableExecutableReference>()
+                .SingleOrDefault(mr =>
+                    !mr.Properties.Aliases.IsDefault &&
+                    mr.Properties.Aliases.Contains(aliasName));
+
+        private static Metadata GetMetadata(MetadataReference metadataReference)
+            => ((PortableExecutableReference)metadataReference).GetMetadata();

         [ConditionalFact(typeof(VisualStudioMSBuildInstalled)), Trait(Traits.Feature, Traits.Features.MSBuildWorkspace)]
         [WorkItem(552981, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/552981")]


misc

misc

* resource designer automated comments updated


Update Setting.cs

Update Setting.cs

--- SharpConfig/Setting.cs
+++ SharpConfig/Setting.cs
@@ -239,7 +239,7 @@

             if (arraySize == 0)
             {
-                // There were no commas in the array expression.
+                // There were no element separators in the array expression.
                 // That does not mean that there are no elements.
                 // Check if there is at least something.
                 // If so, that is the single element of the array.
@@ -254,9 +254,9 @@
             }
             else if (arraySize > 0)
             {
-                // If there were any commas in the array expression,
+                // If there were any element separators in the array expression,
                 // we have to increment the array size, as we assumed
-                // that the number of commas equaled the number of elements + 1.
+                // that the number of element separators equaled the number of elements + 1.
                 ++arraySize;
             }


Исправлено получение адреса организации.

Адрес организации в ответе приходит не сразу в виде AddressData.

--- src/SuggestModel.cs
+++ src/SuggestModel.cs
@@ -173,19 +173,19 @@
     }

     public class PartyData {
-        public AddressData address              { get; set; }
-        public string branch_count              { get; set; }
-        public PartyBranchType branch_type      { get; set; }
-        public string inn                       { get; set; }
-        public string kpp                       { get; set; }
-        public PartyManagementData management   { get; set; }
-        public PartyNameData name               { get; set; }
-        public string ogrn                      { get; set; }
-        public string okpo                      { get; set; }
-        public string okved                     { get; set; }
-        public PartyOpfData opf                 { get; set; }
-        public PartyStateData state             { get; set; }
-        public PartyType type                   { get; set; }
+        public SuggestAddressResponse.Suggestions address { get; set; }
+        public string branch_count                        { get; set; }
+        public PartyBranchType branch_type                { get; set; }
+        public string inn                                 { get; set; }
+        public string kpp                                 { get; set; }
+        public PartyManagementData management             { get; set; }
+        public PartyNameData name                         { get; set; }
+        public string ogrn                                { get; set; }
+        public string okpo                                { get; set; }
+        public string okved                               { get; set; }
+        public PartyOpfData opf                           { get; set; }
+        public PartyStateData state                       { get; set; }
+        public PartyType type                             { get; set; }
     }

     public enum PartyBranchType {
@@ -271,4 +271,4 @@
         }
         public List<Suggestions> suggestions { get; set; }
     }
-}+}


Fix for ignore case for character types

Fix for ignore case for character types

--- src/framework/Constraints/NUnitEqualityComparer.cs
+++ src/framework/Constraints/NUnitEqualityComparer.cs
@@ -156,6 +156,9 @@
             if (x is Stream && y is Stream)
                 return StreamsEqual((Stream)x, (Stream)y);

+            if ( x is char && y is char )
+                return CharsEqual( (char)x, (char)y );
+
             if (x is DirectoryInfo && y is DirectoryInfo)
                 return DirectoriesEqual((DirectoryInfo)x, (DirectoryInfo)y);

@@ -302,6 +305,14 @@
             string s2 = caseInsensitive ? y.ToLower() : y;

             return s1.Equals(s2);
+        }
+
+        private bool CharsEqual(char x, char y)
+        {
+            char c1 = caseInsensitive ? Char.ToLower(x) : x;
+            char c2 = caseInsensitive ? Char.ToLower(y) : y;
+
+            return c1 == c2;
         }

         private bool EnumerablesEqual(IEnumerable x, IEnumerable y, ref Tolerance tolerance)


Perf: Fix caching based on ISignals

Perf: Fix caching based on ISignals

GetLocalizedString result was never cached because of a bug in
ISignals implementation: the token was always "IsCurrent == false",
which meants the cache was always out-of-date.

--HG--
branch : dev

--- src/Orchard/Caching/Signals.cs
+++ src/Orchard/Caching/Signals.cs
@@ -32,6 +32,9 @@
         }

         class Token : IVolatileToken {
+            public Token() {
+                IsCurrent = true;
+            }
             public bool IsCurrent { get; private set; }
             public void Trigger() { IsCurrent = false; }
         }


Updating version number

Updating version number

--- src/Properties/AssemblyInfo.cs
+++ src/Properties/AssemblyInfo.cs
@@ -5,7 +5,7 @@
 [assembly: AssemblyCompany("Peppermint IT Limited")]
 [assembly: AssemblyProduct("Mockable Web Security")]
 [assembly: AssemblyCopyright("Copyright 2011 by Peppermint IT Limited")]
-[assembly: AssemblyVersion("0.0.0.284")]
+[assembly: AssemblyVersion("0.0.0.285")]

-[assembly: AssemblyFileVersion("0.0.0.284")]
+[assembly: AssemblyFileVersion("0.0.0.285")]


Updating version number

Updating version number

--- src/Properties/AssemblyInfo.cs
+++ src/Properties/AssemblyInfo.cs
@@ -5,7 +5,7 @@
 [assembly: AssemblyCompany("Peppermint IT Limited")]
 [assembly: AssemblyProduct("Mockable Web Security")]
 [assembly: AssemblyCopyright("Copyright 2011 by Peppermint IT Limited")]
-[assembly: AssemblyVersion("0.0.0.84")]
+[assembly: AssemblyVersion("0.0.0.85")]

-[assembly: AssemblyFileVersion("0.0.0.84")]
+[assembly: AssemblyFileVersion("0.0.0.85")]


Refactor: new C# features used

Refactor: new C# features used

--- src/reni2/Code/ReplaceVisitor/ReplaceAbsoluteArg.cs
+++ src/reni2/Code/ReplaceVisitor/ReplaceAbsoluteArg.cs
@@ -1,26 +1,6 @@
-//
-//     Project Reni2
-//     Copyright (C) 2011 - 2012 Harald Hoyer
-//
-//     This program is free software: you can redistribute it and/or modify
-//     it under the terms of the GNU General Public License as published by
-//     the Free Software Foundation, either version 3 of the License, or
-//     (at your option) any later version.
-//
-//     This program is distributed in the hope that it will be useful,
-//     but WITHOUT ANY WARRANTY; without even the implied warranty of
-//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//     GNU General Public License for more details.
-//
-//     You should have received a copy of the GNU General Public License
-//     along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-//     Comments, bugs and suggestions to hahoyer at yahoo.de
-
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using hw.Debug;

 namespace Reni.Code.ReplaceVisitor
 {
@@ -29,6 +9,6 @@
         public ReplaceAbsoluteArg(Result actualArg)
             : base(actualArg) { }

-        protected override CodeBase Actual { get { return ActualArg.Code; } }
+        protected override CodeBase Actual => ActualArg.Code;
     }
 }


Added failing tests

Added failing tests

--- src/test/Sieve.NET.Core.Tests/EqualitySieveTests.cs
+++ src/test/Sieve.NET.Core.Tests/EqualitySieveTests.cs
@@ -180,6 +180,22 @@

             }

+            [Fact]
+            public void PlaysNicelyWithForValues_UsingStrings()
+            {
+                var expectedValues = new List<int> { 1, 2, 3 };
+
+
+
+                throw new NotImplementedException();
+            }
+
+            [Fact]
+            public void PlaysNicelyWithForValues_UsingPropertyOfT()
+            {
+                throw new NotImplementedException();
+            }
+
             public class ASingleStringTests
             {
                 [Fact]
@@ -450,6 +466,19 @@

         public class ForValuesTests
         {
+            [Fact]
+            public void PlaysNiceWithForValue_UsingStrings()
+            {
+                throw new NotImplementedException();
+            }
+
+            [Fact]
+            public void PlaysNiceWithForValue_UsingPropertyOfT()
+            {
+                throw new NotImplementedException();
+            }
+
+
             public class EnumerableOfPropertyTypeTests
             {
                 [Fact]


Disable multi-dimensional array test for UAP.

--- src/Microsoft.CSharp/tests/ArrayHandling.cs
+++ src/Microsoft.CSharp/tests/ArrayHandling.cs
@@ -12,6 +12,7 @@
     public class ArrayHandling
     {
         [Fact]
+        [SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "No size array not supported")]
         public void SingleRankNonSZArray()
         {
             dynamic d = Array.CreateInstance(typeof(int), new[] { 8 }, new[] { -2 });
@@ -31,24 +32,30 @@
             d = new int[3];
             ex = Assert.Throws<RuntimeBinderException>(() => { string s = d; });
             Assert.Contains("int[]", ex.Message);
+        }

-            d = new int[3, 2, 1];
+        [Fact]
+        [SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Multi-dimensional array not supported")]
+        public void MultiDimArrayTypeNames()
+        {
+            dynamic d = new int[3, 2, 1];
             ex = Assert.Throws<RuntimeBinderException>(() => { string s = d; });
             Assert.Contains("int[,,]", ex.Message);

             d = Array.CreateInstance(typeof(int), new[] { 3, 2, 1 }, new[] { -2, 2, -0 });
             ex = Assert.Throws<RuntimeBinderException>(() => { string s = d; });
             Assert.Contains("int[,,]", ex.Message);
-
         }

         [Fact]
+        [SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "Multi-dimensional array not supported")]
         public void IncorrectNumberOfIndices()
         {
             dynamic d = new int[2, 2, 2];
             RuntimeBinderException ex = Assert.Throws<RuntimeBinderException>(() => d[1] = 0);
             Assert.Contains("[]", ex.Message);
             Assert.Contains("'3'", ex.Message);
+

             ex = Assert.Throws<RuntimeBinderException>(() => d[1, 2, 3, 4] = 0);
             Assert.Contains("[]", ex.Message);
@@ -70,7 +77,6 @@
             ex = Assert.Throws<RuntimeBinderException>(() => d[1, 2, 3, 4]);
             Assert.Contains("[]", ex.Message);
             Assert.Contains("'1'", ex.Message);
-
         }
     }
 }


Update VersionOracle.cs

Update VersionOracle.cs

--- src/NerdBank.GitVersioning/VersionOracle.cs
+++ src/NerdBank.GitVersioning/VersionOracle.cs
@@ -495,7 +495,9 @@
                 }
             }

-            return headCommit?.GetVersionHeight(relativeRepoProjectDirectory, workingVersion?.PathFilters) ?? 0;
+            return headCommit?.GetVersionHeight(FilterPath.FromVersionOptions(relativeRepoProjectDirectory,
+                       ((LibGit2Sharp.IBelongToARepository) headCommit).Repository, workingVersion), relativeRepoProjectDirectory)
+                   ?? 0;
         }

         private static Version GetIdAsVersion(LibGit2Sharp.Commit headCommit, VersionOptions committedVersion, VersionOptions workingVersion, int versionHeight)


Remove dead code

Remove dead code

--- src/Radical.Windows/Presentation/Tracing.cs
+++ src/Radical.Windows/Presentation/Tracing.cs
@@ -1,34 +0,0 @@
-using System.Configuration;
-using System.Diagnostics;
-
-namespace Radical.Windows.Presentation
-{
-    static class Tracing
-    {
-        static readonly object syncRoot = new object();
-        static TraceSource _source;
-
-        public static TraceSource Source
-        {
-            get
-            {
-                if( _source == null )
-                {
-                    lock( syncRoot )
-                    {
-                        if( _source == null )
-                        {
-                            var name =  ConfigurationManager
-                                .AppSettings[ "radical/windows/presentation/diagnostics/defaultTraceSourceName" ]
-                                .Return( s => s, "Radical.Windows.Presentation" );
-
-                            _source = new TraceSource( name );
-                        }
-                    }
-                }
-
-                return _source;
-            }
-        }
-    }
-}


Update Installer.cs

Update Installer.cs

--- src/umbraco.cms/businesslogic/Packager/Installer.cs
+++ src/umbraco.cms/businesslogic/Packager/Installer.cs
@@ -279,7 +279,7 @@
                 if (_currentUserId > -1)
                 {
                     Audit.Add(AuditTypes.PackagerInstall,
-                                            string.Format("Package '{0}' files installed. Package guid: {1}", insPack.Data.Name, insPack.Data.PackageGuid),
+                                            string.Format("Package '{0}' installed. Package guid: {1}", insPack.Data.Name, insPack.Data.PackageGuid),
                                             _currentUserId, -1);
                 }


Fixed bad merge

Fixed bad merge

--- Palaso/Xml/XmlUtils.cs
+++ Palaso/Xml/XmlUtils.cs
@@ -762,66 +762,5 @@
 				(codePoint >= 0x10000/* && character <= 0x10FFFF*/) //it's impossible to get a code point bigger than 0x10FFFF because Char.ConvertToUtf32 would have thrown an exception
 			);
 		}
-		/// <summary>
-		/// Write a node out containing the XML in dataToWrite, pretty-printed according to the rules of writer, except
-		/// that we suppress indentation for children of nodes whose names are listed in suppressIndentingChildren,
-		/// and also for "mixed" nodes (where some children are text).
-		/// </summary>
-		/// <param name="writer"></param>
-		/// <param name="dataToWrite"></param>
-		/// <param name="suppressIndentingChildren"></param>
-		public static void WriteNode(XmlWriter writer, string dataToWrite, HashSet<string> suppressIndentingChildren)
-		{
-			XElement element = XDocument.Parse(dataToWrite).Root;
-			WriteNode(writer, element, suppressIndentingChildren);
-		}
-		/// <summary>
-		/// Write a node out containing the XML in dataToWrite, pretty-printed according to the rules of writer, except
-		/// that we suppress indentation for children of nodes whose names are listed in suppressIndentingChildren,
-		/// and also for "mixed" nodes (where some children are text).
-		/// </summary>
-		/// <param name="writer"></param>
-		/// <param name="dataToWrite"></param>
-		/// <param name="suppressIndentingChildren"></param>
-		public static void WriteNode(XmlWriter writer, XElement dataToWrite, HashSet<string> suppressIndentingChildren)
-		{
-			if (dataToWrite == null)
-				return;
-			WriteElementTo(writer, dataToWrite, suppressIndentingChildren);
-		}
-
-		/// <summary>
-		/// Recursively write an element to the writer, suppressing indentation of children when required.
-		/// </summary>
-		/// <param name="writer"></param>
-		/// <param name="element"></param>
-		/// <param name="suppressIndentingChildren"></param>
-		private static void WriteElementTo(XmlWriter writer, XElement element, HashSet<string> suppressIndentingChildren)
-		{
-			writer.WriteStartElement(element.Name.LocalName);
-			foreach (var attr in element.Attributes())
-				writer.WriteAttributeString(attr.Name.LocalName, attr.Value);
-			// The writer automatically suppresses indenting children for any element that it detects has text children.
-			// However, it won't do this for the first child if that is an element, even if it later encounters text children.
-			// Also, there may be a parent where text including white space is significant, yet it is possible for the
-			// WHOLE content to be an element. For example, a <text> or <AStr> element may consist entirely of a <span>.
-			// In such cases there is NO way to tell from the content that it should not be indented, so all we can do
-			// is pass a list of such elements.
-			bool suppressIndenting = suppressIndentingChildren.Contains(element.Name.LocalName) || element.Nodes().Any(x => x is XText);
-			// In either case, we implement the suppression by making the first child a fake text element.
-			// Calling this method, even with an empty string, has proved to be enough to make the writer treat the parent
-			// as "mixed" which prevents indenting its children.
-			if (suppressIndenting)
-				writer.WriteString("");
-			foreach (var child in element.Nodes())
-			{
-				var xElement = child as XElement;
-				if (xElement != null)
-					WriteElementTo(writer, xElement, suppressIndentingChildren);
-				else
-					child.WriteTo(writer); // defaults are fine for everything else.
-			}
-			writer.WriteEndElement();
-		}
 	}
 }


(#100) Add more docs

(#100) Add more docs

--- Source/Localization.cs
+++ Source/Localization.cs
@@ -25,7 +25,22 @@

     public static class Localization
     {
+#if DEBUG
+        static unsafe Localization()
+        {
+            Game.LogTrivialDebug($"CTextFile => {((IntPtr)IL.Unsafe.AsPointer(ref CTextFile.Instance)).ToString("X16")}");
+        }
+#endif
+
+        /// <summary>
+        /// Gets the system language. This is the same as the Rockstar Games Launcher language setting.
+        /// </summary>
         public static Language SystemLanguage => (Language)N.GetSystemLanguage();
+
+        /// <summary>
+        /// Gets the user interface language.
+        /// This is normally the same as <see cref="SystemLanguage"/> unless the <c>-uilanguage</c> command line argument is used.
+        /// </summary>
         public static Language Language => (Language)N.GetCurrentLanguage();

         /// <summary>
@@ -123,7 +138,7 @@

             if (oldValue != IntPtr.Zero)
             {
-                unsafe { sysMemAllocator.TheAllocator.Free((void*)oldValue); }
+                FreeUtf8(oldValue);
             }
         }

@@ -156,10 +171,13 @@

             if (oldValue != IntPtr.Zero)
             {
-                unsafe { sysMemAllocator.TheAllocator.Free((void*)oldValue); }
-            }
-        }
-
+                FreeUtf8(oldValue);
+            }
+        }
+
+        /// <summary>
+        /// Converts a null-terminated UTF-8 string to a <see cref="string"/>.
+        /// </summary>
         private static unsafe string FromUtf8(IntPtr ptr)
         {
             var p = (byte*)ptr;
@@ -176,6 +194,9 @@
             }
         }

+        /// <summary>
+        /// Converts a <see cref="string"/> to an unmanaged null-terminated UTF-8 string, allocated using the game allocator.
+        /// </summary>
         private static unsafe IntPtr ToUtf8(string str)
         {
             fixed (char* chars = str)
@@ -187,5 +208,10 @@
                 return (IntPtr)dest;
             }
         }
+
+        /// <summary>
+        /// Frees a UTF-8 string previously allocated by <see cref="ToUtf8(string)"/>.
+        /// </summary>
+        private static unsafe void FreeUtf8(IntPtr ptr) => sysMemAllocator.TheAllocator.Free((void*)ptr);
     }
 }


Throw exception if expected exception not thrown (#24)

--- Source/Totem/Expect.cs
+++ Source/Totem/Expect.cs
@@ -73,6 +73,16 @@

 				throw new ExpectException(message, error);
 			}
+
+			var notThrownMessage = (issue ?? "Expected exception was not thrown")
+					.WriteTwoLines()
+					.WriteLine("Expected:")
+					.WriteLine(Text.OfType<TException>().Indent(retainWhitespace: true))
+					.WriteLine()
+					.WriteLine("Received:")
+					.WriteLine(Text.Of("None").Indent(retainWhitespace: true));
+
+			throw new ExpectException(notThrownMessage);
 		}

 		[DebuggerHidden, DebuggerStepThrough, DebuggerNonUserCode]


Added an info message to the MVC example.

--- src/web-example/Controllers/LogExampleController.cs
+++ src/web-example/Controllers/LogExampleController.cs
@@ -41,6 +41,7 @@
             }

             ViewData[severity] = true;
+            ViewData["Message"] = "Log sent to server.";
             return View("Index");
         }
     }


Added back DecryptIdTech for backwards compatibility.

--- Dukpt/Dukpt.cs
+++ Dukpt/Dukpt.cs
@@ -99,7 +99,6 @@

         #region Public Methods

-
         /// <summary>
         /// Encrypt provided data using TDES DUKPT
         /// </summary>
@@ -126,6 +125,19 @@
             return Transform("TripleDES", false, CreateSessionKey(bdk, ksn, isPIN), encryptedData.ToBigInteger()).GetBytes();
         }

+        /// <summary>
+        /// Decrypt provided data using TDES DUKPT using DEK mask
+        /// Backwards-compatible with previous versions of Dukpt.NET
+        /// </summary>
+        /// <param name="bdk">Base Derivation Key</param>
+        /// <param name="ksn">Key Serial Number</param>
+        /// <param name="data">Data to decrypt</param>
+        /// <returns>Decrypted data</returns>
+        public static byte[] DecryptIdTech(string bdk, string ksn, byte[] encryptedData)
+        {
+            return Transform("TripleDES", false, CreateSessionKey(bdk, ksn, false), encryptedData.ToBigInteger()).GetBytes();
+        }
+
         #endregion

     }


Add FTPS notification to log.

Add FTPS notification to log.

--- src/Tc.Psg.CloudFtpBridge/IO/FileManager.cs
+++ src/Tc.Psg.CloudFtpBridge/IO/FileManager.cs
@@ -221,21 +221,23 @@
                 Server server = workflow.Server;
                 FtpClient ftpClient = new FtpClient(server.Host, server.Port, server.Username, server.Password);

+                if (_log.IsEnabled(LogLevel.Trace))
+                {
+                    _log.LogTrace("Using {FtpUsername} / {FtpPassword} to connect to {FtpHost}:{FtpPort}.", server.Username, server.Password, server.Host, server.Port);
+                }
+
+                else
+                {
+                    _log.LogDebug("Using {FtpUsername} to connect to {FtpHost}:{FtpPort}. Enable trace-level logging to see password.", server.Username, server.Host, server.Port);
+                }
+
                 if (server.FtpsEnabled && Enum.TryParse(server.EncryptionMode, out FtpEncryptionMode ftpEncryptionMode))
                 {
                     ftpClient.EncryptionMode = ftpEncryptionMode;
                     ftpClient.ValidateCertificate += new FtpSslValidation(OnValidateCertificate);
                     ftpClient.SslProtocols = SslProtocols.Default;
-                }
-
-                if (_log.IsEnabled(LogLevel.Trace))
-                {
-                    _log.LogTrace("Using {FtpUsername} / {FtpPassword} to connect to {FtpHost}:{FtpPort}.", server.Username, server.Password, server.Host, server.Port);
-                }
-
-                else
-                {
-                    _log.LogDebug("Using {FtpUsername} to connect to {FtpHost}:{FtpPort}. Enable trace-level logging to see password.", server.Username, server.Host, server.Port);
+
+                    _log.LogDebug("FTPS is enabled. Encryption mode is set to {EncryptionMode}.", server.EncryptionMode);
                 }

                 folder = new FtpFolder(ftpClient, PathUtil.CombineFragments(server.Path, workflow.RemotePath));


Initialize addins in static methods

Initialize addins in static methods

--- FileManager.cs
+++ FileManager.cs
@@ -35,15 +35,9 @@
 		{
 			this.Root = root;
 			this.InfoCollection = infoCollection;
-
-			if (!AddinManager.IsInitialized) {
-				AddinManager.Initialize(".addins");
-				AddinManager.Registry.Update();
-
-				new System.IO.DirectoryInfo(".addins").Attributes |= System.IO.FileAttributes.Hidden;
-			}
+			InitializeAddins();
 		}
-
+
 		public FileContainer Root {
 			get;
 			private set;
@@ -61,6 +55,15 @@
 			return Instance;
 		}

+		private static void InitializeAddins()
+		{
+			if (!AddinManager.IsInitialized) {
+				AddinManager.Initialize(".addins");
+				AddinManager.Registry.Update();
+				new System.IO.DirectoryInfo(".addins").Attributes |= System.IO.FileAttributes.Hidden;
+			}
+		}
+
 		public static void Initialize(FileContainer rootDir, FileInfoCollection infoCollection)
 		{
 			Instance = new FileManager(rootDir, infoCollection);
@@ -68,11 +71,7 @@

 		public static Format GetFormat(string name)
 		{
-			if (!AddinManager.IsInitialized) {
-				AddinManager.Initialize();
-				AddinManager.Registry.Update();
-			}
-
+			InitializeAddins();
 			return AddinManager.GetExtensionObjects<Format>(false).
 				Where(f => f.FormatName == name).
 			    ToArray()[0];
@@ -83,6 +82,7 @@
 			if (file.Format != null)
 				return null;

+			InitializeAddins();
 			FormatValidation validation = AddinManager.GetExtensionObjects<FormatValidation>(false)
 				.OrderByDescending((validat) => {validat.RunTests(file); return validat.Result;})
 				.FirstOrDefault();


Update float parsing

Update float parsing

Update float parsing using InvariantCulture to not depend on OS language to parse float value.
Usefull for French, German, ... users where comma is default notations for the decimal point parsing.


parameterized test

parameterized test


prev commit fix.

prev commit fix.


add variability to password length; cleanup function call;


Levens linksboven in de hoek gezet

Levens linksboven in de hoek gezet

--- Ritual/Assets/Resources/Scripts/GameController.cs
+++ Ritual/Assets/Resources/Scripts/GameController.cs
@@ -24,9 +24,11 @@
 		float height =(2f * cam.orthographicSize)/2;
 		float width = (2f * cam.orthographicSize * cam.aspect)/2;

-		var spacing = 0.5f;
+		var spacing = 0f;
 		for(var i=0; i < amountOfLives; i++){
-			Lives.Add(Instantiate(LiveIndicatorPrefab, new Vector3(-width+spacing,height-0.5f,0), Quaternion.identity) as GameObject);
+			var live = Instantiate(LiveIndicatorPrefab, new Vector3(-width+spacing,height-0.5f,0), Quaternion.identity) as GameObject;
+			live.transform.parent = Camera.main.transform;
+			Lives.Add(live);
 			spacing += 0.7f;
 		}


expanded TraceConfiguration test

expanded TraceConfiguration test

--- tests/NLog.UnitTests/NLogTraceListenerTests.cs
+++ tests/NLog.UnitTests/NLogTraceListenerTests.cs
@@ -139,10 +139,12 @@
             listener.Attributes.Add("defaultLogLevel", "Warn");
             listener.Attributes.Add("forceLogLevel", "Error");
             listener.Attributes.Add("autoLoggerName", "1");
+            listener.Attributes.Add("DISABLEFLUSH", "true");

             Assert.Equal(LogLevel.Warn, listener.DefaultLogLevel);
             Assert.Equal(LogLevel.Error, listener.ForceLogLevel);
             Assert.True(listener.AutoLoggerName);
+            Assert.True(listener.DisableFlush);
         }

         [Fact]


Minor optimizations

Minor optimizations

--- SadConsole.Core/Readers/TextureToSurfaceReader.cs
+++ SadConsole.Core/Readers/TextureToSurfaceReader.cs
@@ -78,10 +78,9 @@
             System.Threading.Tasks.Parallel.For(0, surface.Width * surface.Height, (i) =>
             //for (int i = 0; i < surface.Width * surface.Height; i++)
             {
-                float allR = 0;
-                float allG = 0;
-                float allB = 0;
-                float sbri = 0;
+                int allR = 0;
+                int allG = 0;
+                int allB = 0;

                 int min = i * fontPixels;
                 int max = min + fontPixels;
@@ -101,11 +100,8 @@
                 byte sb = (byte)(allB / fontPixels);

                 var newColor = new Color(sr, sg, sb);
-                sbri = newColor.GetBrightness() * 255;
+                float sbri = newColor.GetBrightness() * 255;

-                allR = 0;
-                allG = 0;
-                allB = 0;

                 Point surfacePoint = surface.GetPointFromIndex(i);
                 if (UseBlockMode)


Fix DotNetCliServiceFacts tests

Fix DotNetCliServiceFacts tests

--- tests/OmniSharp.Tests/DotNetCliServiceFacts.cs
+++ tests/OmniSharp.Tests/DotNetCliServiceFacts.cs
@@ -7,7 +7,7 @@
 {
     public class DotNetCliServiceFacts : AbstractTestFixture
     {
-        private const string DotNetVersion = "6.0.201";
+        private const string DotNetVersion = "7.0.100-preview.2.22153.17";
         private int Major { get; }
         private int Minor { get; }
         private int Patch { get; }


220: 	Crash on startup (Catch argument exception)

git-svn-id: 67c3ee79c80598486550ce992e66ca9291e224ee@274 8d6e282c-8220-11de-b77e-d9b456c0130a

--- SuperPutty/Settings.cs
+++ SuperPutty/Settings.cs
@@ -7,6 +7,8 @@
 using System.Windows.Forms;
 using System.Configuration;
 using System.Collections.Generic;
+using System.Threading;
+using System.Globalization;

 namespace SuperPutty.Properties {

@@ -82,20 +84,28 @@
             foreach (SuperPuttyAction action in Enum.GetValues(typeof(SuperPuttyAction)))
             {
                 string name = string.Format("Action_{0}_Shortcut", action);
+
+                // default
+                KeyboardShortcut ks = new KeyboardShortcut { Key = Keys.None };
+
+                // try load froms settings, note that Ctrl/Strg have conflicts
+                // http://blogs.msdn.com/b/michkap/archive/2010/06/05/10019465.aspx
                 try
                 {
                     Keys keys = (Keys)this[name];
-
-                    // get new and update menu items if needed
-                    KeyboardShortcut ks = KeyboardShortcut.FromKeys(keys);
-                    ks.Name = action.ToString();
-
-                    shortcuts.Add(ks);
+                    ks = KeyboardShortcut.FromKeys(keys);
+                }
+                catch (ArgumentException ex)
+                {
+                    Log.Warn("Could not convert shortcut text to Keys, possible localization bug with Ctrl and Strg.  Setting to None: " + name, ex);
                 }
                 catch (SettingsPropertyNotFoundException)
                 {
-                    Log.Debug("Could not load shortcut for " + name);
+                    Log.Debug("Could not load shortcut for " + name + ", Setting to None.");
                 }
+
+                ks.Name = action.ToString();
+                shortcuts.Add(ks);
             }

             return shortcuts.ToArray();


Fix bug where books could be out of order after a UsxParse until the project was reloaded

--- ProtoScript/Project.cs
+++ ProtoScript/Project.cs
@@ -350,7 +350,10 @@
 				Debug.Fail(e.Error.Message);

 			var result = (IEnumerable<BookScript>)e.Result;
-			m_books.AddRange(result);
+			//REVIEW: more efficient to sort after the fact like this?  Or just don't run them in parallel (in ProjectUsxParser) in the first place?
+			var resultList = result.ToList();
+			resultList.Sort((a, b) => BCVRef.BookToNumber(a.BookId).CompareTo(BCVRef.BookToNumber(b.BookId)));
+			m_books.AddRange(resultList);

 			if (ConfirmedQuoteSystem == null)
 				GuessAtQuoteSystem();


Some adjustments to number of repeated characters to fix the issue with long strings for darkColorString

--- QRCoder/ASCIIQRCode.cs
+++ QRCoder/ASCIIQRCode.cs
@@ -25,18 +25,23 @@
         {
             return String.Join(endOfLine, GetLineByLineGraphic(characterPerModule, darkColorString, whiteSpaceString));
         }
+
         /// <summary>
         /// Returns an array of strings that contain each line of the resulting QR code
         /// </summary>
-        /// <param name="characterPerModule">number of characters per module.</param>
-        /// <param name="darkColorString">string or character for use as dark color bits</param>
-        /// <param name="whiteSpaceString">string or character for use as white space bits</param>
+        /// <param name="repeatPerModule">number of repeated string or character per module.</param>
+        /// <param name="darkColorString">string or character for use as dark color bits. In case of string make sure whiteSpaceString has the same length</param>
+        /// <param name="whiteSpaceString">string or character for use as white space bits. In case of string make sure darkColorString has the same length</param>
         /// <returns></returns>
-        public string[] GetLineByLineGraphic(int characterPerModule, string darkColorString, string whiteSpaceString)
+        public string[] GetLineByLineGraphic(int repeatPerModule, string darkColorString, string whiteSpaceString)
         {
             var qrCode = new List<string>();
-            var sideLength = QrCodeData.ModuleMatrix.Count * characterPerModule;
-
+            //We need to adjust the repeatPerModule based on number of characters in darkColorString
+            //(we assume whiteSpaceString has the same number of characters)
+            //to keep the QR code as square as possible.
+            var adjustmentValueForNumberOfCharacters = darkColorString.Length / 2 != 1 ? darkColorString.Length / 2 : 0;
+            var verticalNumberOfRepeats = repeatPerModule + adjustmentValueForNumberOfCharacters;
+            var sideLength = QrCodeData.ModuleMatrix.Count * verticalNumberOfRepeats;
             for (var y = 0; y < sideLength; y++)
             {
                 bool emptyLine = true;
@@ -44,9 +49,9 @@

                 for (var x = 0; x < QrCodeData.ModuleMatrix.Count; x++)
                 {
-                    var module = QrCodeData.ModuleMatrix[x][(y + characterPerModule) / characterPerModule - 1];
+                    var module = QrCodeData.ModuleMatrix[x][(y + verticalNumberOfRepeats) / verticalNumberOfRepeats - 1];

-                    for (var i = 0; i < characterPerModule; i++)
+                    for (var i = 0; i < repeatPerModule; i++)
                     {
                         lineBuilder.Append(module ? darkColorString : whiteSpaceString);
                     }