Green tests by ignoring CDATA changes

Green tests by ignoring CDATA changes

--- resharper/test/src/tests/AcceptanceTests/XunitTaskRunnerTestBase.cs
+++ resharper/test/src/tests/AcceptanceTests/XunitTaskRunnerTestBase.cs
@@ -158,7 +158,18 @@
         private void ExecuteWithGold(IProjectFile projectFile, UnitTestSessionTestImpl session,
             List<IList<UnitTestTask>> sequences, Lifetime lt)
         {
-            ExecuteWithGold(projectFile.Location.FullPath, output => Execute(session, sequences, lt, output));
+            ExecuteWithGold(projectFile.Location.FullPath, output =>
+            {
+                using (var stringWriter = new StringWriter())
+                {
+                    Execute(session, sequences, lt, stringWriter);
+
+                    // ReSharper 8.2 uses CDATA, but ReSharper 9.0 doesn't. Normalise by removing
+                    var text = stringWriter.ToString();
+                    text = text.Replace("<![CDATA[", string.Empty).Replace("]]>", string.Empty);
+                    output.Write(text);
+                }
+            });
         }

         private IList<XElement> ExecuteWithCapture(UnitTestSessionTestImpl session,


implemented GossipStats and JoinSeedNodeProcess

--- src/core/Akka.Cluster/ClusterDaemon.cs
+++ src/core/Akka.Cluster/ClusterDaemon.cs
@@ -1379,11 +1379,90 @@
         }
     }

-    internal class JoinSeedNodeProcess
+    /// <summary>
+    /// INTERNAL API
+    ///
+    /// Sends <see cref="InternalClusterAction.InitJoin"/> to all seed nodes (except itself) and expect
+    /// <see cref="InternalClusterAction.InitJoinAck"/> reply back. The seed node that replied first
+    /// will be used and joined to. <see cref="InternalClusterAction.InitJoinAck"/> replies received after
+    /// the first one are ignored.
+    ///
+    /// Retries if no <see cref="InternalClusterAction.InitJoinAck"/> replies are received within the
+    /// <see cref="ClusterSettings.SeedNodeTimeout"/>. When at least one reply has been received it stops itself after
+    /// an idle <see cref="ClusterSettings.SeedNodeTimeout"/>.
+    ///
+    /// The seed nodes can be started in any order, but they will not be "active" until they have been
+    /// able to join another seed node (seed1.)
+    ///
+    /// They will retry the join procedure.
+    ///
+    /// Possible scenarios:
+    ///  1. seed2 started, but doesn't get any ack from seed1 or seed3
+    ///  2. seed3 started, doesn't get any ack from seed1 or seed3 (seed2 doesn't reply)
+    ///  3. seed1 is started and joins itself
+    ///  4. seed2 retries the join procedure and gets an ack from seed1, and then joins to seed1
+    ///  5. seed3 retries the join procedure and gets acks from seed2 first, and then joins to seed2
+    /// </summary>
+    internal class JoinSeedNodeProcess : UntypedActor, IActorLogging
     {
-        public JoinSeedNodeProcess()
-        {
-            throw new NotImplementedException();
+        private LoggingAdapter _log = Logging.GetLogger(Context);
+        public LoggingAdapter Log { get { return _log; } }
+
+        private ImmutableHashSet<Address> _seeds;
+        private Address _selfAddress;
+
+        public JoinSeedNodeProcess(ImmutableHashSet<Address> seeds)
+        {
+             _selfAddress = Cluster.Get(Context.System).SelfAddress;
+            _seeds = seeds;
+            if(!seeds.Any() || seeds.Head() == _selfAddress)
+                throw new ArgumentException("Join seed node should not be done");
+           Context.SetReceiveTimeout(Cluster.Get(Context.System).Settings.SeedNodeTimeout);
+        }
+
+        protected override void PreStart()
+        {
+            Self.Tell(new InternalClusterAction.JoinSeenNode());
+        }
+
+        protected override void OnReceive(object message)
+        {
+            if (message is InternalClusterAction.JoinSeenNode)
+            {
+                //send InitJoin to all seed nodes (except myself)
+                foreach (
+                    var path in
+                        _seeds.Where(x => x != _selfAddress)
+                            .Select(y => Context.ActorSelection(Context.Parent.Path.ToStringWithAddress(y))))
+                {
+                   path.Tell(new InternalClusterAction.InitJoin());
+                }
+            }
+            else if (message is InternalClusterAction.InitJoinAck)
+            {
+                //first InitJoinAck reply
+                var initJoinAck = (InternalClusterAction.InitJoinAck) message;
+                Context.Parent.Tell(new ClusterUserAction.JoinTo(initJoinAck.Address));
+                Context.Become(Done);
+            }
+            else if (message is InternalClusterAction.InitJoinNack) { } //that seed was uninitialized
+            else if (message is ReceiveTimeout)
+            {
+                //no InitJoinAck received - try again
+                Self.Tell(new InternalClusterAction.JoinSeenNode());
+            }
+            else
+            {
+                Unhandled(message);
+            }
+        }
+
+        private void Done(object message)
+        {
+            if (message is InternalClusterAction.InitJoinAck)
+            {
+                //already received one, skip the rest
+            } else if(message is ReceiveTimeout) Context.Stop(Self);
         }
     }

@@ -1395,35 +1474,88 @@
         }
     }

-    internal class GossipStats
+    /// <summary>
+    /// INTERNAL API
+    /// </summary>
+    internal sealed class GossipStats
     {
-        public GossipStats()
-        {
-            throw new NotImplementedException();
+        public readonly long ReceivedGossipCount;
+        public readonly long MergeCount;
+        public readonly long SameCount;
+        public readonly long NewerCount;
+        public readonly long OlderCount;
+
+        public GossipStats(long receivedGossipCount = 0L,
+            long mergeCount = 0L,
+            long sameCount = 0L,
+            long newerCount = 0L, long olderCount = 0L)
+        {
+            ReceivedGossipCount = receivedGossipCount;
+            MergeCount = mergeCount;
+            SameCount = sameCount;
+            NewerCount = newerCount;
+            OlderCount = olderCount;
         }

         public GossipStats IncrementMergeCount()
         {
-            throw new NotImplementedException();
+            return Copy(mergeCount: MergeCount + 1, receivedGossipCount: ReceivedGossipCount + 1);
         }

         public GossipStats IncrementSameCount()
         {
-            throw new NotImplementedException();
+            return Copy(sameCount: SameCount + 1, receivedGossipCount: ReceivedGossipCount + 1);
         }

         public GossipStats IncrementNewerCount()
         {
-            throw new NotImplementedException();
+            return Copy(newerCount: NewerCount + 1, receivedGossipCount: ReceivedGossipCount + 1);
         }

         public GossipStats IncrementOlderCount()
         {
-            throw new NotImplementedException();
-        }
+            return Copy(olderCount: OlderCount + 1, receivedGossipCount: ReceivedGossipCount + 1);
+        }
+
+        public GossipStats Copy(long? receivedGossipCount = null,
+            long? mergeCount = null,
+            long? sameCount = null,
+            long? newerCount = null, long? olderCount = null)
+        {
+            return new GossipStats(receivedGossipCount ?? ReceivedGossipCount,
+                mergeCount ?? MergeCount,
+                newerCount ?? NewerCount,
+                olderCount ?? OlderCount);
+        }
+
+        #region Operator overloads
+
+        public static GossipStats operator +(GossipStats a, GossipStats b)
+        {
+            return new GossipStats(a.ReceivedGossipCount + b.ReceivedGossipCount,
+                a.MergeCount + b.MergeCount,
+                a.SameCount + b.SameCount,
+                a.NewerCount + b.NewerCount,
+                a.OlderCount + b.OlderCount);
+        }
+
+        public static GossipStats operator -(GossipStats a, GossipStats b)
+        {
+            return new GossipStats(a.ReceivedGossipCount - b.ReceivedGossipCount,
+                a.MergeCount - b.MergeCount,
+                a.SameCount - b.SameCount,
+                a.NewerCount - b.NewerCount,
+                a.OlderCount - b.OlderCount);
+        }
+
+        #endregion
     }

-
+    /// <summary>
+    /// INTERNAL API
+    ///
+    /// The supplied callback will be run once when the current cluster member is <see cref="MemberStatus.Up"/>
+    /// </summary>
     class OnMemberUpListener : ReceiveActor, IActorLogging
     {
         private readonly Action _callback;


Added failing binding tests.

Added failing binding tests.

--- tests/Avalonia.Markup.Xaml.UnitTests/Data/BindingTests.cs
+++ tests/Avalonia.Markup.Xaml.UnitTests/Data/BindingTests.cs
@@ -1,11 +1,13 @@
 // Copyright (c) The Avalonia Project. All rights reserved.
 // Licensed under the MIT license. See licence.md file in the project root for full license information.

-using Moq;
+using System;
+using System.Collections.Generic;
 using Avalonia.Controls;
 using Avalonia.Data;
 using Avalonia.Markup.Data;
 using Avalonia.Markup.Xaml.Data;
+using Moq;
 using ReactiveUI;
 using Xunit;

@@ -113,6 +115,24 @@
         }

         [Fact]
+        public void Broken_Binding_Should_Use_Default_Value_Instead_Of_Inherited_Value()
+        {
+            var parent = new InheritanceTest()
+            {
+                Baz = 9,
+                DataContext = "data",
+            };
+
+            var child = new InheritanceTest();
+            var bazBinding = new Binding("Missing");
+            parent.Child = child;
+
+            child.Bind(InheritanceTest.BazProperty, bazBinding);
+
+            Assert.Equal(6, child.Baz);
+        }
+
+        [Fact]
         public void DataContext_Binding_Should_Use_Parent_DataContext()
         {
             var parentDataContext = Mock.Of<IHeadered>(x => x.Header == (object)"Foo");
@@ -157,6 +177,26 @@
             Assert.Null(child.DataContext);
             parent.Child = child;
             Assert.Equal("foo", child.DataContext);
+        }
+
+        [Fact]
+        public void DataContext_Binding_Should_Produce_Correct_Results()
+        {
+            var root = new Decorator
+            {
+                DataContext = new { Foo = "bar" },
+            };
+
+            var child = new Control();
+            var dataContextBinding = new Binding("Foo");
+            var values = new List<object>();
+
+            child.GetObservable(Border.DataContextProperty).Subscribe(x => values.Add(x));
+            child.Bind(ContentControl.DataContextProperty, dataContextBinding);
+
+            root.Child = child;
+
+            Assert.Equal(new[] { null, "bar" }, values);
         }

         [Fact]
@@ -337,5 +377,17 @@
                 Bind(BarProperty, this.GetObservable(FooProperty));
             }
         }
+
+        private class InheritanceTest : Decorator
+        {
+            public static readonly StyledProperty<int> BazProperty =
+                AvaloniaProperty.Register<InheritanceTest, int>("Baz", defaultValue: 6, inherits: true);
+
+            public int Baz
+            {
+                get { return GetValue(BazProperty); }
+                set { SetValue(BazProperty, value); }
+            }
+        }
     }
 }


Update c# source

Update c# source

--- webserver.cs
+++ webserver.cs
@@ -11,89 +11,139 @@
 		static void Main ()
 		{
 			uv_init();
-			var sock = new UVTcpSocket();
-			sock.Listen("0.0.0.0", 8080, (client) => {
+			var server = new TcpServer();
+			server.Listen("0.0.0.0", 8080, (socket) => {
 				Console.WriteLine("Client Connected");
-				client.OnData += (data, len) => {
+				socket.OnData += (data, len) => {
 					Console.WriteLine("Data Recieved: {0}", System.Text.Encoding.ASCII.GetString(data, 0, len));
-					client.Write(data, len);
+					socket.Write(data, len);
 				};
-				client.OnClose += () => {
+				socket.OnClose += () => {
 					Console.WriteLine("Client Disconnected");
 				};
 			});
+			var client = new TcpSocket();
+			client.OnData += (data, len) => {
+				Console.WriteLine("Client Recieved: {0}", System.Text.Encoding.ASCII.GetString(data, 0, len));
+			};
+			client.Connect("127.0.0.1", 8080, () => {
+				byte[] message = System.Text.Encoding.ASCII.GetBytes("Hello World\n");
+				client.Write(message, message.Length);
+			});
 			uv_run();
-			//IntPtr server = manos_uv_tcp_t_create();
-			//uv_tcp_init(server);
-			//manos_uv_tcp_bind(server, "0.0.0.0", 8080);
-			//uv_tcp_listen(server, 128, (sock, status) => {
-			//	IntPtr handle = manos_uv_tcp_t_create();
-			//       	uv_tcp_init(handle);
-			//       	uv_accept(sock, handle);
-			//	Console.WriteLine("Client Connected");
-			//	manos_uv_read_start(handle, (socket, count, data) => {
-			//		Console.WriteLine(BitConverter.ToString(data, 0, count));
-			//		Console.WriteLine(System.Text.Encoding.ASCII.GetString(data, 0, count));
-			//		manos_uv_write(socket, data, count);
-			//	}, () => {
-			//		manos_uv_tcp_t_destroy(handle);
-			//		Console.WriteLine("Client Left");
-			//	});
-			//});
-			//uv_run();
-			//manos_uv_tcp_t_destroy(server);
+			client.Dispose();
+			server.Dispose();
 		}
-
 	}
-	class UVTcpSocket {
+	abstract class TcpEntity : IDisposable {
 		public IntPtr Handle;
-		public event Action<byte[], int> OnData;
-		public event Action OnClose;
-		public UVTcpSocket()
+		public TcpEntity()
 		{
 			this.Handle = manos_uv_tcp_t_create();
 			uv_tcp_init(this.Handle);
 		}
-		public void Listen(string ip, int port, Action<UVTcpSocket> OnConnect)
+		public  void Dispose()
 		{
-			manos_uv_tcp_bind(this.Handle, ip, port);
-			uv_tcp_listen(this.Handle, 128, (sock, status) => {
-				UVTcpSocket s = new UVTcpSocket();
-				uv_accept(this.Handle, s.Handle);
-				manos_uv_read_start(s.Handle, (socket, count, data) => {
-					s.OnData(data, count);
+			manos_uv_destroy(this.Handle);
+		}
+		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+		internal delegate void uv_connection_cb(IntPtr socket, int status);
+		[DllImport ("uvwrap")]
+		public static extern void uv_tcp_init (IntPtr socket);
+		[DllImport ("uvwrap")]
+		public static extern IntPtr manos_uv_tcp_t_create();
+		[DllImport ("uvwrap")]
+		public static extern void manos_uv_destroy(IntPtr uv_tcp_t_ptr);
+	}
+	class TcpSocket : TcpEntity {
+		public event Action<byte[], int> OnData;
+		public event Action OnClose;
+		private event Action OnConnect;
+		private IntPtr Parent = IntPtr.Zero;
+		public TcpSocket()
+		{
+			this.Handle = manos_uv_connect_t_create();
+			this.Parent = manos_uv_tcp_t_create();
+			uv_tcp_init(this.Parent);
+		}
+		public TcpSocket(IntPtr ServerHandle) : base()
+		{
+			uv_accept(ServerHandle, this.Handle);
+			manos_uv_read_start(this.Handle, (socket, count, data) => {
+				RaiseData(data, count);
+			}, () => {
+				RaiseClose();
+				this.Dispose();
+			});
+		}
+		private void RaiseData(byte[] data, int count)
+		{
+			if (OnData != null)
+			{
+				OnData(data, count);
+			}
+		}
+		private void RaiseClose()
+		{
+			if (OnClose != null)
+			{
+				OnClose();
+			}
+		}
+		private void HandleConnect()
+		{
+			if (OnConnect != null)
+			{
+				OnConnect();
+			}
+		}
+		public void Connect(string ip, int port, Action OnConnect)
+		{
+			manos_uv_tcp_connect(this.Handle, this.Parent, ip, port, (sock, status) => {
+				manos_uv_read_start(this.Parent, (socket, count, data) => {
+					RaiseData(data, count);
 				}, () => {
-					manos_uv_tcp_t_destroy(s.Handle);
-					s.OnClose();
+					RaiseClose();
+					this.Dispose();
 				});
-				OnConnect(s);
-			});
+				OnConnect();
+			});
 		}
 		public void Write(byte[] data, int length)
 		{
-			manos_uv_write(this.Handle, data, length);
+			if (this.Parent == IntPtr.Zero) {
+				manos_uv_write(this.Handle, data, length);
+			} else {
+				manos_uv_write(this.Parent, data, length);
+			}
 		}
-		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-		internal delegate void uv_connection_cb(IntPtr socket, int status);
 		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
 		internal delegate void manos_uv_read_cb(IntPtr socket, int count, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] byte[] data);
 		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
 		internal delegate void manos_uv_eof_cb();
 		[DllImport ("uvwrap")]
-		public static extern void uv_tcp_init (IntPtr socket);
+		public static extern void uv_accept(IntPtr socket, IntPtr stream);
+		[DllImport ("uvwrap")]
+		public static extern int manos_uv_read_start(IntPtr stream, manos_uv_read_cb cb, manos_uv_eof_cb done);
+		[DllImport ("uvwrap")]
+		public static extern int manos_uv_write(IntPtr uv_tcp_t_ptr, byte[] data, int length);
+		[DllImport ("uvwrap")]
+		public static extern int manos_uv_tcp_connect(IntPtr uv_connect_t_ptr, IntPtr handle, string ip, int port, uv_connection_cb cb);
+		[DllImport ("uvwrap")]
+		public static extern IntPtr manos_uv_connect_t_create();
+	}
+	class TcpServer : TcpEntity {
+		public TcpServer() : base() {}
+		public void Listen(string ip, int port, Action<TcpSocket> OnConnect)
+		{
+			manos_uv_tcp_bind(this.Handle, ip, port);
+			uv_tcp_listen(this.Handle, 128, (sock, status) => {
+				OnConnect(new TcpSocket(this.Handle));
+			});
+		}
 		[DllImport ("uvwrap")]
 		public static extern void manos_uv_tcp_bind (IntPtr socket, string host, int port);
 		[DllImport ("uvwrap")]
 		public static extern void uv_tcp_listen(IntPtr socket, int backlog, uv_connection_cb callback);
-		[DllImport ("uvwrap")]
-		public static extern void uv_accept(IntPtr socket, IntPtr stream);
-		[DllImport ("uvwrap")]
-		public static extern int manos_uv_read_start(IntPtr stream, manos_uv_read_cb cb, manos_uv_eof_cb done);
-		[DllImport ("uvwrap")]
-		public static extern IntPtr manos_uv_tcp_t_create();
-		[DllImport ("uvwrap")]
-		public static extern void manos_uv_tcp_t_destroy(IntPtr uv_tcp_t_ptr);
-		[DllImport ("uvwrap")]
-		public static extern int manos_uv_write(IntPtr uv_tcp_t_ptr, byte[] data, int length);
 	}
 }


Fix exeption.

Fix exeption.

--- AbilityMapHack/AbilityMapHack.cs
+++ AbilityMapHack/AbilityMapHack.cs
@@ -6,17 +6,15 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Threading.Tasks;
-
 namespace AbilityMapHack
 {
     public static class AbilityMapHack
     {
         private static Font Font;
-        private static string heroName, particleName;
+        private static string heroName, particleName, HeroName;
         private static Vector3 vector;
         private static readonly Menu Menu = new Menu("Ability MapHack", "Ability MapHack", true, "Ability MapHack", true).SetFontColor(Color.DarkRed);
-
+        private static ParticleEffect range;
         static void Main()
         {
             Events.OnLoad += EventOnLoad;
@@ -82,62 +80,79 @@

         private static void OnParticleEvent(Entity hero, ParticleEffectAddedEventArgs args)
         {
-            try
-            {
-                if (hero.Name.Contains("npc_dota_hero_") && Menu.Item("enable").GetValue<bool>())
+            if (hero.Name.Contains("npc_dota_hero_") || hero.Name.Contains("npc_dota_neutral"))
+            {
+                DelayAction.Add(50, () =>
                 {
-                    Task.Delay(50).ContinueWith(_ =>
+                    vector = args.ParticleEffect.GetControlPoint(0);
+                    List<Vector2> Position = new List<Vector2>();
+
+                    if (!args.ParticleEffect.Owner.IsVisible)
                     {
-                        vector = args.ParticleEffect.GetControlPoint(0);
-                        List<Vector2> Position = new List<Vector2>();
-
-                        if (!args.ParticleEffect.Owner.IsVisible)
+                        if (hero.Name.Contains("npc_dota_hero_"))
                         {
                             heroName = args.ParticleEffect.Owner.Name;
-                            Hero MyHero = ObjectManager.LocalHero;
-
-                            particleName = args.Name;
-                            //Console.WriteLine("eff4" + eff4);
-                            string partHero = particleName.Substring(particleName.LastIndexOf(@"/") + 1).Replace(".vpcf", "");
-
-                            var result = TextureList.ToArray();
-                            foreach (var spell in result)
+                            HeroName = FirstUpper(GetHeroName(heroName)).Replace("_", "");
+                        }
+
+                        particleName = args.Name;
+                        //Console.WriteLine("eff4" + eff4);
+                        string partHero = particleName.Substring(particleName.LastIndexOf(@"/") + 1).Replace(".vpcf", "");
+
+                        foreach (var spell in TextureList)
+                        {
+                            if (spell == partHero)
                             {
-                                if (spell == partHero)
+                                Position.Add(HUDInfo.WorldToMinimap(vector));
+                                DelayAction.Add(2500, () =>
                                 {
-                                    Position.Add(HUDInfo.WorldToMinimap(vector));
-                                    Task.Delay(2500).ContinueWith(_z =>
+                                    Position.RemoveAt(0);
+                                });
+                                Drawing.OnEndScene += argst =>
+                                {
+                                    if (Drawing.Direct3DDevice9 == null) return;
+                                    foreach (var pos in Position.ToList())
                                     {
-                                        Position.RemoveAt(0);
-                                    });
-                                    Drawing.OnEndScene += argst =>
-                                    {
-                                        if (Drawing.Direct3DDevice9 == null) return;
-                                        foreach (var pos in Position.ToList())
+                                        if (!pos.IsZero)
                                         {
-                                            if (!pos.IsZero)
-                                            {
-                                                var HeroName = FirstUpper(GetHeroName(heroName)).Replace("_", "");
+                                            if (partHero != "generic_hit_blood")
+                                            {
                                                 Font.DrawText(null, HeroName, (int)pos.X - 17 + 2, (int)pos.Y - 16 + 2, Color.Gold);
                                                 Font.DrawText(null, "♉", (int)pos.X - 7 + 2, (int)pos.Y - 8, Color.Red);
-                                                //Drawing.DrawRect(pos - 25, new Vector2(7, 7), Drawing.GetTexture("materials/ensage_ui/miniheroes/" + eff5.Substring(eff5.LastIndexOf("hero_") + 5) + ".vmat_c"));
-                                                //Console.WriteLine("materials/ensage_ui/miniheroes/" + eff5.Substring(eff5.LastIndexOf("hero_") + 5) + ".vmat_c");
-
-                                                //Drawing.DrawRect(Drawing.WorldToScreen(vector) - 25, new Vector2(50, 50), Drawing.GetTexture("materials/ensage_ui/miniheroes/" + eff5.Substring(eff5.LastIndexOf("hero_") + 5) + ".vmat"));
-
-                                                //Drawing.DrawRect(pos, new Vector2(10, 10), Drawing.GetTexture("materials/ensage_ui/miniheroes/" + eff5.Substring(eff5.LastIndexOf("hero_") + 5) + ".vmat"));
+                                            }
+                                            else if (partHero == "generic_hit_blood" && hero.Name.Contains("npc_dota_neutral"))
+                                            {
+                                                Font.DrawText(null, HeroName, (int)pos.X - 17 + 2, (int)pos.Y - 16 + 2, Color.Gold);
+                                                Font.DrawText(null, "♉", (int)pos.X - 7 + 2, (int)pos.Y - 8, Color.Red);
                                             }
                                         }
-                                    };
-
-                                    if (!vector.IsZero)
+                                    }
+                                };
+
+                                if (!vector.IsZero)
+                                {
+                                    if (partHero != "generic_hit_blood")
                                     {
                                         ParticleEffect range = new ParticleEffect(@"materials\ensage_ui\particles\range_display_mod.vpcf", vector);
                                         //ParticleEffect range = new ParticleEffect(particleName, vector);
                                         range.SetControlPoint(1, new Vector3(500, 255, 0));
                                         range.SetControlPoint(2, new Vector3(255, 0, 0));
-
-                                        Task.Delay(2500).ContinueWith(_x =>
+                                        DelayAction.Add(2500, () =>
+                                        {
+                                            if (range != null)
+                                            {
+                                                range.Dispose();
+                                                range = null;
+                                            }
+                                        });
+                                    }
+                                    else if (partHero == "generic_hit_blood" && hero.Name.Contains("npc_dota_neutral"))
+                                    {
+                                        ParticleEffect range = new ParticleEffect(@"materials\ensage_ui\particles\range_display_mod.vpcf", vector);
+                                        //ParticleEffect range = new ParticleEffect(particleName, vector);
+                                        range.SetControlPoint(1, new Vector3(500, 255, 0));
+                                        range.SetControlPoint(2, new Vector3(255, 0, 0));
+                                        DelayAction.Add(2500, () =>
                                         {
                                             if (range != null)
                                             {
@@ -149,63 +164,14 @@
                                 }
                             }
                         }
-                    });
-                }
-                if (hero.Name.Contains("npc_dota_neutral"))
-                {
-                    Task.Delay(50).ContinueWith(_q =>
-                    {
-                        var GetControlPoint = args.ParticleEffect.GetControlPoint(0);
-                        List<Vector2> Position = new List<Vector2>();
-
-                        if (!args.ParticleEffect.Owner.IsVisible)
-                        {
-                            //if(!GetControlPoint.IsZero)
-                            //{
-                            Position.Add(HUDInfo.WorldToMinimap(GetControlPoint));
-                            //}
-                            Task.Delay(1000).ContinueWith(_x =>
-                            {
-                                Position.RemoveAt(0);
-                            });
-
-                            Drawing.OnEndScene += argst =>
-                            {
-                                if (Drawing.Direct3DDevice9 == null) return;
-                                foreach (var pos in Position?.ToList())
-                                {
-                                    if (!pos.IsZero)
-                                    {
-                                        var HeroName = FirstUpper(GetHeroName(heroName)).Replace("_", "");
-                                        Font.DrawText(null, HeroName, (int)pos.X - 12 + 2, (int)pos.Y - 13 + 2, Color.Gold);
-                                    }
-                                }
-                            };
-                            if (!GetControlPoint.IsZero)
-                            {
-                                ParticleEffect range = new ParticleEffect(@"materials\ensage_ui\particles\range_display_mod.vpcf", GetControlPoint);
-                                range.SetControlPoint(1, new Vector3(450, 255, 255));
-                                range.SetControlPoint(2, new Vector3(255, 0, 0));
-                                Task.Delay(700).ContinueWith(_x =>
-                                {
-                                    if (range != null)
-                                    {
-                                        range.Dispose();
-                                        range = null;
-                                    }
-                                });
-                            }
-                        }
-                    });
-                }
-            }
-            catch (Exception)
-            {
+                    }
+                });
             }
         }

         private static List<string> TextureList = new List<string>()
         {
+                {"generic_hit_blood"},
                 {"blink_dagger_start"},
                 {"queen_blink_start"},
                 {"bounty_hunter_windwalk"},
@@ -272,71 +238,5 @@
                 {"techies_stasis_trap_plant"},
                 {"monkey_king_jump_launch_ring"},
         };
-        /*
-        private static List<string> SpellList = new List<string>()
-        {
-                {"nyx_assassin_vendetta"},
-                {"queenofpain_blink"},
-                {"bounty_hunter_wind_walk"},
-                {"antimage_blink"},
-                {"invoker_ice_wall"},
-                {"invoker_emp"},
-                {"invoker_quas"},
-                {"invoker_wex"},
-                {"invoker_exort"},
-                {"legion_commander_overwhelming_odds"},
-                {"tiny_avalanche"},
-                {"tiny_toss"},
-                {"earthshaker_fissure"},
-                {"shredder_timber_chain"},
-                {"shredder_chakram"},
-                {"sandking_burrowstrike"},
-                {"sandking_sand_storm"},
-                {"alchemist_unstable_concoction"},
-                {"alchemist_acid_spray"},
-                {"clinkz_wind_walk"},
-                {"clinkz_death_pact"},
-                {"razor_plasma_field"},
-                {"venomancer_plague_ward"},
-                {"meepo_poof"},
-                {"slark_dark_pact"},
-                {"slark_pounce"},
-                {"ember_spirit_sleight_of_fist"},
-                {"zuus_arc_lightning"},
-                {"zuus_thundergods_wrath"},
-                {"zuus_lightning_bolt"},
-                {"lina_light_strike_array"},
-                {"leshrac_split_earth"},
-                {"disruptor_kinetic_field"},
-                {"jakiro_ice_path"},
-                {"jakiro_dual_breath"},
-                {"crystal_maiden_crystal_nova"},
-                {"phantom_assassin_phantom_strike"},
-                {"phantom_assassin_phantom_strike"},
-                {"storm_spirit_ball_lightning"},
-                {"ancient_apparition_ice_blast"},
-                {"ancient_apparition_chilling_touch"},
-                {"ancient_apparition_ice_vortex"},
-                {"weaver_shukuchi"},
-                {"pudge_meat_hook"},
-                {"rattletrap_power_cogs"},
-                {"rattletrap_hookshot"},
-                {"rattletrap_rocket_flare"},
-                {"tinker_rearm"},
-                {"luna_lucent_beam"},
-                {"pugna_nether_blast"},
-                {"monkey_king_boundless_strike"},
-                {"monkey_king_tree_dance"},
-                {"monkey_king_primal_spring"},
-                {"axe_counter_helix"},
-                {"legion_commander_moment_of_courage"},
-                {"legion_commander_press_the_attack"},
-                {"storm_spirit_overload"},
-                {"tinker_heat_seeking_missile"},
-                {"tidehunter_anchor_smash"},
-                {"techies_remote_mines"},
-                {"techies_stasis_trap"},
-
-        };*/
     }
 }


AGENT-210. Changed Error level logging to Info

--- BoxedIce.ServerDensity.Agent/Checks/NetworkTrafficCheck.cs
+++ BoxedIce.ServerDensity.Agent/Checks/NetworkTrafficCheck.cs
@@ -61,8 +61,8 @@

                         // we need to check if these have overflowed
                         // AGENT-199
-                        Log.ErrorFormat("received: {0}", key + ": " + received.ToString());
-                        Log.ErrorFormat("Previous: {0}", key + ": " + _networkTrafficStore[key]["recv_bytes"].ToString());
+                        Log.InfoFormat("received: {0}", key + ": " + received.ToString());
+                        Log.InfoFormat("Previous: {0}", key + ": " + _networkTrafficStore[key]["recv_bytes"].ToString());

                         var recv_overflow = this.CheckForOverflow("recv", _networkTrafficStore[key], received);
                         var trans_overflow = this.CheckForOverflow("trans", _networkTrafficStore[key], sent);


Increase warning limit for disused matching rules

--- BudgetAnalyser.Engine/Widgets/DisusedMatchingRuleWidget.cs
+++ BudgetAnalyser.Engine/Widgets/DisusedMatchingRuleWidget.cs
@@ -73,7 +73,7 @@
             var count = rulesList.Count();
             LargeNumber = count.ToString();
             ToolTip = $"{count}/{ruleService.MatchingRules.Count()} Rules that have not been used for more than a year.";
-            if (count >= 10)
+            if (count >= 20)
             {
                 ColourStyleName = WidgetWarningStyle;
             }


Improve feature selection.

Improve feature selection.

--- Code2Xml.Learner.Core/Learning/SurroundingNodeTraversal.cs
+++ Code2Xml.Learner.Core/Learning/SurroundingNodeTraversal.cs
@@ -118,6 +118,9 @@
                             prefix = "'+";
                             continue;
                         }
+                        if (!IsMeaningfulIdentifier(tokenNode)) {
+                            continue;
+                        }
                         paths.Add(prefix + extractor.GetToken(tokenNode));
                         //paths.Add(prefix + tokenNode.Name + tokenNode.RuleId + extractor.GetToken(tokenNode));
                     }
@@ -202,6 +205,9 @@
                     foreach (var tokenNode in outermostNode.AllTokenNodes()) {
                         if (myTokenNodes.Contains(tokenNode)) {
                             prefix = "'+";
+                            continue;
+                        }
+                        if (!IsMeaningfulIdentifier(tokenNode)) {
                             continue;
                         }
                         if (featureString2Bit.TryGetValue(


added unit test for StudentsController.Delete() actions

--- ContosoUniversity.UnitTests/Web/StudentsControllerTests.cs
+++ ContosoUniversity.UnitTests/Web/StudentsControllerTests.cs
@@ -166,7 +166,6 @@
             Assert.True(((ViewResult)result).ViewData.ModelState.Count > 0);
         }

-
         [Fact]
         public async Task EditPost_ReturnsAVRedirectToAction_Index()
         {
@@ -177,6 +176,61 @@

             Assert.IsType(typeof(RedirectToActionResult), result);
             Assert.Equal("Index", ((RedirectToActionResult)result).ActionName);
+        }
+
+        [Theory]
+        [InlineData(0)]
+        [InlineData(null)]
+        public async Task Delete_ReturnsANotFoundResult(int? id)
+        {
+            var result = await sut.Delete(id);
+
+            Assert.Equal(404, ((NotFoundResult)result).StatusCode);
+        }
+
+        [Fact]
+        public async Task Delete_ReturnsAViewResult_WithErrorMessageInViewData()
+        {
+            bool saveChangesError = true;
+
+            var result = await sut.Delete(1, saveChangesError);
+
+            Assert.IsType(typeof(ViewResult), result);
+
+            var viewData = ((ViewResult)result).ViewData;
+            Assert.True(viewData.ContainsKey("ErrorMessage"));
+        }
+
+        [Theory]
+        [InlineData(1)]
+        [InlineData(0)]
+        public async Task Delete_ReturnsARedirectToAction_Index(int? id)
+        {
+            var result = await sut.DeleteConfirmed(id.Value);
+
+            Assert.IsType(typeof(RedirectToActionResult), result);
+
+            var actionName = ((RedirectToActionResult)result).ActionName;
+            Assert.Equal("Index", actionName);
+        }
+
+        [Fact]
+        public async Task Delete_ReturnsARedirectToAction_DeleteAction()
+        {
+            mockStudentRepo.Setup(m => m.SaveChangesAsync())
+                .Callback(() => throw new DbUpdateException("myexception", new Exception()))
+                .Returns(Task.FromResult(0));
+
+            var result = await sut.DeleteConfirmed(1);
+
+            Assert.IsType(typeof(RedirectToActionResult), result);
+
+            var actionName = ((RedirectToActionResult)result).ActionName;
+            Assert.Equal("Delete", actionName);
+            Assert.True(((RedirectToActionResult)result).RouteValues.TryGetValue("id", out object id));
+            Assert.True(((RedirectToActionResult)result).RouteValues.TryGetValue("saveChangesError", out object saveChangesError));
+            Assert.Equal(1, id);
+            Assert.True((bool)saveChangesError);
         }

         private List<Student> Students()


Fixed wrong date on KMD backup file.

Fixed wrong date on KMD backup file.

--- Core.ApplicationServices/FileGenerator/ReportFileWriter.cs
+++ Core.ApplicationServices/FileGenerator/ReportFileWriter.cs
@@ -9,7 +9,7 @@
     public class ReportFileWriter : IReportFileWriter
     {
         private readonly string _filePathName = GetSetting("PROTECTED_KMDFilePath") + @"\" + GetSetting("PROTECTED_KMDFileName");
-        private readonly string _backupFilePathName = GetSetting("PROTECTED_KMDBackupFilePath") + @"\" + DateTime.Now.ToString("yyyymmdd-hhmmss");
+        private readonly string _backupFilePathName = GetSetting("PROTECTED_KMDBackupFilePath") + @"\" + DateTime.Now.ToString("yyyyMMdd-hhmmss");

         public bool WriteRecordsToFile(ICollection<FileRecord> recordList)
         {


Fix Warning

Fix Warning


Updates on AccessB class file

Updates on AccessB class file

Fix problems with GPIOxx, GPIO_DIRxx and GPIO_LATCHxx methods.

--- AccessB_class.cs
+++ AccessB_class.cs
@@ -69,7 +69,8 @@
         *  es de usar las propiedades en conjunto con los metodos de lectura y escritura al enviar
         *  comandos al PIC.
         */
-
+
+        /*PORTA RA6 is used for the external osc. for that reason it doesn't work also LATA LAT6 and TRISA6*/
         public UInt32 PORTA { set { SFRValue(128, value); } get { return SFRValue(128); } }
         public UInt32 PORTAbits_RA0 { set { SFRBitValue(128, 0, value); } get { return SFRBitValue(128, 0); } }
         public UInt32 PORTAbits_RA1 { set { SFRBitValue(128, 1, value); } get { return SFRBitValue(128, 1); } }
@@ -77,7 +78,7 @@
         public UInt32 PORTAbits_RA3 { set { SFRBitValue(128, 3, value); } get { return SFRBitValue(128, 3); } }
         public UInt32 PORTAbits_RA4 { set { SFRBitValue(128, 4, value); } get { return SFRBitValue(128, 4); } }
         public UInt32 PORTAbits_RA5 { set { SFRBitValue(128, 5, value); } get { return SFRBitValue(128, 5); } }
-        public UInt32 PORTAbits_RA6 { set { SFRBitValue(128, 6, value); } get { return SFRBitValue(128, 6); } }
+        //public UInt32 PORTAbits_RA6 { set { SFRBitValue(128, 6, value); } get { return SFRBitValue(128, 6); } }

         public UInt32 PORTB { set { SFRValue(129, value); } get { return SFRValue(129); } }
         public UInt32 PORTBbits_RB0 { set { SFRBitValue(129, 0, value); } get { return SFRBitValue(129, 0); } }
@@ -99,6 +100,7 @@
         //Read only bit on 18F2550 devices, TRISE and LATE aren't implemented on 18F2550 devices
         public UInt32 PORTEbits_RE3 { get { return SFRBitValue(132, 3); } }

+        /*PORTA RA6 is used for the external osc. for that reason it doesn't work also LATA LAT6 and TRISA6*/
         public UInt32 LATA { set { SFRValue(137, value); } get { return SFRValue(137); } }
         public UInt32 LATAbits_LATA0 { set { SFRBitValue(137, 0, value); } get { return SFRBitValue(137, 0); } }
         public UInt32 LATAbits_LATA1 { set { SFRBitValue(137, 1, value); } get { return SFRBitValue(137, 1); } }
@@ -106,7 +108,7 @@
         public UInt32 LATAbits_LATA3 { set { SFRBitValue(137, 3, value); } get { return SFRBitValue(137, 3); } }
         public UInt32 LATAbits_LATA4 { set { SFRBitValue(137, 4, value); } get { return SFRBitValue(137, 4); } }
         public UInt32 LATAbits_LATA5 { set { SFRBitValue(137, 5, value); } get { return SFRBitValue(137, 5); } }
-        public UInt32 LATAbits_LATA6 { set { SFRBitValue(137, 6, value); } get { return SFRBitValue(137, 6); } }
+        //public UInt32 LATAbits_LATA6 { set { SFRBitValue(137, 6, value); } get { return SFRBitValue(137, 6); } }

         public UInt32 LATB { set { SFRValue(138, value); } get { return SFRValue(138); } }
         public UInt32 LATBbits_LATB0 { set { SFRBitValue(138, 0, value); } get { return SFRBitValue(138, 0); } }
@@ -125,6 +127,7 @@
         public UInt32 LATCbits_LATC6 { set { SFRBitValue(139, 6 , value); } get { return SFRBitValue(139, 6); } }
         public UInt32 LATCbits_LATC7 { set { SFRBitValue(139, 7 , value); } get { return SFRBitValue(139, 7); } }

+        /*PORTA RA6 is used for the external osc. for that reason it doesn't work also LATA LAT6 and TRISA6*/
         public UInt32 TRISA { set { SFRValue(146, value); } get { return SFRValue(146); } }
         public UInt32 TRISAbits_TRISA0 { set { SFRBitValue(146, 0, value); } get { return SFRBitValue(146, 0); } }
         public UInt32 TRISAbits_TRISA1 { set { SFRBitValue(146, 1, value); } get { return SFRBitValue(146, 1); } }
@@ -132,7 +135,7 @@
         public UInt32 TRISAbits_TRISA3 { set { SFRBitValue(146, 3, value); } get { return SFRBitValue(146, 3); } }
         public UInt32 TRISAbits_TRISA4 { set { SFRBitValue(146, 4, value); } get { return SFRBitValue(146, 4); } }
         public UInt32 TRISAbits_TRISA5 { set { SFRBitValue(146, 5, value); } get { return SFRBitValue(146, 5); } }
-        public UInt32 TRISAbits_TRISA6 { set { SFRBitValue(146, 6, value); } get { return SFRBitValue(146, 6); } }
+        //public UInt32 TRISAbits_TRISA6 { set { SFRBitValue(146, 6, value); } get { return SFRBitValue(146, 6); } }

         public UInt32 TRISB { set { SFRValue(147, value); } get { return SFRValue(147); } }
         public UInt32 TRISBbits_TRISB0 { set { SFRBitValue(147, 0, value); } get { return SFRBitValue(147, 0); } }
@@ -571,20 +574,20 @@
         public UInt32 GPIO3 { set { SFRBitValue(130, 2, value); } get { return SFRBitValue(130, 2); } }
         public UInt32 GPIO4 { set { SFRBitValue(130, 6, value); } get { return SFRBitValue(130, 6); } }
         public UInt32 GPIO5 { set { SFRBitValue(130, 7, value); } get { return SFRBitValue(130, 7); } }
-        public UInt32 GPIO6 { set { SFRBitValue(129, 0, value); } get { return SFRBitValue(129, 0); } }
-        public UInt32 GPIO7 { set { SFRBitValue(129, 1, value); } get { return SFRBitValue(129, 1); } }
-        public UInt32 GPIO8 { set { SFRBitValue(129, 2, value); } get { return SFRBitValue(129, 2); } }
-        public UInt32 GPIO9 { set { SFRBitValue(129, 3, value); } get { return SFRBitValue(129, 3); } }
-        public UInt32 GPIO10 { set { SFRBitValue(129, 4, value); } get { return SFRBitValue(129, 4); } }
-        public UInt32 GPIO11 { set { SFRBitValue(129, 5, value); } get { return SFRBitValue(129, 5); } }
-        public UInt32 GPIO12 { set { SFRBitValue(129, 6, value); } get { return SFRBitValue(129, 6); } }
-        public UInt32 GPIO13 { set { SFRBitValue(129, 7, value); } get { return SFRBitValue(129, 7); } }
-        public UInt32 GPIO14 { set { SFRBitValue(128, 0, value); } get { return SFRBitValue(128, 0); } }
-        public UInt32 GPIO15 { set { SFRBitValue(128, 1, value); } get { return SFRBitValue(128, 1); } }
-        public UInt32 GPIO16 { set { SFRBitValue(128, 2, value); } get { return SFRBitValue(128, 2); } }
-        public UInt32 GPIO17 { set { SFRBitValue(128, 3, value); } get { return SFRBitValue(128, 3); } }
-        public UInt32 GPIO18 { set { SFRBitValue(128, 4, value); } get { return SFRBitValue(128, 4); } }
-        public UInt32 GPIO19 { set { SFRBitValue(128, 5, value); } get { return SFRBitValue(128, 5); } }
+        public UInt32 GPIO6 { set { SFRBitValue(128, 0, value); } get { return SFRBitValue(128, 0); } }
+        public UInt32 GPIO7 { set { SFRBitValue(128, 1, value); } get { return SFRBitValue(128, 1); } }
+        public UInt32 GPIO8 { set { SFRBitValue(128, 2, value); } get { return SFRBitValue(128, 2); } }
+        public UInt32 GPIO9 { set { SFRBitValue(128, 3, value); } get { return SFRBitValue(128, 3); } }
+        public UInt32 GPIO10 { set { SFRBitValue(128, 4, value); } get { return SFRBitValue(128, 4); } }
+        public UInt32 GPIO11 { set { SFRBitValue(128, 5, value); } get { return SFRBitValue(128, 5); } }
+        public UInt32 GPIO12 { set { SFRBitValue(129, 0, value); } get { return SFRBitValue(129, 0); } }
+        public UInt32 GPIO13 { set { SFRBitValue(129, 1, value); } get { return SFRBitValue(129, 1); } }
+        public UInt32 GPIO14 { set { SFRBitValue(129, 2, value); } get { return SFRBitValue(129, 2); } }
+        public UInt32 GPIO15 { set { SFRBitValue(129, 3, value); } get { return SFRBitValue(129, 3); } }
+        public UInt32 GPIO16 { set { SFRBitValue(129, 4, value); } get { return SFRBitValue(129, 4); } }
+        public UInt32 GPIO17 { set { SFRBitValue(129, 5, value); } get { return SFRBitValue(129, 5); } }
+        public UInt32 GPIO18 { set { SFRBitValue(129, 6, value); } get { return SFRBitValue(129, 6); } }
+        public UInt32 GPIO19 { set { SFRBitValue(129, 7, value); } get { return SFRBitValue(129, 7); } }

         //GPIO Latch methods, is the same as use LATx methods but a little slower, LATE isn't implemented on 18F2550 devices
         public UInt32 GPIO_LATCH1 { set { SFRBitValue(139, 0, value); } get { return SFRBitValue(139, 0); } }
@@ -592,20 +595,20 @@
         public UInt32 GPIO_LATCH3 { set { SFRBitValue(139, 2, value); } get { return SFRBitValue(139, 2); } }
         public UInt32 GPIO_LATCH4 { set { SFRBitValue(139, 6, value); } get { return SFRBitValue(139, 6); } }
         public UInt32 GPIO_LATCH5 { set { SFRBitValue(139, 7, value); } get { return SFRBitValue(139, 7); } }
-        public UInt32 GPIO_LATCH6 { set { SFRBitValue(138, 0, value); } get { return SFRBitValue(138, 0); } }
-        public UInt32 GPIO_LATCH7 { set { SFRBitValue(138, 1, value); } get { return SFRBitValue(138, 1); } }
-        public UInt32 GPIO_LATCH8 { set { SFRBitValue(138, 2, value); } get { return SFRBitValue(138, 2); } }
-        public UInt32 GPIO_LATCH9 { set { SFRBitValue(138, 3, value); } get { return SFRBitValue(138, 3); } }
-        public UInt32 GPIO_LATCH10 { set { SFRBitValue(138, 4, value); } get { return SFRBitValue(138, 4); } }
-        public UInt32 GPIO_LATCH11 { set { SFRBitValue(138, 5, value); } get { return SFRBitValue(138, 5); } }
-        public UInt32 GPIO_LATCH12 { set { SFRBitValue(138, 6, value); } get { return SFRBitValue(138, 6); } }
-        public UInt32 GPIO_LATCH13 { set { SFRBitValue(138, 7, value); } get { return SFRBitValue(138, 7); } }
-        public UInt32 GPIO_LATCH14 { set { SFRBitValue(137, 0, value); } get { return SFRBitValue(137, 0); } }
-        public UInt32 GPIO_LATCH15 { set { SFRBitValue(137, 1, value); } get { return SFRBitValue(137, 1); } }
-        public UInt32 GPIO_LATCH16 { set { SFRBitValue(137, 2, value); } get { return SFRBitValue(137, 2); } }
-        public UInt32 GPIO_LATCH17 { set { SFRBitValue(137, 3, value); } get { return SFRBitValue(137, 3); } }
-        public UInt32 GPIO_LATCH18 { set { SFRBitValue(137, 4, value); } get { return SFRBitValue(137, 4); } }
-        public UInt32 GPIO_LATCH19 { set { SFRBitValue(137, 5, value); } get { return SFRBitValue(137, 5); } }
+        public UInt32 GPIO_LATCH6 { set { SFRBitValue(137, 0, value); } get { return SFRBitValue(137, 0); } }
+        public UInt32 GPIO_LATCH7 { set { SFRBitValue(137, 1, value); } get { return SFRBitValue(137, 1); } }
+        public UInt32 GPIO_LATCH8 { set { SFRBitValue(137, 2, value); } get { return SFRBitValue(137, 2); } }
+        public UInt32 GPIO_LATCH9 { set { SFRBitValue(137, 3, value); } get { return SFRBitValue(137, 3); } }
+        public UInt32 GPIO_LATCH10 { set { SFRBitValue(137, 4, value); } get { return SFRBitValue(137, 4); } }
+        public UInt32 GPIO_LATCH11 { set { SFRBitValue(137, 5, value); } get { return SFRBitValue(137, 5); } }
+        public UInt32 GPIO_LATCH12 { set { SFRBitValue(138, 0, value); } get { return SFRBitValue(138, 0); } }
+        public UInt32 GPIO_LATCH13 { set { SFRBitValue(138, 1, value); } get { return SFRBitValue(138, 1); } }
+        public UInt32 GPIO_LATCH14 { set { SFRBitValue(138, 2, value); } get { return SFRBitValue(138, 2); } }
+        public UInt32 GPIO_LATCH15 { set { SFRBitValue(138, 3, value); } get { return SFRBitValue(138, 3); } }
+        public UInt32 GPIO_LATCH16 { set { SFRBitValue(138, 4, value); } get { return SFRBitValue(138, 4); } }
+        public UInt32 GPIO_LATCH17 { set { SFRBitValue(138, 5, value); } get { return SFRBitValue(138, 5); } }
+        public UInt32 GPIO_LATCH18 { set { SFRBitValue(138, 6, value); } get { return SFRBitValue(138, 6); } }
+        public UInt32 GPIO_LATCH19 { set { SFRBitValue(138, 7, value); } get { return SFRBitValue(138, 7); } }

         //GPIO Direction methods, is the same as use TRISx methods but a little slower, TRISE isn't implemented on 18F2550 devices
         public UInt32 GPIO_DIR1 { set { SFRBitValue(148, 0, value); } get { return SFRBitValue(148, 0); } }
@@ -613,20 +616,20 @@
         public UInt32 GPIO_DIR3 { set { SFRBitValue(148, 2, value); } get { return SFRBitValue(148, 2); } }
         public UInt32 GPIO_DIR4 { set { SFRBitValue(148, 6, value); } get { return SFRBitValue(148, 6); } }
         public UInt32 GPIO_DIR5 { set { SFRBitValue(148, 7, value); } get { return SFRBitValue(148, 7); } }
-        public UInt32 GPIO_DIR6 { set { SFRBitValue(147, 0, value); } get { return SFRBitValue(147, 0); } }
-        public UInt32 GPIO_DIR7 { set { SFRBitValue(147, 1, value); } get { return SFRBitValue(147, 1); } }
-        public UInt32 GPIO_DIR8 { set { SFRBitValue(147, 2, value); } get { return SFRBitValue(147, 2); } }
-        public UInt32 GPIO_DIR9 { set { SFRBitValue(147, 3, value); } get { return SFRBitValue(147, 3); } }
-        public UInt32 GPIO_DIR10 { set { SFRBitValue(147, 4, value); } get { return SFRBitValue(147, 4); } }
-        public UInt32 GPIO_DIR11 { set { SFRBitValue(147, 5, value); } get { return SFRBitValue(147, 5); } }
-        public UInt32 GPIO_DIR12 { set { SFRBitValue(147, 6, value); } get { return SFRBitValue(147, 6); } }
-        public UInt32 GPIO_DIR13 { set { SFRBitValue(147, 7, value); } get { return SFRBitValue(147, 7); } }
-        public UInt32 GPIO_DIR14 { set { SFRBitValue(146, 0, value); } get { return SFRBitValue(146, 0); } }
-        public UInt32 GPIO_DIR15 { set { SFRBitValue(146, 1, value); } get { return SFRBitValue(146, 1); } }
-        public UInt32 GPIO_DIR16 { set { SFRBitValue(146, 2, value); } get { return SFRBitValue(146, 2); } }
-        public UInt32 GPIO_DIR17 { set { SFRBitValue(146, 3, value); } get { return SFRBitValue(146, 3); } }
-        public UInt32 GPIO_DIR18 { set { SFRBitValue(146, 4, value); } get { return SFRBitValue(146, 4); } }
-        public UInt32 GPIO_DIR19 { set { SFRBitValue(146, 5, value); } get { return SFRBitValue(146, 5); } }
+        public UInt32 GPIO_DIR6 { set { SFRBitValue(146, 0, value); } get { return SFRBitValue(146, 0); } }
+        public UInt32 GPIO_DIR7 { set { SFRBitValue(146, 1, value); } get { return SFRBitValue(146, 1); } }
+        public UInt32 GPIO_DIR8 { set { SFRBitValue(146, 2, value); } get { return SFRBitValue(146, 2); } }
+        public UInt32 GPIO_DIR9 { set { SFRBitValue(146, 3, value); } get { return SFRBitValue(146, 3); } }
+        public UInt32 GPIO_DIR10 { set { SFRBitValue(146, 4, value); } get { return SFRBitValue(146, 4); } }
+        public UInt32 GPIO_DIR11 { set { SFRBitValue(146, 5, value); } get { return SFRBitValue(146, 5); } }
+        public UInt32 GPIO_DIR12 { set { SFRBitValue(147, 0, value); } get { return SFRBitValue(147, 0); } }
+        public UInt32 GPIO_DIR13 { set { SFRBitValue(147, 1, value); } get { return SFRBitValue(147, 1); } }
+        public UInt32 GPIO_DIR14 { set { SFRBitValue(147, 2, value); } get { return SFRBitValue(147, 2); } }
+        public UInt32 GPIO_DIR15 { set { SFRBitValue(147, 3, value); } get { return SFRBitValue(147, 3); } }
+        public UInt32 GPIO_DIR16 { set { SFRBitValue(147, 4, value); } get { return SFRBitValue(147, 4); } }
+        public UInt32 GPIO_DIR17 { set { SFRBitValue(147, 5, value); } get { return SFRBitValue(147, 5); } }
+        public UInt32 GPIO_DIR18 { set { SFRBitValue(147, 6, value); } get { return SFRBitValue(147, 6); } }
+        public UInt32 GPIO_DIR19 { set { SFRBitValue(147, 7, value); } get { return SFRBitValue(147, 7); } }

         #endregion


Increase timeout on indexer status wait (#12146)

Also adds error handling so we don't wait the maximum timeout in case the indexing failed.

--- sdk/search/Azure.Search.Documents/tests/SearchServiceClientTests.cs
+++ sdk/search/Azure.Search.Documents/tests/SearchServiceClientTests.cs
@@ -4,6 +4,7 @@
 using System;
 using System.Collections.Generic;
 using System.Net;
+using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
 using Azure.Core;
@@ -396,7 +397,7 @@
             TimeSpan? timeout = null)
         {
             TimeSpan delay = TimeSpan.FromSeconds(10);
-            timeout ??= TimeSpan.FromMinutes(1);
+            timeout ??= TimeSpan.FromMinutes(5);

             using CancellationTokenSource cts = new CancellationTokenSource(timeout.Value);

@@ -414,6 +415,21 @@
                 {
                     return;
                 }
+                else if (status.Status == IndexerStatus.Error && status.LastResult is IndexerExecutionResult lastResult)
+                {
+                    StringBuilder sb = new StringBuilder();
+                    sb.AppendLine($"Error: {lastResult.ErrorMessage}");
+
+                    if (lastResult.Errors?.Count > 0)
+                    {
+                        foreach (SearchIndexerError error in lastResult.Errors)
+                        {
+                            sb.AppendLine($" ---> {error.ErrorMessage}");
+                        }
+                    }
+
+                    Assert.Fail(sb.ToString());
+                }
             }
         }
     }


Avoid crash while focusing with touch event.

--- WPPMM/PhoneApp/CameraManager/ControlPanelManager.cs
+++ WPPMM/PhoneApp/CameraManager/ControlPanelManager.cs
@@ -70,7 +70,7 @@
                 panel.Children.Add(CreateStatusPanel("ShootMode", Resources.AppResources.ShootMode,
                      async (sender, arg) =>
                      {
-                         if (status.ShootModeInfo == null || status.ShootModeInfo.candidates == null)
+                         if (status.ShootModeInfo == null || status.ShootModeInfo.candidates == null || status.ShootModeInfo.candidates.Length == 0)
                              return;
                          var picker = sender as ListPicker;
                          var selected = picker.SelectedIndex;
@@ -109,7 +109,7 @@
                 panel.Children.Add(CreateStatusPanel("SelfTimer", Resources.AppResources.SelfTimer,
                      async (sender, arg) =>
                      {
-                         if (status.SelfTimerInfo == null || status.SelfTimerInfo.candidates == null)
+                         if (status.SelfTimerInfo == null || status.SelfTimerInfo.candidates == null || status.SelfTimerInfo.candidates.Length == 0)
                              return;
                          var selected = (sender as ListPicker).SelectedIndex;
                          try
@@ -132,7 +132,7 @@
                 panel.Children.Add(CreateStatusPanel("PostviewSize", Resources.AppResources.Setting_PostViewImageSize,
                     async (sender, arg) =>
                     {
-                        if (status.PostviewSizeInfo == null || status.PostviewSizeInfo.candidates == null)
+                        if (status.PostviewSizeInfo == null || status.PostviewSizeInfo.candidates == null || status.PostviewSizeInfo.candidates.Length == 0)
                             return;
                         var selected = (sender as ListPicker).SelectedIndex;
                         try


(MAI4): be tolerant to premature end-of-file.

--- ArcFormats/ShiinaRio/ImageMI4.cs
+++ ArcFormats/ShiinaRio/ImageMI4.cs
@@ -52,7 +52,6 @@

         public override ImageData Read (IBinaryStream stream, ImageMetaData info)
         {
-            stream.Position = 0x10;
             using (var reader = new Reader (stream, (int)info.Width, (int)info.Height))
             {
                 reader.Unpack ();
@@ -80,13 +79,19 @@
                 m_output = new byte[m_stride*height];
             }

-            uint m_bit_count;
+            int  m_bit_count;
             uint m_bits;

-            void ResetBits ()
-            {
-                m_bits = m_input.ReadUInt32();
-                m_bit_count = 32;
+            void LoadBits ()
+            {
+                for (int i = 0; i < 4; ++i)
+                {
+                    int b = m_input.ReadByte();
+                    if (-1 == b)
+                        break;
+                    m_bits = (m_bits >> 8) | (uint)(b << 24);
+                    m_bit_count += 8;
+                }
             }

             uint GetBit ()
@@ -95,8 +100,7 @@
                 m_bits <<= 1;
                 if (0 == --m_bit_count)
                 {
-                    m_bits = m_input.ReadUInt32();
-                    m_bit_count = 32;
+                    LoadBits();
                 }
                 return bit;
             }
@@ -113,7 +117,9 @@

             public void Unpack ()
             {
-                ResetBits();
+                m_input.Position = 0x10;
+                m_bit_count = 0;
+                LoadBits();
                 int dst = 0;
                 byte b = 0, g = 0, r = 0;
                 while (dst < m_output.Length)
@@ -122,9 +128,12 @@
                     {
                         if (GetBit() != 0)
                         {
-                            b = m_input.ReadUInt8();
-                            g = m_input.ReadUInt8();
-                            r = m_input.ReadUInt8();
+                            if (m_input.PeekByte() != -1)
+                            {
+                                b = m_input.ReadUInt8();
+                                g = m_input.ReadUInt8();
+                                r = m_input.ReadUInt8();
+                            }
                         }
                         else if (GetBit() != 0)
                         {


Fix cj test

Fix cj test

--- WalletWasabi.Tests/RegressionTests/CoinJoinTests.cs
+++ WalletWasabi.Tests/RegressionTests/CoinJoinTests.cs
@@ -1462,6 +1462,11 @@
 				Task timeout = Task.Delay(TimeSpan.FromSeconds(2 * (1 + 11 + 7 + 3 * (3 + 7))));
 				while (wallet.Coins.Count() != 4)
 				{
+					// Make sure CJ confirms.
+					if ((await rpc.GetRawMempoolAsync()).Any())
+					{
+						await rpc.GenerateAsync(1);
+					}
 					if (timeout.IsCompletedSuccessfully)
 					{
 						throw new TimeoutException("CoinJoin was not propagated or did not arrive.");


Support multiple redirect URIs in registration for cloud deployment

--- WebApp-GroupClaims-DotNet/App_Start/Startup.Auth.cs
+++ WebApp-GroupClaims-DotNet/App_Start/Startup.Auth.cs
@@ -58,6 +58,10 @@
                             UrlHelper url = new UrlHelper(HttpContext.Current.Request.RequestContext);
                             if (context.Request.Uri.AbsolutePath == url.Action("SignUp", "Account"))
                                 context.ProtocolMessage.SetParameter("prompt", "admin_consent");
+
+                            // MULTITENANT - to allow for multiple redirect URLs in the app registration, specify redirect URL in request
+                            context.ProtocolMessage.RedirectUri = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Path);
+
                             return Task.FromResult(0);
                         },


Simpler newline replacement

Simpler newline replacement

--- WebEditor/WebEditor/Views/Edit/ElementEditor.cshtml
+++ WebEditor/WebEditor/Views/Edit/ElementEditor.cshtml
@@ -277,7 +277,7 @@
                 }
                 else
                 {
-                        @caption
+                    @caption
                 }
             }

@@ -293,8 +293,8 @@
             break;
         case "richtext":
             // replace any
 tags with NewLine character
-            @Html.TextArea(ctl.Attribute, System.Text.RegularExpressions.Regex.Replace(value.ToString(), @"(?i:
)", Environment.NewLine), 10, 80, new { @class = "richtext", style = "width: 40em; height: 10em" })
-           break;
+            @Html.TextArea(ctl.Attribute, ((string)value).Replace("
", Environment.NewLine).Replace("
", Environment.NewLine), 10, 80, new { @class = "richtext", style = "width: 40em; height: 10em" })
+            break;
         case "number":
            string minMax = string.Empty;
            int? min = ctl.GetInt("minimum");


character turning half done

character turning half done

--- Assets/Scripts/DialogueScript.cs
+++ Assets/Scripts/DialogueScript.cs
@@ -28,6 +28,7 @@
     private Vector3 side2;
     public MovementController _mScript;
 	public static int _seqNum;
+    private bool faceme;

 	public virtual void Start() {
         textbox.enabled = false;
@@ -45,11 +46,13 @@
         Debug.DrawRay(center, transform.forward * 1);
         Debug.DrawRay(side1, transform.forward * 1);
         Debug.DrawRay(center, transform.forward * 1);
+
         if (Physics.Raycast(center, transform.forward, out hit, 1) && !istalking || Physics.Raycast(side1, transform.forward, out hit, 1) && !istalking || Physics.Raycast(side2, transform.forward, out hit, 1) && !istalking)
         //if (cantalk)
         {
             if (Input.GetButtonDown("Action") && hit.collider.tag == "talking")
             {
+                faceme = true;
                 NPCname = hit.collider.name;
                 string textData = dialogue.text;
                 ParseDialogue(textData);


First AI move done.

First AI move done.

--- Assets/Scripts/GameController.cs
+++ Assets/Scripts/GameController.cs
@@ -704,7 +704,8 @@
             {
                 // AI player active
                 Debug.Log("AI player moving");
-                StartCoroutine("FinishTurn");
+                AI_move();
+                //StartCoroutine("FinishTurn");

             }
@@ -793,7 +794,7 @@

     IEnumerator MakeAIMove(tile chosenTile, moves moveChoice)
     {
-
+        Debug.Log("AI aiming to go to " + chosenTile.tilePos.x + ", " + chosenTile.tilePos.y);
         float defaultWait = 0.2f;
         state = states.transitioning;
         yield return new WaitForSeconds(defaultWait);
@@ -803,20 +804,39 @@
         {
             if (chosenTile.tilePos == selectorPos)
             {
+                Debug.Log("AI target tile reached");
                 targetReached = true;
                 // in the right tile, so make the right move
                 yield return new WaitForSeconds(defaultWait);
                 currentMove = moveChoice;
                 UpdateActionSprite();
+                yield return new WaitForSeconds(defaultWait);
+                if (currentMove != moves.move)
+                {
+                    if (DoAction(selectorPos))
+                    {
+                        Debug.Log("AI " + player + " move made");
+                    }
+                }
+                else if (currentMove == moves.move)
+                {
+                    // Do something clever for actually moving stacks...
+                    if (MoveStack(selectorPos))
+                    {
+                        state = states.moving;
+                    }
+                }

             }
             else
             {
                 // figure out x and y differences
-                int xDiff = (int)(chosenTile.tilePos.x - selectorPos.x);
-                int yDiff = (int)(chosenTile.tilePos.y - selectorPos.y);
+                int xDiff = (int)(selectorPos.x - chosenTile.tilePos.x);
+                int yDiff = (int)(selectorPos.y - chosenTile.tilePos.y);
+                Debug.Log("xDiff " + xDiff + ", yDiff " + yDiff);

                 // make appropriate move and then wait
+                Debug.Log("Making move...");
                 if (xDiff < 0)
                 {
                     MakeMove(new Vector2(1, 0));
@@ -834,7 +854,7 @@
                 }

                 yield return new WaitForSeconds(defaultWait);
-
+                Debug.Log("selector pos " + selectorPos);

             }
         }


Nothing special

Nothing special

--- Assets/Scripts/PlayerControls.cs
+++ Assets/Scripts/PlayerControls.cs
@@ -10,14 +10,12 @@
     public float speed = 4;
     private GamePerspective persp;
     private Animator animator;
-    private SpriteRenderer sprRenderer;

 	// Use this for initialization
 	void Start () {

         persp = GetComponent<GamePerspective>();
         animator = GetComponent<Animator>();
-        sprRenderer = GetComponent<SpriteRenderer>();
 	}

 	// Update is called once per frame


Added a RotationModeChangedEvent to RotationControl

-UnityEvents are not well-documented, but are fun and easy when you know them

--- Assets/script/RotationControl.cs
+++ Assets/script/RotationControl.cs
@@ -1,5 +1,8 @@
 using UnityEngine;
+using System.Reflection;
 using System.Collections;
+using System;
+using UnityEngine.Events;

 public class RotationControl : MonoBehaviour
 {
@@ -11,6 +14,11 @@
     public RotationMode
         RotationMode = RotationMode.XZ;
     public float RotationDecay = 1;
+
+    [Tooltip("The GameObjects to be notified when the user changes the rotation mode. Each GameObject must have a" +
+             " method called \"OnRotationModeChanged(string, RotationMode, RotationMode)\".")]
+
+    public RotationModeChangedEvent OnRotationModeChanged;

     void FixedUpdate ()
     {
@@ -40,7 +48,12 @@
     void Update ()
     {
         if (Input.GetButtonDown ("Fire2")) {
+            RotationMode old = this.RotationMode;
             this.RotationMode = this.RotationMode.Next ();
+            this.OnRotationModeChanged.Invoke(old, this.RotationMode);
         }
     }
 }
+
+[Serializable]
+public class RotationModeChangedEvent : UnityEvent<RotationMode, RotationMode> {}


issue #9 ４次元の頂点配列をまとめて定義するようにした。

issue #9 ４次元の頂点配列をまとめて定義するようにした。


More Cleanup of the RNG code

More Cleanup of the RNG code

Thx @Admiral-Fish 👍

--- AutoLegality/IVtoPIDGenerator.cs
+++ AutoLegality/IVtoPIDGenerator.cs
@@ -117,12 +117,6 @@
         HiddenTrickRoom
     };

-    internal enum GenderCriteria
-    {
-        DontCareGenderless,
-        Male,
-        Female
-    }
     internal class IVFilter
     {
         public CompareType atkCompare;
@@ -172,34 +166,6 @@
             speCompare = CompareType.None;
         }
     }
-
-    public enum EncounterType
-    {
-        Wild,
-        WildSurfing,
-        WildOldRod,
-        WildGoodRod,
-        WildSuperRod,
-        WildWaterSpot,
-        WildSwarm,
-        WildShakerGrass,
-        WildCaveSpot,
-        Stationary,
-        Roamer,
-        Gift,
-        Entralink,
-        LarvestaEgg,
-        AllEncounterShiny,
-        BugCatchingContest,
-        BugCatchingContestPreDex,
-        BugBugCatchingContestTues,
-        BugCatchingContestThurs,
-        BugCatchingContestSat,
-        SafariZone,
-        Headbutt,
-        Manaphy,
-        HiddenGrotto
-    };

     public class Frame
     {
@@ -385,7 +351,7 @@
         private readonly CompareType speCompare;
         private readonly uint speValue;

-        public FrameCompare(IVFilter ivBase, List<uint> natures)
+        public FrameCompare(IVFilter ivBase, uint nature)
         {
             if (ivBase != null)
             {
@@ -402,15 +368,14 @@
                 speValue = ivBase.speValue;
                 speCompare = ivBase.speCompare;
             }
-            Natures = natures;
-        }
-
-        public List<uint> Natures { get; private set; }
+            Nature = nature;
+        }
+
+        public uint Nature { get; private set; }

         public bool Compare(Frame frame)
         {
-            bool test = Natures.Any(nature => nature == frame.Nature);
-            if (!test)
+            if (Nature != frame.Nature)
                 return false;

             if (!CompareIV(hpCompare, frame.Hp, hpValue))
@@ -508,13 +473,9 @@
         public FrameGenerator()
         {
             maxResults = 1000000;
-            Compatibility = 20;
             InitialFrame = 1;
             InitialSeed = 0;
-            SynchNature = -1;
-        }
-
-        public uint Calibration { get; set; }
+        }

         public FrameType FrameType
         {
@@ -525,46 +486,9 @@
             }
         }

-        public EncounterType EncounterType { get; set; }
-
-        public bool Everstone { get; set; }
-
-        public int SynchNature { get; set; }
-
         public ulong InitialSeed { get; set; }

         public uint InitialFrame { get; set; }
-
-        public uint MaxResults
-        {
-            get { return maxResults; }
-            set
-            {
-                maxResults = value;
-            }
-        }
-
-        public byte MotherAbility { get; set; }
-
-        public bool DittoUsed { get; set; }
-
-        public bool MaleOnlySpecies { get; set; }
-
-        public bool ShinyCharm { get; set; }
-
-        public uint[] ParentA { get; set; }
-
-        public uint[] ParentB { get; set; }
-
-        public uint[] RNGIVs { get; set; }
-
-        public bool isBW2 { get; set; }
-
-        //a static portion of the PID
-        //either lower (R/S eggs) or the entire PID (E eggs)
-        public uint StaticPID { get; set; }
-
-        public uint Compatibility { get; set; }

         // by declaring these only once you get a huge performance boost

@@ -690,26 +614,6 @@

             return frames;
         }
-
-        private static uint ForceShiny(uint pid, uint tid, uint sid)
-        {
-            uint lowByte = pid & 0x000000ff;
-            return ((lowByte ^ tid ^ sid) << 16) | lowByte;
-        }
-
-        private static uint ForceNonShiny(uint pid, uint tid, uint sid)
-        {
-            if (((pid >> 16) ^ (pid & 0xffff) ^ sid ^ tid) < 8)
-                pid = pid ^ 0x10000000;
-
-            return pid;
-        }
-
-        #region Nested type: Compare
-
-        protected delegate bool Compare(uint x);
-
-        #endregion
     }

     /// <summary>
@@ -718,93 +622,7 @@
     internal class IVtoSeed
     {
         //  We need a function to return a list of monster seeds,
-        //  which will be updated to include a method.
-
-
-        public static List<Seed> GetXDSeeds(
-            uint hp,
-            uint atk,
-            uint def,
-            uint spa,
-            uint spd,
-            uint spe,
-            uint nature,
-            uint id)
-        {
-            var seeds = new List<Seed>();
-
-            uint ivs1 = hp + (atk << 5) + (def << 10);
-            uint ivs1_2 = ivs1 ^ 0x8000;
-            uint ivs2 = spe | (spa << 5) | (spd << 10);
-            uint ivs2_2 = ivs2 ^ 0x8000;
-            uint x_testXD = ivs1 << 16;
-
-            //  Now we want to start with IV2 and call the RNG for
-            //  values between 0 and FFFF in the low order bits.
-            for (uint cnt = 0; cnt <= 0xFFFF; cnt++)
-            {
-                //  Set our test seed here so we can start
-                //  working backwards to see if the rest
-                //  of the information we were provided
-                //  is a match.
-
-                uint seed = x_testXD | cnt;
-                var rngXD = new XdRng(seed);
-                uint rng1XD = rngXD.GetNext16BitNumber();
-
-                //Check if ivs line up
-                if (rng1XD == ivs2 || rng1XD == ivs2_2)
-                {
-
-                    var rngXDR = new XdRngR(seed);
-                    uint XDColoSeed = rngXDR.GetNext32BitNumber();
-
-                    //  Right now, this simply assumes method
-                    //  1 and gets the value previous to check
-                    //  for  match.  We need a clean way to do
-                    //  this for all of our methods.
-
-                    //  We have a max of 5 total RNG calls
-                    //  to make a pokemon and we already have
-                    //  one so lets go ahead and get 4 more.
-                    uint rng2XD = rngXD.GetNext16BitNumber();
-                    uint rng3XD = rngXD.GetNext16BitNumber();
-                    uint rng4XD = rngXD.GetNext16BitNumber();
-                    uint pid = (rng3XD << 16) + rng4XD;
-
-                    //  Check Colosseum\XD
-                    // [IVs] [IVs] [xxx] [PID] [PID]
-                    // [START] [rng1] [rng3] [rng4]
-
-                    if (pid % 25 == nature)
-                    {
-                        var newSeed = new Seed
-                        {
-                            Method = "Colosseum/XD",
-                            Pid = pid,
-                            MonsterSeed = XDColoSeed
-                        };
-                        seeds.Add(newSeed);
-                    }
-
-                    //  Check Colosseum\XD XOR
-                    // [IVs] [IVs] [xxx] [PID] [PID]
-                    // [START] [rng1] [rng3] [rng4]
-                    pid ^= 0x80008000;
-                    if (pid % 25 == nature)
-                    {
-                        var newSeed = new Seed
-                        {
-                            Method = "Colosseum/XD",
-                            Pid = pid,
-                            MonsterSeed = XDColoSeed ^ 0x80000000
-                        };
-                        seeds.Add(newSeed);
-                    }
-                }
-            }
-            return seeds;
-        }
+        //  which will be updated to include a method.

         public static List<Seed> GetSeeds(
             uint hp,
@@ -819,14 +637,11 @@
             var seeds = new List<Seed>();

             uint ivs2 = spe | (spa << 5) | (spd << 10);
-            uint ivs2_2 = ivs2 ^ 0x8000;
             uint ivs1 = hp | (atk << 5) | (def << 10);
-            uint ivs1_2 = ivs1 ^ 0x8000;

             uint x_test = ivs2 << 16;
             uint x_testXD = ivs1 << 16;
             uint pid, pidXor, sid;
-            bool pass = false;

             //  Now we want to start with IV2 and call the RNG for
             //  values between 0 and FFFF in the low order bits.
@@ -838,7 +653,7 @@
                 var rngXDR = new XdRngR(seedXD);
                 uint rng1XD = rngXD.GetNext16BitNumber();

-                if (rng1XD == ivs2 || rng1XD == ivs2_2)
+                if ((rng1XD & 0x7FFF) == ivs2)
                 {
                     //Grab rest of RNG calls for XDColo
                     uint rng2XD = rngXD.GetNext16BitNumber();
@@ -886,7 +701,7 @@
                 var rng = new PokeRngR(seed);
                 uint rng1 = rng.GetNext16BitNumber();
                 //Checks that ivs line up
-                if (rng1 == ivs1 || rng1 == ivs1_2)
+                if ((rng1 & 0x7FFF) == ivs1)
                 {
                     //  We have a max of 5 total RNG calls
                     //  to make a pokemon and we already have
@@ -901,7 +716,6 @@
                     rng.GetNext16BitNumber();
                     uint method234Seed = rng.Seed;
                     uint method234SeedXor = method234Seed ^ 0x80000000;
-                    uint choppedPID;

                     //  Check Method 1
                     // [PID] [PID] [IVs] [IVs]
@@ -1053,483 +867,9 @@
                         };
                         seeds.Add(newSeed);
                     }
-
-                    //  DPPt Cute Charm
-                    if (rng3 / 0x5556 != 0)
-                    {
-                        //  Check DPPt Cute Charm
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        choppedPID = rng2 / 0xA3E;
-                        pass = choppedPID % 25 == nature;
-                        if (pass)
-                        {
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (DPPt)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1Seed,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check DPPt Cute Charm (50% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 / 0xA3E + 0x96;
-                        if (pass)
-                        {
-                            choppedPID += 0x96;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (DPPt)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1Seed,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check DPPt Cute Charm (25% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 / 0xA3E + 0xC8;
-                        if (pass)
-                        {
-                            choppedPID += 0x32;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (DPPt)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1Seed,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check DPPt Cute Charm (75% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 / 0xA3E + 0x4B;
-                        if (pass)
-                        {
-                            choppedPID -= 0x7D;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (DPPt)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1Seed,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check DPPt Cute Charm (87.5% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 / 0xA3E + 0x32;
-                        if (pass)
-                        {
-                            choppedPID -= 0x19;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (DPPt)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1Seed,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-                    }
-
-                    //  HGSS Cute Charm
-                    if (rng3 % 3 != 0)
-                    {
-                        //  Check HGSS Cute Charm
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        choppedPID = rng2 % 25;
-                        pass = choppedPID == nature;
-                        if (pass)
-                        {
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (HGSS)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1Seed,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check HGSS Cute Charm (50% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 % 25 + 0x96;
-                        if (pass)
-                        {
-                            choppedPID += 0x96;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (HGSS)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1Seed,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check HGSS Cute Charm (25% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 % 25 + 0xC8;
-                        if (pass)
-                        {
-                            choppedPID += 0x32;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (HGSS)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1Seed,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check HGSS Cute Charm (75% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 % 25 + 0x4B;
-                        if (pass)
-                        {
-                            choppedPID -= 0x7D;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (HGSS)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1Seed,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check HGSS Cute Charm (87.5% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 % 25 + 0x32;
-                        if (pass)
-                        {
-                            choppedPID -= 0x19;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (HGSS)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1Seed,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-                    }
-
-                    //  DPPt Cute Charm XOR
-                    rng3 ^= 0x8000;
-                    rng2 ^= 0x8000;
-                    if (rng3 / 0x5556 != 0)
-                    {
-                        //  Check DPPt Cute Charm
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        choppedPID = rng2 / 0xA3E;
-                        pass = choppedPID % 25 == nature;
-                        if (pass)
-                        {
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (DPPt)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1SeedXor,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check DPPt Cute Charm (50% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 / 0xA3E + 0x96;
-                        if (pass)
-                        {
-                            choppedPID += 0x96;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (DPPt)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1SeedXor,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check DPPt Cute Charm (25% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 / 0xA3E + 0xC8;
-                        if (pass)
-                        {
-                            choppedPID += 0x32;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (DPPt)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1SeedXor,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check DPPt Cute Charm (75% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 / 0xA3E + 0x4B;
-                        if (pass)
-                        {
-                            choppedPID -= 0x7D;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (DPPt)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1SeedXor,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check DPPt Cute Charm (87.5% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 / 0xA3E + 0x32;
-                        if (pass)
-                        {
-                            choppedPID -= 0x19;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (DPPt)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1SeedXor,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-                    }
-
-                    //  HGSS Cute Charm XOR
-                    if (rng3 % 3 != 0)
-                    {
-                        //  Check HGSS Cute Charm
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        choppedPID = rng2 % 25;
-                        pass = choppedPID == nature;
-                        if (pass)
-                        {
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (HGSS)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1SeedXor,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check HGSS Cute Charm (50% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 % 25 + 0x96;
-                        if (pass)
-                        {
-                            choppedPID += 0x96;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (HGSS)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1SeedXor,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check HGSS Cute Charm (25% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 % 25 + 0xC8;
-                        if (pass)
-                        {
-                            choppedPID += 0x32;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (HGSS)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1SeedXor,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check HGSS Cute Charm (75% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 % 25 + 0x4B;
-                        if (pass)
-                        {
-                            choppedPID -= 0x7D;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (HGSS)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1SeedXor,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-
-                        //  Check HGSS Cute Charm (87.5% male)
-                        //  [CC Check] [PID] [IVs] [IVs]
-                        //  [rng3] [rng2] [rng1] [START]
-
-                        //choppedPID = rng2 % 25 + 0x32;
-                        if (pass)
-                        {
-                            choppedPID -= 0x19;
-                            var newSeed = new Seed
-                            {
-                                Method = "Cute Charm (HGSS)",
-                                Pid = choppedPID,
-                                MonsterSeed = method1SeedXor,
-                                Sid = (choppedPID ^ id) & 0xFFF8
-                            };
-                            seeds.Add(newSeed);
-                        }
-                    }
                 }
             }
             return seeds;
-        }
-
-
-        // Overloaded method for SeedFinder's Open Search
-        public static List<Seed> GetSeeds(
-            uint hp,
-            uint atk,
-            uint def,
-            uint spa,
-            uint spd,
-            uint spe,
-            uint nature)
-        {
-            var seeds = new List<Seed>();
-
-            uint ivs2 = spe | (spa << 5) | (spd << 10);
-            uint ivs2_2 = ivs2 ^ 0x8000;
-
-            uint ivs1 = hp | (atk << 5) | (def << 10);
-            uint ivs1_2 = ivs1 ^ 0x8000;
-
-            uint x_test = ivs2 << 16;
-
-            //  Now we want to start with IV2 and call the RNG for
-            //  values between 0 and FFFF in the low order bits.
-            for (uint cnt = 0; cnt <= 0xFFFF; cnt++)
-            {
-                //  Set our test seed here so we can start
-                //  working backwards to see if the rest
-                //  of the information we were provided
-                //  is a match.
-
-                uint seed = x_test | (cnt & 0xFFFF);
-
-                var rng = new PokeRngR(seed);
-
-                //  Right now, this simply assumes method
-                //  1 and gets the value previous to check
-                //  for  match.  We need a clean way to do
-                //  this for all of our methods.
-
-                uint rng1 = rng.GetNext16BitNumber();
-
-                //Check if ivs line up
-                if (rng1 == ivs1 || rng1 == ivs1_2)
-                {
-                    //  We have a max of 5 total RNG calls
-                    //  to make a pokemon and we already have
-                    //  one so lets go ahead and get 4 more.
-                    uint rng2 = rng.GetNext16BitNumber();
-                    uint rng3 = rng.GetNext16BitNumber();
-                    uint rng4 = rng.GetNext16BitNumber();
-                    uint pid = (rng2 << 16) + rng3;
-                    uint method1Seed = rng.Seed;
-
-                    //  Check Method 1
-                    // [PID] [PID] [IVs] [IVs]
-                    // [rng3] [rng2] [rng1] [START]
-                    if (pid % 25 == nature)
-                    {
-                        //  Build a seed to add to our collection
-                        var newSeed = new Seed
-                        {
-                            Method = "Method 1",
-                            Pid = pid,
-                            MonsterSeed = method1Seed
-                        };
-                        seeds.Add(newSeed);
-                    }
-
-                    // Check Method 1 XOR
-                    // [PID] [PID] [IVs] [IVs]
-                    // [rng3] [rng2] [rng1] [START]
-                    pid ^= 0x80008000;
-                    if (pid % 25 == nature)
-                    {
-                        //  Build a seed to add to our collection
-                        var newSeed = new Seed
-                        {
-                            Method = "Method 1",
-                            Pid = pid,
-                            MonsterSeed = method1Seed ^ 0x80000000
-                        };
-                        seeds.Add(newSeed);
-                    }
-                }
-            }
-            return seeds;
-        }
-
-        public static bool CheckPID(uint pid2, uint pid1, uint nature)
-        {
-            //  Do a nature comparison with what we have selected
-            //  in the dropdown and if we have a good match we can
-            //  go ahead and add this to our starting seeds.
-            return nature == ((pid2 << 16) | pid1) % 25;
         }
     }

@@ -1594,7 +934,7 @@
             return ans;
         }

-        public string[] generateWishmkr(List<uint> natureList)
+        public string[] generateWishmkr(uint targetNature)
         {
             uint finalPID = 0;
             uint finalHP = 0;
@@ -1610,7 +950,7 @@
                 uint pid = (pid1 & 0xFFFF0000) | (pid2 >> 16);
                 uint nature = pid % 25;

-                if (natureList == null || natureList.Contains(nature))
+                if (nature == targetNature)
                 {
                     uint ivs1 = forward(pid2);
                     uint ivs2 = forward(ivs1);
@@ -1644,31 +984,12 @@

             for (int x = 0; x < 3; x++)
             {
-                int q = x * 5;
-                uint iv = (iv1 >> q) & 31;
-                if (iv >= 0 && iv <= 31)
-                    ivs[x] = iv;
-                else
-                    return null;
-            }
-
-            uint iV = (ivs2 >> 5) & 31;
-            if (iV >= 0 && iV <= 31)
-                ivs[3] = iV;
-            else
-                return null;
-
-            iV = (ivs2 >> 10) & 31;
-            if (iV >= 0 && iV <= 31)
-                ivs[4] = iV;
-            else
-                return null;
-
-            iV = ivs2 & 31;
-            if (iV >= 0 && iV <= 31)
-                ivs[5] = iV;
-            else
-                return null;
+                ivs[x] = (iv1 >> (x * 5)) & 31;
+            }
+
+            ivs[3] = (ivs2 >> 5) & 31;
+            ivs[4] = (ivs2 >> 10) & 31;
+            ivs[5] = ivs2 & 31;

             return ivs;
         }
@@ -1793,11 +1114,9 @@
                     FrameType = FrameType.Method1Reverse
                 };
                 IVtoPIDGenerator bacdr = new IVtoPIDGenerator();
-                return bacdr.generateWishmkr(new List<uint> { nature });
-            }
-            FrameCompare frameCompare = new FrameCompare(
-                    hptofilter(hiddenpower),
-                    new List<uint> { nature });
+                return bacdr.generateWishmkr(nature);
+            }
+            FrameCompare frameCompare = new FrameCompare(hptofilter(hiddenpower), nature);
             List<Frame> frames = generator.Generate(frameCompare, 0, 0);
             Console.WriteLine("Num frames: " + frames.Count);
             return new string[] { frames[0].Pid.ToString("X"), frames[0].Hp.ToString(), frames[0].Atk.ToString(), frames[0].Def.ToString(), frames[0].Spa.ToString(), frames[0].Spd.ToString(), frames[0].Spe.ToString() };