* assembly info added

* assembly info added

--- OAuth.WinRT/Properties/AssemblyInfo.cs
+++ OAuth.WinRT/Properties/AssemblyInfo.cs
@@ -7,9 +7,9 @@
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("OAuth.WinRT")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyDescription("A Windows Phone 8. / Windows 8.1 port of the OAuth Sample Library for C# from oauth.googlecode.com")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("Igor Kulman")]
 [assembly: AssemblyProduct("OAuth.WinRT")]
 [assembly: AssemblyCopyright("Copyright ©  2015")]
 [assembly: AssemblyTrademark("")]


add helper constructor for response message

--- OElite.Restme.Utils/ResponseMessage.cs
+++ OElite.Restme.Utils/ResponseMessage.cs
@@ -30,6 +30,11 @@
             AssociatedTotalCountPropertyName = associatedTotalCountPropertyName.IsNullOrEmpty()
                 ? "TotalRecordsCount"
                 : associatedTotalCountPropertyName;
+        }
+
+        public ResponseMessage(bool success = true)
+        {
+            Success = success;
         }

         public ResponseMessage(object data, string message = "", bool success = true,


Split out logic for subsequent log message and apply action to only itself

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -402,14 +402,22 @@
             {
                 if (entry.Level < LogLevel.Important || entry.Target == null) return;

-                if (recentLogCount < 3)
-                {
-                    bool lastDisplayable = recentLogCount == recentLogCount - 1;
-
+                const int short_term_display_limit = 3;
+
+                if (recentLogCount < short_term_display_limit)
+                {
                     Schedule(() => notifications.Post(new SimpleNotification
                     {
                         Icon = entry.Level == LogLevel.Important ? FontAwesome.fa_exclamation_circle : FontAwesome.fa_bomb,
-                        Text = (!lastDisplayable ? entry.Message : "Subsequent messages have been logged.") + "\n\nClick to view log files.",
+                        Text = entry.Message,
+                    }));
+                }
+                else if (recentLogCount == short_term_display_limit)
+                {
+                    Schedule(() => notifications.Post(new SimpleNotification
+                    {
+                        Icon = FontAwesome.fa_ellipsis_h,
+                        Text = "Subsequent messages have been logged. Click to view log files.",
                         Activated = () =>
                         {
                             Host.Storage.GetStorageForDirectory("logs").OpenInNativeExplorer();
@@ -419,7 +427,6 @@
                 }

                 Interlocked.Increment(ref recentLogCount);
-
                 Scheduler.AddDelayed(() => Interlocked.Decrement(ref recentLogCount), debounce);
             };
         }


Protect against requests to show overlays before the target overlay is ready

--- osu.Game/OsuGame.cs
+++ osu.Game/OsuGame.cs
@@ -215,16 +215,20 @@

         private ExternalLinkOpener externalLinkOpener;

-        public void HandleLink(string url) => HandleLink(MessageFormatter.GetLinkDetails(url));
-
+        /// <summary>
+        /// Handle an arbitrary URL. Displays via in-game overlays where possible.
+        /// This can be called from a non-thread-safe non-game-loaded state.
+        /// </summary>
+        /// <param name="url">The URL to load.</param>
+        public void HandleLink(string url) => Schedule(() => HandleLink(MessageFormatter.GetLinkDetails(url)));
+
+        /// <summary>
+        /// Handle a specific <see cref="LinkDetails"/>.
+        /// This can be called from a non-thread-safe non-game-loaded state.
+        /// </summary>
+        /// <param name="link">The link to load.</param>
         public void HandleLink(LinkDetails link)
         {
-            Action showNotImplementedError = () => notifications?.Post(new SimpleNotification
-            {
-                Text = @"This link type is not yet supported!",
-                Icon = FontAwesome.Solid.LifeRing,
-            });
-
             switch (link.Action)
             {
                 case LinkAction.OpenBeatmap:
@@ -239,21 +243,17 @@
                     break;

                 case LinkAction.OpenChannel:
-                    try
-                    {
-                        channelManager.OpenChannel(link.Argument);
-                    }
-                    catch (ChannelNotFoundException)
-                    {
-                        Logger.Log($"The requested channel \"{link.Argument}\" does not exist");
-                    }
-
+                    ShowChannel(link.Argument);
                     break;

                 case LinkAction.OpenEditorTimestamp:
                 case LinkAction.JoinMultiplayerMatch:
                 case LinkAction.Spectate:
-                    showNotImplementedError.Invoke();
+                    waitForReady(() => notifications, _ => notifications?.Post(new SimpleNotification
+                    {
+                        Text = @"This link type is not yet supported!",
+                        Icon = FontAwesome.Solid.LifeRing,
+                    }));
                     break;

                 case LinkAction.External:
@@ -270,31 +270,47 @@
             }
         }

-        public void OpenUrlExternally(string url)
+        public void OpenUrlExternally(string url) => waitForReady(() => externalLinkOpener, _ =>
         {
             if (url.StartsWith("/"))
                 url = $"{API.Endpoint}{url}";

             externalLinkOpener.OpenUrlExternally(url);
-        }
+        });
+
+        /// <summary>
+        /// Open a specific channel in chat.
+        /// </summary>
+        /// <param name="channel">The channel to display.</param>
+        public void ShowChannel(string channel) => waitForReady(() => channelManager, _ =>
+        {
+            try
+            {
+                channelManager.OpenChannel(channel);
+            }
+            catch (ChannelNotFoundException)
+            {
+                Logger.Log($"The requested channel \"{channel}\" does not exist");
+            }
+        });

         /// <summary>
         /// Show a beatmap set as an overlay.
         /// </summary>
         /// <param name="setId">The set to display.</param>
-        public void ShowBeatmapSet(int setId) => beatmapSetOverlay.FetchAndShowBeatmapSet(setId);
+        public void ShowBeatmapSet(int setId) => waitForReady(() => beatmapSetOverlay, _ => beatmapSetOverlay.FetchAndShowBeatmapSet(setId));

         /// <summary>
         /// Show a user's profile as an overlay.
         /// </summary>
         /// <param name="userId">The user to display.</param>
-        public void ShowUser(long userId) => userProfile.ShowUser(userId);
+        public void ShowUser(long userId) => waitForReady(() => userProfile, _ => userProfile.ShowUser(userId));

         /// <summary>
         /// Show a beatmap's set as an overlay, displaying the given beatmap.
         /// </summary>
         /// <param name="beatmapId">The beatmap to show.</param>
-        public void ShowBeatmap(int beatmapId) => beatmapSetOverlay.FetchAndShowBeatmap(beatmapId);
+        public void ShowBeatmap(int beatmapId) => waitForReady(() => beatmapSetOverlay, _ => beatmapSetOverlay.FetchAndShowBeatmap(beatmapId));

         /// <summary>
         /// Present a beatmap at song select immediately.
@@ -450,6 +466,23 @@
             menuScreen?.MakeCurrent();

             performFromMainMenuTask = Schedule(() => performFromMainMenu(action, taskName));
+        }
+
+        /// <summary>
+        /// Wait for the game (and target component) to become loaded and then run an action.
+        /// </summary>
+        /// <param name="retrieveInstance">A function to retrieve a (potentially not-yet-constructed) target instance.</param>
+        /// <param name="action">The action to perform on the instance when load is confirmed.</param>
+        /// <typeparam name="T">The type of the target instance.</typeparam>
+        private void waitForReady<T>(Func<T> retrieveInstance, Action<T> action)
+            where T : Drawable
+        {
+            var instance = retrieveInstance();
+
+            if (ScreenStack == null || ScreenStack.CurrentScreen is StartupScreen || instance?.IsLoaded != true)
+                Schedule(() => waitForReady(retrieveInstance, action));
+            else
+                action(instance);
         }

         protected override void Dispose(bool isDisposing)


Define an implicit conversion from strings to markup nodes

--- Pixie/MarkupNode.cs
+++ Pixie/MarkupNode.cs
@@ -1,4 +1,5 @@
 using System;
+using Pixie.Markup;

 namespace Pixie
 {
@@ -24,5 +25,16 @@
         /// <param name="mapping">A mapping function.</param>
         /// <returns>A new markup node.</returns>
         public abstract MarkupNode Map(Func<MarkupNode, MarkupNode> mapping);
+
+        /// <summary>
+        /// Creates a text markup node from a string of characters.
+        /// </summary>
+        /// <param name="text">
+        /// The text to wrap in a text markup node.
+        /// </param>
+        public static implicit operator MarkupNode(string text)
+        {
+            return new Text(text);
+        }
     }
-}+}


Add subfolder support

Add subfolder support

--- ProjectProcessor.cs
+++ ProjectProcessor.cs
@@ -158,8 +158,12 @@

                             foreach (var files in this.GetProjectItems("CopyToOutputDirectory", "None").Where(p => p.Item2 != "Never"))
                             {
+                                var destdir = GetAttribute(node, "Flatten", "false").ToLower() == "true"
+                                    ? GetAttribute(node, "DestDir")
+                                    : Path.Combine(GetAttribute(node, "DestDir"), Path.GetDirectoryName(files.Item1.EvaluatedInclude));
+
                                 yield return new InnoSetupFileItem(Path.GetFullPath(Path.Combine(this.Project.DirectoryPath, files.Item1.EvaluatedInclude)),
-                                   GetAttribute(node, "DestDir"),
+                                   destdir,
                                    components,
                                    GetAttribute(node, "Tasks"));
                             }
@@ -235,10 +239,6 @@
                 return defValue;
             }
         }
-
-
-
-
     }
 }


Added RefreshDevicesAsync test as per updated #17

--- ParticleSDKTests/ParticleCloudTests.cs
+++ ParticleSDKTests/ParticleCloudTests.cs
@@ -148,6 +148,105 @@
 		}

 		[TestMethod]
+		public async Task RefreshDevicesAsyncTest()
+		{
+			using (var cloud = new ParticleCloudMock())
+			{
+				cloud.RequestCallBack = (t, m, p) =>
+				{
+					return new RequestResponse
+					{
+						StatusCode = HttpStatusCode.OK,
+						Response = JToken.Parse(@"[
+						{
+							""id"": ""1"",
+							""name"": ""Work"",
+							""last_app"": null,
+							""last_ip_address"": ""192.168.0.1"",
+							""last_heard"": ""2015-05-25T01:15:36.034Z"",
+							""product_id"": 0,
+							""connected"": false
+						},
+						{
+							""id"": ""2"",
+							""name"": ""Home"",
+							""last_app"": null,
+							""last_ip_address"": ""192.168.0.1"",
+							""last_heard"": ""2015-05-25T01:15:59.188Z"",
+							""product_id"": 0,
+							""connected"": false
+						},
+						{
+							""id"": ""3"",
+							""name"": ""Proto"",
+							""last_app"": null,
+							""last_ip_address"": ""192.168.0.1"",
+							""last_heard"": ""2015-07-24T00:37:07.820Z"",
+							""product_id"": 6,
+							""connected"": true
+						}
+]")
+					};
+				};
+
+				var result = await cloud.RefreshDevicesAsync();
+				Assert.IsNotNull(result);
+				Assert.IsTrue(result.Success);
+				var devices = cloud.Devices;
+				Assert.AreEqual(3, devices.Count);
+				var device = devices[0];
+				Assert.AreEqual("1", device.Id);
+				Assert.AreEqual("Work", device.Name);
+				device = devices[1];
+				Assert.AreEqual("2", device.Id);
+				Assert.AreEqual("Home", device.Name);
+				device = devices[2];
+				Assert.AreEqual("3", device.Id);
+				Assert.AreEqual("Proto", device.Name);
+
+				cloud.RequestCallBack = (t, m, p) =>
+				{
+					return new RequestResponse
+					{
+						StatusCode = HttpStatusCode.OK,
+						Response = JToken.Parse(@"[
+						{
+							""id"": ""1"",
+							""name"": ""Work"",
+							""last_app"": null,
+							""last_ip_address"": ""192.168.0.1"",
+							""last_heard"": ""2015-05-25T01:15:36.034Z"",
+							""product_id"": 0,
+							""connected"": false
+						},
+						{
+							""id"": ""4"",
+							""name"": ""Home2"",
+							""last_app"": null,
+							""last_ip_address"": ""192.168.0.1"",
+							""last_heard"": ""2015-05-25T01:15:59.188Z"",
+							""product_id"": 0,
+							""connected"": false
+						}
+]")
+					};
+				};
+
+				result = await cloud.RefreshDevicesAsync();
+				Assert.IsNotNull(result);
+				Assert.IsTrue(result.Success);
+				devices = cloud.Devices;
+				Assert.AreEqual(2, devices.Count);
+				device = devices[0];
+				Assert.AreEqual("1", device.Id);
+				Assert.AreEqual("Work", device.Name);
+				device = devices[1];
+				Assert.AreEqual("4", device.Id);
+				Assert.AreEqual("Home2", device.Name);
+			}
+		}
+
+		[TestMethod]
 		public async Task SignupWithUserAsyncTest()
 		{
 			using (var cloud = new ParticleCloudMock())


Querystring accessed by reflection now

Querystring accessed by reflection now

--- source/Glimpse.AspNet/Model/RequestModel.cs
+++ source/Glimpse.AspNet/Model/RequestModel.cs
@@ -20,6 +20,9 @@
                                                               BindingFlags.Instance | BindingFlags.NonPublic);

         private static readonly FieldInfo httpRequestField = typeof(HttpRequestWrapper).GetField("_httpRequest",
+                                                                      BindingFlags.Instance | BindingFlags.NonPublic);
+
+        private static readonly FieldInfo queryStringField = typeof(HttpRequest).GetField("_queryString",
                                                                       BindingFlags.Instance | BindingFlags.NonPublic);

         public RequestModel(HttpContextBase context)
@@ -46,7 +49,7 @@
             UserHostName = request.UserHostName;

             Cookies = GetCookies(httpRequest, context.Server);
-            QueryString = GetQueryString(request.QueryString);
+            QueryString = GetQueryString(httpRequest);
         }

         //// TODO: Add InputStream
@@ -146,11 +149,19 @@
             }
         }

-        private IEnumerable<QueryStringParameter> GetQueryString(NameValueCollection queryString)
+        private IEnumerable<QueryStringParameter> GetQueryString(HttpRequest httpRequest)
         {
-            foreach (var key in queryString.AllKeys)
+            if (httpRequest != null)
             {
-                yield return new QueryStringParameter { Key = key, Value = queryString[key] };
+                var queryString = queryStringField.GetValue(httpRequest) as NameValueCollection;
+
+                if (queryString != null)
+                {
+                    foreach (var key in queryString.AllKeys)
+                    {
+                        yield return new QueryStringParameter { Key = key, Value = queryString[key] };
+                    }
+                }
             }
         }


Stop IDE from squirming

Stop IDE from squirming

--- PathfinderPatcher/PathfinderPatcher.cs
+++ PathfinderPatcher/PathfinderPatcher.cs
@@ -199,7 +199,7 @@

                 // Add Properties Property to Folder
                 type = gameAssembly.MainModule.GetType("Hacknet.Folder");
-                type.ModifyConstructor(m => { m.Body.Variables.Add(new VariableDefinition(gameAssembly.MainModule.TypeSystem.UInt64)); }
+                type.ModifyConstructor((m => { m.Body.Variables.Add(new VariableDefinition(gameAssembly.MainModule.TypeSystem.UInt64)); })
                     + GetCommonConstructorModifier(nestedType,
                     type.AddFullProperty("Properties", nestedType),
                     gameAssembly.MainModule.GetType("Hacknet.OS").GetField("currentElapsedTime")));
@@ -215,15 +215,15 @@
             }
             if(!spitOutHacknetOnly) try
                 {
-                    using (var stream = new MemoryStream())
-                    {
-                        gameAssembly.Write(stream);
-                        System.Reflection.Assembly.Load(stream.GetBuffer());
-                        var assm = System.Reflection.Assembly.LoadFrom(
-                            new FileInfo(string.IsNullOrEmpty(pathfinderDir) ? "Pathfinder.dll" : pathfinderDir + "Pathfinder.dll").FullName);
-                        var t = assm.GetType("Pathfinder.Internal.Patcher.Executor");
-                        t.GetMethod("Main", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)
-                            .Invoke(null, new object[] { gameAssembly });
+                    using (var stream = new MemoryStream())
+                    {
+                        gameAssembly.Write(stream);
+                        System.Reflection.Assembly.Load(stream.GetBuffer());
+                        var assm = System.Reflection.Assembly.LoadFrom(
+                            new FileInfo(string.IsNullOrEmpty(pathfinderDir) ? "Pathfinder.dll" : pathfinderDir + "Pathfinder.dll").FullName);
+                        var t = assm.GetType("Pathfinder.Internal.Patcher.Executor");
+                        t.GetMethod("Main", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)
+                            .Invoke(null, new object[] { gameAssembly });
                     }
                 }
                 catch(Exception ex)


Fixed an issue running on Desktop Bridge.

--- source/SylphyHorn/Properties/Directories.cs
+++ source/SylphyHorn/Properties/Directories.cs
@@ -5,7 +5,16 @@
 {
 	public static class Directories
 	{
-		private static readonly Lazy<DirectoryInfo> _localAppDataLazy = new Lazy<DirectoryInfo>(() => new DirectoryInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), ProductInfo.Company, ProductInfo.Product)));
+		private static readonly Lazy<DirectoryInfo> _localAppDataLazy = new Lazy<DirectoryInfo>(
+			() => new DirectoryInfo(
+				Path.Combine(
+					Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
+#if APPX
+					@"Packages\46846grabacr.net.SylphyHorn_vwznf8jfphrrc\LocalCache\Local",
+#endif
+					ProductInfo.Company,
+					ProductInfo.Product)
+			));

 		internal static DirectoryInfo LocalAppData => _localAppDataLazy.Value;
 	}


Added color to the console logo

Added color to the console logo

--- PitFiend/SexStore.Client/EntryPoint.cs
+++ PitFiend/SexStore.Client/EntryPoint.cs
@@ -382,7 +382,9 @@
            ,,,,,,:       .,,,,,,.
 ";

+            Console.ForegroundColor = ConsoleColor.Cyan;
             Console.WriteLine(logo);
+            Console.ForegroundColor = ConsoleColor.Gray;
             Console.WriteLine("Loading...");

             Console.ReadLine();


--- PracticalLINQ/PracticalLINQ/Program.cs
+++ PracticalLINQ/PracticalLINQ/Program.cs
@@ -104,7 +104,7 @@
         {
             var generator = new Random();
             var nonIdemPotent = Enumerable.Range(1, 10)
-                                .Select(n => generator.Next(25));
+                                .Select(n => generator.Next(25)).ToList();

             foreach (var item in nonIdemPotent)
                 Console.WriteLine(item);


Component selection was missing from 'add/change information' form.

git-svn-id: eda3d06fcef731589ace1b284159cead3416df9b@149 af82e41b-90c4-0310-8c96-b1721e28e2e2

--- templates/ticket.cs
+++ templates/ticket.cs
@@ -139,6 +139,13 @@

+      Component:
+
+        <?cs call:hdf_select(ticket.components, "component",
+                             ticket.component) ?>
+
+

+

       Severity:

         <?cs call:hdf_select(enums.severity, "severity",
@@ -155,6 +162,7 @@
         <?cs var:ticket.resolution ?>

     <?cs /if ?>
+


FindImplementations - ImplementedBy in MLists fix

--- Signum.Engine/Schema/Schema.cs
+++ Signum.Engine/Schema/Schema.cs
@@ -454,7 +454,7 @@

         public Implementations FindImplementations(PropertyRoute route)
         {
-            if (route.PropertyRouteType == PropertyRouteType.MListItems || route.PropertyRouteType == PropertyRouteType.LiteEntity)
+            if (route.PropertyRouteType == PropertyRouteType.LiteEntity)
                 route = route.Parent;

             Type type = route.RootType;


fix EntityBase types and typeNiceNames

fix EntityBase types and typeNiceNames

--- Signum.Web/Lines/EntityBase.cs
+++ Signum.Web/Lines/EntityBase.cs
@@ -94,8 +94,8 @@
                 if (Implementations != null)
                     throw new ArgumentException("implementations should be null for EmbeddedEntities");

-                options.Add("types", Navigator.ResolveWebTypeName(type));
-                options.Add("typeNiceNames", type.NiceName());
+                options.Add("types", new JArray(Navigator.ResolveWebTypeName(type)));
+                options.Add("typeNiceNames", new JArray(type.NiceName()));

                 PropertyRoute route = this.GetElementRoute();
                 options.Add("rootType", Navigator.ResolveWebTypeName(route.RootType));
@@ -106,8 +106,13 @@
                 Type[] types = Implementations.Value.IsByAll ? ImplementedByAll :
                                Implementations.Value.Types.ToArray();

-                options.Add("types", types == ImplementedByAll ? ImplementedByAllKey : types.ToString(t => Navigator.ResolveWebTypeName(t), ","));
-                options.Add("typeNiceNames", types == ImplementedByAll ? ImplementedByAllKey : types.ToString(t => t.NiceName(), ","));
+                options.Add("types", new JArray(types == ImplementedByAll ?
+                    new string[]{ ImplementedByAllKey } :
+                    types.Select(t => Navigator.ResolveWebTypeName(t)).ToArray()));
+
+                options.Add("typeNiceNames", new JArray(types == ImplementedByAll ?
+                    new string[] { ImplementedByAllKey } :
+                    types.Select(t => t.NiceName()).ToArray()));
             }

             if (this.ReadOnly)


don't await site replace call if the publishing fails for some reason. fail faster to the user

--- SimpleWAWS/Code/SiteManager.cs
+++ SimpleWAWS/Code/SiteManager.cs
@@ -225,7 +225,9 @@
             //if we are here that means a bad exception happened above, but we might leak a site if we don't remove the site and replace it correctly.
             if (site != null)
             {
-                await site.DeleteAndCreateReplacementAsync();
+                //no need to await this call
+                //this call is to fix our internal state, return an error right away to the caller
+                site.DeleteAndCreateReplacementAsync();
             }
             throw new Exception("No free sites are available, try again later");
         }


Avoid InvalidOperationException at opening local detail image

--- Project/Pages/RemoteViewerPage.xaml.cs
+++ Project/Pages/RemoteViewerPage.xaml.cs
@@ -483,23 +483,30 @@
             {
                 Dispatcher.BeginInvoke(() =>
                 {
-                    using (var strm = thumb.picture.GetImage())
+                    try
                     {
-                        using (var replica = new MemoryStream())
+                        using (var strm = thumb.picture.GetImage())
                         {
-                            strm.CopyTo(replica); // Copy to the new stream to avoid stream crash issue.
-                            if (replica.Length <= 0)
+                            using (var replica = new MemoryStream())
                             {
-                                return;
+                                strm.CopyTo(replica); // Copy to the new stream to avoid stream crash issue.
+                                if (replica.Length <= 0)
+                                {
+                                    return;
+                                }
+                                replica.Seek(0, SeekOrigin.Begin);
+
+                                _bitmap = new BitmapImage();
+                                _bitmap.SetSource(replica);
+                                InitBitmapBeforeOpen();
+                                DetailImage.Source = _bitmap;
+                                SetVisibility(true);
                             }
-                            replica.Seek(0, SeekOrigin.Begin);
-
-                            _bitmap = new BitmapImage();
-                            _bitmap.SetSource(replica);
-                            InitBitmapBeforeOpen();
-                            DetailImage.Source = _bitmap;
-                            SetVisibility(true);
                         }
+                    }
+                    catch (InvalidOperationException)
+                    {
+                        ShowToast("Failed to open detail image...");
                     }
                 });
             });


add Digits() tests

add Digits() tests

--- PunkuTests/Extensions/IntExtensions.cs
+++ PunkuTests/Extensions/IntExtensions.cs
@@ -28,30 +28,50 @@
 	}

 	[Test]
-	public void GetDigitCount01 ()
+	public void CountDigits01 ()
 	{
 		int x = 1;
 		Assert.AreEqual (x.CountDigits (), 1);
 	}

 	[Test]
-	public void GetDigitCount02 ()
+	public void CountDigits02 ()
 	{
 		int x = 1234;
 		Assert.AreEqual (x.CountDigits (), 4);
 	}

 	[Test]
-	public void GetDigitCount03 ()
+	public void CountDigits03 ()
 	{
 		int x = 99999999;
 		Assert.AreEqual (x.CountDigits (), 8);
 	}

 	[Test]
-	public void GetDigitCount04 ()
+	public void CountDigits04 ()
 	{
 		int x = 123456789;
 		Assert.AreEqual (x.CountDigits (), 9);
 	}
+
+	[Test]
+	public void Digits01 ()
+	{
+		int x = 7;
+		Assert.AreEqual (
+			x.Digits (),
+			new byte[] { 7 }
+		);
+	}
+
+	[Test]
+	public void Digits02 ()
+	{
+		int x = 123456789;
+		Assert.AreEqual (
+			x.Digits (),
+			new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
+		);
+	}
 }


#134, #95

#134, #95


Update TypeIterator.cs

Update TypeIterator.cs


Expanding env vars in include path suppressions and path suppression (as per request in #180)


Cleanup

Cleanup

--- test/SimpleSoft.IniParser.Tests/Normalization/IniNormalizerTests.cs
+++ test/SimpleSoft.IniParser.Tests/Normalization/IniNormalizerTests.cs
@@ -22,8 +22,6 @@
 // SOFTWARE.
 #endregion

-using System.Collections.Generic;
-using System.Linq;
 using SimpleSoft.IniParser.Impl;
 using Xunit;


Bug in parsing sample configuration fixed


searches through app dependencies not capabilities


Fixed flair template bug

Fixed flair template bug

--- RedditSharp/Subreddit.cs
+++ RedditSharp/Subreddit.cs
@@ -159,6 +159,9 @@
                 uh = Reddit.User.Modhash,
                 r = this.Name
             });
+            stream.Close();
+            var response = post.GetResponse();
+            var data = Reddit.GetResponseString(response.GetResponseStream());
         }

         public override string ToString()


Graphics.MeasureString: Add a check for null strings and return Size.Empty. (Platforms such as iOS and Mac throw exceptions for empty strings.)

--- Source/Eto/Drawing/Graphics.cs
+++ Source/Eto/Drawing/Graphics.cs
@@ -900,6 +900,7 @@
 		/// <returns>Size representing the dimensions of the entire text would take to draw given the specified <paramref name="font"/></returns>
 		public SizeF MeasureString (Font font, string text)
 		{
+			if (string.IsNullOrEmpty(text)) return SizeF.Empty; // handle null explicitly
 			return Handler.MeasureString (font, text);
 		}


Cleanup

Cleanup

--- Source/EventFlow/CommandBus.cs
+++ Source/EventFlow/CommandBus.cs
@@ -136,11 +136,7 @@
             return await _aggregateStore.UpdateAsync<TAggregate, TIdentity, TResult>(
                 command.AggregateId,
                 command.SourceId,
-                async (a, c) =>
-                    {
-                        var task = (Task<TResult>) commandExecutionDetails.Invoker(commandHandler, a, command, c);
-                        return await task.ConfigureAwait(false);
-                    },
+                (a, c) => (Task<TResult>) commandExecutionDetails.Invoker(commandHandler, a, command, c),
                 cancellationToken)
                 .ConfigureAwait(false);
         }


Use empty string instead of null to avoid contract failures in WalCheckPointAll

--- SQLitePCL.pretty/DatabaseConnection.cs
+++ SQLitePCL.pretty/DatabaseConnection.cs
@@ -200,7 +200,10 @@

             int nLog;
             int nCkpt;
-            This.WalCheckPoint(null, WalCheckPointMode.Passive, out nLog, out nCkpt);
+
+            // If parameter zDb is NULL or points to a zero length string, then the specified operation is
+            // attempted on all WAL databases attached to database connection db
+            This.WalCheckPoint("", WalCheckPointMode.Passive, out nLog, out nCkpt);
         }

         /// <summary>


Simplify the code a bit

Simplify the code a bit

--- src/Avalonia.Styling/ClassBindingManager.cs
+++ src/Avalonia.Styling/ClassBindingManager.cs
@@ -21,15 +21,8 @@
             var prop = AvaloniaProperty.Register<StyledElement, bool>("__AvaloniaReserved::Classes::" + className);
             prop.Changed.Subscribe(args =>
             {
-                var enable = args.NewValue.GetValueOrDefault();
                 var classes = ((IStyledElement)args.Sender).Classes;
-                if (enable)
-                {
-                    if (!classes.Contains(className))
-                        classes.Add(className);
-                }
-                else
-                    classes.Remove(className);
+                classes.Set(className, args.NewValue.GetValueOrDefault());
             });

             return prop;


remove bad key

remove bad key

--- src/AzureTableStorageCacheSample/Startup.cs
+++ src/AzureTableStorageCacheSample/Startup.cs
@@ -29,7 +29,7 @@
         // This method gets called by the runtime. Use this method to add services to the container.
         public void ConfigureServices(IServiceCollection services)
         {
-            services.AddAzureTableStorageCache("DefaultEndpointsProtocol=https;AccountName=tparnell;AccountKey=cEHdbvM6bljcIYOaODs16vRokLDvxujEn+JR/8MWgYE/9g4mw95n/jusTAdvhc/JrySfZGwaq/WIg9Bi/TeoOw==", "yodawg", "cachingforlyfe");
+            services.AddAzureTableStorageCache("connectionstring", "table", "partitionKey");
             // Add framework services.
             services.AddMvc();
         }


Ranks fix

Ranks fix


Fixed a bug on the game listing page where the last row was not closing its <div> tag.

--- src/BolfTracker.Web/Views/Game/Index.cshtml
+++ src/BolfTracker.Web/Views/Game/Index.cshtml
@@ -17,11 +17,13 @@

 @{
   int i = 1;
+  bool needsClosingDiv = false;
 }
 @foreach (var item in Model.Games)
 {
   if (i % 2 != 0)
   {
+    needsClosingDiv = true;
     @:

   }
   var pgs = Model.GetPlayerGameStatistics(item.Id);
@@ -68,6 +70,11 @@
   if (i % 2 == 0)
   {
     @:

+    needsClosingDiv = false;
   }
   i++;
 }
+@if (needsClosingDiv)
+{
+  @:

+}


unnecessary line
-ssary  line, and those below, will be ignored--

M    src/Boo.Lang.Compiler/Steps/EmitAssembly.cs

git-svn-id: c3b8989232654601f1acea7403f771adaaa44a81@1022 2c1201b4-01cd-e047-a400-b836ae1fbc61

--- src/Boo.Lang.Compiler/Steps/EmitAssembly.cs
+++ src/Boo.Lang.Compiler/Steps/EmitAssembly.cs
@@ -343,7 +343,6 @@

 			foreach (EnumMember member in node.Members)
 			{
-				//enumBuilder.DefineLiteral(member.Name, (long)member.Initializer.Value);
 				FieldBuilder field = builder.DefineField(member.Name, builder,
 									FieldAttributes.Public |
 									FieldAttributes.Static |


mono does not like AssemblyName.Version being set to null

git-svn-id: c3b8989232654601f1acea7403f771adaaa44a81@1342 2c1201b4-01cd-e047-a400-b836ae1fbc61

--- src/Boo.Lang.Compiler/Steps/EmitAssembly.cs
+++ src/Boo.Lang.Compiler/Steps/EmitAssembly.cs
@@ -3638,11 +3638,11 @@
 		Version GetAssemblyVersion()
 		{
 			string version = GetAssemblyAttributeValue("System.Reflection.AssemblyVersionAttribute");
-			if (null != version)
-			{
-				return new Version(version);
-			}
-			return null;
+			if (null == version)
+			{
+				version = "0.0.0.0";
+			}
+			return new Version(version);
 		}

 		string GetAssemblyAttributeValue(string name)


v2.0 Trunk: Some renaming to the Show factory methods in order to improve overload resolution relating to screen subjects.

--- src/Caliburn.ShellFramework/Results/Show.cs
+++ src/Caliburn.ShellFramework/Results/Show.cs
@@ -21,15 +21,14 @@
             _viewModelFactory = viewModelFactory;
         }

-        public static OpenScreenSubjectResult ChildFor(IScreenSubject screenSubject)
+        public static OpenScreenSubjectResult ChildSubject(IScreenSubject screenSubject)
         {
             return new OpenScreenSubjectResult(screenSubject);
         }

         public static OpenScreenSubjectResult ChildFor<T>(T subject)
         {
-            var screenSubject = new ScreenSubject<T>(subject);
-            return new OpenScreenSubjectResult(screenSubject);
+            return ChildSubject(new ScreenSubject<T>(subject));
         }

         public static OpenChildResult<TChild> Child<TChild>()


tls-sni-01: Add 127.0.0.1 to hosts during SNI check as some servers can't resolve their own domains.

--- src/Certify.Core/Management/VaultManager.cs
+++ src/Certify.Core/Management/VaultManager.cs
@@ -690,14 +690,16 @@
         }

         /// <summary>
-        /// Simulates responding to a challenge, performs a sample configuration and attempts to verify it.
+        /// Simulates responding to a challenge, performs a sample configuration and attempts to
+        /// verify it.
         /// </summary>
         /// <param name="iisManager"></param>
         /// <param name="managedSite"></param>
-        /// <returns>APIResult</returns>
+        /// <returns> APIResult </returns>
         /// <remarks>
-        /// The purpose of this method is to test the options (permissions, configuration) before submitting
-        /// a request to the ACME server, to avoid creating failed requests and hitting usage limits.
+        /// The purpose of this method is to test the options (permissions, configuration) before
+        /// submitting a request to the ACME server, to avoid creating failed requests and hitting
+        /// usage limits.
         /// </remarks>
         public async Task<APIResult> TestChallengeResponse(IISManager iisManager, ManagedSite managedSite)
         {
@@ -779,12 +781,13 @@
         }

         /// <summary>
-        /// Creates a realistic-looking simulated Key Authorization
+        /// Creates a realistic-looking simulated Key Authorization
         /// </summary>
         /// <remarks>
-        /// example KeyAuthorization (from https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-7.2):
+        /// example KeyAuthorization (from
+        /// https://tools.ietf.org/html/draft-ietf-acme-acme-01#section-7.2):
         /// "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA.nP1qzpXGymHBrUEepNY9HCsQk7K8KhOypzEt62jcerQ"
-        /// i.e. [token-string].[sha256(token-string bytes)] where token-string is >= 128 bits of data
+        /// i.e. [token-string].[sha256(token-string bytes)] where token-string is >= 128 bits of data
         /// </remarks>
         private string GenerateSimulatedKeyAuth()
         {
@@ -805,7 +808,7 @@
             var domain = pendingAuth.Identifier.Dns;
             if (pendingAuth.Challenge != null)
             {
-                if (pendingAuth.Challenge.ChallengeData is ACMESharp.ACME.HttpChallenge
+                if (pendingAuth.Challenge.ChallengeData is ACMESharp.ACME.HttpChallenge
                     && requestConfig.PerformChallengeFileCopy /* is this needed? */)
                 {
                     var check = PrepareChallengeResponse_Http01(iisManager, domain, managedSite, pendingAuth);
@@ -828,9 +831,11 @@
         }

         /// <summary>
-        /// Prepares IIS to respond to a http-01 challenge
+        /// Prepares IIS to respond to a http-01 challenge
         /// </summary>
-        /// <returns>A Boolean returning Func. Invoke the Func to test the challenge response locally.</returns>
+        /// <returns>
+        /// A Boolean returning Func. Invoke the Func to test the challenge response locally.
+        /// </returns>
         private Func<bool> PrepareChallengeResponse_Http01(IISManager iisManager, string domain, ManagedSite managedSite, PendingAuthorization pendingAuth)
         {
             var requestConfig = managedSite.RequestConfig;
@@ -849,8 +854,8 @@

             if (!String.IsNullOrEmpty(websiteRootPath) && websiteRootPath.Contains("%"))
             {
-                // if websiteRootPath contains %websiteroot% variable, replace that with the
-                // current physical path for the site
+                // if websiteRootPath contains %websiteroot% variable, replace that with the current
+                // physical path for the site
                 if (websiteRootPath.Contains("%websiteroot%"))
                 {
                     // sets env variable for this process only
@@ -918,9 +923,11 @@
         }

         /// <summary>
-        /// Prepares IIS to respond to a tls-sni-01 challenge
+        /// Prepares IIS to respond to a tls-sni-01 challenge
         /// </summary>
-        /// <returns>A Boolean-returning Func. Invoke the Func to test the challenge response locally.</returns>
+        /// <returns>
+        /// A Boolean-returning Func. Invoke the Func to test the challenge response locally.
+        /// </returns>
         private Func<bool> PrepareChallengeResponse_TlsSni01(IISManager iisManager, string domain, ManagedSite managedSite, PendingAuthorization pendingAuth)
         {
             var requestConfig = managedSite.RequestConfig;
@@ -1091,22 +1098,22 @@
         }

         /// <summary>
-        /// Performs a simulated tls-sni-01 verification over HTTPS/SNI.
+        /// Performs a simulated tls-sni-01 verification over HTTPS/SNI.
         /// </summary>
-        /// <param name="host">The domain being verified</param>
-        /// <param name="sni">The server name indication used for TLS server response</param>
-        /// <param name="useProxyAPI">Whether to use the server proxy for verification</param>
-        /// <returns>True if the verification is successful, False if not.</returns>
+        /// <param name="host"> The domain being verified </param>
+        /// <param name="sni"> The server name indication used for TLS server response </param>
+        /// <param name="useProxyAPI"> Whether to use the server proxy for verification </param>
+        /// <returns> True if the verification is successful, False if not. </returns>
         private bool CheckSNI(string host, string sni, bool? useProxyAPI = null)
         {
-            // if validation proxy enabled, access to the domain being validated is checked via
-            // our remote API rather than directly on the servers
+            // if validation proxy enabled, access to the domain being validated is checked via our
+            // remote API rather than directly on the servers
             bool useProxy = useProxyAPI ?? Certify.Properties.Settings.Default.EnableValidationProxyAPI;
             if (useProxy)
             {
                 // TODO: check proxy here, needs server support. if successful "return true"; and "LogAction(...)"
                 System.Diagnostics.Debug.WriteLine("ProxyAPI is not implemented for Checking SNI config, trying local");
-                this.LogAction($"Proxy TLS SNI binding check error: {host}, {sni}");
+                this.LogAction($"Proxy TLS SNI binding check error: {host}, {sni}");

                 return CheckSNI(host, sni, false); // proxy failed, try local
             }
@@ -1119,14 +1126,30 @@
                     // verify SNI-selected certificate is correctly configured
                     return CertificateManager.VerifyCertificateSAN(cert, sni);
                 };
-                // modify the hosts file
-                var ip = Dns.GetHostEntry(host).AddressList.First();
-                string hostEntry = $"\n{ip}\t{sni}";
+
+                // modify the hosts file so we can resolve this request locally: create an entry for
+                // the primary IP address and also for 127.0.0.1 (where primary IP will not resolve
+                // internally i.e. the default resolution is an external IP)
+
+                List<string> testHostEntries = new List<string> {
+                    $"\n127.0.0.1\t{sni}",
+                };
+
+                var ip = Dns.GetHostEntry(host)?.AddressList?.FirstOrDefault();
+                if (ip != null)
+                {
+                    testHostEntries.Add($"\n{ip}\t{sni}");
+                }
+
                 using (StreamWriter writer = File.AppendText(hosts))
                 {
-                    writer.Write(hostEntry);
-                }
-                Thread.Sleep(250); // wait a bit for hostsfile to take effect
+                    foreach (var hostEntry in testHostEntries)
+                    {
+                        writer.Write(hostEntry);
+                    }
+                }
+                Thread.Sleep(250); // wait a bit for hosts file to take effect
+
                 try
                 {
                     using (var client = new HttpClient())
@@ -1138,11 +1161,16 @@
                 }
                 finally
                 {
-                    // clean up hosts
+                    // clean up temp entries in hosts file
                     try
                     {
                         var txt = File.ReadAllText(hosts);
-                        txt = txt.Substring(0, txt.Length - hostEntry.Length);
+                        foreach (var hostEntry in testHostEntries)
+                        {
+                            //should we just remove all .acme.invalid entries instead of looking for our current entries?
+                            txt = txt.Substring(0, txt.Length - hostEntry.Length);
+                        }
+
                         File.WriteAllText(hosts, txt);
                     }
                     catch
@@ -1156,8 +1184,8 @@
             }
             catch (Exception ex)
             {
-                // eat the error that HttpClient throws, either cert validation failed
-                // or the site is inaccessible via https://host name
+                // eat the error that HttpClient throws, either cert validation failed or the site is
+                // inaccessible via https://host name
                 this.LogAction($"Local TLS SNI binding check error: {host}, {sni}\n{ex.GetType()}: {ex.Message}\n{ex.StackTrace}");
                 return false;
             }
@@ -1170,14 +1198,14 @@

         private bool CheckURL(string url, bool? useProxyAPI = null)
         {
-            // if validation proxy enabled, access to the domain being validated is checked via
-            // our remote API rather than directly on the servers
+            // if validation proxy enabled, access to the domain being validated is checked via our
+            // remote API rather than directly on the servers
             bool useProxy = useProxyAPI ?? Certify.Properties.Settings.Default.EnableValidationProxyAPI;

             //check http request to test path works
             try
             {
-                var request = WebRequest.Create(!useProxy ? url :
+                var request = WebRequest.Create(!useProxy ? url :
                     Properties.Resources.APIBaseURI + "testurlaccess?url=" + url);
                 ServicePointManager.ServerCertificateValidationCallback = (obj, cert, chain, errors) =>
                 {


Undefined and UTF8 header value  support

Undefined and UTF8 header value  support

--- Sources/Core2/MessageHelper.cs
+++ Sources/Core2/MessageHelper.cs
@@ -67,14 +67,23 @@
                     case ExceptionHeader.WellknownName:
                         message.Headers.Add(new ExceptionHeader
                         {
-                            Message = Encoding.ASCII.GetString((byte[])o)
+                            Message = BuildHeaderValue(o)
                         });
                         break;
                     default:
-                        message.Headers.Add(new BusHeader(header.Key, Encoding.ASCII.GetString((byte[])o)));
+                        message.Headers.Add(new BusHeader(header.Key, BuildHeaderValue(o)));
                         break;
                 }
             }
+        }
+
+        private static string BuildHeaderValue(object o)
+        {
+            byte[] data = o as byte[];
+
+            if (data == null) return null;
+
+            return Encoding.UTF8.GetString((byte[])o);
         }

         private static XDeadHeader BuildXDeadHeader(object o)


Many versions of recursive range.

Many versions of recursive range.

--- Src/YieldForEachApp/Program.cs
+++ Src/YieldForEachApp/Program.cs
@@ -19,35 +19,63 @@
             var timesLen = $"{times:N0}".Length;

             var fmt = string.Format(CultureInfo.InvariantCulture,
-                "{{0,10:N}} from {{1,{0}:N0}} to {{2,{1}:N0}}, {{3,{2}:N0}} times: {{4,9:N0}} ticks. Equal {{5,7:N0}}",
+                "{{0,-8:N}} from {{1,{0}:N0}} to {{2,{1}:N0}}, {{3,{2}:N0}} times: {{4,9:N0}} ticks. Equal {{5,7:N0}}",
                 bLen, endLen, timesLen);
-
-            for (var e = 1; e <= end;  e *= 2)
-            {
-                var e1 = e;
-                var time = Benchmark(times, () => FromToNestedStandart(b, e1).Sum());
-                Console.WriteLine(fmt, "Standart", b, e, times, time.Item1, time.Item2);
-            }
-
-           for (var e = 1; e <= end; e *= 2)
-            {
-                var e1 = e;
-                var time = Benchmark(times, () => FromToNestedNewHyperloop(null, b, e1).Sum());
-                Console.WriteLine(fmt, "HL", b, e, times, time.Item1, time.Item2);
-            }
-
-            for (var e = 1; e <= end; e *= 2)
-            {
-                var e1 = e;
-                var time = Benchmark(times, () => new Hyperloop<int>{{Enumerable.Range(b, e1 - b + 1)}}.Sum());
-                Console.WriteLine(fmt, "HL Range", b, e, times, time.Item1, time.Item2);
-            }

             for (var e = 1; e <= end; e *= 2)
             {
                 var e1 = e;
                 var time = Benchmark(times, () => Enumerable.Range(b, e1 - b + 1).Sum());
                 Console.WriteLine(fmt, "Range", b, e, times, time.Item1, time.Item2);
+            }
+
+            for (var e = 1; e <= end; e *= 2)
+            {
+                var e1 = e;
+                var time = Benchmark(times, () => new Hyperloop<int>{{Enumerable.Range(b, e1 - b + 1)}}.Sum());
+                Console.WriteLine(fmt, "Range HL", b, e, times, time.Item1, time.Item2);
+            }
+
+            for (var e = 1; e <= end;  e *= 2)
+            {
+                var e1 = e;
+                var time = Benchmark(times, () => RangeRecursive1(b, e1).Sum());
+                Console.WriteLine(fmt, "RR1", b, e, times, time.Item1, time.Item2);
+            }
+
+            for (var e = 1; e <= end; e *= 2)
+            {
+                var e1 = e;
+                var time = Benchmark(times, () => RangeRecursive1_Hl(b, e1).Sum());
+                Console.WriteLine(fmt, "RR1 HL", b, e, times, time.Item1, time.Item2);
+            }
+
+            for (var e = 1; e <= end;  e *= 2)
+            {
+                var e1 = e;
+                var time = Benchmark(times, () => RangeRecursive2(b, e1).Sum());
+                Console.WriteLine(fmt, "RR2", b, e, times, time.Item1, time.Item2);
+            }
+
+            for (var e = 1; e <= end; e *= 2)
+            {
+                var e1 = e;
+                var time = Benchmark(times, () => RangeRecursive2_Hl(b, e1).Sum());
+                Console.WriteLine(fmt, "RR2 HL", b, e, times, time.Item1, time.Item2);
+            }
+
+            for (var e = 1; e <= end;  e *= 2)
+            {
+                var e1 = e;
+                var time = Benchmark(times, () => RangeRecursive31(b, e1).Sum());
+                Console.WriteLine(fmt, "RR3", b, e, times, time.Item1, time.Item2);
+            }
+
+            for (var e = 1; e <= end; e *= 2)
+            {
+                var e1 = e;
+                var time = Benchmark(times, () => RangeRecursive31_Hl(b, e1).Sum());
+                Console.WriteLine(fmt, "RR3 HL", b, e, times, time.Item1, time.Item2);
             }

             Console.ReadLine();
@@ -75,30 +103,102 @@
             return Tuple.Create(sw.ElapsedTicks, res);
         }

-        static IEnumerable<int> FromToNestedStandart(int b, int e)
-        {
-            if (b > e)
-                yield break;
-            yield return b;
-            foreach(var v in FromToNestedStandart(b + 1, e))
-                yield return v;
-        }
-
-        static IEnumerable<int> FromToNestedNewHyperloop(IHyperloop<int> hl, int b, int e)
-        {
-            hl = hl ?? new Hyperloop<int>();
-            hl.Add(FromToNestedNewHyperloopImp(hl, b, e));
-            return hl;
-        }
-
-        static IEnumerable<int> FromToNestedNewHyperloopImp(IHyperloop<int> hl, int b, int e)
-        {
-            if (hl == null) throw new ArgumentNullException(nameof(hl));
-            if (b > e)
-                yield break;
-            yield return b;
-            hl.Add(FromToNestedNewHyperloopImp(hl, b+1, e));
-        }
+        static IEnumerable<int> RangeRecursive1(int b, int e)
+        {
+            if (b > e)
+                yield break;
+            yield return b;
+            foreach(var v in RangeRecursive1(b + 1, e))
+                yield return v;
+        }
+
+        static IEnumerable<int> RangeRecursive1_Hl(int b, int e)
+        {
+            var hl = new Hyperloop<int>();
+            hl.Add(RangeRecursive1_HlImp(hl, b, e));
+            return hl;
+        }
+
+        static IEnumerable<int> RangeRecursive1_HlImp(IHyperloop<int> hl, int b, int e)
+        {
+            if (b > e)
+                yield break;
+            yield return b;
+            hl.Add(RangeRecursive1_HlImp(hl, b + 1, e));
+        }
+
+        static IEnumerable<int> RangeRecursive2(int b, int e)
+        {
+            if (b > e)
+                yield break;
+            foreach(var v in RangeRecursive2(b, e - 1))
+                yield return v;
+            yield return e;
+        }
+
+        static IEnumerable<int> RangeRecursive2_Hl(int b, int e)
+        {
+            var hl = new Hyperloop<int>();
+            hl.Add(RangeRecursive2_HlImp(hl, b, e));
+            return hl;
+        }
+
+        static IEnumerable<int> RangeRecursive2_HlImp(IHyperloop<int> hl, int b, int e)
+        {
+            if (b > e)
+                yield break;
+            hl.Add(RangeRecursive2_HlImp(hl, b, e - 1));
+            yield return e;
+        }
+
+        static IEnumerable<int> RangeRecursive31(int b, int e)
+        {
+            if (b > e)
+                yield break;
+            yield return b;
+            foreach(var v in RangeRecursive32(b + 1, e))
+                yield return v;
+        }
+
+        static IEnumerable<int> RangeRecursive32(int b, int e)
+        {
+            if (b > e)
+                yield break;
+            foreach(var v in RangeRecursive31(b, e - 1))
+                yield return v;
+            yield return e;
+        }
+
+        static IEnumerable<int> RangeRecursive31_Hl(int b, int e)
+        {
+            var hl = new Hyperloop<int>();
+            hl.Add(RangeRecursive31_HlImp(hl, b, e));
+            return hl;
+        }
+
+        static IEnumerable<int> RangeRecursive31_HlImp(IHyperloop<int> hl, int b, int e)
+        {
+            if (b > e)
+                yield break;
+            yield return b;
+            hl.Add(RangeRecursive32_HlImp(hl, b + 1, e));
+        }
+
+        static IEnumerable<int> RangeRecursive32_Hl(int b, int e)
+        {
+            var hl = new Hyperloop<int>();
+            hl.Add(RangeRecursive32_HlImp(hl, b, e));
+            return hl;
+        }
+
+        static IEnumerable<int> RangeRecursive32_HlImp(IHyperloop<int> hl, int b, int e)
+        {
+            if (b > e)
+                yield break;
+            hl.Add(RangeRecursive31_HlImp(hl, b, e - 1));
+            yield return e;
+        }
+
     }

 }


Update Settings.cs

Update Settings.cs

Behavior was misspelled

--- ReoGrid/Settings.cs
+++ ReoGrid/Settings.cs
@@ -45,20 +45,20 @@
 		/// <summary>
 		/// Default Settings
 		/// </summary>
-		Default = View_Default | Behaivor_Default | View_ShowScrolls
+		Default = View_Default | Behavior_Default | View_ShowScrolls
 #if EX_SCRIPT
 			| Script_Default
 #endif // EX_SCRIPT
 			,

-		#region Behaivor
+		#region Behavior

 		/// <summary>
-		/// Default behaivor settings
+		/// Default behavior settings
 		/// </summary>
-		Behaivor_Default = 0L,
+		Behavior_Default = 0L,

-		#endregion // Behaivor
+		#endregion // Behavior

 		#region View


Make multiloger not be disposable. Better to leave disposing of the individual loggers to the DI container.

--- Reporting/Logger.cs
+++ Reporting/Logger.cs
@@ -16,20 +16,27 @@
 		/// </summary>
 		void WriteConciseHistoricalEvent(string message, params object[] args);
 	}
-	public class MultiLogger : IDisposable, ILogger
+	public class MultiLogger :ILogger
 	{
 		private readonly List<ILogger> _loggers= new List<ILogger>();
-		public void Dispose()
-		{
-			foreach (ILogger logger in _loggers)
-			{
-				IDisposable d = logger as IDisposable;
-				if(d!=null)
-					d.Dispose();
-			}
-			_loggers.Clear();
-		}
-
+
+  //          this just lead to problems.  Better to say "this doesn't own anything", and let the DI container handle the lifetimes
+//        public void Dispose()
+//        {
+//            foreach (ILogger logger in _loggers)
+//            {
+//
+//                IDisposable d = logger as IDisposable;
+//                if(d!=null)
+//                    d.Dispose();
+//            }
+//            _loggers.Clear();
+//        }
+
+		/// <summary>
+		/// NB: you must handle disposal of the logger yourself (easy with a DI container)
+		/// </summary>
+		/// <param name="logger"></param>
 		public void Add(ILogger logger)
 		{
 			_loggers.Add(logger);


Add support for named locals (indexer on Codegen), and Label(string labelName) and Goto(string labelName) methods on Codegen; examples to follow

--- RunSharp/CodeGen.cs
+++ RunSharp/CodeGen.cs
@@ -53,6 +53,8 @@
 		LocalBuilder retVar = null;
 		Label retLabel;
 		Stack<Block> blocks = new Stack<Block>();
+		Dictionary<string, Label> Labels = new Dictionary<string, Label>();
+		Dictionary<string, Operand> NamedLocals = new Dictionary<string, Operand>();

 		internal ILGenerator IL { get { return il; } }
 		internal ICodeGenContext Context { get { return context; } }
@@ -396,5 +398,62 @@
 				}
 			}
 		}
+
+		public Operand this[string localName] // Named locals support.
+		{
+			get
+			{
+				Operand target;
+				if (!NamedLocals.TryGetValue(localName, out target))
+					throw new InvalidOperationException(Properties.Messages.ErrUninitializedVarAccess);
+				return target;
+			}
+			set
+			{
+				Operand target;
+				if (NamedLocals.TryGetValue(localName, out target))
+					// run in statement form; C# left-to-right evaluation semantics "just work"
+					Assign(target, value);
+				else
+					NamedLocals.Add(localName, Local(value));
+			}
+		}
+
+		/// <summary>
+		/// DO NOT USE THIS. Declare a label with a compile-time value, not a run-time value.
+		/// </summary>
+		/// <param name="operand"></param>
+		public void Label(Operand operand, bool soValuesDontCoerceToOperand)
+		{
+			throw new InvalidOperationException("we use computed gotos only!");
+		}
+
+		/// <summary>
+		/// DO NOT USE THIS. Declare a label with a compile-time value, not a run-time value.
+		/// </summary>
+		/// <param name="operand"></param>
+		public void Goto(Operand operand, bool soValuesDontCoerceToOperand)
+		{
+			throw new InvalidOperationException("we use computed gotos only!");
+		}
+
+		// stringified object for convenience when generating label names from integral types
+		public void Label(object labelNameObject)
+		{
+			var labelName = labelNameObject.ToString();
+			Label label;
+			if (!Labels.TryGetValue(labelName, out label))
+				Labels.Add(labelName, label = IL.DefineLabel());
+			IL.MarkLabel(label);
+		}
+
+		public void Goto(object labelNameObject)
+		{
+			var labelName = labelNameObject.ToString();
+			Label label;
+			if (!Labels.TryGetValue(labelName, out label))
+				Labels.Add(labelName, label = IL.DefineLabel());
+			IL.Emit(OpCodes.Br, label);
+		}
 	}
 }


SF-4342 adding a sanity check in for status code


Fix combox Service

Fix combox Service


[Player] Bugfix: Take timestamps from unknown spawn items to.

Signed-off-by: Juri Berlanda <5bfdca9e82c53adb0603ce7083f4ba4f2da5cacf@hotmail.com>

--- ScreenPlayPlayer.cs
+++ ScreenPlayPlayer.cs
@@ -93,8 +93,8 @@
 		foreach (ScreenPlayItem item in _screenPlay.getItems()) {
 			spawner = getSpawnerForItem(item);

+			currentTime = getNextTimestamp(currentTime, item.delay);
 			if (spawner != null) {
-				currentTime = getNextTimestamp(currentTime, item.delay);
 				Debug.Log("Spawning " + item + " after " + currentTime);
 				spawner.spawnDelayed(currentTime);
 			}


Added a dynamic control loader

Added a dynamic control loader

--- tronpon/tronpon/Pages/content.aspx.cs
+++ tronpon/tronpon/Pages/content.aspx.cs
@@ -4,6 +4,7 @@
 using System.Web;
 using System.Web.UI;
 using System.Web.UI.WebControls;
+using System.Web.UI.HtmlControls;
 using System.Data;
 using GUI_Handler;

@@ -18,6 +19,7 @@
             int lowerLimit = pageNumber * 9;
             int maxLimit = (pageNumber + 1) * 9;
             List<string> content = Handler.GetContent(maxLimit, lowerLimit);
+            VisualizeContent(content);
         }

         protected void btnPrevPage_Click(object sender, EventArgs e)
@@ -32,8 +34,18 @@

         public void VisualizeContent(List<string> content)
         {
-            imageOutboundUrl1.HRef = content[0];
-            image1.Src = content[0];
+            for (int i = 1; i < 10; i++)
+            {
+                string contextIndex = content[i - 1];
+
+                if (!String.IsNullOrWhiteSpace(contextIndex))
+                {
+                    HtmlAnchor imgOb = (HtmlAnchor)Page.FindControl("imageOutboundUrl" + i);
+                    imgOb.HRef = contextIndex;
+                    HtmlImage img = (HtmlImage)Page.FindControl("image" + i);
+                    img.Src = contextIndex;
+                }
+            }
         }
     }
 }


add cap started and shotdown log.

add cap started and shotdown log.

--- src/DotNetCore.CAP/IBootstrapper.Default.cs
+++ src/DotNetCore.CAP/IBootstrapper.Default.cs
@@ -59,6 +59,8 @@

         private async Task BootstrapTaskAsync()
         {
+            _logger.LogInformation("### CAP starting...");
+
             await Storage.InitializeAsync(_cts.Token);

             if (_cts.IsCancellationRequested)
@@ -83,6 +85,8 @@

             _ctsRegistration.Dispose();
             _cts.Dispose();
+
+            _logger.LogInformation("### CAP started!");
         }

         protected virtual Task BootstrapCoreAsync()


Added Run extension methods for WindowsIdentity to run methods as an impersonated identity on any platform.

--- Security/AccountUtils.cs
+++ Security/AccountUtils.cs
@@ -1,4 +1,5 @@
-using System.Security.Principal;
+using System;
+using System.Security.Principal;

 namespace Vanara.Security
 {
@@ -18,6 +19,35 @@
 			}
 			catch { }
 			return false;
+		}
+
+		/// Runs the specified function as the impersonated Windows identity.
+		/// <param name="identity">The impersonated identity under which to run the function.</param>
+		/// <param name="func">The System.Func to run.</param>
+		public static void Run(this WindowsIdentity identity, Action func)
+		{
+			if (identity is null) func();
+#if NET20 || NET35 || NET40 || NET45
+			using (new Principal.WindowsImpersonatedIdentity(identity))
+				func();
+#else
+			WindowsIdentity.RunImpersonated(identity.AccessToken, func);
+#endif
+		}
+		/// Runs the specified function as the impersonated Windows identity.
+		/// <typeparam name="T">The type of object used by and returned by the function.</typeparam>
+		/// <param name="identity">The impersonated identity under which to run the function.</param>
+		/// <param name="func">The System.Func to run.</param>
+		/// <returns>The result of the function.</returns>
+		public static T Run<T>(this WindowsIdentity identity, Func<T> func)
+		{
+			if (identity is null) return func();
+#if NET20 || NET35 || NET40 || NET45
+			using (new Principal.WindowsImpersonatedIdentity(identity))
+				return func();
+#else
+			return WindowsIdentity.RunImpersonated(identity.AccessToken, func);
+#endif
 		}

 		public static string SidStringFromUserName(string userName)


TSI-1638 Changed URL pattern for NavigationController.GetNavigationSubtree (TSI-1931)

--- Site/Global.asax.cs
+++ Site/Global.asax.cs
@@ -76,8 +76,16 @@
             ).DataTokens.Add("area", "Core");

             // Navigation subtree
-            routes.MapRoute("NavSubtree", "navigation/{sitemapItemId}", new { controller = "Navigation", action = "GetNavigationSubtree", sitemapItemId = UrlParameter.Optional });
-            routes.MapRoute("NavSubtree_Loc", "{localization}/navigation/{sitemapItemId}", new { controller = "Navigation", action = "GetNavigationSubtree", sitemapItemId = UrlParameter.Optional });
+            routes.MapRoute(
+                "NavSubtree",
+                "api/navigation/subtree/{sitemapItemId}",
+                new { controller = "Navigation", action = "GetNavigationSubtree", sitemapItemId = UrlParameter.Optional }
+                );
+            routes.MapRoute(
+                "NavSubtree_Loc",
+                "{localization}/api/navigation/subtree/{sitemapItemId}",
+                new { controller = "Navigation", action = "GetNavigationSubtree", sitemapItemId = UrlParameter.Optional }
+                );

             // For resolving ids to urls
             routes.MapRoute(


Fixed bug triggered by incomplete rar file.

--- SharpCompress/Utility.cs
+++ SharpCompress/Utility.cs
@@ -146,7 +146,7 @@
                     readCount = (int)advanceAmount;
                 }
                 read = source.Read(buffer, 0, readCount);
-                if (read < 0)
+                if (read == 0)
                 {
                     break;
                 }


Rename ShouldNotEqual to ShouldNotBe.

Rename ShouldNotEqual to ShouldNotBe.

--- src/Fixie.Assertions/AssertionExtensions.cs
+++ src/Fixie.Assertions/AssertionExtensions.cs
@@ -59,10 +59,10 @@

         public static void ShouldNotBeNull<T>(this T @object) where T : class
         {
-            @object.ShouldNotEqual(null);
+            @object.ShouldNotBe(null);
         }

-        public static void ShouldNotEqual<T>(this T actual, T expected)
+        public static void ShouldNotBe<T>(this T actual, T expected)
         {
             if (Assert.Equal(expected, actual))
                 throw new AssertException($"Unexpected: {Format(expected)}");


Remove unused constructor overload.

Remove unused constructor overload.

--- src/Fixie/Internal/Listeners/PipeMessage.cs
+++ src/Fixie/Internal/Listeners/PipeMessage.cs
@@ -136,13 +136,6 @@
                 StackTrace = exception.LiterateStackTrace();
             }

-            public ExceptionSummary(string type, string message, string stackTrace)
-            {
-                Type = type;
-                Message = message;
-                StackTrace = stackTrace;
-            }
-
             ExceptionSummary() { /* Trust Deserialization */ }

             public string Type { get; set; } = default!;


Fixing conditionals

Fixing conditionals

--- src/GitHub.Api/NewTaskSystem/ProcessTask.cs
+++ src/GitHub.Api/NewTaskSystem/ProcessTask.cs
@@ -78,21 +78,6 @@

         public void Run()
         {
-            if (!Process.StartInfo.RedirectStandardOutput)
-            {
-                throw new ArgumentException("Process must RedirectStandardOutput");
-            }
-
-            if (!Process.StartInfo.RedirectStandardError)
-            {
-                throw new ArgumentException("Process must RedirectStandardError");
-            }
-
-            if (!Process.StartInfo.CreateNoWindow)
-            {
-                throw new ArgumentException("Process must CreateNoWindow");
-            }
-
             try
             {
                 Process.Start();
@@ -120,48 +105,57 @@

             onStart?.Invoke();

-            var outputStream = Process.StandardOutput;
-            var line = outputStream.ReadLine();
-            while (line != null)
+            if (Process.StartInfo.CreateNoWindow)
             {
-                outputProcessor.LineReceived(line);
-
-                if (token.IsCancellationRequested)
-                {
-                    if (!Process.HasExited)
-                        Process.Kill();
-
-                    Process.Close();
-                    onEnd?.Invoke();
-                    token.ThrowIfCancellationRequested();
+                if (Process.StartInfo.RedirectStandardOutput)
+                {
+                    var outputStream = Process.StandardOutput;
+                    var line = outputStream.ReadLine();
+                    while (line != null)
+                    {
+                        outputProcessor.LineReceived(line);
+
+                        if (token.IsCancellationRequested)
+                        {
+                            if (!Process.HasExited)
+                                Process.Kill();
+
+                            Process.Close();
+                            onEnd?.Invoke();
+                            token.ThrowIfCancellationRequested();
+                        }
+
+                        line = outputStream.ReadLine();
+                    }
+                    outputProcessor.LineReceived(null);
                 }

-                line = outputStream.ReadLine();
-            }
-            outputProcessor.LineReceived(null);
-
-            var errorStream = Process.StandardError;
-            var errorLine = errorStream.ReadLine();
-            while (errorLine != null)
-            {
-                errors.Add(errorLine);
-
-                if (token.IsCancellationRequested)
-                {
-                    if (!Process.HasExited)
-                        Process.Kill();
-
-                    Process.Close();
-                    onEnd?.Invoke();
-                    token.ThrowIfCancellationRequested();
+                if (!Process.StartInfo.RedirectStandardError)
+                {
+                    var errorStream = Process.StandardError;
+                    var errorLine = errorStream.ReadLine();
+                    while (errorLine != null)
+                    {
+                        errors.Add(errorLine);
+
+                        if (token.IsCancellationRequested)
+                        {
+                            if (!Process.HasExited)
+                                Process.Kill();
+
+                            Process.Close();
+                            onEnd?.Invoke();
+                            token.ThrowIfCancellationRequested();
+                        }
+
+                        errorLine = errorStream.ReadLine();
+                    }
+
+                    if (Process.ExitCode != 0 && errors.Count > 0)
+                    {
+                        onError?.Invoke(null, string.Join(Environment.NewLine, errors.ToArray()));
+                    }
                 }
-
-                errorLine = errorStream.ReadLine();
-            }
-
-            if (Process.ExitCode != 0 && errors.Count > 0)
-            {
-                onError?.Invoke(null, string.Join(Environment.NewLine, errors.ToArray()));
             }

             onEnd?.Invoke();


Fixing incorrect namespace

Fixing incorrect namespace

--- src/Greentube.Monitoring/IVersionService.cs
+++ src/Greentube.Monitoring/IVersionService.cs
@@ -1,4 +1,4 @@
-namespace Greentube.Monitoring.AspNetCore
+namespace Greentube.Monitoring
 {
     /// <summary>
     /// Version information of the running service


Fixed a bug in the MVMAX command parsing.

--- src/I8Beef.Denon/Commands/CommandFactory.cs
+++ src/I8Beef.Denon/Commands/CommandFactory.cs
@@ -11,7 +11,7 @@

             if (commandString.StartsWith("MV"))
             {
-                if (!commandString.StartsWith("MVMAX"))
+                if (commandString.StartsWith("MVMAX"))
                     return null;

                 return VolumeCommand.Parse(commandString);


Small fix for unit tests

Small fix for unit tests

--- src/Kephas.Core/Services/IContextFactory.cs
+++ src/Kephas.Core/Services/IContextFactory.cs
@@ -81,7 +81,7 @@
                 return factory.LogManager;
             }

-            return logManagerMap.GetOrAdd(contextFactory, _ => contextFactory.CreateContext<Context>().AmbientServices.LogManager);
+            return logManagerMap.GetOrAdd(contextFactory, _ => contextFactory.CreateContext<Context>()?.AmbientServices.LogManager);
         }
     }
 }


ParallelTasks.ForEachAsyncWorker: dynamic tasksInFlight sizing for large MaxDegreeOfParallelism values

--- src/Kirkin/Threading/Tasks/ParallelTasks.cs
+++ src/Kirkin/Threading/Tasks/ParallelTasks.cs
@@ -226,7 +226,12 @@
                     return;
                 }

-                List<TTask> tasksInFlight = new List<TTask>(parallelOptions.MaxDegreeOfParallelism);
+                List<TTask> tasksInFlight = (parallelOptions.MaxDegreeOfParallelism < 1024)
+                    ? new List<TTask>(parallelOptions.MaxDegreeOfParallelism)
+                    // Avoid large array allocation if the user specifies an
+                    // unrealistic MaxDegreeOfParallelism (i.e. int.MaxValue).
+                    : new List<TTask>();
+
                 List<Task> faultedTasks = null;

                 try
@@ -257,7 +262,9 @@
                         }
                         catch
                         {
-                            if (faultedTasks == null) faultedTasks = new List<Task>();
+                            if (faultedTasks == null) {
+                                faultedTasks = new List<Task>();
+                            }

                             // Exception will be rethrown inside "finally" if necessary.
                             faultedTasks.Add(fullCompletion);


finished disconnectclient tests

finished disconnectclient tests

--- test/JabbR-Core.Tests/Services/ChatServiceTest.cs
+++ test/JabbR-Core.Tests/Services/ChatServiceTest.cs
@@ -1381,7 +1381,68 @@
             _repository.Remove(otherAdmin);
         }

-        //
+        //DisconnectClient tests
+        [Fact]
+        public void RemovesClientFromUserClientList()
+        {
+            var user = new ChatUser
+            {
+                Name = "foo",
+                Status = (int)UserStatus.Inactive
+            };
+            user.ConnectedClients.Add(new ChatClient
+            {
+                Id = "foo",
+                UserKeyNavigation = user
+            });
+
+            user.ConnectedClients.Add(new ChatClient
+            {
+                Id = "bar",
+                UserKeyNavigation = user
+            });
+
+            _repository.Add(user);
+
+            chatService.DisconnectClient("foo");
+
+            Assert.Equal(1, user.ConnectedClients.Count);
+            Assert.Equal("bar", user.ConnectedClients.First().Id);
+
+            _repository.Remove(user);
+        }
+
+        [Fact]
+        public void MarksUserAsOfflineIfNoMoreClients()
+        {
+            var user = new ChatUser
+            {
+                Id = "userId",
+                Name = "foo",
+                Status = (int)UserStatus.Inactive
+            };
+            user.ConnectedClients.Add(new ChatClient
+            {
+                Id = "foo",
+                UserKeyNavigation = user
+            });
+
+            _repository.Add(user);
+
+            string userId = chatService.DisconnectClient("foo");
+
+            Assert.Equal(0, user.ConnectedClients.Count);
+            Assert.Equal("userId", userId);
+            Assert.Equal((int)UserStatus.Offline, user.Status);
+
+            _repository.Remove(user);
+        }
+
+        //LockRoom tests
+
+
+
+        //

         //rest of functions to test
         public void AddAdmin(ChatUser admin, ChatUser targetUser)


Try shorter test names

Try shorter test names

--- test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs
+++ test/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs
@@ -365,7 +365,7 @@
         }

         [Fact]
-        public void ItPrefersTheValueOfApplicationUrlFromEnvironmentVariablesOverTheProperty()
+        public void ItPrefersTheValueOfAppUrlFromEnvVarOverTheProp()
         {
             var testAppName = "AppWithApplicationUrlInLaunchSettings";
             var testInstance = TestAssets.Get(testAppName)
@@ -395,7 +395,7 @@
         }

         [Fact]
-        public void ItUsesTheValueOfApplicationUrlIfTheEnvironmentVariableIsNotSet()
+        public void ItUsesTheValueOfAppUrlIfTheEnvVarIsNotSet()
         {
             var testAppName = "AppWithApplicationUrlInLaunchSettings";
             var testInstance = TestAssets.Get(testAppName)


Display different MovingImage when the Y-coordinate of a target square == 0. What MovingImage is displayed depends on the quadrant of the target square the mouse is hovering above.

--- Sandra.UI.WF/StandardChessBoardForm.cs
+++ Sandra.UI.WF/StandardChessBoardForm.cs
@@ -17,6 +17,7 @@
  *
  *********************************************************************************/
 using System.Drawing;
+using System.Windows.Forms;

 namespace Sandra.UI.WF
 {
@@ -40,12 +41,94 @@
             PlayingBoard.BoardWidth = Chess.Constants.SquareCount;
             PlayingBoard.BoardHeight = Chess.Constants.SquareCount;

+            PlayingBoard.MouseMove += playingBoard_MouseMove;
             PlayingBoard.MouseEnterSquare += playingBoard_MouseEnterSquare;
             PlayingBoard.MouseLeaveSquare += playingBoard_MouseLeaveSquare;
             PlayingBoard.MoveCancel += playingBoard_MoveCancel;
             PlayingBoard.MoveCommit += playingBoard_MoveCommit;
         }

+        /// <summary>
+        /// Identifies a quadrant of a square.
+        /// </summary>
+        private enum SquareQuadrant
+        {
+            /// <summary>
+            /// Either there is no active quadrant, or the square size is too small to subdivide into non-empty quadrants.
+            /// </summary>
+            Indeterminate,
+
+            TopLeft,
+            TopRight,
+            BottomLeft,
+            BottomRight,
+        }
+
+        private Chess.NonEmptyColoredPiece getPromoteToPiece(SquareQuadrant quadrant)
+        {
+            switch (quadrant)
+            {
+                case SquareQuadrant.TopLeft:
+                    return Chess.NonEmptyColoredPiece.WhiteRook;
+                case SquareQuadrant.TopRight:
+                    return Chess.NonEmptyColoredPiece.WhiteBishop;
+                case SquareQuadrant.BottomRight:
+                    return Chess.NonEmptyColoredPiece.WhiteKnight;
+                case SquareQuadrant.BottomLeft:
+                case SquareQuadrant.Indeterminate:
+                default:
+                    return Chess.NonEmptyColoredPiece.WhiteQueen;
+            }
+        }
+
+        private SquareQuadrant hoverQuadrant;
+
+        private void updateHoverQuadrant(SquareQuadrant value)
+        {
+            if (hoverQuadrant != value)
+            {
+                hoverQuadrant = value;
+                if (value == SquareQuadrant.Indeterminate)
+                {
+                    PlayingBoard.MovingImage = null;
+                }
+                else
+                {
+                    PlayingBoard.MovingImage = PieceImages[getPromoteToPiece(value)];
+                }
+            }
+        }
+
+        private void playingBoard_MouseMove(object sender, MouseEventArgs e)
+        {
+            if (PlayingBoard.IsMoving && PlayingBoard.HoverSquare != null && PlayingBoard.HoverSquare.Y == 0)
+            {
+                Rectangle hoverSquareRectangle = PlayingBoard.GetSquareRectangle(PlayingBoard.HoverSquare);
+                SquareQuadrant hitQuadrant = SquareQuadrant.Indeterminate;
+                if (hoverSquareRectangle.Contains(e.X, e.Y))
+                {
+                    int squareSize = PlayingBoard.SquareSize;
+                    if (squareSize >= 2)
+                    {
+                        int halfSquareSize = (squareSize + 1) / 2;
+                        if (e.X - hoverSquareRectangle.Left < halfSquareSize)
+                        {
+                            hitQuadrant = e.Y - hoverSquareRectangle.Top < halfSquareSize
+                                        ? SquareQuadrant.TopLeft
+                                        : SquareQuadrant.BottomLeft;
+                        }
+                        else
+                        {
+                            hitQuadrant = e.Y - hoverSquareRectangle.Top < halfSquareSize
+                                        ? SquareQuadrant.TopRight
+                                        : SquareQuadrant.BottomRight;
+                        }
+                    }
+                }
+                updateHoverQuadrant(hitQuadrant);
+            }
+        }
+
         private void playingBoard_MouseEnterSquare(object sender, SquareEventArgs e)
         {
             if (PlayingBoard.IsMoving)
@@ -60,6 +143,7 @@

         private void playingBoard_MouseLeaveSquare(object sender, SquareEventArgs e)
         {
+            updateHoverQuadrant(SquareQuadrant.Indeterminate);
             if (PlayingBoard.IsMoving)
             {
                 PlayingBoard.SetSquareOverlayColor(e.Location.X, e.Location.Y, Color.FromArgb(48, 255, 190, 0));


Make address constructor public

Make address constructor public

--- Styx/Illias/Helpers/Address.cs
+++ Styx/Illias/Helpers/Address.cs
@@ -161,16 +161,16 @@
         /// <param name="Comment">An optional text/comment to describe the address.</param>
         ///
         /// <param name="CustomData">An optional dictionary of customer-specific data.</param>
-        private Address(String                               Street,
-                        String                               HouseNumber,
-                        String                               FloorLevel,
-                        String                               PostalCode,
-                        String                               PostalCodeSub,
-                        I18NString                           City,
-                        Country                              Country,
-                        I18NString                           Comment      = null,
-
-                        IReadOnlyDictionary<String, Object>  CustomData   = null)
+        public Address(String                               Street,
+                       String                               HouseNumber,
+                       String                               FloorLevel,
+                       String                               PostalCode,
+                       String                               PostalCodeSub,
+                       I18NString                           City,
+                       Country                              Country,
+                       I18NString                           Comment      = null,
+
+                       IReadOnlyDictionary<String, Object>  CustomData   = null)

             : base(CustomData)


add setter

add setter

--- Svelto.ECS/EntityDescriptor.cs
+++ Svelto.ECS/EntityDescriptor.cs
@@ -17,7 +17,7 @@
             this.entityViewsToBuild = entityViewsToBuild;
         }

-        public IEntityViewBuilder[] entityViewsToBuild { get; }
+        public IEntityViewBuilder[] entityViewsToBuild { get; private set;  }
     }

     public interface IEntityDescriptorInfo


Check invoke command length

Check invoke command length

--- Sync/Command/CommandManager.cs
+++ Sync/Command/CommandManager.cs
@@ -20,6 +20,7 @@

         public void invokeCmdString(string cmd)
         {
+            if (cmd.Length == 0) return;
             string[] args = cmd.Split(" ".ToCharArray(), 2);

             if(args.Length < 1 )


More missing uniform assignments for the instancing shader

--- TestBench0/Main_renderScene.cs
+++ TestBench0/Main_renderScene.cs
@@ -44,6 +44,8 @@
 			mainShader.Activate();
 			mainShader.UniAnimateSecondsOffset = (float)animateSecondsOffset;

+			instancingShader.Activate ();
+			instancingShader.UniAnimateSecondsOffset = (float)animateSecondsOffset;

 			/////////////////////////////////////////
 			// clear the render buffer....
@@ -202,6 +204,9 @@
 			mainShader.Activate();
 			mainShader.UniWinScale = ClientRectangle;

+			instancingShader.Activate ();
+			instancingShader.UniWinScale = ClientRectangle;
+
 			saveClientWindowLocation ();
 		}


simple unit test of distribution calculation

--- Tests.Analytics/UnitTesting.cs
+++ Tests.Analytics/UnitTesting.cs
@@ -33,6 +33,35 @@
 				Assert.IsTrue(res.UpperQuartile == 40M);
 			}
 		}
+
+		[Test]
+		public void TestDistributionCalculation()
+		{
+			{
+				var data = new[] { 0M, 0.1M, 0.6M, 0.8M, 1.1M, 2.2M, 2.4M, };
+				var distribution = Stats.CalculateDistribution(data, 0.5M);
+				var sample = new SortedDictionary<decimal, decimal>
+				    {
+						{ 0, 1 },
+				        { 0.5M, 1 },
+						{ 1, 2 },
+						{ 1.5M, 1 },
+						{ 2.5M, 2 }
+				    };
+				Assert.IsTrue(distribution.Vals.SequenceEqual(sample));
+			}
+
+			{
+				var data = new[] { 0M, 0.1M, 0.2M, 0.21M, 0.25M };
+				var distribution = Stats.CalculateDistribution(data, 0.2M);
+				var sample = new SortedDictionary<decimal, decimal>
+				    {
+				        { 0, 1 },
+						{ 0.2M, 2 },
+						{ 0.4M, 2 },
+				    };
+				Assert.IsTrue(distribution.Vals.SequenceEqual(sample));
+			}
 		}
 	}
 }


Banned victims SHOULD now be automaticly removed from victims.json file

--- Titan/Logging/VictimTracker.cs
+++ Titan/Logging/VictimTracker.cs
@@ -2,7 +2,7 @@
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
-using System.Text;
+using System.Linq;
 using Eto.Forms;
 using Newtonsoft.Json;
 using Quartz;
@@ -76,11 +76,14 @@

         public void SaveVictimsFile()
         {
-            using(var writer = new StreamWriter(_file.OpenWrite(), Encoding.UTF8))
+            using(var writer = new StreamWriter(_file.ToString(), false))
             {
+                // TODO: Change this ugly workaround
+
                 var victims = new Victims
                 {
-                    Array = _victims.ToArray()
+                    Array = (from victim in _victims let bans = Titan.Instance.BanManager.GetBanInfoFor(SteamUtil.FromSteamID64(victim.SteamID))
+                        where !(bans.GameBanCount > 0 || bans.VacBanned) select victim).ToArray()
                 };

                 writer.Write(JsonConvert.SerializeObject(victims, Formatting.Indented));
@@ -106,27 +109,28 @@
                 {
                     var count = bans.GameBanCount == 0 ? bans.VacBanCount : bans.GameBanCount;
                     var id64 = target.ConvertToUInt64();
-
-                    _victims.Remove(victim);
-
-                    _log.Information("Your recently botted target {Target} received " +
-                                     "{Count} ban(s) after {Delay}. Thank you for using Titan.",
-                        id64, count, time.Hours == 0 ? time.Minutes + " minute(s)" : time.Hours + " hour(s)");
-
-                    var notification = new Notification
+
+                    if(_victims.Remove(victim))
                     {
-                        Title = "Titan - " + id64 + " banned",
-                        Message = "Your recently botted target " + id64 + " " +
-                                  "has been banned and has now " + count + " Ban(s) on record.",
-                        Icon = Titan.Instance.UIManager.SharedResources.TITAN_ICON
-                    };
-
-                    notification.Activated += delegate
-                    {
-                        Process.Start("https://steamcommunity.com/profiles/" + id64 + "/");
-                    };
+                        _log.Information("Your recently botted target {Target} received " +
+                                         "{Count} ban(s) after {Delay}. Thank you for using Titan.",
+                            id64, count, time.Hours == 0 ? time.Minutes + " minute(s)" : time.Hours + " hour(s)");

-                    Application.Instance.Invoke(() => notification.Show());
+                        var notification = new Notification
+                        {
+                            Title = "Titan - " + id64 + " banned",
+                            Message = "Your recently botted target " + id64 + " " +
+                                      "has been banned and has now " + count + " Ban(s) on record.",
+                            Icon = Titan.Instance.UIManager.SharedResources.TITAN_ICON
+                        };
+
+                        notification.Activated += delegate
+                        {
+                            Process.Start("https://steamcommunity.com/profiles/" + id64 + "/");
+                        };
+
+                        Application.Instance.Invoke(() => notification.Show());
+                    }
                 }
             }
         }


Implement the edit category method

Implement the edit category method

--- Todo-List/Todo-List/Program.cs
+++ Todo-List/Todo-List/Program.cs
@@ -193,7 +193,18 @@
         /// <param name="cmd"> The command inputted. </param>
         public static void EditCategory(string cmd)
         {
-
+            string name = GetName(cmd);
+
+            int noteIndex = NoteSorter.NoteIndex(name);
+            if (noteIndex == -1)
+            {
+                // Throw error if note doesn't exists
+                throw new Exception("No note found under the provided name!");
+            }
+
+            // Edit the categories of the note
+            string[] categories = GetCategories(cmd, cmd.IndexOf('"') + name.Length + 3);
+            NoteSorter.Notes[noteIndex].Categories = categories;
         }

         /// <summary>


Write edit function

Write edit function

Implement some code for the edit function to ru.

--- Todo-List/Todo-List/Program.cs
+++ Todo-List/Todo-List/Program.cs
@@ -26,7 +26,7 @@

                 Console.Write(">>> ");
                 string cmd = Console.ReadLine();
-                switch (cmd.Split(new char[] { ' ' })[0])
+                switch (cmd.Split(' ')[0])
                 {
                     case "/a":
                         Add(cmd);
@@ -127,7 +127,6 @@
         /// <param name="cmd"> The command inputted. </param>
         public static void View(string cmd)
         {
-
         }

         /// <summary>
@@ -164,7 +163,27 @@
         /// <param name="cmd"> The command inputted. </param>
         public static void Edit(string cmd)
         {
-
+            try
+            {
+                string oldName = cmd.Split(new char[] { '"' }, StringSplitOptions.RemoveEmptyEntries)[1];
+                string newName = cmd.Split(new char[] { '"' }, StringSplitOptions.RemoveEmptyEntries)[3];
+
+                int oldNoteIndex = NoteSorter.NoteIndex(oldName);
+                if (oldNoteIndex != -1)
+                {
+                    Note oldNote = NoteSorter.Notes[oldNoteIndex];
+                    Note newNote = new Note(newName, oldNote.Categories);
+                    NoteSorter.EditNote(oldNote, newNote);
+                }
+                else
+                {
+                    Console.WriteLine("Error! No note was found.");
+                }
+            }
+            catch (IndexOutOfRangeException)
+            {
+                Console.WriteLine("Error! An arguement was missing from the command.");
+            }
         }

         /// <summary>


made TreeResult sorted by configuration path.

--- Tweek.ApiService/TreeResult.cs
+++ Tweek.ApiService/TreeResult.cs
@@ -23,19 +23,19 @@

     public class TreeBuilder
     {
-        private readonly Dictionary<string, object> _dictionary;
+        private readonly SortedDictionary<string, object> _dictionary;

         public TreeBuilder()
         {
-            _dictionary = new Dictionary<string, object>();
+            _dictionary = new SortedDictionary<string,object>();
         }

-        private Dictionary<string, object> GetOrCreateContainer(IEnumerable<string> indexes)
+        private SortedDictionary<string, object> GetOrCreateContainer(IEnumerable<string> indexes)
         {
             return indexes.Aggregate(_dictionary, (a, b) =>
             {
-                if (!a.ContainsKey(b)) a[b] = new Dictionary<string, object>();
-                return a[b] as Dictionary<string, object>;
+                if (!a.ContainsKey(b)) a[b] = new SortedDictionary<string, object>();
+                return a[b] as SortedDictionary<string, object>;
             });
         }


How to get full path for all project items.

--- VSYard/VSYard/VSYardPackage.cs
+++ VSYard/VSYard/VSYardPackage.cs
@@ -87,6 +87,7 @@

         public int OnAfterOpenSolution(object pUnkReserved, int fNewSolution)
         {
+            var paths = "";
             var m_dte = (EnvDTE.DTE)this.GetService(typeof(EnvDTE.DTE));
             if (m_dte == null)
                 ErrorHandler.ThrowOnFailure(1);
@@ -96,6 +97,11 @@
                 foreach (EnvDTE.Project i in m_dte.Solution.Projects)
                 {
                     Trace.WriteLine(i.FullName);
+                    foreach (EnvDTE.ProjectItem pi in i.ProjectItems)
+                    {
+                        paths += pi.Properties.Item("FullPath").Value;
+                        paths += ";\n";
+                    }
                 }
             }
             return VSConstants.S_OK;


[DEV] Fixed OnDisconnected being called twice when the connection timed out, this may have been the cause of several of the recently reported bugs

git-svn-id: b16d2c2f79895eba805d8254311bfe28536746dd@1472 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife/NetworkManager.cs
+++ libsecondlife/NetworkManager.cs
@@ -760,19 +760,6 @@
                     // Shutdown the network layer
                     Shutdown(DisconnectType.NetworkTimeout);

-                    if (OnDisconnected != null)
-                    {
-                        try
-                        {
-                            OnDisconnected(DisconnectType.NetworkTimeout, String.Empty);
-                        }
-                        catch (Exception e)
-                        {
-                            Client.Log("Caught an exception in OnDisconnected(): " + e.ToString(),
-                                Helpers.LogLevel.Error);
-                        }
-                    }
-
                     // We're completely logged out and shut down, leave this function
                     return;
                 }


0000124: [patch] when calling Primitive.ParticleSystem.GetBytes(), PartMaxAge is never packed up. MaxAge is packed up twice - From Teravus

git-svn-id: baf6e02d125cf6f9bfcfe153b2eb83d6e1f5ace6@1630 52acb1d6-8a22-11de-b505-999d5b087335

--- libsecondlife/ParticleSystem.cs
+++ libsecondlife/ParticleSystem.cs
@@ -241,7 +241,7 @@
                 pack.PackUUID(Target);

                 pack.PackBits((uint)PartDataFlags, 32);
-                pack.PackFixed(MaxAge, false, 8, 8);
+                pack.PackFixed(PartMaxAge, false, 8, 8);
                 pack.PackColor(PartStartColor);
                 pack.PackColor(PartEndColor);
                 pack.PackFixed(PartStartScaleX, false, 3, 5);


Fixed minor 500 server error bug!

Fixed minor 500 server error bug!

--- ApplicationSkeleton/Application.Web/Controllers/ProfileController.cs
+++ ApplicationSkeleton/Application.Web/Controllers/ProfileController.cs
@@ -102,7 +102,7 @@
             return this.File(image.Content, "image/" + image.FileExtension);
         }

-        public JsonResult RefreshTowns(int id)
+        public JsonResult RefreshTowns(int? id)
         {
             var items =
                 new SelectList(this.Data.Towns.All().Where(x => x.CountryId == id).ToList(), "Id", "Name");


Removing redundant debug message.

Removing redundant debug message.

--- Assets/HoloToolkit-Examples/UX/Scripts/OptimizeSceneforDeviceType.cs
+++ Assets/HoloToolkit-Examples/UX/Scripts/OptimizeSceneforDeviceType.cs
@@ -21,7 +21,6 @@
             // Check if the device type is HoloLens or Immersive HMD
             if (HolographicSettings.IsDisplayOpaque)
             {
-                Debug.Log("*********************** IHMD ************************************");
                 // Set camera clear flags to skybox for IHMD, show floor and table
                 cameraObject.clearFlags = CameraClearFlags.Skybox;
                 environmentObject.SetActive(true);
@@ -31,7 +30,6 @@
             }
             else
             {
-                Debug.Log("*********************** HOLOLENS ************************************");
                 // Set camera clear flags to solid color for HoloLens, hide floor and table
                 cameraObject.clearFlags = CameraClearFlags.SolidColor;
                 environmentObject.SetActive(false);


Update ListCategories.cshtml

Update ListCategories.cshtml

--- AstroPhotoGallery/AstroPhotoGallery/Views/Home/ListCategories.cshtml
+++ AstroPhotoGallery/AstroPhotoGallery/Views/Home/ListCategories.cshtml
@@ -7,27 +7,28 @@

Browse by categories

-

+

     @foreach (var category in Model)
     {

-                @if (category.Pictures.Any(p => p.CategoryId == category.Id))
-                {
-                     p.CategoryId == category.Id).FirstOrDefault().ImagePath)" style="width: 360px; height:270px" >
-                }
-                else
-                {
-
-                }
-
-

-

-                        @Html.ActionLink(string.Format($"{category.Name} ({category.Pictures.Count})"),
-                                "ListPictures", "Home", new { @categoryId = category.Id }, null)
-

-

+
+                    @if (category.Pictures.Any(p => p.CategoryId == category.Id))
+                    {
+                         p.CategoryId == category.Id).FirstOrDefault().ImagePath)" style="width: 360px; height:270px">
+                    }
+                    else
+                    {
+
+                    }
+
+

+

+                            @string.Format($"{category.Name} ({category.Pictures.Count()})")
+

+

+

     }


Fix keymap check

Fix keymap check

--- SnakeMess/Player.cs
+++ SnakeMess/Player.cs
@@ -5,8 +5,6 @@

     public class Player
     {
-        private readonly KeyMapping keyMap;
-
         public Player(int id)
         {
             Id = id;
@@ -15,11 +13,11 @@
             {
                 case 1:
                     Color = ConsoleColor.Green;
-                    keyMap = new KeyMapping(ConsoleKey.UpArrow, ConsoleKey.DownArrow, ConsoleKey.LeftArrow, ConsoleKey.RightArrow);
+                    KeyMap = new KeyMapping(ConsoleKey.UpArrow, ConsoleKey.DownArrow, ConsoleKey.LeftArrow, ConsoleKey.RightArrow);
                     break;
                 case 2:
                     Color = ConsoleColor.Blue;
-                    keyMap = new KeyMapping(ConsoleKey.W, ConsoleKey.S, ConsoleKey.A, ConsoleKey.D);
+                    KeyMap = new KeyMapping(ConsoleKey.W, ConsoleKey.S, ConsoleKey.A, ConsoleKey.D);
                     break;
             }
         }
@@ -43,19 +41,19 @@
             }

             var keyPushed = Console.ReadKey(true);
-            if (keyPushed.Equals(this.keyMap.Up))
+            if (keyPushed.Key == KeyMap.Up && Snake.Direction != Direction.Down)
             {
                 Debug.Write("Up");
             }
-            else if (keyPushed.Equals(this.keyMap.Down))
+            else if (keyPushed.Key == KeyMap.Down && Snake.Direction != Direction.Up)
             {
                 Debug.Write("Down");
             }
-            else if (keyPushed.Equals(this.keyMap.Left))
+            else if (keyPushed.Key == KeyMap.Left && Snake.Direction != Direction.Right)
             {
                 Debug.Write("Left");
             }
-            else if (keyPushed.Equals(this.keyMap.Left))
+            else if (keyPushed.Key == KeyMap.Right && Snake.Direction != Direction.Right)
             {
                 Debug.Write("Right");
             }


contacts controller functions added

contacts controller functions added

--- CRM_Project_C/Source/CRM.WebApi/Infrastructure/ApplicationManager.cs
+++ CRM_Project_C/Source/CRM.WebApi/Infrastructure/ApplicationManager.cs
@@ -54,7 +54,7 @@
         public async Task<bool> SendEmailToContacts(List<Contact> ContactsToSend, int TamplateId)
         {
             // send email to all contacts of ContactsToSend with text $"Hello {Contact.Name} your message is {TamplateId}"
-            // test by Tigran
+            // testing
             throw new Exception();
         }


Update CrewCheck.cs

Update CrewCheck.cs

--- Source/CrewCheck.cs
+++ Source/CrewCheck.cs
@@ -9,7 +9,7 @@
         static Rect launchBlock = new Rect(Screen.width - 97, 0, 50, 43);
         static Rect crewWindow = new Rect(0, 0, 100, 50);
         static bool crewWindowDisplayed = false;
-        static bool launchBlocked;
+        static bool launchBlocked = false;
         static GUIStyle buttonStyle = new GUIStyle(HighLogic.Skin.button);
         static bool isManned = false;
         static bool launchAllowed = true;
@@ -43,6 +43,7 @@
                     {
                         Debug.Log("[WernherChecker] Displayng CrewCheck window");
                         RenderingManager.AddToPostDrawQueue(54, DrawWindow);
+                        EditorLogic.fetch.Lock(true, true, true, "WernherChecker_crewCheck");
                         crewWindowDisplayed = true;
                     }
                 }
@@ -73,6 +74,7 @@
             {
                 RenderingManager.RemoveFromPostDrawQueue(54, DrawWindow);
                 crewWindowDisplayed = false;
+                EditorLogic.fetch.Unlock("WernherChecker_crewCheck");
                 Debug.Log("[WernherChecker] Launching vessel!");
                 EditorLogic.fetch.launchVessel();
             }
@@ -81,7 +83,7 @@
                 RenderingManager.RemoveFromPostDrawQueue(54, DrawWindow);
                 crewWindowDisplayed = false;
                 EditorLogic.fetch.SelectPanelCrew();
-                WernherChecker.minimized = true;
+                EditorLogic.fetch.Unlock("WernherChecker_crewCheck");
             }
         }
     }