Renamed OpenSimBase m_autoCreateLindenStack to m_autoCreateClientStack

--- OpenSim/Region/Application/OpenSimBase.cs
+++ OpenSim/Region/Application/OpenSimBase.cs
@@ -66,7 +66,7 @@
         protected string proxyUrl;
         protected int proxyOffset = 0;

-        protected bool m_autoCreateLindenStack = true;
+        protected bool m_autoCreateClientStack = true;

         /// <summary>
         /// The file used to load and save prim backup xml if no filename has been specified
@@ -585,7 +585,7 @@

             m_sceneManager.Add(scene);

-            if (m_autoCreateLindenStack)
+            if (m_autoCreateClientStack)
             {
                 m_clientServers.Add(clientServer);
                 clientServer.Start();
@@ -662,7 +662,7 @@

             uint port = (uint)regionInfo.InternalEndPoint.Port;

-            if (m_autoCreateLindenStack)
+            if (m_autoCreateClientStack)
             {
                 clientServer
                     = m_clientStackManager.CreateServer(
@@ -678,7 +678,7 @@

             Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager);

-            if (m_autoCreateLindenStack)
+            if (m_autoCreateClientStack)
             {
                 clientServer.AddScene(scene);
             }


deleting SilverlightStyle.cs

deleting SilverlightStyle.cs

--- Mapsui.Rendering.XamlRendering/SilverlightStyle.cs
+++ Mapsui.Rendering.XamlRendering/SilverlightStyle.cs
@@ -1,31 +0,0 @@
-using Mapsui.Styles;
-#if !NETFX_CORE
-using Media = System.Windows.Media;
-using WinPoint = System.Windows.Point;
-using WinColor = System.Windows.Media.Color;
-#else
-using Media = Windows.UI.Xaml.Media;
-using WinPoint = Windows.Foundation.Point;
-using WinColor = Windows.UI.Color;
-#endif
-
-namespace Mapsui.Rendering.XamlRendering
-{
-    static class SilverlightStyle
-    {
-        public static WinColor Convert(this Color color)
-        {
-            return WinColor.FromArgb((byte)color.A, (byte)color.R, (byte)color.G, (byte)color.B);
-        }
-
-        public static Media.Brush Convert(this Brush brush)
-        {
-            return new Media.SolidColorBrush(brush.Color.Convert());
-        }
-
-        public static WinPoint Convert(this Offset offset)
-        {
-            return new WinPoint(offset.X, offset.Y);
-        }
-    }
-}


Naming corrections.

Naming corrections.

--- Miles.MassTransit/TransactionalMessagePublisher.cs
+++ Miles.MassTransit/TransactionalMessagePublisher.cs
@@ -33,7 +33,7 @@
     /// <seealso cref="Miles.Events.ICommandPublisher" />
     public class TransactionalMessagePublisher : IEventPublisher, ICommandPublisher
     {
-        private readonly IOutgoingMessageRepository outgoingEventRepository;
+        private readonly IOutgoingMessageRepository outgoingMessageRepository;
         private readonly ITime time;

         // State
@@ -45,19 +45,19 @@
         /// Initializes a new instance of the <see cref="TransactionalMessagePublisher" /> class.
         /// </summary>
         /// <param name="transactionContext">The transaction context.</param>
-        /// <param name="outgoingEventRepository">The outgoing event repository.</param>
+        /// <param name="outgoingMessageRepository">The outgoing message repository.</param>
         /// <param name="time">The time service.</param>
         /// <param name="activityContext">The activity context.</param>
         /// <param name="messageDispatcher">The message dispatcher.</param>
         public TransactionalMessagePublisher(
             ITransactionContext transactionContext,
-            IOutgoingMessageRepository outgoingEventRepository,
+            IOutgoingMessageRepository outgoingMessageRepository,
             ITime time,
             IActivityContext activityContext,
             IMessageDispatcher messageDispatcher)
         {
             this.publisherStack.Push(new PublisherStackInstance(this));
-            this.outgoingEventRepository = outgoingEventRepository;
+            this.outgoingMessageRepository = outgoingMessageRepository;
             this.time = time;
             this.activityContext = activityContext;

@@ -171,7 +171,7 @@
             public async Task Handle()
             {
                 // Just before commit save all the outgoing messages and generate their ids - for consistency.
-                await publisher.outgoingEventRepository.SaveAsync(pendingSaveMessages.Select(x => x.GenerateOutgoingMessage(publisher.activityContext.CorrelationId, publisher.time.Now))).ConfigureAwait(false);
+                await publisher.outgoingMessageRepository.SaveAsync(pendingSaveMessages.Select(x => x.GenerateOutgoingMessage(publisher.activityContext.CorrelationId, publisher.time.Now))).ConfigureAwait(false);
                 publisher.pendingDispatchMessages.AddRange(pendingSaveMessages);

                 // Execute any immediate message handlers so they are within the transaction


Now removes messages as they are published.

--- Miles.MassTransit/TransactionalMessagePublisher.cs
+++ Miles.MassTransit/TransactionalMessagePublisher.cs
@@ -5,7 +5,6 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Threading.Tasks;

 namespace Miles.MassTransit
 {
@@ -47,19 +46,22 @@
                 pendingSaveMessages.Clear();
             });

-            // TODO: Remove from pendingDispatchMessages
-            if (consumeContext == null)
+            // TODO: Handle commands
+
+            // If we are working off the back of something else we have a consumeContext.
+            // If we are initiating action we fallback to the bus
+            var publishEndPoint = (IPublishEndpoint)consumeContext ?? bus;
+
+            transaction.PostCommit.Register(async (s, e) =>
             {
-                // first event
-                transaction.PostCommit.Register((s, e) =>
-                    Task.WhenAll(pendingDispatchMessages.Select(evt => bus.Publish(evt.MessageObject, callback: x => x.MessageId = evt.OutgoingMessage.MessageId))));
-            }
-            else
-            {
-                // responding to an event or command
-                transaction.PostCommit.Register((s, e) =>
-                    Task.WhenAll(pendingDispatchMessages.Select(evt => consumeContext.Publish(evt.MessageObject, callback: x => x.MessageId = evt.OutgoingMessage.MessageId))));
-            }
+                foreach (var message in pendingDispatchMessages.ToList())
+                {
+                    await publishEndPoint.Publish(message.MessageObject, callback: x => x.MessageId = message.OutgoingMessage.MessageId);
+                    message.OutgoingMessage.Dispatched(time);
+                    await outgoingEventRepository.SaveAsync(message.OutgoingMessage, ignoreTransaction: true);
+                    pendingDispatchMessages.Remove(message);
+                }
+            });
         }

         void IEventPublisher.Publish<TEvent>(TEvent evt)


(GH-80) Set milestone to correct version number

There is a slight edge case where artifacts are pushed to the wrong
GitHub release.  Rather then set milestone to MajorMinorPatch, use the
asserted SemVer version instead.

--- Cake.Recipe/Content/gitversion.cake
+++ Cake.Recipe/Content/gitversion.cake
@@ -73,7 +73,7 @@
             semVersion = assertedVersions.LegacySemVerPadded;
             informationalVersion = assertedVersions.InformationalVersion;
             assemblySemVer = assertedVersions.AssemblySemVer;
-            milestone = string.Concat(version);
+            milestone = assertedVersions.SemVer;
             fullSemVersion = assertedVersions.FullSemVer;

             context.Information("Calculated Semantic Version: {0}", semVersion);


Adding the missing com_speech_to_text url in the HttpFake class.

--- eFormCore/Communication/HttpFake.cs
+++ eFormCore/Communication/HttpFake.cs
@@ -319,6 +319,7 @@
                 com_address = "http://srv05.microting.com",
                 com_address_basic = "https://basic.microting.com",
                 com_address_pdf_upload = "https://srv16.microting.com",
+                com_speech_to_text = "https://srv16.microting.com",
                 subscriber_address = "notification.microting.com",
                 subscriber_token = token,
                 subscriber_name = "john_doen_corporation_ltd" } });


fix: unbox a single element

fix: unbox a single element

--- primitives.cs
+++ primitives.cs
@@ -242,6 +242,9 @@
         }

         public AType unbox(A<Box> y) {
+            if (y.Shape == null) {
+                return y.Ravel[0].val;
+            }
             var newShape = y.ShapeCopy();
             var shape = y.Ravel[0].val.Shape;
             if (shape == null) {


format

format

--- WalletWasabi/BitcoinCore/CoreNode.cs
+++ WalletWasabi/BitcoinCore/CoreNode.cs
@@ -219,7 +219,7 @@
 		{
 			var isConnected = node.IsConnected;
 			var trustedNodeMode = MempoolService.TrustedNodeMode;
-			if (isConnected != trustedNodeMode)
+			if (trustedNodeMode != isConnected)
 			{
 				MempoolService.TrustedNodeMode = isConnected;
 				Logger.LogInfo($"CoreNode connection state changed. Triggered {nameof(MempoolService)}.{nameof(MempoolService.TrustedNodeMode)} to be {MempoolService.TrustedNodeMode}");


Fix missing break statement.

Fix missing break statement.


Fix: Limit numbers to the range [-999, 999]

--- TIS100/Number.cs
+++ TIS100/Number.cs
@@ -8,7 +8,7 @@
         private int value;

         public Number(int value) {
-            this.value = value;
+            this.value = Math.Max(-999, Math.Min(value, 999));
         }

         public static IEnumerable<Number> Convert(IEnumerable<int> values) {


Revert test settings

Revert test settings

--- Tests/Program.cs
+++ Tests/Program.cs
@@ -11,9 +11,9 @@
     class Program
     {
         // TODO: Make these command line arguments.
-        static int SampleRate = 44100;
+        static int SampleRate = 48000;
         static int Samples = 4800;
-        static int Oversample = 4;
+        static int Oversample = 8;
         static int Iterations = 8;

         static void Main(string[] args)


Moved code to Tester class, added WriteDocs

--- Tests/Program.cs
+++ Tests/Program.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Reflection;
@@ -13,32 +14,30 @@

 namespace Tests
 {
-    class Program
+    class Tester
     {
-        static readonly Variable t = Component.t;
-
-        static int SampleRate = 44100;
-        static int Samples = 100000;
-        static int Oversample = 8;
-        static int Iterations = 8;
-
-        static double analysisTime = 0.0;
-        static double simulateTime = 0.0;
-
-        static ConsoleLog Log = new ConsoleLog() { Verbosity = MessageType.Info };
-
-        static void Main(string[] args)
-        {
-            Func<double, double> Vin = t => Harmonics(t, 0.5, 82, 2);
-
+        private static readonly Variable t = Component.t;
+
+        public int SampleRate = 44100;
+        public int Samples = 100000;
+        public int Oversample = 8;
+        public int Iterations = 8;
+
+        private double analysisTime = 0.0;
+        private double simulateTime = 0.0;
+
+        public Log Log = new ConsoleLog() { Verbosity = MessageType.Info };
+
+        public void Run(IEnumerable<string> Tests, Func<double, double> Vin)
+        {
             List<string> errors = new List<string>();
             List<string> performance = new List<string>();

             // This test generates the signal for the LiveSPICE 'logo'.
             //Run("BossSD1NoBuffer.xml", Vin, "V1[t]", new Expression[] { "_v15[t]", "_v11[t]" });
             //return;
-
-            foreach (string File in System.IO.Directory.EnumerateFiles(@".", "*.schx"))
+
+            foreach (string File in Tests)
             {
                 string Name = System.IO.Path.GetFileNameWithoutExtension(File);
                 try
@@ -46,43 +45,43 @@
                     double perf = Run(File, Vin);
                     performance.Add(Name + ":\t" + Quantity.ToString(perf, Units.Hz) + " (" + (perf / (double)SampleRate).ToString("G3") + "x real time)");
                 }
-                catch (Exception ex)
+                catch (Exception ex)
                 {
                     errors.Add(Name + ":\t" + ex.Message);
-                    Console.WriteLine(ex.Message);
+                    Log.WriteLine(ex.Message);
                 }
             }

-            Console.WriteLine("Analyze/Simulate {0}/{1}", analysisTime, simulateTime);
-
-            Console.WriteLine("{0} succeeded:", performance.Count);
+            Log.WriteLine("Analyze/Simulate {0}/{1}", analysisTime, simulateTime);
+
+            Log.WriteLine("{0} succeeded:", performance.Count);
             foreach (string i in performance)
-                Console.WriteLine(i);
-
-            Console.WriteLine("{0} failed:", errors.Count);
+                Log.WriteLine(i);
+
+            Log.WriteLine("{0} failed:", errors.Count);
             foreach (string i in errors)
-                Console.WriteLine(i);
-        }
-
-        public static double Run(string FileName, Func<double, double> Vin)
+                Log.WriteLine(i);
+        }
+
+        public double Run(string FileName, Func<double, double> Vin)
         {
             Circuit.Circuit C = Schematic.Load(FileName, Log).Build();
             C.Name = System.IO.Path.GetFileNameWithoutExtension(FileName);
             return Run(
-                C,
-                Vin,
-                C.Components.OfType<Input>().Select(i => Expression.Parse(i.Name + "[t]")).DefaultIfEmpty("V[t]").SingleOrDefault(),
+                C,
+                Vin,
+                C.Components.OfType<Input>().Select(i => Expression.Parse(i.Name + "[t]")).DefaultIfEmpty("V[t]").SingleOrDefault(),
                 C.Nodes.Select(i => i.V));
         }

-        public static double Run(string FileName, Func<double, double> Vin, Expression Input, IEnumerable<Expression> Plots)
+        public double Run(string FileName, Func<double, double> Vin, Expression Input, IEnumerable<Expression> Plots)
         {
             Circuit.Circuit C = Schematic.Load(FileName, Log).Build();
             C.Name = System.IO.Path.GetFileNameWithoutExtension(FileName);
             return Run(C, Vin, Input, Plots);
         }

-        public static double Run(Circuit.Circuit C, Func<double, double> Vin, Expression Input, IEnumerable<Expression> Plots)
+        public double Run(Circuit.Circuit C, Func<double, double> Vin, Expression Input, IEnumerable<Expression> Plots)
         {
             long a = Timer.Counter;

@@ -90,9 +89,9 @@
             TransientSolution TS = TransientSolution.Solve(analysis, (Real)1 / (SampleRate * Oversample), Log);

             analysisTime += Timer.Delta(a);
-
+
             Simulation S = new LinqCompiledSimulation(TS, Oversample, Log);
-            Console.WriteLine("");
+            Log.WriteLine("");
             if (Samples > 0)
                 return RunTest(
                     C, S,
@@ -105,44 +104,49 @@
                 return 0.0;
         }

-        public static double RunTest(Circuit.Circuit C, Simulation S, Expression Input, IEnumerable<Expression> Outputs, Func<double, double> Vin, int N, string Name)
-        {
+        public double RunTest(Circuit.Circuit C, Simulation S, Expression Input, IEnumerable<Expression> Outputs, Func<double, double> Vin, int Samples, string Name)
+        {
             double t0 = (double)S.Time;
-
+
+            int N = 353;
+
             Dictionary<Expression, double[]> input = new Dictionary<Expression, double[]>();
-            double[] vs = new double[N];
-            for (int n = 0; n < vs.Length; ++n)
-                vs[n] = Vin(n * S.TimeStep);
-            input.Add(Input, vs);
-
-            Dictionary<Expression, double[]> output = Outputs.ToDictionary(i => i, i => new double[vs.Length]);
-
+            double[] vin = new double[N];
+            input.Add(Input, vin);
+
+            Dictionary<Expression, List<double>> output = Outputs.ToDictionary(i => i, i => new List<double>());
+            Dictionary<Expression, double[]> buffers = Outputs.ToDictionary(i => i, i => new double[N]);
+
             // Ensure that the simulation is cached before benchmarking.
-            S.Run(1, input, output, Iterations);
+            S.Run(1, input, buffers, Iterations);
             S.Reset();

             double time = 0.0;
-            try
-            {
+            int samples = 0;
+            double t = 0;
+            for (; samples < Samples; samples += N)
+            {
+                for (int n = 0; n < N; ++n, t += S.TimeStep)
+                    vin[n] = Vin(t);
+
                 long a = Timer.Counter;
-                S.Run(vs.Length, input, output, Iterations);
-                time = Timer.Delta(a);
-                simulateTime += time;
+                S.Run(N, input, buffers, Iterations);
+                time += Timer.Delta(a);
+
+                foreach (Expression key in output.Keys)
+                    output[key].AddRange(buffers[key]);
             }
-            catch (SimulationDiverged Ex)
-            {
-                if (Ex.At < 10) throw;
-                N = (int)Ex.At;
-            }
-
-            int t1 = Math.Min(N, 2000);
-
-            Console.WriteLine("Performance {0}", Quantity.ToString(N / time, Units.Hz));
+            simulateTime += time;
+
+            int t1 = Math.Min(Samples, 4000);
+
+            Log.WriteLine("Performance {0}", Quantity.ToString(samples / time, Units.Hz));

             Plot p = new Plot()
             {
-                Title = Name,
-                Width = 800, Height = 400,
+                Title = Name,
+                Width = 800,
+                Height = 400,
                 x0 = t0,
                 x1 = S.TimeStep * t1,
                 xLabel = "Time (s)",
@@ -152,11 +156,69 @@
             p.Series.AddRange(output.Select(i => new Scatter(
                 i.Value.Take(t1)
                 .Select((j, n) => new KeyValuePair<double, double>(n * S.TimeStep, j)).ToArray()) { Name = i.Key.ToString() }));
-            return N / time;
+            return samples / time;
+        }
+    }
+
+    class Program
+    {
+        static void WriteDocs()
+        {
+            FileStream file = new FileStream("docs.html", FileMode.Create);
+            StreamWriter docs = new StreamWriter(file);
+
+            Action<StreamWriter, string, string, string> WriteTag = (StreamWriter S, string Tab, string Tag, string P) => S.WriteLine(Tab + "<" + Tag + ">" + P + "</" + Tag + ">");
+
+            docs.WriteLine("
");
+            docs.WriteLine("\t
Components
");
+            docs.WriteLine("\t
This section describes the operation of the basic component types provided in LiveSPICE. All of the components in the library are directly or indirectly (via subcircuits) implemented using these component types.
");
+
+            Type root = typeof(Circuit.Component);
+            foreach (Assembly i in AppDomain.CurrentDomain.GetAssemblies())
+            {
+                foreach (Type j in i.GetTypes().Where(j => j.IsPublic && !j.IsAbstract && root.IsAssignableFrom(j)))
+                {
+                    try
+                    {
+                        System.ComponentModel.DisplayNameAttribute name = j.GetCustomAttribute<System.ComponentModel.DisplayNameAttribute>();
+                        System.ComponentModel.DescriptionAttribute desc = j.GetCustomAttribute<System.ComponentModel.DescriptionAttribute>();
+
+                        docs.WriteLine("\t
");
+                        docs.WriteLine("\t
" + (name != null ? name.DisplayName : j.Name) + "
");
+                        if (desc != null)
+                            WriteTag(docs, "\t\t", "p", desc.Description);
+
+                        docs.WriteLine("\t\t
Properties
");
+                        docs.WriteLine("\t\t
");
+                        foreach (PropertyInfo p in j.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(k => k.GetCustomAttribute<Serialize>() != null))
+                        {
+                            desc = p.GetCustomAttribute<System.ComponentModel.DescriptionAttribute>();
+                            StringBuilder prop = new StringBuilder();
+                            prop.Append("" + p.Name + "");
+                            if (desc != null)
+                                prop.Append(": " + desc.Description);
+
+                            WriteTag(docs, "\t\t\t", "li", prop.ToString());
+                        }
+                        docs.WriteLine("\t\t
");
+                    }
+                    catch (Exception) { }
+                }
+            }
+
+            docs.WriteLine("
 ");
+        }
+
+        static void Main(string[] args)
+        {
+            //WriteDocs();
+
+            Tester tests = new Tester();
+            tests.Run(System.IO.Directory.EnumerateFiles(@".", "*.schx"), t => Harmonics(t, 0.5, 82, 2));
         }

         // Generate a function with the first N harmonics of f0.
-        static double Harmonics(double t, double A, double f0, int N)
+        private static double Harmonics(double t, double A, double f0, int N)
         {
             double s = 0;
             for (int i = 1; i <= N; ++i)


Removing child content view controller from its parent (prevents from potential memory leaks if a new content view controller is created each time you navigate)

--- Xamarin-Sidebar/SidebarController.cs
+++ Xamarin-Sidebar/SidebarController.cs
@@ -253,6 +253,10 @@
 		public void ChangeContentView(UIViewController newContentView) {
 			if (_contentAreaView != null)
 				_contentAreaView.RemoveFromSuperview();
+
+            if (ContentAreaController != null)
+                ContentAreaController.RemoveFromParentViewController ();
+
 			ContentAreaController = newContentView;
 			SetVisibleView();
 			CloseMenu();


Update contributors list

Update contributors list

--- Tomboy/Tomboy.cs
+++ Tomboy/Tomboy.cs
@@ -329,9 +329,11 @@
 				"",
 				Catalog.GetString ("Contributors:"),
 				"\tAaron Bockover",
+				"\tAbhinav Upadhyay",
 				"\tAlejandro Cura",
 				"\tAlexey Nedilko",
 				"\tAlex Kloss",
+				"\tAlex Tereschenko",
 				"\tAnders Petersson",
 				"\tAndrew Fister",
 				"\tBrian Mattern",
@@ -348,6 +350,7 @@
 				"\tFrederic Crozat",
 				"\tGabriel Burt",
 				"\tGabriel de Perthuis",
+				"\tIain Lane",
 				"\tJakub Steiner",
 				"\tJames Westby",
 				"\tJamin Philip Gray",
@@ -371,13 +374,17 @@
 				"\tMatthew Pirocchi",
 				"\tMatt Johnston",
 				"\tMatt Jones",
+				"\tMichael Fletcher",
 				"\tMike Mazur",
 				"\tNathaniel Smith",
+				"\tOlav Vitters",
 				"\tOlivier Le Thanh Duong",
 				"\tOwen Williams",
 				"\tPaul Cutler",
+				"\tPavol Klačanský",
 				"\tPrzemysław Grzegorczyk",
 				"\tRobert Buchholz",
+				"\tRobert Nordan",
 				"\tRobin Sonefors",
 				"\tRodrigo Moya",
 				"\tRomain Tartiere",


Make sure the DuelEnd and GameEnd events are fired only when required

--- YGOSharp/Game.cs
+++ YGOSharp/Game.cs
@@ -965,6 +965,11 @@

         public void EndDuel(bool force)
         {
+            if (State == GameState.End)
+            {
+                return;
+            }
+
             if (State == GameState.Duel)
             {
                 if (!Replay.Disabled)
@@ -976,7 +981,6 @@
                     SendToAll(packet);
                 }

-                State = GameState.End;
                 _duel.End();
             }

@@ -1006,11 +1010,6 @@
                     Players[0].Type = 0;
                     Players[1].Type = 1;
                 }
-            }
-
-            if (OnDuelEnd != null)
-            {
-                OnDuelEnd(this, EventArgs.Empty);
             }

             if (IsMatch && !force && !MatchIsEnd())
@@ -1087,9 +1086,7 @@
                 {
                     if (!IsReady[0] && !IsReady[1])
                     {
-                        State = GameState.End;
-                        CalculateWinner();
-                        End();
+                        EndDuel(true);
                         return;
                     }

@@ -1121,7 +1118,7 @@
                     else if (_handResult[1] != 0)
                         Surrender(Players[0], 3, true);
                     else
-                        End();
+                        EndDuel(true);
                 }
             }
         }
@@ -1136,6 +1133,11 @@
                 _startplayer = 1 - _startplayer;
             MatchResults[DuelCount] = player;
             MatchReasons[DuelCount++] = reason;
+
+            if (OnDuelEnd != null)
+            {
+                OnDuelEnd(this, EventArgs.Empty);
+            }
         }

         public void MatchKill()
@@ -1194,7 +1196,7 @@
             switch (result)
             {
                 case -1:
-                    _server.Stop();
+                    EndDuel(true);
                     break;
                 case 2: // Game finished
                     EndDuel(false);


Add custom fft path to script dependencies.

--- common/Scripting/StoryboardObjectGenerator.cs
+++ common/Scripting/StoryboardObjectGenerator.cs
@@ -121,7 +121,10 @@
         /// Useful to make spectrum effets.
         /// </summary>
         public float[] GetFft(double time, string path = null)
-            => context.GetFft(time, path);
+        {
+            if (path != null) AddDependency(path);
+            return context.GetFft(time, path);
+        }

         /// <summary>
         /// Returns the Fast Fourier Transform of the song at a certain time, with the specified amount of magnitudes.


Bugfix to the Uri parser

Bugfix to the Uri parser

--- Duplicati/Library/Utility/Uri.cs
+++ Duplicati/Library/Utility/Uri.cs
@@ -23,14 +23,17 @@
 {
     /// <summary>
     /// Represents a relaxed parsing of a URL.
-    /// The goal is to cover as
+    /// The goal is to cover as many types of url's as possible,
+    /// without being ambiguos.
+    /// The major limitations is that an embedded username may not contain a :,
+    /// and the password may not contain a @.
     /// </summary>
     public struct Uri
     {
         /// <summary>
         /// A very lax version of a URL parser
         /// </summary>
-        private static System.Text.RegularExpressions.Regex URL_PARSER = new System.Text.RegularExpressions.Regex(@"(?<scheme>[^:]+)://((?<username>[^\:]+)(\:(?<password>.*))?\@)?((?<hostname>[^/\?\:]+)(\:(?<port>\d+))?(/(?<path>[^\?]*))|(?<path>([^\?]*)))?(\?(?<query>.+))?");
+        private static System.Text.RegularExpressions.Regex URL_PARSER = new System.Text.RegularExpressions.Regex(@"(?<scheme>[^:]+)://(((?<username>[^\:]+)\:((?<password>[^@]*))\@))?((?<hostname>[^/\?\:]+)(\:(?<port>\d+))?(/(?<path>[^\?]*))|(?<path>([^\?]*)))?(\?(?<query>.+))?");

         /// <summary>
         /// The URL scheme, e.g. http
@@ -99,7 +102,12 @@
         {
             get
             {
-                return Host + (Path == null ? "" : "/" + Path);
+                if (string.IsNullOrEmpty(Path))
+                    return Host;
+                else if (string.IsNullOrEmpty(Host))
+                    return Path;
+                else
+                    return Host + (Path == null ? "" : "/" + Path);
             }
         }

@@ -127,7 +135,6 @@
             m_queryParams = null;
             this.OriginalUri = url;

-            //TODO: Does not parse urls with a @ in the path correctly
             var m = URL_PARSER.Match(url);
             if (!m.Success || m.Length != url.Length)
             {
@@ -217,24 +224,29 @@
         private static string AsString(string scheme, string host, string path, string query, string username, string password, int port)
         {
             var s = scheme + "://";
-            if (username != null)
+            if (!string.IsNullOrEmpty(username) || !string.IsNullOrEmpty(password))
             {
                 s += username;
-                if (password != null)
-                    s += ":" + password;
+                s += ":";
+                if (!string.IsNullOrEmpty(password))
+                    s += password;
                 s += "@";
             }

-            if (host != null)
+            if (!string.IsNullOrEmpty(host))
             {
                 s += host;
                 if (port != -1)
                     s += ":" + port.ToString();
             }

-            if (path != null)
-                s += "/" + path;
-            if (query != null)
+            if (!string.IsNullOrEmpty(path))
+            {
+                if (!string.IsNullOrEmpty(host))
+                    s += "/";
+                s += path;
+            }
+            if (!string.IsNullOrEmpty(query))
                 s += "?" + query;

             return s;             }


Corrected logic to calculate correctly per Issue #5

--- aaLogReader/Struct/FileTimeStruct.cs
+++ aaLogReader/Struct/FileTimeStruct.cs
@@ -1,6 +1,5 @@
 using System;
 using Newtonsoft.Json;
-

 namespace aaLogReader
 {
@@ -15,8 +14,12 @@
         public ulong @value
         {
             get
-            {
-               return checked(checked((ulong)Math.Round((double)((float)this.dwHighDateTime) * (Math.Pow(2,32)))) + (ulong)this.dwLowDateTime);
+            {
+                ulong lDt;
+
+                lDt = (((ulong)dwHighDateTime) << 32) | dwLowDateTime;
+
+                return lDt;
             }
         }
     }


Change enum value name

Change enum value name

--- CmcLibNet.Export/ValueFormatting.cs
+++ CmcLibNet.Export/ValueFormatting.cs
@@ -10,12 +10,13 @@
         /// </summary>
         None = 0,
         /// <summary>
-        /// Return canonical format as defined by Commence. Unlike Commence, CmcLibNet returns connected data in the format as well. <seealso cref="CmcOptionFlags.Canonical"/>
+        /// Return canonical format as defined by Commence.
+        /// Unlike Commence, CmcLibNet returns connected data formatted as well. <seealso cref="CmcOptionFlags.Canonical"/>
         /// </summary>
         Canonical = 1,
         /// <summary>
         /// Return data compliant with ISO 8601 format. http://www.iso.org/iso/iso8601
         /// </summary>
-        XSD_ISO8601 = 2,
+        ISO8601 = 2,
     }
-}
+}


Preliminary code to warn if the user has not enabled ipfiltering in uTorrent

--- Code/IPFilter.UI/MainWindow.xaml.cs
+++ Code/IPFilter.UI/MainWindow.xaml.cs
@@ -1,435 +1,446 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Globalization;
-using System.IO;
-using System.IO.Compression;
-using System.Linq;
-using System.Net;
-using System.Reflection;
-using System.Threading;
-using System.Windows;
-using Ionic.Zip;
-using IPFilter.UI.Properties;
-
-namespace IPFilter.UI
-{
-    /// <summary>
-    /// Interaction logic for the main window.
-    /// </summary>
-    public partial class MainWindow
-    {
-        string[] zipContentTypes = new string[]{};
-
-        string[] gzipContentTypes = new string[]{};
-
-        readonly BackgroundWorker worker;
-        IEnumerable<FileMirror> mirrors;
-        UpdateState state;
-
-        public MainWindow()
-        {
-            worker = new BackgroundWorker
-                         {
-                             WorkerReportsProgress = true,
-                             WorkerSupportsCancellation = true
-                         };
-
-            worker.DoWork += DoWork;
-            worker.ProgressChanged += ProgressChanged;
-            worker.RunWorkerCompleted += RunWorkerCompleted;
-
-            InitializeComponent();
-
-            var version = GetAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
-            var product = GetAttribute<AssemblyProductAttribute>().Product;
-
-            Title = string.Concat(product, @" ", version);
-        }
-
-        static T GetAttribute<T>() where T : Attribute
-        {
-            return Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(T), true).Cast<T>().Single();
-        }
-
-        void RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
-        {
-            //lblStatus.Content = e.Cancelled ? "Cancelled" : "Done";
-            if (e.Cancelled) lblStatus.Content = "Cancelled";
-            pbProgress.Value = 100;
-            SetState( e.Cancelled ? UpdateState.Cancelled : UpdateState.Done);
-        }
-
-        void SetState(UpdateState updateState)
-        {
-            state = updateState;
-            RefreshState();
-        }
-
-        void RefreshState()
-        {
-            switch (state)
-            {
-                case UpdateState.Cancelled:
-                case UpdateState.Ready:
-                    cboMirror.IsEnabled = cboMirrorProvider.IsEnabled = true;
-                    pbProgress.Value = 0;
-                    lblStatus.Content = "Ready";
-                    btnGo.Content = "Go";
-                    btnGo.IsEnabled = true;
-                    break;
-                case UpdateState.Downloading:
-                    cboMirror.IsEnabled = cboMirrorProvider.IsEnabled = false;
-                    btnGo.Content = "Cancel";
-                    break;
-                case UpdateState.Cancelling:
-                    if (worker.CancellationPending) break;
-                    btnGo.Content = "Cancelling...";
-                    btnGo.IsEnabled = false;
-                    CancelDownload();
-                    break;
-                case UpdateState.Done:
-                    btnGo.Content = "Done";
-                    break;
-                default:
-                    throw new ArgumentOutOfRangeException();
-            }
-        }
-
-        void CancelDownload()
-        {
-            worker.CancelAsync();
-        }
-
-        void StartDownload()
-        {
-            var mirrorProvider = (IMirrorProvider)cboMirrorProvider.SelectedItem;
-            var mirror = ((FileMirror) cboMirror.SelectedItem);
-            string urlString = mirrorProvider.GetUrlForMirror(mirror);
-            worker.RunWorkerAsync(urlString);
-        }
-
-
-        void ProgressChanged(object sender, ProgressChangedEventArgs e)
-        {
-            lblStatus.Content = e.UserState.ToString();
-            pbProgress.Value = e.ProgressPercentage;
-        }
-
-        void ZipProgress(object sender, ZipProgressEventArgs args)
-        {
-            if (args.EventType != ZipProgressEventType.Extracting_EntryBytesWritten) return;
-            var percentage = args.BytesTransferred/args.TotalBytesToTransfer * 100;
-            worker.ReportProgress( Convert.ToInt32(percentage), "Extracting..." );
-        }
-
-        void DoWork(object sender, DoWorkEventArgs e)
-        {
-            WebRequest request = WebRequest.Create((string) e.Argument);
-
-            worker.ReportProgress(0, string.Format(CultureInfo.CurrentUICulture, "Contacting {0}", request.RequestUri));
-            WebResponse response = request.GetResponse();
-
-            const int bufferSize = 1024*64; // Go in 64K chunks
-
-            var buffer = new byte[bufferSize];
-
-            using (var contentStream = new MemoryStream())
-            using (Stream stream = response.GetResponseStream())
-            {
-                worker.ReportProgress(0, "Downloading...");
-
-                var lastModified = response.Headers[HttpResponseHeader.LastModified];
-
-                if( !string.IsNullOrEmpty(lastModified))
-                {
-                    lastModified = DateTime.Parse(lastModified).ToString(CultureInfo.CurrentCulture);// "Cannot determine date of file.";
-                }
-                else
-                {
-                    lastModified = "Cannot determine date of file.";
-                }
-
-                int length = Convert.ToInt32(response.ContentLength);
-                double lengthMegs = (double) length/1024/1024;
-
-                int bytesRead = stream.Read(buffer, 0, bufferSize);
-                int totalRead = 0;
-
-                CompressionFormat fileFormat = CompressionFormat.None;
-
-                switch (response.ContentType)
-                {
-                    case "application/gzip":
-                    case "application/x-gzip":
-                    case "application/x-gunzip":
-                    case "application/gzipped":
-                    case "application/gzip-compressed":
-                    case "gzip/document":
-                        fileFormat = CompressionFormat.GZip;
-                        break;
-
-                    case "application/zip":
-                    case "application/x-zip":
-                    case "application/x-zip-compressed":
-                    case "multipart/x-zip":
-                        fileFormat = CompressionFormat.Zip;
-                        break;
-
-                    case "application/x-compressed":
-                    case "application/octet-stream":
-                    case "text/plain":
-                    default:
-                        {
-                            // Look for the GZip header bytes
-                            if (buffer[0] == 31 && buffer[1] == 139)
-                            {
-                                fileFormat = CompressionFormat.GZip;
-                            }
-                            else
-                            {
-                                // Look for the ZIP header bytes.
-                                var zipHeaderNumber = BitConverter.ToInt32(buffer, 0);
-                                if (zipHeaderNumber == 0x4034b50)
-                                {
-                                    fileFormat = CompressionFormat.Zip;
-                                }
-                            }
-                        }
-                        break;
-                }
-
-                while (bytesRead > 0)
-                {
-                    contentStream.Write(buffer, 0, bytesRead);
-                    totalRead += bytesRead;
-
-                    double downloadedMegs = (double) totalRead/1024/1024;
-                    double percentage = (double) totalRead/length;
-
-                    worker.ReportProgress(Convert.ToInt32(percentage*100),
-                                          string.Format(CultureInfo.CurrentUICulture,
-                                                        "Downloaded {0:F2} MB of {1:F2} MB", downloadedMegs, lengthMegs));
-                    bytesRead = stream.Read(buffer, 0, bufferSize);
-
-                    if (!worker.CancellationPending) continue;
-
-                    // Cancel
-                    e.Cancel = true;
-                    return;
-                }
-
-                string filterPath = Environment.ExpandEnvironmentVariables(@"%APPDATA%\uTorrent\ipfilter.dat");
-
-                worker.ReportProgress(0, "Decompressing...");
-
-                using (var decompressedStream = new MemoryStream())
-                {
-                    MessageBoxResult tryToWrite = MessageBoxResult.Yes;
-
-                    try
-                    {
-                        contentStream.Seek(0, SeekOrigin.Begin);
-
-                        switch(fileFormat)
-                        {
-                            case CompressionFormat.GZip:
-
-                                // Can't report progress for GZip
-                                Dispatcher.Invoke(new Action(() => pbProgress.IsIndeterminate = true));
-
-                                using(var gzipFile = new GZipStream(contentStream, CompressionMode.Decompress))
-                                {
-                                    var zipByteBuffer = new byte[1024 * 64];
-                                    int zipBytesRead;
-                                    while ((zipBytesRead = gzipFile.Read(zipByteBuffer, 0, zipByteBuffer.Length)) > 0)
-                                    {
-                                        decompressedStream.Write(zipByteBuffer, 0, zipBytesRead);
-                                    }
-                                }
-                                break;
-
-                            case CompressionFormat.Zip:
-                                using (var zipFile = ZipFile.Read(contentStream, ZipProgress))
-                                {
-                                    if (zipFile.Entries.Count == 0) throw new ZipException("There are no entries in the zip file.");
-                                    if (zipFile.Entries.Count > 1) throw new ZipException("There is more than one file in the zip file. This application will need to be updated to support this.");
-
-                                    var entry = zipFile.Entries.First();
-
-                                    entry.Extract(decompressedStream);
-                                }
-                                break;
-
-                            default:
-                                throw new ArgumentOutOfRangeException();
-                        }
-                    }
-                    catch (Exception ex)
-                    {
-                        ShowMessageBox("Error Decompressing", // Title / Caption
-                                       MessageBoxButton.OK, // Buttons
-                                       MessageBoxImage.Error, // Icon
-                                       MessageBoxResult.OK, // Default button
-                                       "There was a problem decompressing: {0}",
-                                       ex.Message
-                            ); // RTL culture?
-
-                        return;
-                    }
-
-                    if (!File.Exists(filterPath))
-                    {
-                        var filterDirectory = new DirectoryInfo(Path.GetDirectoryName(filterPath));
-                        if (!filterDirectory.Exists) filterDirectory.Create();
-                        File.Create(filterPath).Dispose();
-                    }
-
-                    worker.ReportProgress(100, "Writing to " + filterPath);
-
-                    while (tryToWrite == MessageBoxResult.Yes)
-                    {
-                        try
-                        {
-                            using (FileStream file = File.Open(filterPath, FileMode.Truncate, FileAccess.Write, FileShare.None))
-                            {
-                                decompressedStream.WriteTo(file);
-                                file.Flush();
-                                file.Close();
-                                tryToWrite = MessageBoxResult.No;
-                            }
-                        }
-                        catch (Exception ex)
-                        {
-                            tryToWrite = ShowMessageBox("Error Writing ipfilter.dat", // Title / Caption
-                                                        MessageBoxButton.YesNo, // Buttons
-                                                        MessageBoxImage.Error, // Icon
-                                                        MessageBoxResult.Yes, // Default button
-                                                        "There was a problem writing to {0}:\n\n{1}",
-                                                        filterPath, ex.Message
-                                ); // RTL culture?
-                        }
-                    }
-
-                    SetStatus("IP Filter downloaded. Date of this filter is " + lastModified, false);
-                    Dispatcher.Invoke(new Action(() => pbProgress.IsIndeterminate = false));
-                }
-            }
-        }
-
-        MessageBoxResult ShowMessageBox(string title, MessageBoxButton buttons, MessageBoxImage image, MessageBoxResult defaultButton, string message, params object[] args)
-        {
-            string formattedMessage = string.Format(CultureInfo.CurrentCulture, message, args);
-
-            return (MessageBoxResult)Dispatcher.Invoke(new Func<MessageBoxResult>(
-                () => MessageBox.Show(this, // Owner
-                            formattedMessage, // Message
-                            title, // Title / Caption
-                            buttons, // Buttons
-                            image, // Icon
-                            defaultButton, // Default button
-                            CultureInfo.CurrentCulture.TextInfo.IsRightToLeft ? MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading : 0) // RTL culture?
-            ));
-        }
-
-        void Window_Loaded(object sender, RoutedEventArgs e)
-        {
-            cboMirrorProvider.Items.Clear();
-            cboMirrorProvider.IsEnabled = false;
-
-            cboMirrorProvider.Items.Add(new BlocklistMirrorProvider());
-            cboMirrorProvider.Items.Add(new SourceForgeMirrorProvider());
-
-            cboMirrorProvider.SelectedIndex = 0;
-
-            cboMirrorProvider.IsEnabled = true;
-
-            ThreadPool.QueueUserWorkItem(LoadMirrors);
-        }
-
-        void LoadMirrors(object currentState)
-        {
-            SetStatus("Loading mirrors...", true);
-
-            IMirrorProvider selectedMirrorProvider = null;
-
-            Dispatcher.Invoke(
-                new Action(
-                    () =>
-                    {
-                        selectedMirrorProvider = (IMirrorProvider)cboMirrorProvider.SelectedItem;
-                        //cboMirror.Items.Clear();
-                        cboMirror.IsEnabled = false;
-                    }));
-
-            var backgroundWorker = new BackgroundWorker();
-
-            backgroundWorker.DoWork += delegate(object sender, DoWorkEventArgs args)
-                {
-                    mirrors = selectedMirrorProvider.GetMirrors();
-                };
-
-            backgroundWorker.RunWorkerCompleted += delegate(object sender, RunWorkerCompletedEventArgs args)
-                {
-                    Dispatcher.Invoke(new Action(() =>
-                    {
-                        cboMirror.ItemsSource = mirrors;
-                        cboMirror.SelectedIndex = mirrors.Count() - 1;
-                        cboMirror.IsEnabled = true;
-                        SetStatus("Ready", false);
-                        btnGo.IsEnabled = true;
-                        pbProgress.IsIndeterminate = false;
-                    }));
-                };
-
-            backgroundWorker.RunWorkerAsync();
-        }
-
-        void SetStatus(string message, bool busy)
-        {
-            if( !Dispatcher.CheckAccess())
-            {
-                Dispatcher.Invoke(new Action<string, bool>(SetStatus), message, busy);
-                return;
-            }
-            btnGo.IsEnabled = !busy;
-            pbProgress.IsIndeterminate = busy;
-            lblStatus.Content = message;
-        }
-
-        void BtnGoClick(object sender, RoutedEventArgs e)
-        {
-            switch (state)
-            {
-                case UpdateState.Cancelled:
-                case UpdateState.Ready:
-                    state = UpdateState.Downloading;
-                    StartDownload();
-                    break;
-                case UpdateState.Downloading:
-                    state = UpdateState.Cancelling;
-                    break;
-                case UpdateState.Done:
-                    Close();
-                    break;
-                default:
-                    throw new ArgumentOutOfRangeException();
-            }
-
-            cboMirror.IsEnabled = cboMirrorProvider.IsEnabled = false;
-            RefreshState();
-        }
-
-        private void cboMirrorProvider_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
-        {
-            LoadMirrors(null);
-        }
-    }
-
-    enum CompressionFormat
-    {
-        None = 0,
-        GZip = 1,
-        Zip = 2
-    }
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Globalization;
+using System.IO;
+using System.IO.Compression;
+using System.Linq;
+using System.Net;
+using System.Reflection;
+using System.Threading;
+using System.Windows;
+using Ionic.Zip;
+using IPFilter.UI.Properties;
+
+namespace IPFilter.UI
+{
+    /// <summary>
+    /// Interaction logic for the main window.
+    /// </summary>
+    public partial class MainWindow
+    {
+        string[] zipContentTypes = new string[]{};
+
+        string[] gzipContentTypes = new string[]{};
+
+        readonly BackgroundWorker worker;
+        IEnumerable<FileMirror> mirrors;
+        UpdateState state;
+
+        public MainWindow()
+        {
+            worker = new BackgroundWorker
+                         {
+                             WorkerReportsProgress = true,
+                             WorkerSupportsCancellation = true
+                         };
+
+            worker.DoWork += DoWork;
+            worker.ProgressChanged += ProgressChanged;
+            worker.RunWorkerCompleted += RunWorkerCompleted;
+
+            InitializeComponent();
+
+            var version = GetAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
+            var product = GetAttribute<AssemblyProductAttribute>().Product;
+
+            Title = string.Concat(product, @" ", version);
+        }
+
+        static T GetAttribute<T>() where T : Attribute
+        {
+            return Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(T), true).Cast<T>().Single();
+        }
+
+        void RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
+        {
+            //lblStatus.Content = e.Cancelled ? "Cancelled" : "Done";
+            if (e.Cancelled) lblStatus.Content = "Cancelled";
+            pbProgress.Value = 100;
+            SetState( e.Cancelled ? UpdateState.Cancelled : UpdateState.Done);
+        }
+
+        void SetState(UpdateState updateState)
+        {
+            state = updateState;
+            RefreshState();
+        }
+
+        void RefreshState()
+        {
+            switch (state)
+            {
+                case UpdateState.Cancelled:
+                case UpdateState.Ready:
+                    cboMirror.IsEnabled = cboMirrorProvider.IsEnabled = true;
+                    pbProgress.Value = 0;
+                    lblStatus.Content = "Ready";
+                    btnGo.Content = "Go";
+                    btnGo.IsEnabled = true;
+                    break;
+                case UpdateState.Downloading:
+                    cboMirror.IsEnabled = cboMirrorProvider.IsEnabled = false;
+                    btnGo.Content = "Cancel";
+                    break;
+                case UpdateState.Cancelling:
+                    if (worker.CancellationPending) break;
+                    btnGo.Content = "Cancelling...";
+                    btnGo.IsEnabled = false;
+                    CancelDownload();
+                    break;
+                case UpdateState.Done:
+                    btnGo.Content = "Done";
+                    break;
+                default:
+                    throw new ArgumentOutOfRangeException();
+            }
+        }
+
+        void CancelDownload()
+        {
+            worker.CancelAsync();
+        }
+
+        void StartDownload()
+        {
+            var mirrorProvider = (IMirrorProvider)cboMirrorProvider.SelectedItem;
+            var mirror = ((FileMirror) cboMirror.SelectedItem);
+            string urlString = mirrorProvider.GetUrlForMirror(mirror);
+            worker.RunWorkerAsync(urlString);
+        }
+
+
+        void ProgressChanged(object sender, ProgressChangedEventArgs e)
+        {
+            lblStatus.Content = e.UserState.ToString();
+            pbProgress.Value = e.ProgressPercentage;
+        }
+
+        void ZipProgress(object sender, ZipProgressEventArgs args)
+        {
+            if (args.EventType != ZipProgressEventType.Extracting_EntryBytesWritten) return;
+            var percentage = args.BytesTransferred/args.TotalBytesToTransfer * 100;
+            worker.ReportProgress( Convert.ToInt32(percentage), "Extracting..." );
+        }
+
+        void DoWork(object sender, DoWorkEventArgs e)
+        {
+            WebRequest request = WebRequest.Create((string) e.Argument);
+
+            worker.ReportProgress(0, string.Format(CultureInfo.CurrentUICulture, "Contacting {0}", request.RequestUri));
+            WebResponse response = request.GetResponse();
+
+            const int bufferSize = 1024*64; // Go in 64K chunks
+
+            var buffer = new byte[bufferSize];
+
+            using (var contentStream = new MemoryStream())
+            using (Stream stream = response.GetResponseStream())
+            {
+                worker.ReportProgress(0, "Downloading...");
+
+                var lastModified = response.Headers[HttpResponseHeader.LastModified];
+
+                if( !string.IsNullOrEmpty(lastModified))
+                {
+                    lastModified = DateTime.Parse(lastModified).ToString(CultureInfo.CurrentCulture);// "Cannot determine date of file.";
+                }
+                else
+                {
+                    lastModified = "Cannot determine date of file.";
+                }
+
+                int length = Convert.ToInt32(response.ContentLength);
+                double lengthMegs = (double) length/1024/1024;
+
+                int bytesRead = stream.Read(buffer, 0, bufferSize);
+                int totalRead = 0;
+
+                CompressionFormat fileFormat = CompressionFormat.None;
+
+                switch (response.ContentType)
+                {
+                    case "application/gzip":
+                    case "application/x-gzip":
+                    case "application/x-gunzip":
+                    case "application/gzipped":
+                    case "application/gzip-compressed":
+                    case "gzip/document":
+                        fileFormat = CompressionFormat.GZip;
+                        break;
+
+                    case "application/zip":
+                    case "application/x-zip":
+                    case "application/x-zip-compressed":
+                    case "multipart/x-zip":
+                        fileFormat = CompressionFormat.Zip;
+                        break;
+
+                    case "application/x-compressed":
+                    case "application/octet-stream":
+                    case "text/plain":
+                    default:
+                        {
+                            // Look for the GZip header bytes
+                            if (buffer[0] == 31 && buffer[1] == 139)
+                            {
+                                fileFormat = CompressionFormat.GZip;
+                            }
+                            else
+                            {
+                                // Look for the ZIP header bytes.
+                                var zipHeaderNumber = BitConverter.ToInt32(buffer, 0);
+                                if (zipHeaderNumber == 0x4034b50)
+                                {
+                                    fileFormat = CompressionFormat.Zip;
+                                }
+                            }
+                        }
+                        break;
+                }
+
+                while (bytesRead > 0)
+                {
+                    contentStream.Write(buffer, 0, bytesRead);
+                    totalRead += bytesRead;
+
+                    double downloadedMegs = (double) totalRead/1024/1024;
+                    double percentage = (double) totalRead/length;
+
+                    worker.ReportProgress(Convert.ToInt32(percentage*100),
+                                          string.Format(CultureInfo.CurrentUICulture,
+                                                        "Downloaded {0:F2} MB of {1:F2} MB", downloadedMegs, lengthMegs));
+                    bytesRead = stream.Read(buffer, 0, bufferSize);
+
+                    if (!worker.CancellationPending) continue;
+
+                    // Cancel
+                    e.Cancel = true;
+                    return;
+                }
+
+                string filterPath = Environment.ExpandEnvironmentVariables(@"%APPDATA%\uTorrent\ipfilter.dat");
+
+                worker.ReportProgress(0, "Decompressing...");
+
+                using (var decompressedStream = new MemoryStream())
+                {
+                    MessageBoxResult tryToWrite = MessageBoxResult.Yes;
+
+                    try
+                    {
+                        contentStream.Seek(0, SeekOrigin.Begin);
+
+                        switch(fileFormat)
+                        {
+                            case CompressionFormat.GZip:
+
+                                // Can't report progress for GZip
+                                Dispatcher.Invoke(new Action(() => pbProgress.IsIndeterminate = true));
+
+                                using(var gzipFile = new GZipStream(contentStream, CompressionMode.Decompress))
+                                {
+                                    var zipByteBuffer = new byte[1024 * 64];
+                                    int zipBytesRead;
+                                    while ((zipBytesRead = gzipFile.Read(zipByteBuffer, 0, zipByteBuffer.Length)) > 0)
+                                    {
+                                        decompressedStream.Write(zipByteBuffer, 0, zipBytesRead);
+                                    }
+                                }
+                                break;
+
+                            case CompressionFormat.Zip:
+                                using (var zipFile = ZipFile.Read(contentStream, ZipProgress))
+                                {
+                                    if (zipFile.Entries.Count == 0) throw new ZipException("There are no entries in the zip file.");
+                                    if (zipFile.Entries.Count > 1) throw new ZipException("There is more than one file in the zip file. This application will need to be updated to support this.");
+
+                                    var entry = zipFile.Entries.First();
+
+                                    entry.Extract(decompressedStream);
+                                }
+                                break;
+
+                            default:
+                                throw new ArgumentOutOfRangeException();
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        ShowMessageBox("Error Decompressing", // Title / Caption
+                                       MessageBoxButton.OK, // Buttons
+                                       MessageBoxImage.Error, // Icon
+                                       MessageBoxResult.OK, // Default button
+                                       "There was a problem decompressing: {0}",
+                                       ex.Message
+                            ); // RTL culture?
+
+                        return;
+                    }
+
+                    if (!File.Exists(filterPath))
+                    {
+                        var filterDirectory = new DirectoryInfo(Path.GetDirectoryName(filterPath));
+                        if (!filterDirectory.Exists) filterDirectory.Create();
+                        File.Create(filterPath).Dispose();
+                    }
+
+                    worker.ReportProgress(100, "Writing to " + filterPath);
+
+                    while (tryToWrite == MessageBoxResult.Yes)
+                    {
+                        try
+                        {
+                            using (FileStream file = File.Open(filterPath, FileMode.Truncate, FileAccess.Write, FileShare.None))
+                            {
+                                decompressedStream.WriteTo(file);
+                                file.Flush();
+                                file.Close();
+                                tryToWrite = MessageBoxResult.No;
+                            }
+                        }
+                        catch (Exception ex)
+                        {
+                            tryToWrite = ShowMessageBox("Error Writing ipfilter.dat", // Title / Caption
+                                                        MessageBoxButton.YesNo, // Buttons
+                                                        MessageBoxImage.Error, // Icon
+                                                        MessageBoxResult.Yes, // Default button
+                                                        "There was a problem writing to {0}:\n\n{1}",
+                                                        filterPath, ex.Message
+                                ); // RTL culture?
+                        }
+                    }
+
+                    SetStatus("IP Filter downloaded. Date of this filter is " + lastModified, false);
+                    Dispatcher.Invoke(new Action(() => pbProgress.IsIndeterminate = false));
+                }
+            }
+        }
+
+        MessageBoxResult ShowMessageBox(string title, MessageBoxButton buttons, MessageBoxImage image, MessageBoxResult defaultButton, string message, params object[] args)
+        {
+            string formattedMessage = string.Format(CultureInfo.CurrentCulture, message, args);
+
+            return (MessageBoxResult)Dispatcher.Invoke(new Func<MessageBoxResult>(
+                () => MessageBox.Show(this, // Owner
+                            formattedMessage, // Message
+                            title, // Title / Caption
+                            buttons, // Buttons
+                            image, // Icon
+                            defaultButton, // Default button
+                            CultureInfo.CurrentCulture.TextInfo.IsRightToLeft ? MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading : 0) // RTL culture?
+            ));
+        }
+
+        void Window_Loaded(object sender, RoutedEventArgs e)
+        {
+            cboMirrorProvider.Items.Clear();
+            cboMirrorProvider.IsEnabled = false;
+
+            cboMirrorProvider.Items.Add(new BlocklistMirrorProvider());
+            cboMirrorProvider.Items.Add(new SourceForgeMirrorProvider());
+
+            cboMirrorProvider.SelectedIndex = 0;
+
+            cboMirrorProvider.IsEnabled = true;
+
+            ThreadPool.QueueUserWorkItem(LoadMirrors);
+
+            return;
+
+            // TODO: Check if IP Filter is enabled in µTorrent
+            string settingsPath = Environment.ExpandEnvironmentVariables(@"%APPDATA%\uTorrent\settings.dat");
+            var settings = File.ReadAllText(settingsPath);
+            if (settings.Contains("15:ipfilter.enablei0e"))
+            {
+                MessageBox.Show("You haven't enabled IP Filtering in µTorrent! Go to http://ipfilter.codeplex.com/ for help.", "IP filtering not enabled", MessageBoxButton.OK);
+            }
+
+        }
+
+        void LoadMirrors(object currentState)
+        {
+            SetStatus("Loading mirrors...", true);
+
+            IMirrorProvider selectedMirrorProvider = null;
+
+            Dispatcher.Invoke(
+                new Action(
+                    () =>
+                    {
+                        selectedMirrorProvider = (IMirrorProvider)cboMirrorProvider.SelectedItem;
+                        //cboMirror.Items.Clear();
+                        cboMirror.IsEnabled = false;
+                    }));
+
+            var backgroundWorker = new BackgroundWorker();
+
+            backgroundWorker.DoWork += delegate(object sender, DoWorkEventArgs args)
+                {
+                    mirrors = selectedMirrorProvider.GetMirrors();
+                };
+
+            backgroundWorker.RunWorkerCompleted += delegate(object sender, RunWorkerCompletedEventArgs args)
+                {
+                    Dispatcher.Invoke(new Action(() =>
+                    {
+                        cboMirror.ItemsSource = mirrors;
+                        cboMirror.SelectedIndex = mirrors.Count() - 1;
+                        cboMirror.IsEnabled = true;
+                        SetStatus("Ready", false);
+                        btnGo.IsEnabled = true;
+                        pbProgress.IsIndeterminate = false;
+                    }));
+                };
+
+            backgroundWorker.RunWorkerAsync();
+        }
+
+        void SetStatus(string message, bool busy)
+        {
+            if( !Dispatcher.CheckAccess())
+            {
+                Dispatcher.Invoke(new Action<string, bool>(SetStatus), message, busy);
+                return;
+            }
+            btnGo.IsEnabled = !busy;
+            pbProgress.IsIndeterminate = busy;
+            lblStatus.Content = message;
+        }
+
+        void BtnGoClick(object sender, RoutedEventArgs e)
+        {
+            switch (state)
+            {
+                case UpdateState.Cancelled:
+                case UpdateState.Ready:
+                    state = UpdateState.Downloading;
+                    StartDownload();
+                    break;
+                case UpdateState.Downloading:
+                    state = UpdateState.Cancelling;
+                    break;
+                case UpdateState.Done:
+                    Close();
+                    break;
+                default:
+                    throw new ArgumentOutOfRangeException();
+            }
+
+            cboMirror.IsEnabled = cboMirrorProvider.IsEnabled = false;
+            RefreshState();
+        }
+
+        private void cboMirrorProvider_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
+        {
+            LoadMirrors(null);
+        }
+    }
+
+    enum CompressionFormat
+    {
+        None = 0,
+        GZip = 1,
+        Zip = 2
+    }
 }


increase performance - use hashset instead of list for file extensions lookup

--- CodeSearcher.Index/Io/FileReader.cs
+++ CodeSearcher.Index/Io/FileReader.cs
@@ -11,11 +11,11 @@
 {
     internal class FileReader : IFileReader
     {
-        private IList<String> m_FileExtensions;
+		private HashSet<String> m_FileExtensions;

         public  FileReader(IList<String> fileExtensions)
         {
-            m_FileExtensions = fileExtensions;
+			m_FileExtensions = new HashSet<String>(fileExtensions);
         }

         public Task ReadFilesAsync(String srcPath, Action<IList<FileStructure>> action)


Fixed bug in payment method test

Fixed bug in payment method test

--- Mollie.Tests.Integration/Api/PaymentMethodTests.cs
+++ Mollie.Tests.Integration/Api/PaymentMethodTests.cs
@@ -16,7 +16,7 @@
             Array paymentMethodEnumValues = Enum.GetValues(typeof(PaymentMethod));

             // Then: Make sure the list of payment methods is the same as our PaymentMethod enum
-            Assert.AreEqual(paymentMethodEnumValues.Length - 1, paymentMethodList.TotalCount);
+            Assert.AreEqual(paymentMethodEnumValues.Length, paymentMethodList.TotalCount);
             foreach (PaymentMethod paymentMethodEnum in paymentMethodEnumValues) {
                 PaymentMethodResponse paymentResponse = paymentMethodList.Data.FirstOrDefault(x => x.Id == paymentMethodEnum.ToString().ToLower());
                 Assert.IsNotNull(paymentResponse);


First/Single support

First/Single support

--- MonoDroid/Xamarin.Mobile/ContentQueryTranslator.cs
+++ MonoDroid/Xamarin.Mobile/ContentQueryTranslator.cs
@@ -132,9 +132,39 @@
 				    expression = VisitTake (methodCall);
 				else if (methodCall.Method.Name == "Count")
 					expression = VisitCount (methodCall);
+				else if (methodCall.Method.Name == "First" || methodCall.Method.Name == "FirstOrDefault")
+					expression = VisitFirst (methodCall);
+				else if (methodCall.Method.Name == "Single" || methodCall.Method.Name == "SingleOrDefault")
+					expression = VisitSingle (methodCall);
 			}

 			return expression;
+		}
+
+		private Expression VisitFirst (MethodCallExpression methodCall)
+		{
+			if (methodCall.Arguments.Count > 1)
+			{
+				VisitWhere (methodCall);
+				if (this.fallback)
+					return methodCall;
+			}
+
+			Take = 1;
+			return methodCall;
+		}
+
+		private Expression VisitSingle (MethodCallExpression methodCall)
+		{
+			if (methodCall.Arguments.Count > 1)
+			{
+				VisitWhere (methodCall);
+				if (this.fallback)
+					return methodCall;
+			}
+
+			Take = 2;
+			return methodCall;
 		}

 		private Expression VisitCount (MethodCallExpression methodCall)


Bumped AssemblyInfo

Bumped AssemblyInfo

--- Nancy.Serialization.Jil/Properties/AssemblyInfo.cs
+++ Nancy.Serialization.Jil/Properties/AssemblyInfo.cs
@@ -21,4 +21,4 @@
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("3dce26ef-2b21-4048-bb3a-f9cfaf075c87")]

-[assembly: AssemblyVersion("1.3.*")]
+[assembly: AssemblyVersion("1.7.0.0")]


* Added a child agent check to the ChildAgentData Update to make sure that you're a child agent before applying the changes from the grid comms.     Doing this to rule it out as a source of a few bugs such as the Zombie bug and the Express Train to 0,0,0 bug.

--- OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -1754,6 +1754,9 @@
         public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY)
         {
             //
+            if (!IsChildAgent)
+                return;
+
             int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize;
             int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize;

@@ -1766,7 +1769,8 @@

             m_godlevel = cAgentData.godlevel;
-            SetHeight(cAgentData.AVHeight);
+            m_avHeight = cAgentData.AVHeight;
+            //SetHeight(cAgentData.AVHeight);

             ControllingClient.SetChildAgentThrottle(cAgentData.throttles);


Revert "More on mantis #4869. This fixes the problem of objects showing up as no copy when they are copy-able. It works, but I have no idea what I'm doing." Cuauses a permission escalation. do NOT USE the preceding commit

--- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -276,7 +276,6 @@
             {
                 if (UUID.Zero == transactionID)
                 {
-
                     item.Name = itemUpd.Name;
                     item.Description = itemUpd.Description;
                     item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
@@ -450,18 +449,12 @@
                                           (uint)PermissionMask.Modify) != 0 ?
                                           true : false;

-                        bool isRootCopy = (item.CurrentPermissions &
-                                          (uint)PermissionMask.Copy) != 0 ?
-                                          true : false;
-
                         // Mask the owner perms to the folded perms
                         ownerPerms &= foldedPerms;

                         // If the root was mod, let the mask reflect that
                         if (isRootMod)
                             ownerPerms |= (uint)PermissionMask.Modify;
-                        if (isRootCopy)
-                            ownerPerms |= (uint)PermissionMask.Copy;
                     }

                     // These will be applied to the root prim at next rez.


Correct SOP.GetNumberOfSides() to return 8 for meshes rather than 7

We are returning the actual number of 'sides', not the maximum index number.
Also minor format corrections.

--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3273,16 +3273,13 @@
                     break;
                 case PrimType.SCULPT:
                     // Special mesh handling
-                    if (this.Shape.SculptType == 5)
-                    {
-                        ret = 7; // its a mesh then max 8 faces
-                    }
+                    if (Shape.SculptType == (byte)SculptType.Mesh)
+                        ret = 8; // if it's a mesh then max 8 faces
                     else
-                    {
-                        ret = 1; // its a sculpt then max 1 faces
-                    }
+                        ret = 1; // if it's a sculpt then max 1 face
                     break;
             }
+
             return ret;
         }

@@ -3295,6 +3292,7 @@
         {
             if (Shape.SculptEntry)
                 return PrimType.SCULPT;
+
             if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Square)
             {
                 if (Shape.PathCurve == (byte)Extrusion.Straight)


Forgot to save a change to SceneObjectPart.cs >.<

--- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4696,7 +4696,7 @@
         /// </summary>
         /// <param name="tex"></param>
         /// <param name="doChangedEvent"></param>
-        public void UpdateTexture(Primitive.TextureEntry tex, bool doChangedEvent = true)
+        public void UpdateTexture(Primitive.TextureEntry tex, bool doChangedEvent = false)
         {
             m_shape.Textures = tex;


BugFix: Installer can now handle trhe case when registry value EnableLUA (for UAC) is not found - considers it as 0 (false)

--- PART/Source/Core/Installers/Utilities/UacHelper.cs
+++ PART/Source/Core/Installers/Utilities/UacHelper.cs
@@ -70,7 +70,7 @@
             get
             {
                 RegistryKey uacKey = Registry.LocalMachine.OpenSubKey(uacRegistryKey, false);
-                bool result = uacKey.GetValue(uacRegistryValue).Equals(1);
+                bool result = object.Equals(uacKey.GetValue(uacRegistryValue), 1);
                 return result;
             }
         }


TODO comment

TODO comment

--- PART/Source/CprBroker/CPRDirect/XML/INameSource.cs
+++ PART/Source/CprBroker/CPRDirect/XML/INameSource.cs
@@ -58,10 +58,12 @@
         string FirstName_s { get; }
         string MiddleName { get; }
         string LastName { get; }
+
+        // TODO: Remove these 2 properties
         DateTime? NameStartDate { get; }
         char NameStartDateUncertainty { get; }
+
         bool IsValid();
-
         NavnStrukturType ToNavnStrukturType();
     }
 }


Id_value calculation in EntityId changed. It now splits the string after the second slash, instead of the last slash. EntityId.GetMultiSelectPickListIds() function added to use the new Id_value.

--- Ekin.Clarizen/Common/entityId.cs
+++ Ekin.Clarizen/Common/entityId.cs
@@ -1,20 +1,42 @@
 using Newtonsoft.Json;
 using System;
+using System.Collections.Generic;
+using System.Linq;

 namespace Ekin.Clarizen
 {
     public class EntityId
     {
-        public string Id { get; set; }
-
-        [JsonIgnore]
-        public string Id_value
+        private string _id { get; set; }
+        public string Id
         {
             get
             {
-                return !string.IsNullOrWhiteSpace(Id) && Id.Contains("/") ? Id.Substring(Id.LastIndexOf("/") + 1) : Id;
+                return _id;
+            }
+            set
+            {
+                _id = value;
+
+                // Find the text after the second slash in the Id and set it to the Id_value property
+                if (!string.IsNullOrWhiteSpace(_id))
+                {
+                    // Apologies for the lack of syntactic sugar but the below algorithm is, sadly, faster than a LINQ or a Regex solution
+                    int firstSlash = _id.IndexOf('/');
+                    if (firstSlash >= 0)
+                    {
+                        int secondSlash = _id.IndexOf('/', firstSlash + 1);
+                        if (secondSlash >= 0)
+                        {
+                            Id_value = _id.Length > secondSlash + 1 ? _id.Substring(secondSlash + 1) : string.Empty;
+                        }
+                    }
+                }
             }
         }
+
+        [JsonIgnore]
+        public string Id_value { get; private set; }

         public EntityId() { }

@@ -45,8 +67,10 @@
             return Id.GetHashCode();
         }

+        public List<string> GetMultiSelectPickListIds()
+        {
+            if (string.IsNullOrEmpty(Id_value)) return new List<string>();
+            return Id_value.Split(';').Select(str => str.Trim()).ToList();
+        }
     }
-
-
-
 }


Type sigs (#8191)

Type sigs (#8191)

--- src/mscorlib/src/System/Type.cs
+++ src/mscorlib/src/System/Type.cs
@@ -1076,11 +1076,7 @@
             get {return ((GetAttributeFlagsImpl() & TypeAttributes.Sealed) != 0);}
         }

-#if FEATURE_CORECLR
-         public bool IsEnum {
-#else
          public virtual bool IsEnum {
-#endif
              [Pure]
              get
              {
@@ -1773,11 +1769,7 @@

         // _Type.Equals(Type)
         [Pure]
-#if !FEATURE_CORECLR
         public virtual bool Equals(Type o)
-#else
-        public bool Equals(Type o)
-#endif
         {
             if ((object)o == null)
                 return false;


Have the output directory by unique per profiler run

--- Python/Product/Profiling/PythonProfilingPackage.cs
+++ Python/Product/Profiling/PythonProfilingPackage.cs
@@ -337,6 +337,12 @@
             }

             string outPathDir = Path.GetTempPath();
+            var subpath = Path.Combine(outPathDir, Path.GetRandomFileName());
+            while (Directory.Exists(subpath) || File.Exists(subpath)) {
+                subpath = Path.Combine(outPathDir, Path.GetRandomFileName());
+            }
+            outPathDir = subpath;
+
             string outPath = Path.Combine(outPathDir, "pythontrace.diagsession");

             var driver = PythonToolsInstallPath.GetFile(ExternalProfilerDriverExe, typeof(PythonProfilingPackage).Assembly);


Use lambdas

Use lambdas

--- PrinterCommunication/PrinterConnection.cs
+++ PrinterCommunication/PrinterConnection.cs
@@ -316,8 +316,8 @@
 			WriteLineStartCallBacks.AddCallbackToKey("G91", MovementWasSetToRelativeMode);
 			WriteLineStartCallBacks.AddCallbackToKey("M80", AtxPowerUpWasWritenToPrinter);
 			WriteLineStartCallBacks.AddCallbackToKey("M81", AtxPowerDownWasWritenToPrinter);
-			WriteLineStartCallBacks.AddCallbackToKey("M82", ExtruderWasSetToAbsoluteMode);
-			WriteLineStartCallBacks.AddCallbackToKey("M83", ExtruderWasSetToRelativeMode);
+			WriteLineStartCallBacks.AddCallbackToKey("M82", (s, e) => extruderMode = PrinterMachineInstruction.MovementTypes.Absolute);
+			WriteLineStartCallBacks.AddCallbackToKey("M83", (s, e) => extruderMode = PrinterMachineInstruction.MovementTypes.Relative);
 			WriteLineStartCallBacks.AddCallbackToKey("M104", HotendTemperatureWasWritenToPrinter);
 			WriteLineStartCallBacks.AddCallbackToKey("M106", FanSpeedWasWritenToPrinter);
 			WriteLineStartCallBacks.AddCallbackToKey("M107", FanOffWasWritenToPrinter);
@@ -2072,16 +2072,6 @@
 			TurnOffBedAndExtruders();

 			ReleaseMotors();
-		}
-
-		private void ExtruderWasSetToAbsoluteMode(object sender, EventArgs e)
-		{
-			extruderMode = PrinterMachineInstruction.MovementTypes.Absolute;
-		}
-
-		private void ExtruderWasSetToRelativeMode(object sender, EventArgs e)
-		{
-			extruderMode = PrinterMachineInstruction.MovementTypes.Relative;
 		}

 		private void FileDeleteConfirmed(object sender, EventArgs e)


added a comment as a reminder for future changes to the OrderStatus code values.

--- Purchasing.Core/Domain/OrderStatusCode.cs
+++ Purchasing.Core/Domain/OrderStatusCode.cs
@@ -19,6 +19,9 @@
         public virtual bool KfsStatus { get; set; }
         public virtual bool ShowInFilterList { get; set; }

+        /// <summary>
+        /// NOTE!!!! If Completed order status codes are ever added to the database, vClosedAccess.sql and vOpenAccess.SQL must be modified.
+        /// </summary>
         public static class Codes
         {
             public const string AccountManager = Role.Codes.AccountManager;


SA1642: Constructor summary documentation should begin with standard text

--- Quamotion.TurboJpegWrapper/TJException.cs
+++ Quamotion.TurboJpegWrapper/TJException.cs
@@ -7,15 +7,13 @@

 namespace TurboJpegWrapper
 {
-    // ReSharper disable once InconsistentNaming
-
     /// <summary>
     /// Exception thrown then internal error in the underlying turbo jpeg library is occured.
     /// </summary>
     public class TJException : Exception
     {
         /// <summary>
-        /// Creates new instance of the <see cref="TJException"/> class.
+        /// Initializes a new instance of the <see cref="TJException"/> class.
         /// </summary>
         /// <param name="error">Error message from underlying turbo jpeg library.</param>
         public TJException(string error)


Automate set print page orientation.

Automate set print page orientation.

--- RdlGtkViewer/RdlGtkViewer/ReportViewer.cs
+++ RdlGtkViewer/RdlGtkViewer/ReportViewer.cs
@@ -26,7 +26,6 @@
 using System.Collections;
 using System.Collections.Specialized;
 using System.Text;
-using System.Xml;
 using fyiReporting.RDL;
 using Gtk;

@@ -580,10 +579,12 @@
         {
             using (PrintContext context = new PrintContext(GdkWindow.Handle))
             {
-
                 printing = new PrintOperation();
                 printing.Unit = Unit.Points;
 				printing.UseFullPage = true;
+				printing.DefaultPageSetup = new PageSetup();
+				printing.DefaultPageSetup.Orientation =
+					report.PageHeightPoints > report.PageWidthPoints ? PageOrientation.Portrait : PageOrientation.Landscape;

                 printing.BeginPrint += HandlePrintBeginPrint;
                 printing.DrawPage += HandlePrintDrawPage;


Revert "Fixing detection of variables with joined declarations and assignments in nested BlockExpression"

--- ReadableExpressions/TranslationContext.cs
+++ ReadableExpressions/TranslationContext.cs
@@ -1,4 +1,4 @@
-namespace AgileObjects.ReadableExpressions
+namespace AgileObjects.ReadableExpressions
 {
     using System.Collections.Generic;
     using System.Linq;
@@ -6,19 +6,20 @@

     public class TranslationContext
     {
+        private IEnumerable<BinaryExpression> _joinedAssignments;
         private IEnumerable<ParameterExpression> _joinedAssignmentVariables;
-        private IEnumerable<BinaryExpression> _joinedAssignments;

         public IEnumerable<ParameterExpression> JoinedAssignmentVariables
         {
             get
             {
                 return _joinedAssignmentVariables ??
-                    (_joinedAssignmentVariables = _joinedAssignments?
-                        .Select(assignment => assignment.Left)
-                        .Cast<ParameterExpression>()
-                        .ToArray()
-                    ?? Enumerable.Empty<ParameterExpression>());
+                       (_joinedAssignmentVariables =
+                            _joinedAssignments?
+                               .Select(assignment => assignment.Left)
+                               .Cast<ParameterExpression>()
+                               .ToArray()
+                            ?? Enumerable.Empty<ParameterExpression>());
             }
         }


Fixed stance in initial 0xD

Fixed stance in initial 0xD

--- Craft.Net.Server/MinecraftServer.cs
+++ Craft.Net.Server/MinecraftServer.cs
@@ -283,7 +283,8 @@
             // Send initial chunks
             client.UpdateChunks(true);
             client.SendPacket(new PlayerPositionAndLookPacket(client.Entity.Position.X, client.Entity.Position.Y,
-                client.Entity.Position.Z, client.Entity.Position.Y + 1.5, client.Entity.Yaw, client.Entity.Pitch, true));
+                client.Entity.Position.Z, client.Entity.Position.Y - 1.62, client.Entity.Yaw, client.Entity.Pitch, true));
+            // TODO: Move 1.62 somewhere else

             // Send entities
             EntityManager.SendClientEntities(client);


big bugfix

big bugfix

--- D2MPMaster/Browser/BrowserClient.cs
+++ D2MPMaster/Browser/BrowserClient.cs
@@ -170,6 +170,13 @@
                                 RespondError(jdata, "You are not logged in!");
                                 return;
                             }
+                            //Check if they are in a lobby
+                            CheckLobby();
+                            if (lobby != null)
+                            {
+                                RespondError(jdata, "You are already in a lobby.");
+                                return; //omfg
+                            }
                             //Parse the create lobby request
                             var req = jdata["req"].ToObject<CreateLobby>();
                             if (req.name == null)
@@ -203,10 +210,7 @@
                                 Send(obj.ToString(Formatting.None));
                                 return;
                             }
-                            //Check if they are in a lobby
-                            CheckLobby();
-                            if (lobby != null)
-                                RespondError(jdata, "You are already in a lobby.");
+
                             lobby = LobbyManager.CreateLobby(user, mod, req.name);
                             break;
                         }


Small modifications to Feature Service for a planned deprecration.

--- Geode/Services/FeatureService.cs
+++ Geode/Services/FeatureService.cs
@@ -5,6 +5,8 @@
 using System.Reflection;
 using System.Text;
 using Geode.Geometry;
+using System.Runtime.CompilerServices;
+[assembly: InternalsVisibleTo("Geode.Tests")]

 namespace Geode.Services
 {
@@ -12,6 +14,10 @@
     {
         private static IGeoType GetPointGeometry(GeometryAttribute attribute, Object point)
         {
+            if (point is IPosition)
+            {
+                return new Point(((IPosition)point));
+            }
             var xMap = attribute.Map != null ? attribute.Map.XMap : "X";
             var yMap = attribute.Map != null ? attribute.Map.YMap : "Y";
             object x = point.GetType().GetProperty(xMap).GetValue(point, null);
@@ -29,7 +35,11 @@
                 var line = new List<IEnumerable<double>>();
                 foreach (var point in enumerable)
                 {
-                    if (IsEnumerable(point))
+                    if (point is IPosition)
+                    {
+                        line.Add(((IPosition)point).Coordinates);
+                    }
+                    else if (IsEnumerable(point))
                     {
                         line.Add(point as double[]);
                     }
@@ -49,7 +59,7 @@
         private static IGeoType GetPolylineGeometry(GeometryAttribute attribute, Object polyline)
         {
             var line = CreatePoly(attribute, polyline);
-            return line != null ? new Polyline(line) : null;
+            return line != null ? new LineString(line) : null;
         }

         private static IGeoType GetPolygonGeometry(GeometryAttribute attribute, Object polyline)
@@ -84,10 +94,9 @@
             return propAttributes.FirstOrDefault(at => at.GetType() == typeof(GeometryAttribute)) as GeometryAttribute;
         }

-        public static Feature<IGeoType> CreateFeature<T>(Object obj)
+        public static IFeature<IGeoType> CreateFeature<T>(Object obj)
         {
             var properties = obj.GetType().GetRuntimeProperties();
-
             IGeoType geometry = null;
             var objProperties = new Dictionary<string, object>();
             foreach (var prop in properties)
@@ -103,26 +112,21 @@
                     objProperties.Add(prop.Name, propVal);
                 }
             }
-
             var feature = new Feature<IGeoType>
             {
                 Geometry = geometry,
                 Properties = objProperties
             };
-
             return feature;
         }

         public static FeatureCollection<IFeature<IGeoType>> CreateFeatures<T>(IEnumerable<Object> objList)
         {
+            var features = objList.Select(obj => CreateFeature<T>(obj));
+            return new FeatureCollection<IFeature<IGeoType>>
             {
-                var features = objList.Select(obj => CreateFeature<T>(obj));
-                return new FeatureCollection<IFeature<IGeoType>>
-                {
-                    Features = features
-                };
-            }
+                Features = features
+            };
         }
-
     }
 }


[Macrocompiler] Fix boundary error preprocessor

--- Runtime/MacroCompiler/Preprocessor/XSharpPPRule.cs
+++ Runtime/MacroCompiler/Preprocessor/XSharpPPRule.cs
@@ -567,7 +567,7 @@
                     //    addErrorMessage(token, "Closing bracket ']' found with missing '['");
                     //    break;
                     case TokenType.BACKSLASH: // escape next token
-                        if (i < max)
+                        if (i < max-1)
                         {
                             i++;
                             token = matchTokens[i];
@@ -889,7 +889,7 @@
                         }
                         break;
                     case TokenType.BACKSLASH: // escape next token
-                        if (i < max)
+                        if (i < max-1)
                         {
                             i++;
                             token = resultTokens[i];


Timing issues

Timing issues

--- Hermod/HTTP/Client/HTTPClient.cs
+++ Hermod/HTTP/Client/HTTPClient.cs
@@ -509,7 +509,7 @@

                     }

-                    //Debug.WriteLine("[" + DateTime.Now + "] HTTPClient (" + TCPClient.Client.LocalEndPoint.ToString() + " -> " + RemoteSocket.ToString() + ") got first response after " + sw.ElapsedMilliseconds + "ms!");
+                    Debug.WriteLine("[" + DateTime.Now + "] HTTPClient (" + TCPClient.Client.LocalEndPoint.ToString() + " -> " + RemoteSocket.ToString() + ") got first response after " + sw.ElapsedMilliseconds + "ms!");

                     #endregion

@@ -530,7 +530,7 @@
                             if (CurrentDataLength > -1)
                             {
                                 _MemoryStream.Write(_Buffer, 0, CurrentDataLength);
-                                //Debug.WriteLine("[" + DateTime.Now + "] Read " + CurrentDataLength + " bytes from HTTP connection (" + TCPClient.Client.LocalEndPoint.ToString() + " -> " + RemoteSocket.ToString() + ") (" + sw.ElapsedMilliseconds + "ms)!");
+                                Debug.WriteLine("[" + DateTime.Now + "] Read " + CurrentDataLength + " bytes from HTTP connection (" + TCPClient.Client.LocalEndPoint.ToString() + " -> " + RemoteSocket.ToString() + ") (" + sw.ElapsedMilliseconds + "ms)!");
                             }

                         }
@@ -559,14 +559,14 @@

                             }

-                            //if (HTTPHeaderBytes.Length > 0)
-                            //    Debug.WriteLine("[" + DateTime.Now + "] End of (" + TCPClient.Client.LocalEndPoint.ToString() + " -> " + RemoteSocket.ToString() + ") HTTP header at " + HTTPHeaderBytes.Length + " bytes (" + sw.ElapsedMilliseconds + "ms)!");
+                            if (HTTPHeaderBytes.Length > 0)
+                                Debug.WriteLine("[" + DateTime.Now + "] End of (" + TCPClient.Client.LocalEndPoint.ToString() + " -> " + RemoteSocket.ToString() + ") HTTP header at " + HTTPHeaderBytes.Length + " bytes (" + sw.ElapsedMilliseconds + "ms)!");

                         }
-                        else
-                            Thread.Sleep(1);

                         #endregion
+
+                        Thread.Sleep(1);

                     }
                     // Note: Delayed parts of the HTTP body may not be read into the buffer
@@ -574,7 +574,7 @@
                     while (TCPStream.DataAvailable ||
                            ((sw.ElapsedMilliseconds < HTTPStream.ReadTimeout) && HTTPHeaderBytes.Length == 0));

-                    //Debug.WriteLine("[" + DateTime.Now + "] Finally read " + _MemoryStream.Length + " bytes of HTTP client (" + TCPClient.Client.LocalEndPoint.ToString() + " -> " + RemoteSocket.ToString() + ") data (" + sw.ElapsedMilliseconds + "ms)!");
+                    Debug.WriteLine("[" + DateTime.Now + "] Finally read " + _MemoryStream.Length + " bytes of HTTP client (" + TCPClient.Client.LocalEndPoint.ToString() + " -> " + RemoteSocket.ToString() + ") data (" + sw.ElapsedMilliseconds + "ms)!");

                     #endregion

@@ -763,6 +763,7 @@
                 }
                 catch (Exception e)
                 {
+                    Debug.WriteLine("[" + DateTime.Now + "] HTTPClient exception: " + e.Message);
                     _HTTPResponse = new HTTPResponse(e);
                 }


Simplify dictionary logic

Simplify dictionary logic

--- DynamicWrapper/WrapperDictionary.cs
+++ DynamicWrapper/WrapperDictionary.cs
@@ -14,23 +14,19 @@

     public Type GetType(Type interfaceType, Type realObjectType)
     {
-      string key = GenerateKey(interfaceType, realObjectType);
+      var key = GenerateKey(interfaceType, realObjectType);

-      if (_wrapperTypes.ContainsKey(key))
-        return _wrapperTypes[key];
+      Type value;
+      _wrapperTypes.TryGetValue(key, out value);

-      return null;
+      return value;
     }

     public void SetType(Type interfaceType, Type realObjectType, Type wrapperType)
     {
-      string key = GenerateKey(interfaceType, realObjectType);
+      var key = GenerateKey(interfaceType, realObjectType);

-      if (_wrapperTypes.ContainsKey(key))
-        _wrapperTypes[key] = wrapperType;
-      else
-        _wrapperTypes.Add(key, wrapperType);
+      _wrapperTypes[key] = wrapperType;
     }
-
   }
 }


dodalem koment

dodalem koment

--- Dzien37/DokumentyPacjenci/Class1.cs
+++ Dzien37/DokumentyPacjenci/Class1.cs
@@ -13,6 +13,7 @@
             static int i = 0;
             string Imie;

+            // dodaelm komentaz

         }


Remove now-empty post-init cases

Remove now-empty post-init cases

--- EDDiscovery/TravelHistoryControl.cs
+++ EDDiscovery/TravelHistoryControl.cs
@@ -262,18 +262,6 @@
                 ucm.NoHistoryIcon();
                 ucm.NoPopOutIcon();
             }
-            else if (ctrl is UserControlScreenshot)
-            {
-                UserControlScreenshot ucm = ctrl as UserControlScreenshot;
-            }
-            else if (ctrl is UserControlStats)
-            {
-                UserControlStats ucm = ctrl as UserControlStats;
-            }
-            else if (ctrl is UserControlScan)
-            {
-                UserControlScan ucm = ctrl as UserControlScan;
-            }
         }

         void TabPopOut(TabStrip t, int i)        // pop out clicked


:green_book:  增加默认构造函数。 :older_man:

:green_book:  增加默认构造函数。 :older_man:

--- src/Censorship.cs
+++ src/Censorship.cs
@@ -26,6 +26,7 @@

 using System;
 using System.Collections.Generic;
+using System.Linq;

 using Zongsoft.Data;
 using Zongsoft.Services;
@@ -47,9 +48,19 @@
 		#endregion

 		#region 构造函数
-		public Censorship(params string[] keys)
+		public Censorship()
+		{
+		}
+
+		public Censorship(string[] keys)
 		{
 			_keys = keys;
+		}
+
+		public Censorship(IEnumerable<string> keys)
+		{
+			if(keys != null)
+				_keys = keys.Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
 		}
 		#endregion


Filtering assemblies mapping types only

Filtering assemblies mapping types only

--- Easy.NHibernate/NHibernateHelper.cs
+++ Easy.NHibernate/NHibernateHelper.cs
@@ -29,7 +29,9 @@

         public void AddMappingsFromAssemblies(IEnumerable<Assembly> assemblies)
         {
-            AddMappings(assemblies.SelectMany(x => x.GetExportedTypes()));
+            // Select only ClassMapping<> types.
+            IEnumerable<Type> mappingTypes = assemblies.SelectMany(x => x.GetExportedTypes().Where(t => typeof(IConformistHoldersProvider).IsAssignableFrom(t)));
+            AddMappings(mappingTypes);
         }

         public void AddMappings(IEnumerable<Type> types)


Java SDK workaround for azure pipelines

Java SDK workaround for azure pipelines

--- nukebuild/Build.cs
+++ nukebuild/Build.cs
@@ -89,6 +89,29 @@

     }

+    IReadOnlyCollection<Output> MsBuildCommon(
+        string projectFile,
+        Configure<MSBuildSettings> configurator = null)
+    {
+        return MSBuild(projectFile, c =>
+        {
+            // This is required for VS2019 image on Azure Pipelines
+            if (Parameters.IsRunningOnWindows && Parameters.IsRunningOnAzure)
+            {
+                var javaSdk = Environment.GetEnvironmentVariable("JAVA_HOME_8_X64");
+                if (javaSdk != null)
+                    c = c.AddProperty("JavaSdkDirectory", javaSdk);
+            }
+
+            c = c.AddProperty("PackageVersion", Parameters.Version)
+                .AddProperty("iOSRoslynPathHackRequired", "true")
+                .SetToolPath(MsBuildExe.Value)
+                .SetConfiguration(Parameters.Configuration)
+                .SetVerbosity(MSBuildVerbosity.Minimal);
+            c = configurator?.Invoke(c) ?? c;
+            return c;
+        });
+    }
     Target Clean => _ => _.Executes(() =>
     {
         DeleteDirectories(Parameters.BuildDirs);
@@ -105,13 +128,8 @@
         .Executes(() =>
         {
             if (Parameters.IsRunningOnWindows)
-                MSBuild(Parameters.MSBuildSolution, c => c
+                MsBuildCommon(Parameters.MSBuildSolution, c => c
                     .SetArgumentConfigurator(a => a.Add("/r"))
-                    .SetConfiguration(Parameters.Configuration)
-                    .SetVerbosity(MSBuildVerbosity.Minimal)
-                    .AddProperty("PackageVersion", Parameters.Version)
-                    .AddProperty("iOSRoslynPathHackRequired", "true")
-                    .SetToolPath(MsBuildExe.Value)
                     .AddTargets("Build")
                 );

@@ -237,12 +255,7 @@
         {
             if (Parameters.IsRunningOnWindows)

-                MSBuild(Parameters.MSBuildSolution, c => c
-                    .SetConfiguration(Parameters.Configuration)
-                    .SetVerbosity(MSBuildVerbosity.Minimal)
-                    .AddProperty("PackageVersion", Parameters.Version)
-                    .AddProperty("iOSRoslynPathHackRequired", "true")
-                    .SetToolPath(MsBuildExe.Value)
+                MsBuildCommon(Parameters.MSBuildSolution, c => c
                     .AddTargets("Pack"));
             else
                 DotNetPack(Parameters.MSBuildSolution, c =>