Fix: Labels should only be visible for visible polygons

--- DotSpatial.Controls/MapLabelLayer.cs
+++ DotSpatial.Controls/MapLabelLayer.cs
@@ -297,6 +297,9 @@
                 }
                 foreach (int fid in catFeatures)
                 {
+                    if (!this.FeatureLayer.DrawnStates[fid].Visible)
+                        continue;
+
                     IFeature feature = FeatureSet.GetFeature(fid);
                     switch (type)
                     {
@@ -373,18 +376,21 @@
                         }
                     }
                 }
-                foreach (IFeature feature in catFeatures)
-                {
+                for (int i = 0; i < catFeatures.Count; i++)
+                {
+                    if (!this.FeatureLayer.DrawnStates[i].Visible)
+                        continue;
+
                     switch (type)
                     {
                         case FeatureType.Polygon:
-                            DrawPolygonFeature(e, g, feature, drawStates[feature].Category, drawStates[feature].Selected, ExistingLabels);
+                            DrawPolygonFeature(e, g, catFeatures[i], drawStates[catFeatures[i]].Category, drawStates[catFeatures[i]].Selected, ExistingLabels);
                             break;
                         case FeatureType.Line:
-                            DrawLineFeature(e, g, feature, drawStates[feature].Category, drawStates[feature].Selected, ExistingLabels);
+                            DrawLineFeature(e, g, catFeatures[i], drawStates[catFeatures[i]].Category, drawStates[catFeatures[i]].Selected, ExistingLabels);
                             break;
                         case FeatureType.Point:
-                            DrawPointFeature(e, g, feature, drawStates[feature].Category, drawStates[feature].Selected, ExistingLabels);
+                            DrawPointFeature(e, g, catFeatures[i], drawStates[catFeatures[i]].Category, drawStates[catFeatures[i]].Selected, ExistingLabels);
                             break;
                     }
                 }


Allow custom commands to be provided to CreateScript test helper.

--- Duplicati/UnitTest/RunScriptTests.cs
+++ Duplicati/UnitTest/RunScriptTests.cs
@@ -148,12 +148,12 @@
         }

-        private string CreateScript(int exitcode, string stderr = null, string stdout = null, int sleeptime = 0)
+        private string CreateScript(int exitcode, string stderr = null, string stdout = null, int sleeptime = 0, List<string> customCommands = null)
         {
             var id = Guid.NewGuid().ToString("N").Substring(0, 6);
             if (Platform.IsClientWindows)
             {
-                var commands = new List<string>();
+                var commands = customCommands ?? new List<string>();
                 if (!string.IsNullOrWhiteSpace(stdout))
                     commands.Add($@"echo {stdout}");
                 if (!string.IsNullOrWhiteSpace(stderr))
@@ -173,6 +173,11 @@
                 var commands = new List<string>();
                 commands.Add("#!/bin/sh");

+                if (customCommands != null)
+                {
+                    commands.AddRange(customCommands);
+                }
+
                 if (!string.IsNullOrWhiteSpace(stdout))
                     commands.Add($@"echo {stdout}");
                 if (!string.IsNullOrWhiteSpace(stderr))


Slightly clunky hack but it ensures top most is reapplied properly

--- EDDiscovery/Forms/UserControlForm.cs
+++ EDDiscovery/Forms/UserControlForm.cs
@@ -260,7 +260,11 @@
             if (IsTransparencySupported)
                 transparentmode = (TransparencyMode)SQLiteDBClass.GetSettingInt(dbrefname + "Transparent", deftransparent ? (int)TransparencyMode.On : (int)TransparencyMode.Off);

-            SetTopMost(SQLiteDBClass.GetSettingBool(dbrefname + "TopMost", deftopmost)); // this also establishes transparency
+            bool wantedTopMost = SQLiteDBClass.GetSettingBool(dbrefname + "TopMost", deftopmost);
+            //kludge
+            SetTopMost(wantedTopMost);
+            SetTopMost(!wantedTopMost);
+            SetTopMost(wantedTopMost); // this also establishes transparency

             var top = SQLiteDBClass.GetSettingInt(dbrefname + "Top", -999);
             //System.Diagnostics.Debug.WriteLine("Position Top is {0} {1}", dbrefname, top);


HR theme switching can be unreliable

HR theme switching can be unreliable

--- EarTrumpet/UI/Themes/ThemeManager.cs
+++ EarTrumpet/UI/Themes/ThemeManager.cs
@@ -135,7 +135,8 @@
                     break;
                 case WM_SETTINGCHANGE:
                     var settingChanged = Marshal.PtrToStringUni(lParam);
-                    if (settingChanged == "ImmersiveColorSet")
+                    if (settingChanged == "ImmersiveColorSet" || // Accent color
+                        settingChanged == "WindowsThemeElement") // High contrast
                     {
                         OnThemeColorsChanged();
                     }


Remove uneeded methods. Add method to terminate session gracefully.

--- ExoMail.Smtp/Protocol/SmtpSession.cs
+++ ExoMail.Smtp/Protocol/SmtpSession.cs
@@ -1,6 +1,7 @@
 using ExoMail.Smtp.Enums;
 using ExoMail.Smtp.Extensions;
 using ExoMail.Smtp.Interfaces;
+using ExoMail.Smtp.Services;
 using ExoMail.Smtp.Utilities;
 using System;
 using System.Collections.Generic;
@@ -206,16 +207,12 @@
             };
         }

-        private void ReceiveData()
-        {
-        }
-
         public void Reset()
         {
             this.SmtpCommands.Clear();
         }

-        private void Quit()
+        public void StopSession()
         {
             this.TokenSource.Cancel();
         }


Show message if checkbox is not checked and button is clicked


Tmp Fix #233

Tmp Fix #233

--- src/redmine-net20-api/Types/Project.cs
+++ src/redmine-net20-api/Types/Project.cs
@@ -208,7 +208,7 @@
             writer.WriteElementString(RedmineKeys.NAME, Name);
             writer.WriteElementString(RedmineKeys.IDENTIFIER, Identifier);
             writer.WriteElementString(RedmineKeys.DESCRIPTION, Description);
-            writer.WriteElementString(RedmineKeys.INHERIT_MEMBERS, InheritMembers.ToString().ToLowerInvariant());
+            //writer.WriteElementString(RedmineKeys.INHERIT_MEMBERS, InheritMembers.ToString().ToLowerInvariant());
             writer.WriteElementString(RedmineKeys.IS_PUBLIC, IsPublic.ToString().ToLowerInvariant());
             writer.WriteIdOrEmpty(Parent, RedmineKeys.PARENT_ID);
             writer.WriteElementString(RedmineKeys.HOMEPAGE, HomePage);
@@ -276,7 +276,7 @@
 		        hashCode = HashCodeHelper.GetHashCode(UpdatedOn, hashCode);
 		        hashCode = HashCodeHelper.GetHashCode(Status, hashCode);
 		        hashCode = HashCodeHelper.GetHashCode(IsPublic, hashCode);
-		        hashCode = HashCodeHelper.GetHashCode(InheritMembers, hashCode);
+		        //hashCode = HashCodeHelper.GetHashCode(InheritMembers, hashCode);
 		        hashCode = HashCodeHelper.GetHashCode(Trackers, hashCode);
 		        hashCode = HashCodeHelper.GetHashCode(CustomFields, hashCode);
 		        hashCode = HashCodeHelper.GetHashCode(IssueCategories, hashCode);
@@ -296,4 +296,4 @@
                 Identifier, Description, Parent, HomePage, CreatedOn, UpdatedOn, Status, IsPublic, InheritMembers, Trackers, CustomFields, IssueCategories, EnabledModules, base.ToString());
         }
     }
-}+}


add comment for paste zone

add comment for paste zone

--- csharp/SampleBot/SampleBot/Controllers/MessagesController.cs
+++ csharp/SampleBot/SampleBot/Controllers/MessagesController.cs
@@ -16,10 +16,17 @@

 namespace SampleBot
 {
+    /**************************************************************
+     * Botを操作するときはこのファイルを編集します。
+     * 詳しくはTutorialを参照 https://github.com/mspjp/201612hackathonyokohama/blob/master/csharp/README.md
+     **************************************************************/
+
     [BotAuthentication]
     public class MessagesController : ApiController
     {
         //Botにメッセージがくるとここが呼び出される
+        //  第一引数 connector: 発話を返す時に使うもの
+        //  第二引数 message: 発話の内容が入っている
         private async Task OnMessageAsync(ConnectorClient connector,Activity message)
         {
             //rule.csvに書いてあるルールとマッチングを行う
@@ -39,11 +46,23 @@
                 break;
             }

+            //発話のテキスト
+            var text = message.Text;
+
+            /**************************************************************
+             * コピペゾーン1: 発話が来て、ルールに何もマッチングしなかった時に通るゾーン
+             **************************************************************/
+
             //アタッチメント(画像など)が添付されているとこの中が実行される
             if (message.Attachments != null && message.Attachments.Count > 0)
             {
                 //アタッチメントのURL
                 var imageUrl = message.Attachments.First().ContentUrl;
+
+                /**************************************************************
+                 * コピペゾーン2: 発話がきて、アタッチメント(画像)が添付されていた時に通るゾーン
+                 **************************************************************/
+
                 //Face APIを呼び出す
                 var client = new FaceServiceClient(ApiKey.FACE_APIKEY);
                 var faces = await client.DetectAsync(imageUrl, true, false, new List<FaceAttributeType>()
@@ -67,20 +86,37 @@
             //マッチするルールがないなら
             if (responses.Count == 0)
             {
+                /**************************************************************
+                 * コピペゾーン3: 用意したルールに何もマッチングしなかった発話が来た時に通るゾーン
+                 **************************************************************/
+
                 var reply = message.CreateReply("今日はいい天気ですね！");
                 await connector.Conversations.ReplyToActivityAsync(reply);
             }
         }

         //ルールに{command}が入っていればここが呼び出される
+        //  第一引数 connector: 発話を返す時に使うもの
+        //  第二引数 message: 発話の内容が入っている
+        //  第三引数 command: コマンドの名前が入っている
         private async Task OnCommandAsync(ConnectorClient connector, Activity message, string command)
         {
+            /**************************************************************
+             * コピペゾーン4: 発話がルールにマッチして、ルールに{command}が書いてあった時に通るゾーン
+             **************************************************************/
+
             if (command == "command1")
             {
                 var reply = message.CreateReply("execute " + command);
                 await connector.Conversations.ReplyToActivityAsync(reply);
             }
         }
+
+
+        /**************************************************************
+         * ここから下は特に気にしなくても大丈夫です
+         **************************************************************/
+

         //Bot Connectorからここが呼び出される
         public async Task<HttpResponseMessage> Post([FromBody]Activity activity)


Fill credits, and make richtextbox readonly

--- osu!StreamCompanion/Code/Modules/SCGUI/AboutForm.cs
+++ osu!StreamCompanion/Code/Modules/SCGUI/AboutForm.cs
@@ -13,7 +13,13 @@
 https://github.com/Piotrekol
 https://osu.ppy.sh/u/Piotrekol
 https://twitch.tv/Piotrekol
-            ";
+Libraries used:
+CollectionManager by Piotrekol
+OppaiSharp by HoLLy-HaCKeR
+oppai-ng by Francesco149
+SQLite
+Newtonsoft.Json by JamesNK";
+            richTextBox1.ReadOnly = true;
         }

         private void richTextBox1_LinkClicked(object sender, LinkClickedEventArgs e)


Add more xmldocs

Add more xmldocs

--- osu.Framework/Graphics/Containers/TableContainer.cs
+++ osu.Framework/Graphics/Containers/TableContainer.cs
@@ -9,6 +9,9 @@

 namespace osu.Framework.Graphics.Containers
 {
+    /// <summary>
+    /// A container which tabulates <see cref="Drawable"/>s.
+    /// </summary>
     public class TableContainer : CompositeDrawable
     {
         private readonly GridContainer grid;
@@ -131,8 +134,14 @@
             }
         }

+        /// <summary>
+        /// The total number of rows in the content, including the header.
+        /// </summary>
         private int totalRows => content.GetLength(0) + (ShowHeaders ? 1 : 0);

+        /// <summary>
+        /// The total number of columns in the content, including the header.
+        /// </summary>
         private int totalColumns
         {
             get
@@ -144,6 +153,9 @@
             }
         }

+        /// <summary>
+        /// Adds content to the underlying grid.
+        /// </summary>
         private void updateContent()
         {
             if (content == null)
@@ -233,17 +245,41 @@
                 grid.AutoSizeAxes |= Axes.Y;
         }

+        /// <summary>
+        /// Creates the content for a cell in the header row of the table.
+        /// </summary>
+        /// <param name="index">The column index.</param>
+        /// <param name="column">The column definition.</param>
+        /// <returns>The cell content.</returns>
         protected virtual Drawable CreateHeader(int index, [CanBeNull] TableColumn column) => new SpriteText { Text = column?.Header ?? string.Empty };
     }

+    /// <summary>
+    /// Defines a column of the <see cref="TableContainer"/>.
+    /// </summary>
     public class TableColumn
     {
+        /// <summary>
+        /// The text to be displayed in the cell.
+        /// </summary>
         public readonly string Header;

+        /// <summary>
+        /// The anchor of all cells in this column of the <see cref="TableContainer"/>.
+        /// </summary>
         public readonly Anchor Anchor;

+        /// <summary>
+        /// The dimension of the column in the table.
+        /// </summary>
         public readonly Dimension Dimension;

+        /// <summary>
+        /// Constructs a new <see cref="TableColumn"/>.
+        /// </summary>
+        /// <param name="header">The text to be displayed in the cell.</param>
+        /// <param name="anchor">The anchor of all cells in this column of the <see cref="TableContainer"/>.</param>
+        /// <param name="dimension">The dimension of the column in the table.</param>
         public TableColumn(string header = null, Anchor anchor = Anchor.TopLeft, Dimension dimension = null)
         {
             Header = header ?? "";


Fix incorrect DI error being reported by StepButton failures

--- osu.Framework/Testing/Drawables/Steps/StepButton.cs
+++ osu.Framework/Testing/Drawables/Steps/StepButton.cs
@@ -2,6 +2,7 @@
 // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

 using System;
+using osu.Framework.Allocation;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Shapes;
@@ -92,6 +93,8 @@
             }
             catch (Exception e)
             {
+                if (e.InnerException is DependencyInjectionException die)
+                    e = die.DispatchInfo.SourceException;
                 Logging.Logger.Error(e, $"Step {this} triggered an error");
             }


Further speed up dynamic compilation type resolution

--- osu.Framework/Testing/RoslynTypeReferenceBuilder.cs
+++ osu.Framework/Testing/RoslynTypeReferenceBuilder.cs
@@ -254,12 +254,18 @@
                 // - Namespace names (not entire namespaces).
                 // - Entire static classes.
                 // - Variable declarators (names of variables).
-                // - The first IdentifierName child of an assignment expression (variable name), below.
+                // - The single IdentifierName child of an assignment expression (variable name), below.
+                // - The single IdentifierName child of an argument syntax (variable name), below.
+                // - The name of namespace declarations.
+                // - Name-colon syntaxes.
+                // - Invocation expressions. Static classes are explicitly disallowed so the target type of an invocation must be available elsewhere in the syntax tree.

                 return kind != SyntaxKind.UsingDirective
                        && kind != SyntaxKind.NamespaceKeyword
                        && (kind != SyntaxKind.ClassDeclaration || ((ClassDeclarationSyntax)n).Modifiers.All(m => m.Kind() != SyntaxKind.StaticKeyword))
-                       && kind != SyntaxKind.VariableDeclarator;
+                       && kind != SyntaxKind.VariableDeclarator
+                       && (kind != SyntaxKind.QualifiedName || !(n.Parent is NamespaceDeclarationSyntax))
+                       && (kind != SyntaxKind.InvocationExpression);
             });

             // This hashset is used to prevent re-exploring syntaxes with the same name.
@@ -269,20 +275,25 @@
             // Find all the named type symbols in the syntax tree, and mark + recursively iterate through them.
             foreach (var node in descendantNodes)
             {
-                // Ignore the variable name of assignment expressions.
-                if (node.Kind() == SyntaxKind.IdentifierName && node.Parent is AssignmentExpressionSyntax)
+                if (node.Kind() == SyntaxKind.IdentifierName)
+                {
+                    // Ignore the variable name of assignment expressions.
+                    if (node.Parent is AssignmentExpressionSyntax)
+                        continue;
+
+                    // Ignore the variable name of arguments.
+                    if (node.Parent is ArgumentSyntax)
+                        continue;
+                }
+
+                // Ignore name-colon syntaxes (arguments).
+                if (node.Kind() == SyntaxKind.NameColon)
                     continue;

                 switch (node.Kind())
                 {
                     case SyntaxKind.GenericName:
                     case SyntaxKind.IdentifierName:
-                    case SyntaxKind.AsExpression:
-                    case SyntaxKind.IsExpression:
-                    case SyntaxKind.SizeOfExpression:
-                    case SyntaxKind.TypeOfExpression:
-                    case SyntaxKind.CastExpression:
-                    case SyntaxKind.ObjectCreationExpression:
                     {
                         string nodeString = node.ToString();


Removed redundant flag var

Removed redundant flag var

--- Sharpex.GameLibrary/Framework/Input/Devices/Mouse.cs
+++ Sharpex.GameLibrary/Framework/Input/Devices/Mouse.cs
@@ -108,7 +108,6 @@
         }

         private readonly Dictionary<MouseButtons, bool> _mousestate;
-        private bool _flag;

         /// <summary>
         /// Represents the surface handle.


DashboardLogic add Id in query

DashboardLogic add Id in query

--- Signum.Engine.Extensions/Dashboard/DashboardLogic.cs
+++ Signum.Engine.Extensions/Dashboard/DashboardLogic.cs
@@ -51,6 +51,7 @@
                     select new
                     {
                         Entity = cp,
+                        cp.Id,
                         cp.DisplayName,
                         cp.EntityType,
                         Related = cp.Owner,


EntityOperationDisabled and OperationContextFromMany tests fix

--- Signum.Web.Extensions.Selenium/SeleniumExtensions.cs
+++ Signum.Web.Extensions.Selenium/SeleniumExtensions.cs
@@ -246,6 +246,16 @@
             return selenium.IsElementPresent("{0}:not(.sf-disabled)".Formato(EntityButtonLocator(idButton)));
         }

+        public static bool EntityOperationDisabled(this ISelenium selenium, Enum operationKey)
+        {
+            return selenium.EntityButtonDisabled(operationKey.GetType().Name + "_" + operationKey.ToString());
+        }
+
+        public static bool EntityButtonDisabled(this ISelenium selenium, string idButton)
+        {
+            return selenium.IsElementPresent("{0}.sf-disabled".Formato(EntityButtonLocator(idButton)));
+        }
+
         public static void EntityOperationClick(this ISelenium selenium, Enum operationKey)
         {
             selenium.EntityButtonClick(operationKey.GetType().Name + "_" + operationKey.ToString());


removed extra file

removed extra file

--- SimpleBroadboardButtonLed/Properties/AssemblyInfo.cs
+++ SimpleBroadboardButtonLed/Properties/AssemblyInfo.cs
@@ -1,25 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("SimpleBroadboardButtonLed")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SimpleBroadboardButtonLed")]
-[assembly: AssemblyCopyright("Copyright ©  2014")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]


Don't open VS Code or update on process and close

--- Source/Dna.Web.Core/DnaEnvironment/DnaEnvironment.cs
+++ Source/Dna.Web.Core/DnaEnvironment/DnaEnvironment.cs
@@ -224,7 +224,7 @@
                         continue;

                     // See if we should quit
-                    ProcessCommand(nextCommand, out bool quit);
+                    ProcessCommand(nextCommand, out var quit);

                     // If the command should quit out...
                     if (quit)
@@ -339,7 +339,7 @@
                             var unresolvedPath = Configuration.MonitorPath;

                             // Resolve any relative paths
-                            Configuration.MonitorPath = DnaConfiguration.ResolveFullPath(EnvironmentDirectory, unresolvedPath, false, out bool wasRelative);
+                            Configuration.MonitorPath = DnaConfiguration.ResolveFullPath(EnvironmentDirectory, unresolvedPath, false, out var wasRelative);

                             // Log it
                             CoreLogger.LogTabbed("Argument Override MonitorPath", Configuration.MonitorPath, 1);
@@ -351,7 +351,7 @@
                         else if (arg.StartsWith("logLevel="))
                         {
                             // Try get value
-                            if (Enum.TryParse<LogLevel>(arg.Substring(arg.IndexOf("=") + 1), out LogLevel result))
+                            if (Enum.TryParse<LogLevel>(arg.Substring(arg.IndexOf("=") + 1), out var result))
                             {
                                 // Set new value
                                 Configuration.LogLevel = result;
@@ -368,7 +368,7 @@
                         {
                             // Set path (and resolve if relative)
                             var unresolvedPath = arg.Substring(arg.IndexOf("=") + 1);
-                            Configuration.OutputPath = DnaConfiguration.ResolveFullPath(EnvironmentDirectory, unresolvedPath, true, out bool wasRelative);
+                            Configuration.OutputPath = DnaConfiguration.ResolveFullPath(EnvironmentDirectory, unresolvedPath, true, out var wasRelative);

                             // Log it
                             CoreLogger.LogTabbed("Argument Override Output Path", Configuration.OutputPath, 1);
@@ -381,7 +381,7 @@
                         {
                             // Set Path (and resolve if relative)
                             var unresolvedPath = arg.Substring(arg.IndexOf("=") + 1);
-                            Configuration.CachePath = DnaConfiguration.ResolveFullPath(EnvironmentDirectory, unresolvedPath, true, out bool wasRelative);
+                            Configuration.CachePath = DnaConfiguration.ResolveFullPath(EnvironmentDirectory, unresolvedPath, true, out var wasRelative);

                             // Log it
                             CoreLogger.LogTabbed("Argument Override Cache Path", Configuration.CachePath, 1);
@@ -393,7 +393,7 @@
                         else if (arg.StartsWith("scssOutputStyle="))
                         {
                             // Try and parse it
-                            if (Enum.TryParse<ScssOutputStyle>(arg.Substring(arg.IndexOf("=") + 1), out ScssOutputStyle scssOutputStyle))
+                            if (Enum.TryParse<ScssOutputStyle>(arg.Substring(arg.IndexOf("=") + 1), out var scssOutputStyle))
                             {
                                 // Set new style
                                 Configuration.ScssOutputStyle = scssOutputStyle;
@@ -409,7 +409,7 @@
                         else if (arg.StartsWith("scssGenerateSourceMap="))
                         {
                             // Try and parse it
-                            if (bool.TryParse(arg.Substring(arg.IndexOf("=") + 1), out bool generateMap))
+                            if (bool.TryParse(arg.Substring(arg.IndexOf("=") + 1), out var generateMap))
                             {
                                 // Set new value
                                 Configuration.ScssGenerateSourceMaps = generateMap;
@@ -425,7 +425,7 @@
                         else if (arg.StartsWith("openVsCode="))
                         {
                             // Try and parse it
-                            if (bool.TryParse(arg.Substring(arg.IndexOf("=") + 1), out bool openVsCode))
+                            if (bool.TryParse(arg.Substring(arg.IndexOf("=") + 1), out var openVsCode))
                             {
                                 // Set new value
                                 Configuration.OpenVsCode = openVsCode;
@@ -571,6 +571,17 @@
                     }

                     #endregion
+
+                    #region Open VS Code
+
+                    // Should we open VS Code?
+                    if (Configuration.OpenVsCode == true)
+                        OpenVsCode(Configuration.MonitorPath);
+
+                    #endregion
+
+                    // Check for updates
+                    AutoUpdateManager.CheckForUpdate();
                 }

                 #region Live Data
@@ -583,17 +594,6 @@

                 // Download any out-of-date / unprocessed live sources
                 LiveDataManager.DownloadSourcesAsync(Configuration.LiveDataSources);
-
-                #endregion
-
-                #region Open VS Code
-
-                // Should we open VS Code?
-                if (Configuration.OpenVsCode == true)
-                    OpenVsCode(Configuration.MonitorPath);
-
-                // Check for updates
-                AutoUpdateManager.CheckForUpdate();

                 #endregion
             });
@@ -869,7 +869,7 @@
             var destination = Console.ReadLine();

             // Resolve path based on the monitor path being the root
-            destination = DnaConfiguration.ResolveFullPath(Configuration.MonitorPath, destination, true, out bool wasRelative);
+            destination = DnaConfiguration.ResolveFullPath(Configuration.MonitorPath, destination, true, out var wasRelative);

             try
             {
@@ -923,7 +923,7 @@
             var destination = Console.ReadLine();

             // Resolve path based on the monitor path being the root
-            destination = DnaConfiguration.ResolveFullPath(Configuration.MonitorPath, destination, true, out bool wasRelative);
+            destination = DnaConfiguration.ResolveFullPath(Configuration.MonitorPath, destination, true, out var wasRelative);

             // Add configuration file name
             destination = Path.Combine(destination, DnaSettings.ConfigurationFileName);
@@ -995,7 +995,7 @@
             destination = Console.ReadLine();

             // Resolve path based on the monitor path being the root
-            destination = DnaConfiguration.ResolveFullPath(Configuration.MonitorPath, destination, true, out bool wasRelative);
+            destination = DnaConfiguration.ResolveFullPath(Configuration.MonitorPath, destination, true, out var wasRelative);

             // Get unique name from that location
             destination = FileHelpers.GetUnusedPath(Path.Combine(destination, name));
@@ -1402,7 +1402,7 @@

             // First line should be version string
             // If it isn't...
-            if (lines == null || lines.Length <= 0 || !Version.TryParse(lines[0], out Version vsVersion))
+            if (lines == null || lines.Length <= 0 || !Version.TryParse(lines[0], out var vsVersion))
                 // Presume not installed
                 return false;


Annotate parameters in users module with notnull attribute.

--- Source/Lib/TraktApiSharp/Modules/TraktUsersModule.cs
+++ Source/Lib/TraktApiSharp/Modules/TraktUsersModule.cs
@@ -156,7 +156,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<TraktUser> GetUserProfileAsync(string usernameOrSlug, TraktExtendedOption extendedOption = null)
+        public async Task<TraktUser> GetUserProfileAsync([NotNull] string usernameOrSlug, TraktExtendedOption extendedOption = null)
         {
             ValidateUsername(usernameOrSlug);

@@ -183,7 +183,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<IEnumerable<TraktCollectionMovie>> GetCollectionMoviesAsync(string usernameOrSlug, TraktExtendedOption extendedOption = null)
+        public async Task<IEnumerable<TraktCollectionMovie>> GetCollectionMoviesAsync([NotNull] string usernameOrSlug, TraktExtendedOption extendedOption = null)
         {
             ValidateUsername(usernameOrSlug);

@@ -210,7 +210,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<IEnumerable<TraktCollectionShow>> GetCollectionShowsAsync(string usernameOrSlug, TraktExtendedOption extendedOption = null)
+        public async Task<IEnumerable<TraktCollectionShow>> GetCollectionShowsAsync([NotNull] string usernameOrSlug, TraktExtendedOption extendedOption = null)
         {
             ValidateUsername(usernameOrSlug);

@@ -247,7 +247,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<TraktPaginationListResult<TraktUserComment>> GetCommentsAsync(string usernameOrSlug,
+        public async Task<TraktPaginationListResult<TraktUserComment>> GetCommentsAsync([NotNull] string usernameOrSlug,
                                                                                TraktCommentType? commentType = null,
                                                                                TraktObjectType? objectType = null,
                                                                                TraktExtendedOption extendedOption = null,
@@ -277,7 +277,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<IEnumerable<TraktList>> GetCustomListsAsync(string usernameOrSlug)
+        public async Task<IEnumerable<TraktList>> GetCustomListsAsync([NotNull] string usernameOrSlug)
         {
             ValidateUsername(usernameOrSlug);

@@ -301,7 +301,7 @@
         /// Thrown, if the given list id is null, empty or contains spaces.
         /// </exception>
         [OAuthAuthorizationOptional]
-        public async Task<TraktList> GetCustomSingleListAsync(string usernameOrSlug, string listId)
+        public async Task<TraktList> GetCustomSingleListAsync([NotNull] string usernameOrSlug, [NotNull] string listId)
         {
             ValidateUsername(usernameOrSlug);
             ValidateListId(listId);
@@ -367,7 +367,7 @@
         /// Thrown, if the given list id is null, empty or contains spaces.
         /// </exception>
         [OAuthAuthorizationOptional]
-        public async Task<IEnumerable<TraktListItem>> GetCustomListItemsAsync(string usernameOrSlug, string listId,
+        public async Task<IEnumerable<TraktListItem>> GetCustomListItemsAsync([NotNull] string usernameOrSlug, [NotNull] string listId,
                                                                               TraktListItemType? listItemType = null,
                                                                               TraktExtendedOption extendedOption = null)
         {
@@ -403,7 +403,7 @@
         /// Thrown, if the given list name is null or empty.
         /// </exception>
         [OAuthAuthorizationRequired]
-        public async Task<TraktList> CreateCustomListAsync(string usernameOrSlug, string listName, string listDescription = null,
+        public async Task<TraktList> CreateCustomListAsync([NotNull] string usernameOrSlug, [NotNull] string listName, string listDescription = null,
                                                            TraktAccessScope? privacy = null,
                                                            bool? displayNumbers = null, bool? allowComments = null)
         {
@@ -453,7 +453,7 @@
         /// display numbers is not set and comments allowed is not set).
         /// </exception>
         [OAuthAuthorizationRequired]
-        public async Task<TraktList> UpdateCustomListAsync(string usernameOrSlug, string listId,
+        public async Task<TraktList> UpdateCustomListAsync([NotNull] string usernameOrSlug, [NotNull] string listId,
                                                            string listName = null, string listDescription = null,
                                                            TraktAccessScope? privacy = null,
                                                            bool? displayNumbers = null, bool? allowComments = null)
@@ -506,7 +506,7 @@
         /// Thrown, if the given list id is null, empty or contains spaces.
         /// </exception>
         [OAuthAuthorizationRequired]
-        public async Task DeleteCustomListAsync(string usernameOrSlug, string listId)
+        public async Task DeleteCustomListAsync([NotNull] string usernameOrSlug, [NotNull] string listId)
         {
             ValidateUsername(usernameOrSlug);
             ValidateListId(listId);
@@ -543,8 +543,8 @@
         /// Thrown, if the given list items post is empty.
         /// </exception>
         [OAuthAuthorizationRequired]
-        public async Task<TraktUserCustomListItemsPostResponse> AddCustomListItemsAsync(string usernameOrSlug, string listId,
-                                                                                TraktUserCustomListItemsPost listItemsPost,
+        public async Task<TraktUserCustomListItemsPostResponse> AddCustomListItemsAsync([NotNull] string usernameOrSlug, [NotNull] string listId,
+                                                                                [NotNull] TraktUserCustomListItemsPost listItemsPost,
                                                                                TraktListItemType? listItemType = null)
         {
             ValidateUsername(usernameOrSlug);
@@ -584,8 +584,8 @@
         /// Thrown, if the given list items remove post is empty.
         /// </exception>
         [OAuthAuthorizationRequired]
-        public async Task<TraktUserCustomListItemsRemovePostResponse> RemoveCustomListItemsAsync(string usernameOrSlug, string listId,
-                                                                                TraktUserCustomListItemsPost listItemsRemovePost)
+        public async Task<TraktUserCustomListItemsRemovePostResponse> RemoveCustomListItemsAsync([NotNull] string usernameOrSlug, [NotNull] string listId,
+                                                                                [NotNull] TraktUserCustomListItemsPost listItemsRemovePost)
         {
             ValidateUsername(usernameOrSlug);
             ValidateListId(listId);
@@ -624,7 +624,7 @@
         /// Thrown, if the given list id is null, empty or contains spaces.
         /// </exception>
         [OAuthAuthorizationRequired(false)]
-        public async Task<TraktPaginationListResult<TraktComment>> GetListCommentsAsync(string usernameOrSlug, string listId,
+        public async Task<TraktPaginationListResult<TraktComment>> GetListCommentsAsync([NotNull] string usernameOrSlug, [NotNull] string listId,
                                                                                TraktCommentSortOrder? commentSortOrder = null,
                                                                                int? page = null, int? limitPerPage = null)
         {
@@ -655,7 +655,7 @@
         /// Thrown, if the given list id is null, empty or contains spaces.
         /// </exception>
         [OAuthAuthorizationRequired]
-        public async Task LikeListAsync(string usernameOrSlug, string listId)
+        public async Task LikeListAsync([NotNull] string usernameOrSlug, [NotNull] string listId)
         {
             ValidateUsername(usernameOrSlug);
             ValidateListId(listId);
@@ -682,7 +682,7 @@
         /// Thrown, if the given list id is null, empty or contains spaces.
         /// </exception>
         [OAuthAuthorizationRequired]
-        public async Task UnlikeListAsync(string usernameOrSlug, string listId)
+        public async Task UnlikeListAsync([NotNull] string usernameOrSlug, [NotNull] string listId)
         {
             ValidateUsername(usernameOrSlug);
             ValidateListId(listId);
@@ -710,7 +710,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<IEnumerable<TraktUserFollower>> GetFollowersAsync(string usernameOrSlug, TraktExtendedOption extendedOption = null)
+        public async Task<IEnumerable<TraktUserFollower>> GetFollowersAsync([NotNull] string usernameOrSlug, TraktExtendedOption extendedOption = null)
         {
             ValidateUsername(usernameOrSlug);

@@ -733,7 +733,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<IEnumerable<TraktUserFollower>> GetFollowingAsync(string usernameOrSlug, TraktExtendedOption extendedOption = null)
+        public async Task<IEnumerable<TraktUserFollower>> GetFollowingAsync([NotNull] string usernameOrSlug, TraktExtendedOption extendedOption = null)
         {
             ValidateUsername(usernameOrSlug);

@@ -756,7 +756,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<IEnumerable<TraktUserFriend>> GetFriendsAsync(string usernameOrSlug, TraktExtendedOption extendedOption = null)
+        public async Task<IEnumerable<TraktUserFriend>> GetFriendsAsync([NotNull] string usernameOrSlug, TraktExtendedOption extendedOption = null)
         {
             ValidateUsername(usernameOrSlug);

@@ -778,7 +778,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationRequired]
-        public async Task<TraktUserFollowUserPostResponse> FollowUserAsync(string usernameOrSlug)
+        public async Task<TraktUserFollowUserPostResponse> FollowUserAsync([NotNull] string usernameOrSlug)
         {
             ValidateUsername(usernameOrSlug);

@@ -796,7 +796,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationRequired]
-        public async Task UnfollowUserAsync(string usernameOrSlug)
+        public async Task UnfollowUserAsync([NotNull] string usernameOrSlug)
         {
             ValidateUsername(usernameOrSlug);

@@ -815,7 +815,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given follower request id is null, empty or contains spaces.</exception>
         [OAuthAuthorizationRequired]
-        public async Task<TraktUserFollower> ApproveFollowRequestAsync(string followerRequestId)
+        public async Task<TraktUserFollower> ApproveFollowRequestAsync([NotNull] string followerRequestId)
         {
             ValidateFollowerRequestId(followerRequestId);

@@ -833,7 +833,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given follower request id is null, empty or contains spaces.</exception>
         [OAuthAuthorizationRequired]
-        public async Task DenyFollowRequestAsync(string followerRequestId)
+        public async Task DenyFollowRequestAsync([NotNull] string followerRequestId)
         {
             ValidateFollowerRequestId(followerRequestId);

@@ -868,7 +868,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<TraktPaginationListResult<TraktHistoryItem>> GetWatchedHistoryAsync(string usernameOrSlug, TraktSyncItemType? historyItemType = null,
+        public async Task<TraktPaginationListResult<TraktHistoryItem>> GetWatchedHistoryAsync([NotNull] string usernameOrSlug, TraktSyncItemType? historyItemType = null,
                                                                                string itemId = null, DateTime? startAt = null,
                                                                                DateTime? endAt = null, TraktExtendedOption extendedOption = null,
                                                                                int? page = null, int? limitPerPage = null)
@@ -909,7 +909,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<IEnumerable<TraktRatingsItem>> GetRatingsAsync(string usernameOrSlug, TraktSyncRatingsItemType? ratingsItemType = null,
+        public async Task<IEnumerable<TraktRatingsItem>> GetRatingsAsync([NotNull] string usernameOrSlug, TraktSyncRatingsItemType? ratingsItemType = null,
                                                                          int[] ratingsFilter = null, TraktExtendedOption extendedOption = null)
         {
             ValidateUsername(usernameOrSlug);
@@ -940,7 +940,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<IEnumerable<TraktWatchlistItem>> GetWatchlistAsync(string usernameOrSlug, TraktSyncItemType? watchlistItemType = null,
+        public async Task<IEnumerable<TraktWatchlistItem>> GetWatchlistAsync([NotNull] string usernameOrSlug, TraktSyncItemType? watchlistItemType = null,
                                                                              TraktExtendedOption extendedOption = null)
         {
             ValidateUsername(usernameOrSlug);
@@ -969,7 +969,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<TraktUserWatchingItem> GetWatchingAsync(string usernameOrSlug, TraktExtendedOption extendedOption = null)
+        public async Task<TraktUserWatchingItem> GetWatchingAsync([NotNull] string usernameOrSlug, TraktExtendedOption extendedOption = null)
         {
             ValidateUsername(usernameOrSlug);

@@ -996,7 +996,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<IEnumerable<TraktWatchedMovie>> GetWatchedMoviesAsync(string usernameOrSlug, TraktExtendedOption extendedOption = null)
+        public async Task<IEnumerable<TraktWatchedMovie>> GetWatchedMoviesAsync([NotNull] string usernameOrSlug, TraktExtendedOption extendedOption = null)
         {
             ValidateUsername(usernameOrSlug);

@@ -1023,7 +1023,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<IEnumerable<TraktWatchedShow>> GetWatchedShowsAsync(string usernameOrSlug, TraktExtendedOption extendedOption = null)
+        public async Task<IEnumerable<TraktWatchedShow>> GetWatchedShowsAsync([NotNull] string usernameOrSlug, TraktExtendedOption extendedOption = null)
         {
             ValidateUsername(usernameOrSlug);

@@ -1046,7 +1046,7 @@
         /// <exception cref="Exceptions.TraktException">Thrown, if the request fails.</exception>
         /// <exception cref="ArgumentException">Thrown, if the given username or slug is null, empty or contains spaces.</exception>
         [OAuthAuthorizationOptional]
-        public async Task<TraktUserStatistics> GetStatisticsAsync(string usernameOrSlug)
+        public async Task<TraktUserStatistics> GetStatisticsAsync([NotNull] string usernameOrSlug)
         {
             ValidateUsername(usernameOrSlug);


Changed visibility of SchemaProviderBase.ToValidName to protected. Fixes #944

--- Source/LinqToDB/SchemaProvider/SchemaProviderBase.cs
+++ Source/LinqToDB/SchemaProvider/SchemaProviderBase.cs
@@ -528,7 +528,7 @@
 			return dbType;
 		}

-		internal static string ToValidName(string name)
+		protected static string ToValidName(string name)
 		{
 			if (name.Contains(" ") || name.Contains("\t"))
 			{


Fixed failing test: LoadRelatedEntities_Should_Populate_Product_With_HolidayPromo Updated DbContextExtensions.GetRelatedEntitiesSql to return null if either entitySetName or foreignKeyName is null, or keyValues is empty. Updated DbContextExtensions.GetEntitySetName to return entity set for derived types.

--- Source/TrackableEntities.EF.5/DbContextExtensions.cs
+++ Source/TrackableEntities.EF.5/DbContextExtensions.cs
@@ -214,7 +214,7 @@
             var entitySetName =
                 (from c in containers
                  from es in c.BaseEntitySets
-                 where es.ElementType == dbContext.GetEdmSpaceType(entityType)
+                 where GetEntityTypes(dbContext, entityType).Contains(es.ElementType)
                  select es.EntityContainer.Name + "." + es.Name).SingleOrDefault();
             return entitySetName;
         }
@@ -668,15 +668,32 @@
         {
             // Get entity set name
             string entitySetName = context.GetEntitySetName(propertyType);
+            if (string.IsNullOrEmpty(entitySetName)) return null;

             // Get foreign key name
             string foreignKeyName = context.GetForeignKeyName(entityType, propertyName);
+            if (string.IsNullOrEmpty(entitySetName)) return null;

             // Get key values
             var keyValues = GetKeyValues(foreignKeyName, items);
+            if (!keyValues.Any()) return null;

             // Get entity sql
             return GetQueryEntitySql(entitySetName, foreignKeyName, keyValues);
+        }
+
+        private static IEnumerable<EntityType> GetEntityTypes(DbContext dbContext, Type entityType)
+        {
+            // First get concrete entity type
+            yield return dbContext.GetEdmSpaceType(entityType);
+
+            // Then get base entity types
+            var baseType = entityType.BaseType;
+            while (baseType != null && baseType != typeof (object))
+            {
+                yield return dbContext.GetEdmSpaceType(baseType);
+                baseType = baseType.BaseType;
+            }
         }

         private static void SetRelatedEntities(this DbContext context,


Fix local translation Good Friday

Fix local translation Good Friday

https://github.com/nager/Nager.Date/issues/298

--- Src/Nager.Date/PublicHolidays/NetherlandsProvider.cs
+++ Src/Nager.Date/PublicHolidays/NetherlandsProvider.cs
@@ -40,7 +40,7 @@

             var items = new List<PublicHoliday>();
             items.Add(new PublicHoliday(year, 1, 1, "Nieuwjaarsdag", "New Year's Day", countryCode, 1967));
-            items.Add(this._catholicProvider.GoodFriday("Eerste Paasdag", year, countryCode).SetType(PublicHolidayType.Authorities | PublicHolidayType.School));
+            items.Add(this._catholicProvider.GoodFriday("Goede Vrijdag", year, countryCode).SetType(PublicHolidayType.Authorities | PublicHolidayType.School));
             items.Add(this._catholicProvider.EasterSunday("Eerste Paasdag", year, countryCode));
             items.Add(this._catholicProvider.EasterMonday("Tweede Paasdag", year, countryCode).SetLaunchYear(1642));
             items.Add(new PublicHoliday(year, 4, kingsDay, "Koningsdag", "King's Day", countryCode));


append unit test fixed #13

append unit test fixed #13

--- Starry.Tests/Data/Sql/DbAssistorSinglePrimaryTest.cs
+++ Starry.Tests/Data/Sql/DbAssistorSinglePrimaryTest.cs
@@ -46,6 +46,12 @@

             var result = dbContext.TestTable.DeleteEntity(entity);
             Assert.AreEqual(result, 1, "DELETE ENTITY ERROR");
+
+            dbContext.TestTable.AddEntity(new TestEntity { Content = "TEST1", CreateTime = DateTime.Now, LastUpdateTime = DateTime.Now });
+            dbContext.TestTable.AddEntity(new TestEntity { Content = "TEST2", CreateTime = DateTime.Now, LastUpdateTime = DateTime.Now });
+            dbContext.TestTable.AddEntity(new TestEntity { Content = "TEST3", CreateTime = DateTime.Now, LastUpdateTime = DateTime.Now });
+            dbContext.TestTable.AddEntity(new TestEntity { Content = "TEST4", CreateTime = DateTime.Now, LastUpdateTime = DateTime.Now });
+            dbContext.TestTable.AddEntity(new TestEntity { Content = "TEST5", CreateTime = DateTime.Now, LastUpdateTime = DateTime.Now });
         }
     }
 }


fix crash on corrupted lfg packet

fix crash on corrupted lfg packet

--- TCC.Core/Parsing/Messages/S_SHOW_PARTY_MATCH_INFO.cs
+++ TCC.Core/Parsing/Messages/S_SHOW_PARTY_MATCH_INFO.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using TCC.Data;
 using TCC.TeraCommon.Game.Messages;
 using TCC.TeraCommon.Game.Services;
@@ -38,19 +39,27 @@

                 reader.BaseStream.Position = msgOffset - 4;
                 var msg = reader.ReadTeraString();
-                reader.BaseStream.Position = leaderNameOffset - 4;
+                try
+                {
+                    reader.BaseStream.Position = leaderNameOffset - 4;
+                }
+                catch
+                {
+                    if (next != 0) reader.BaseStream.Position = next - 4;
+                    continue;
+                }
                 var leaderName = reader.ReadTeraString();
                 l.LeaderName = leaderName;
                 l.LeaderId = leaderId;
                 l.IsRaid = isRaid;
                 l.Message = msg;
                 l.PlayerCount = playerCount;
-                if(!(l.IsTrade && !SettingsManager.ShowTradeLfg)) Listings.Add(l);
-                if(next != 0) reader.BaseStream.Position = next - 4;
+                if (!(l.IsTrade && !SettingsManager.ShowTradeLfg)) Listings.Add(l);
+                if (next != 0) reader.BaseStream.Position = next - 4;

             }

-            if (page < pages) if(SettingsManager.LfgEnabled) Proxy.RequestNextLfgPage(page + 1);
+            if (page < pages) if (SettingsManager.LfgEnabled && Proxy.IsConnected) Proxy.RequestNextLfgPage(page + 1);
             if (page == pages) IsLast = true;
         }
     }


MD5Builder is now locked to make Helpers.MD5() thread-safe

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@1136 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife/Helpers.cs
+++ libsecondlife/Helpers.cs
@@ -942,7 +942,8 @@
         public static string MD5(string password)
         {
             StringBuilder digest = new StringBuilder();
-            byte[] hash = MD5Builder.ComputeHash(ASCIIEncoding.Default.GetBytes(password));
+            byte[] hash;
+            lock(MD5Builder) hash = MD5Builder.ComputeHash(ASCIIEncoding.Default.GetBytes(password));

             // Convert the hash to a hex string
             foreach (byte b in hash)


removed goals assertion on test because it can come back null if no goal exists

--- Fitbit.IntegrationTests/UserTests.cs
+++ Fitbit.IntegrationTests/UserTests.cs
@@ -183,7 +183,6 @@

             Assert.IsNotNull(measurements);
             Assert.IsNotNull(measurements.Body);
-            Assert.IsNotNull(measurements.Goals);

         }


Fix: TileableComponents now properly reset their bounding areas when tiles are added and removed.

--- Framework/Tiles/TileableComponent.cs
+++ Framework/Tiles/TileableComponent.cs
@@ -77,6 +77,8 @@
                 else if (tile.Y < this.MinimumTile.Y) {
                     this.MinimumTile = new Point(this.MinimumTile.X, tile.Y);
                 }
+
+                this.ResetBoundingArea();
             }

             return result;
@@ -90,6 +92,7 @@
             this.MinimumTile = Point.Zero;
             this.MaximumTile = Point.Zero;
             this.ResetBoundingArea();
+            this.ResetTileBoundingAreas();
         }

         /// <inheritdoc/>
@@ -124,10 +127,12 @@

                 if (tile.X == this.MinimumTile.X || tile.Y == this.MinimumTile.Y) {
                     this.ResetMinimumTile();
+                    this.ResetBoundingArea();
                 }

                 if (tile.X == this.MaximumTile.X || tile.Y == this.MaximumTile.Y) {
-                    this.ResetMinimumTile();
+                    this.ResetMaximumTile();
+                    this.ResetBoundingArea();
                 }
             }

@@ -193,6 +198,7 @@
         protected override void Initialize() {
             this.TransformChanged += this.Self_TransformChanged;
             this.ResetBoundingArea();
+            this.ResetTileBoundingAreas();
             this.ResetMinimumTile();
             this.ResetMaximumTile();
         }
@@ -203,6 +209,7 @@
         protected virtual void OnGridChanged() {
             this._worldGrid.Reset();
             this.ResetBoundingArea();
+            this.ResetTileBoundingAreas();
         }

         /// <summary>
@@ -211,6 +218,13 @@
         protected void ResetBoundingArea() {
             this._tilePositionToBoundingArea.Clear();
             this._boundingArea.Reset();
+        }
+
+        /// <summary>
+        /// Resets the tile bounding areas.
+        /// </summary>
+        protected void ResetTileBoundingAreas() {
+            this._tilePositionToBoundingArea.Clear();
         }

         /// <summary>
@@ -260,6 +274,8 @@
             else {
                 this.MaximumTile = Point.Zero;
             }
+
+            this._boundingArea.Reset();
         }

         private void ResetMinimumTile() {
@@ -269,12 +285,12 @@
             else {
                 this.MinimumTile = Point.Zero;
             }
+
+            this._boundingArea.Reset();
         }

         private void Self_TransformChanged(object sender, EventArgs e) {
-            this._tilePositionToBoundingArea.Clear();
-            this._worldGrid.Reset();
-            this.ResetBoundingArea();
+            this.OnGridChanged();
         }
     }
 }


version update for the new package

version update for the new package

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


Media - Brush - Convert - Source type check

--- Granular.Presentation/Media/Brush.cs
+++ Granular.Presentation/Media/Brush.cs
@@ -30,7 +30,12 @@

         public object ConvertFrom(XamlNamespaces namespaces, object value)
         {
-            return new SolidColorBrush((Color)colorTypeConverter.ConvertFrom(namespaces, value));
+            if (value is string)
+            {
+                return new SolidColorBrush((Color)colorTypeConverter.ConvertFrom(namespaces, value));
+            }
+
+            throw new Granular.Exception("Can't convert \"{0}\" to Color", value);
         }
     }
 }


Fix null byte in closed captions

Fix null byte in closed captions

--- ValveResourceFormat/ClosedCaptions/ClosedCaptions.cs
+++ ValveResourceFormat/ClosedCaptions/ClosedCaptions.cs
@@ -2,7 +2,6 @@
 using System.Collections;
 using System.Collections.Generic;
 using System.IO;
-using System.Linq;
 using System.Text;

 namespace ValveResourceFormat.ClosedCaptions
@@ -87,8 +86,7 @@
             foreach (var caption in Captions)
             {
                 reader.BaseStream.Position = dataoffset + (caption.Blocknum * blocksize) + caption.Offset;
-                var bytes = reader.ReadBytes(caption.Length);
-                caption.Text = Encoding.Unicode.GetString(bytes);
+                caption.Text = reader.ReadNullTermString(Encoding.Unicode);
             }
         }


Amend

Amend

--- WpfAnalyzers/Refactorings/AutoPropertyRefactoring.cs
+++ WpfAnalyzers/Refactorings/AutoPropertyRefactoring.cs
@@ -600,7 +600,14 @@
             static InvocationExpressionSyntax Nameof(PropertyDeclarationSyntax property)
             {
                 return SyntaxFactory.InvocationExpression(
-                    expression: SyntaxFactory.IdentifierName("nameof"),
+                    expression: SyntaxFactory.IdentifierName(
+                        SyntaxFactory.Identifier(
+                            SyntaxFactory.TriviaList(
+                                SyntaxFactory.Whitespace(property.LeadingWhitespace() + new string(' ', 4))),
+                            SyntaxKind.NameOfKeyword,
+                            "nameof",
+                            "nameof",
+                            default)),
                     argumentList: SyntaxFactory.ArgumentList(
                         arguments: SyntaxFactory.SingletonSeparatedList(
                             SyntaxFactory.Argument(


tests(Compute): Generate random names with more time granularity. We don't care about precission really, just that names don't clash, which they were.

--- compute/api/Compute.Samples.Tests/ComputeFixture.cs
+++ compute/api/Compute.Samples.Tests/ComputeFixture.cs
@@ -106,7 +106,7 @@
         }

         private static string GenerateName(string prefix) =>
-            $"{prefix}-{DateTime.UtcNow.ToString("yyyyMMdd-HHmmssfff", CultureInfo.InvariantCulture)}";
+            $"{prefix}-{DateTime.UtcNow.ToString("yyyyMMdd-HHmmssfffffff", CultureInfo.InvariantCulture)}";

         private bool _disposed = false;
         public void Dispose()


ignore empty and javascript

ignore empty and javascript

--- 200oker/200oker/Checker.cs
+++ 200oker/200oker/Checker.cs
@@ -85,7 +85,11 @@
             Parallel.ForEach(links, new ParallelOptions() { MaxDegreeOfParallelism = Config.MaxChildThreads }, o =>
               {
                   var url = o.Attributes["href"];
+                  // ignore empty
                   if (String.IsNullOrWhiteSpace(url))
+                      return;
+                  // ignore javascript
+                  if (url.ToLower().StartsWith("javascript:"))
                       return;

                   // jump out if url should be ignored


AdventureSample - extract GetDirection method

--- projects/AdventureSample/src/Adventure/adventure.cs
+++ projects/AdventureSample/src/Adventure/adventure.cs
@@ -246,6 +246,26 @@

     private VerbResult Go(string noun)
     {
+        int dir = GetDirection(noun);
+        if (dir == Direction.Invalid)
+        {
+            if ((noun == "BOA") && (objects.Ref(ObjectId.Boat).Room == map.CurrentRoom))
+            {
+                map.CurrentRoom = RoomId.Boat;
+                return VerbResult.Proceed;
+            }
+            else
+            {
+                PRINT("YOU CAN'T GO THERE!");
+                return VerbResult.Idle;
+            }
+        }
+
+        return Go(dir);
+    }
+
+    private static int GetDirection(string noun)
+    {
         int dir = Direction.Invalid;
         if (noun == "NOR")
         {
@@ -272,21 +292,7 @@
             dir = Direction.Down;
         }

-        if (dir == Direction.Invalid)
-        {
-            if ((noun == "BOA") && (objects.Ref(ObjectId.Boat).Room == map.CurrentRoom))
-            {
-                map.CurrentRoom = RoomId.Boat;
-                return VerbResult.Proceed;
-            }
-            else
-            {
-                PRINT("YOU CAN'T GO THERE!");
-                return VerbResult.Idle;
-            }
-        }
-
-        return Go(dir);
+        return dir;
     }

     private VerbResult Go(int dir)


AdventureSample - extract Leave method

AdventureSample - extract Leave method

--- projects/AdventureSample/src/Adventure/adventure.cs
+++ projects/AdventureSample/src/Adventure/adventure.cs
@@ -900,9 +900,14 @@

     private VerbResult Leave(string noun)
     {
+        ObjectId id = objects.IdOf(noun);
+        return Leave(id);
+    }
+
+    private VerbResult Leave(ObjectId id)
+    {
         if (map.CurrentRoom == RoomId.Boat)
         {
-            ObjectId id = objects.IdOf(noun);
             if ((id == ObjectId.Boat) || (id == ObjectId.Blank))
             {
                 map.CurrentRoom = objects.Ref(ObjectId.Boat).Room;


CUDAのデバッグ

CUDAのデバッグ

--- output/CUDA.cs
+++ output/CUDA.cs
@@ -87,7 +87,7 @@
             if (depend.TryGetValue(asn, out depend_asns)) {
                 foreach(Assignment dep_asn in depend_asns) {

-                    sw.WriteLine("\tcudaStreamSynchronize({0});", StreamName(dep_asn.Left.VarRef));
+                    sw.WriteLine("\t_chk(cudaStreamSynchronize({0}));", StreamName(dep_asn.Left.VarRef));
                 }
             }

@@ -146,7 +146,7 @@
             // 順伝播/逆伝播の関数を作る。
             string fnc_name = (is_forward ? "Forward" : "Backward");
             sw.WriteLine("void {0}::{1}(){{", cls.Name, fnc_name);
-            sw.WriteLine("\tcudaMemcpyToSymbol(&_BatchSize, &BatchSize, sizeof(BatchSize));");
+            sw.WriteLine("\t_chk(cudaMemcpyToSymbol(_BatchSize, &BatchSize, sizeof(BatchSize)));");
             foreach (Assignment asn in asns) {
                 sw.WriteLine("\tStart_{0}();", KernelName(is_forward, asn.Left.VarRef));
             }
@@ -292,7 +292,7 @@

             // パラメータ更新の関数を作る。
             sw.WriteLine("void {0}::ParameterUpdate(){{", cls.Name);
-            sw.WriteLine("\tcudaMemcpyToSymbol(&_BatchSize, &BatchSize, sizeof(BatchSize));");
+            sw.WriteLine("\t_chk(cudaMemcpyToSymbol(_BatchSize, &BatchSize, sizeof(BatchSize)));");
             foreach (int i in Range(dic.Keys.Count)) {
                 sw.WriteLine("\tParameterUpdate_{0}();", i);
             }
@@ -330,10 +330,10 @@
         /*
         ヘッダファイルのコードを作る。
         */
-        string MakeHeaderFile(Class cls, List<Variable> array_flds, Function constructor, List<Assignment> sorted_forward_asns, List<Assignment> sorted_backward_asns, int n_parameter_update) {
+        string MakeHeaderFile(Class cls, Variable x_var, Variable y_var, List<Variable> array_flds, Function constructor, List<Assignment> sorted_forward_asns, List<Assignment> sorted_backward_asns, int n_parameter_update) {
             StringWriter sw = new StringWriter();

-            string header = "class " + cls.Name + " : Layer {\r\npublic:\r\n" +
+            string header = "class " + cls.Name + " : public Layer {\r\npublic:\r\n" +
                 string.Join("", from fld in cls.Fields select Nest(1) + FieldCode(fld)) +
                 string.Join("", from fld in array_flds select "\tcudaStream_t " + StreamName(fld) + ";\r\n");

@@ -341,10 +341,13 @@

             sw.WriteLine("\t{0};", FunctionHeader(cls, constructor, false));
             sw.WriteLine("\t~{0}();", cls.Name);
-            sw.WriteLine("\tvoid Forward();");
-            sw.WriteLine("\tvoid Backward();");
-            sw.WriteLine("\tvoid Allocate();");
-            sw.WriteLine("\tvoid Free();");
+            sw.WriteLine("\tvirtual void Forward() override;");
+            sw.WriteLine("\tvirtual void Backward() override;");
+            sw.WriteLine("\tvirtual void Allocate() override;");
+            sw.WriteLine("\tvirtual void Free() override;");
+
+            sw.WriteLine("\tvirtual void SetX(void* src) override {{ _chk(cudaMemcpy({0}, src, BatchSize * {1} * sizeof({2}), cudaMemcpyHostToDevice)); }}", x_var.Name, ElementCountApply(x_var).Code(), x_var.TypeVar.Name);
+            sw.WriteLine("\tvirtual void SetY(void* src) override {{ _chk(cudaMemcpy({0}, src, BatchSize * {1} * sizeof({2}), cudaMemcpyHostToDevice)); }}", y_var.Name, ElementCountApply(y_var).Code(), y_var.TypeVar.Name);

             foreach (Assignment asn in sorted_forward_asns) {
                 sw.WriteLine("\tvoid Start_{0}();", KernelName(true , asn.Left.VarRef));
@@ -380,26 +383,26 @@
                     sw.WriteLine(StatementCode(stmt, 1));
                 }
             }
-            sw.WriteLine(string.Join("", from fld in array_flds select "\tcudaStreamCreate(&" + StreamName(fld) + ");\r\n"));
+            sw.WriteLine(string.Join("", from fld in array_flds select "\t_chk(cudaStreamCreate(&" + StreamName(fld) + "));\r\n"));
             sw.WriteLine("}");

             // デストラクタを作る。
             sw.WriteLine("");
             sw.WriteLine("{0}::~{0}(){{", cls.Name);
             sw.WriteLine("\tFree();");
-            sw.WriteLine(string.Join("", from fld in array_flds select "\tcudaStreamDestroy(" + StreamName(fld) + ");\r\n"));
+            sw.WriteLine(string.Join("", from fld in array_flds select "\t_chk(cudaStreamDestroy(" + StreamName(fld) + "));\r\n"));
             sw.WriteLine("}");

             // 配列の領域の確保を作る。
             sw.WriteLine("");
             sw.WriteLine("void {0}::Allocate(){{", cls.Name);
-            sw.Write(string.Join("", from fld in array_flds select string.Format("\tcudaMalloc(&{0}, BatchSize * {1}); \r\n", fld.Name, ElementCountApply(fld).Code())));
+            sw.Write(string.Join("", from fld in array_flds select string.Format("\t_chk(cudaMalloc(&{0}, BatchSize * {1} * sizeof({2}))); \r\n", fld.Name, ElementCountApply(fld).Code(), fld.TypeVar.Name)));
             sw.WriteLine("}");

             // 配列の領域の解放を作る。
             sw.WriteLine("");
             sw.WriteLine("void {0}::Free(){{", cls.Name);
-            sw.Write(string.Join("", from fld in array_flds select string.Format("\tcudaFree({0}); \r\n", fld.Name)));
+            sw.Write(string.Join("", from fld in array_flds select string.Format("\t_chk(cudaFree({0})); \r\n", fld.Name)));
             sw.WriteLine("}");
         }

@@ -428,6 +431,7 @@

             sw.WriteLine("#include <stdio.h>");
             sw.WriteLine("#include <FLOAT.h>");
+            sw.WriteLine("#include \"../Lib/Lib.h\"");
             sw.WriteLine("#include \"MkFn.h\"");
             sw.WriteLine("#include \"{0}.h\"", cls.Name);

@@ -465,7 +469,7 @@
             }

             // ヘッダファイルのコードを作る。
-            string header_code = MakeHeaderFile(cls, array_flds, constructor, sorted_forward_asns, sorted_backward_asns, n_parameter_update);
+            string header_code = MakeHeaderFile(cls, x_var, y_var, array_flds, constructor, sorted_forward_asns, sorted_backward_asns, n_parameter_update);
             File.WriteAllText(src_dir + "\\" + cls.Name + ".h", ASCII(header_code), Encoding.UTF8);

             // 実装のコードをファイルに書く。


Add XML Document comments for 'LexerError.cs'

--- lury-lexer/LexerError.cs
+++ lury-lexer/LexerError.cs
@@ -30,28 +30,72 @@
 {
     // Lexer's Number Range: 0x10_0000 - 0x1f_ffff

+    /// <summary>
+    /// エラーを識別するための列挙体です。
+    /// </summary>
     public enum LexerError
     {
         // Number Range: 0x10_0000 - 0x10_ffff
+
+        /// <summary>
+        /// 不明なエラーです。
+        /// </summary>
         Unknown = 0x100000,

+        /// <summary>
+        /// 論理行の一行目に無効なインデントが存在します。
+        /// </summary>
         InvalidIndentFirstLine = 0x100001,
+
+        /// <summary>
+        /// 認識できない文字が検出されました。
+        /// </summary>
         InvalidCharacter = 0x100002,
+
+        /// <summary>
+        /// 無効なインデントが検出されました。
+        /// </summary>
         InvalidIndent = 0x100003,
+
+        /// <summary>
+        /// バックスラッシュの後に予期しない文字が存在します。
+        /// </summary>
         UnexpectedCharacterAfterBackslash = 0x100004,
+
+        /// <summary>
+        /// ブロックコメントが閉じられていません。
+        /// </summary>
         UnclosedBlockComment = 0x100005,
+
+        /// <summary>
+        /// 文字列リテラルが閉じられていません。
+        /// </summary>
         UnclosedStringLiteral = 0x100006,
     }

+    /// <summary>
+    /// 警告を識別するための列挙体です。
+    /// </summary>
     public enum LexerWarning
     {
         // Number Range: 0x11_0000 - 0x11_ffff
+
+        /// <summary>
+        /// 不明な警告です。
+        /// </summary>
         Unknown = 0x110000,
     }

+    /// <summary>
+    /// 情報を識別するための列挙体です。
+    /// </summary>
     public enum LexerInfo
     {
         // Number Range: 0x12_0000 - 0x12_ffff
+
+        /// <summary>
+        /// 不明な情報です。
+        /// </summary>
         Unknown = 0x120000,
     }
 }


Using generated symbols instead of hard-coded temp names.

--- csharp/Magpie.Compilation/Compiler/FunctionBinder.cs
+++ csharp/Magpie.Compilation/Compiler/FunctionBinder.cs
@@ -19,7 +19,7 @@
             // create a local slot for the arg if there is one
             if (function.Type.Parameter.Unbound != Decl.Unit)
             {
-                scope.Define("__arg", Decl.Unit /* ignored */, false);
+                scope.Define(GenerateName(), Decl.Unit /* ignored */, false);
             }

             var binder = new FunctionBinder(function, context, scope);
@@ -328,12 +328,7 @@
         IBoundExpr IUnboundExprVisitor<IBoundExpr>.Visit(LocalFuncExpr expr)
         {
             // create a unique name for the local function
-            //### bob: this actually isn't foolproof. if the parent
-            // named function is overloaded (in two separate source files),
-            // this could collide if both overloads defined local function
-            // at the same source position.
-            string name = String.Format("{0}.{1}.{2}", mFunction.Name,
-                expr.Position.Line, expr.Position.Column);
+            string name = GenerateName();

             // create a reference to it
             var reference = new FuncRefExpr(expr.Position,
@@ -408,8 +403,7 @@
             //      else Bang

             // use a space so we can't collide with a user's variable
-            //### bob: should use some auto-generated name so multiple lets don't collide
-            var optionName = "let ";
+            var optionName = GenerateName();

             // def a__ <- Foo
             var defineOption = new DefineExpr(expr.Position, optionName, expr.Condition, false);
@@ -528,12 +522,11 @@
                 }
                 else
                 {
-                    // note: the iterator variable includes a space to ensure it can't collide with a
-                    // user-defined variable.
+                    var iterName = GenerateName();
                     var createIterator = new CallExpr(new NameExpr(clause.Position, "Iterate"), clause.Expression);
-                    topExprs.Add(new DefineExpr(clause.Position, clause.Name + " iter", createIterator, false));
-
-                    var condition = new CallExpr(new NameExpr(clause.Position, "MoveNext"), new NameExpr(clause.Position, clause.Name + " iter"));
+                    topExprs.Add(new DefineExpr(clause.Position, iterName, createIterator, false));
+
+                    var condition = new CallExpr(new NameExpr(clause.Position, "MoveNext"), new NameExpr(clause.Position, iterName));
                     if (conditionExpr == null)
                     {
                         conditionExpr = condition;
@@ -544,7 +537,7 @@
                         conditionExpr = new CallExpr(new NameExpr(clause.Position, "&"), new TupleExpr(conditionExpr, condition));
                     }

-                    var currentValue = new CallExpr(new NameExpr(clause.Position, "Current"), new NameExpr(clause.Position, clause.Name + " iter"));
+                    var currentValue = new CallExpr(new NameExpr(clause.Position, "Current"), new NameExpr(clause.Position, iterName));
                     whileExprs.Add(new DefineExpr(clause.Position, clause.Name, currentValue, false));
                 }
             }
@@ -603,14 +596,16 @@
         }

         //### bob: should refactor code to use this for all temps
-        private string GenerateName()
-        {
+        private static string GenerateName()
+        {
+            sTempIndex++;
+
             // using space in identifiers ensures it can't collide with a user-defined name
-            return "__temp " + mTempIndex;
+            return "__temp " + sTempIndex;
         }

         private BindingContext mContext;
         private Function mFunction;
-        private int mTempIndex;
+        private static int sTempIndex;
     }
 }


Updates

Updates

--- Hermod/HTTP/Server/HTTPExtentions.cs
+++ Hermod/HTTP/Server/HTTPExtentions.cs
@@ -68,7 +68,7 @@
             if (Request.Content == null || Request.Content.Length == 0)
                 return new HTTPResult<String>(Request, HTTPStatusCode.BadRequest);

-            var RequestBodyString = Request.Content.ToUTF8String();
+            var RequestBodyString = Request.Content.ToUTF8String().Trim();

             if (RequestBodyString.IsNullOrEmpty())
                 return new HTTPResult<String>(Request, HTTPStatusCode.BadRequest);


Switch direct handling by a syncrhonous dispatching in console sample

--- samples/ConsoleApplication/ConsoleApplication/Program.cs
+++ samples/ConsoleApplication/ConsoleApplication/Program.cs
@@ -9,20 +9,18 @@
 {
     class Program
     {
-        static void Main(string[] args)
+        static void Main()
         {
             var registry = new Registry();
             registry.IncludeRegistry<InfrastructureRegistry>();
             var container = new Container(registry);

-            var createPersonCommandHandler = container.GetInstance<IHandler<CreatePersonCommand>>();
-            createPersonCommandHandler.Handle(new CreatePersonCommand());
+            var dispatcher = container.GetInstance<IDispatcher>();
+            dispatcher.Dispatch(new CreatePersonCommand());

-            var getPersonQueryHandler = container.GetInstance<IHandler<GetPersonQuery, GetPersonReadModel>>();
-            var person = getPersonQueryHandler.Handle(new GetPersonQuery());
+            var person = dispatcher.Dispatch<GetPersonQuery, GetPersonReadModel>(new GetPersonQuery());

             Console.WriteLine($"Hello {person.Name} !");
-
             Console.ReadKey();
         }
     }


Can draw a red circle now.

Can draw a red circle now.

--- ISGP2D3D/One.Eight/One.Eight/Game.cs
+++ ISGP2D3D/One.Eight/One.Eight/Game.cs
@@ -109,7 +109,26 @@
 		protected override void Draw(GameTime gameTime)
 		{
 			GraphicsDevice.Clear(Color.White);
-
+			#region Transform
+			effect.VertexColorEnabled = true;
+			effect.World = Matrix.Identity;
+			effect.View = new Matrix(
+				1.0f, 0.0f, 0.0f, 0.0f,
+				0.0f, 1.0f, 0.0f, 0.0f,
+				0.0f, 0.0f, -1.0f, 0.0f,
+				0.0f, 0.0f, 0.0f, 1.0f
+			);
+			effect.Projection = Matrix.CreateOrthographicOffCenter(
+				0f, Window.ClientBounds.Width,
+				Window.ClientBounds.Height, 0f,
+				-10f, 10f
+			);
+			#endregion
+			if (vertex.Count > 0)
+			{
+				effect.CurrentTechnique.Passes[0].Apply();
+				GraphicsDevice.DrawPrimitives(PrimitiveType.LineStrip, 0, vertex.Count);
+			}
 			base.Draw(gameTime);
 		}
 	}


Try to recover NamePipeServerStream on IOException

--- source/Htc.Vita.Core/Runtime/NamedPipeIpcChannel.cs
+++ source/Htc.Vita.Core/Runtime/NamedPipeIpcChannel.cs
@@ -282,41 +282,48 @@
                     {
                         while (!_shouldStopWorkers)
                         {
-                            if (serverStream.IsConnected)
+                            try
                             {
-                                serverStream.Disconnect();
-                            }
-                            serverStream.WaitForConnection();
-
-                            var outputBuilder = new StringBuilder();
-                            var outputBuffer = new byte[PipeBufferSize];
-                            do
-                            {
-                                serverStream.Read(outputBuffer, 0, outputBuffer.Length);
-                                var outputChunk = Encoding.UTF8.GetString(outputBuffer);
-                                outputBuilder.Append(outputChunk);
-                                outputBuffer = new byte[outputBuffer.Length];
-                            }
-                            while (!serverStream.IsMessageComplete);
-                            var channel = new IpcChannel
-                            {
+                                if (serverStream.IsConnected)
+                                {
+                                    serverStream.Disconnect();
+                                }
+                                serverStream.WaitForConnection();
+
+                                var outputBuilder = new StringBuilder();
+                                var outputBuffer = new byte[PipeBufferSize];
+                                do
+                                {
+                                    serverStream.Read(outputBuffer, 0, outputBuffer.Length);
+                                    var outputChunk = Encoding.UTF8.GetString(outputBuffer);
+                                    outputBuilder.Append(outputChunk);
+                                    outputBuffer = new byte[outputBuffer.Length];
+                                }
+                                while (!serverStream.IsMessageComplete);
+                                var channel = new IpcChannel
+                                {
                                     Output = FilterOutInvalidChars(outputBuilder.ToString())
-                            };
-                            if (!string.IsNullOrEmpty(channel.Output))
-                            {
-                                if (OnMessageHandled == null)
+                                };
+                                if (!string.IsNullOrEmpty(channel.Output))
                                 {
-                                    Logger.GetInstance(typeof(Provider)).Error("Can not find OnMessageHandled delegates to handle messages");
+                                    if (OnMessageHandled == null)
+                                    {
+                                        Logger.GetInstance(typeof(Provider)).Error("Can not find OnMessageHandled delegates to handle messages");
+                                    }
+                                    else
+                                    {
+                                        OnMessageHandled(channel, GetClientSignature(serverStream));
+                                    }
                                 }
-                                else
+                                if (!string.IsNullOrEmpty(channel.Input))
                                 {
-                                    OnMessageHandled(channel, GetClientSignature(serverStream));
+                                    var inputBytes = Encoding.UTF8.GetBytes(channel.Input);
+                                    serverStream.Write(inputBytes, 0, inputBytes.Length);
                                 }
                             }
-                            if (!string.IsNullOrEmpty(channel.Input))
+                            catch (IOException e)
                             {
-                                var inputBytes = Encoding.UTF8.GetBytes(channel.Input);
-                                serverStream.Write(inputBytes, 0, inputBytes.Length);
+                                Logger.GetInstance(typeof(Provider)).Error($"IOException happened on thread[{threadId}]: {e.Message}");
                             }
                         }
                         if (serverStream.IsConnected)


test ToNamespaceContext

test ToNamespaceContext

--- src/tests/net-core/Util/ConvertTest.cs
+++ src/tests/net-core/Util/ConvertTest.cs
@@ -12,6 +12,7 @@
   limitations under the License.
 */

+using System.Collections.Generic;
 using System.Xml;
 using NUnit.Framework;
 using Org.XmlUnit.Input;
@@ -77,5 +78,14 @@
             Assert.AreSame(d.DocumentElement,
                            Convert.ToNode(new DOMSource(d.DocumentElement)));
         }
+
+        [Test]
+        public void ShouldFillNamespaceManager() {
+            XmlNamespaceManager mgr = Convert.ToNamespaceContext(new Dictionary<string, string> {
+                    { "foo", "bar" }
+                });
+            Assert.AreEqual("foo", mgr.LookupPrefix("bar"));
+            Assert.AreEqual("bar", mgr.LookupNamespace("foo"));
+        }
     }
 }


cars-assembly: compare doubles with precision 1 (#1596)

--- exercises/concept/cars-assemble/CarsAssembleTests.cs
+++ exercises/concept/cars-assemble/CarsAssembleTests.cs
@@ -6,37 +6,37 @@
     [Fact]
     public void Production_rate_per_hour_for_speed_zero()
     {
-        Assert.Equal(0.0, AssemblyLine.ProductionRatePerHour(0));
+        Assert.Equal(0.0, AssemblyLine.ProductionRatePerHour(0), precision: 1);
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
     public void Production_rate_per_hour_for_speed_one()
     {
-        Assert.Equal(221.0, AssemblyLine.ProductionRatePerHour(1));
+        Assert.Equal(221.0, AssemblyLine.ProductionRatePerHour(1), precision: 1);
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
     public void Production_rate_per_hour_for_speed_four()
     {
-        Assert.Equal(884.0, AssemblyLine.ProductionRatePerHour(4));
+        Assert.Equal(884.0, AssemblyLine.ProductionRatePerHour(4), precision: 1);
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
     public void Production_rate_per_hour_for_speed_seven()
     {
-        Assert.Equal(1392.3, AssemblyLine.ProductionRatePerHour(7));
+        Assert.Equal(1392.3, AssemblyLine.ProductionRatePerHour(7), precision: 1);
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
     public void Production_rate_per_hour_for_speed_nine()
     {
-        Assert.Equal(1591.2, AssemblyLine.ProductionRatePerHour(9));
+        Assert.Equal(1591.2, AssemblyLine.ProductionRatePerHour(9), precision: 1);
     }

     [Fact(Skip = "Remove this Skip property to run this test")]
     public void Production_rate_per_hour_for_speed_ten()
     {
-        Assert.Equal(1701.7, AssemblyLine.ProductionRatePerHour(10));
+        Assert.Equal(1701.7, AssemblyLine.ProductionRatePerHour(10), precision: 1);
     }

     [Fact(Skip = "Remove this Skip property to run this test")]


Update Resource.cs

Update Resource.cs

Handle nested Dictionaries during deserialization. Otherwise we get an error trying to convert a string to a dictionary.

--- src/Balanced/Resource.cs
+++ src/Balanced/Resource.cs
@@ -6,6 +6,7 @@
 using System.Linq;
 using System.Reflection;
 using System.Runtime.Serialization;
+using System.Runtime.Serialization.Json;
 using System.Web;
 using System.Diagnostics;

@@ -105,16 +106,31 @@
                 if (PropertyNames.Any(x => x == entry.Key))
                 {
                     var clsProperty = this.GetType().GetProperty(entry.Key);
-                    if (clsProperty.PropertyType.Name == "DateTime")
+                    switch(clsProperty.PropertyType.Name)
                     {
-                        DateTime dttm = DateTime.Parse((string)entry.Value, null, DateTimeStyles.RoundtripKind);
-                        clsProperty.SetValue(this, dttm);
+                        case "DateTime":
+                            {
+                                DateTime dttm = DateTime.Parse((string)entry.Value, null, DateTimeStyles.RoundtripKind);
+                                clsProperty.SetValue(this, dttm, null);
+                                break;
+                            }
+                        case "Dictionary`2":
+                            {
+                                if (entry.Value != null && entry.Value.ToString() != "")
+                                {
+                                    var jsSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
+                                    clsProperty.SetValue(this, (Dictionary<string, object>)jsSerializer.DeserializeObject(entry.Value.ToString()), null);
+                                }
+
+                                break;
+                            }
+                        default:
+                            {
+                                clsProperty.SetValue(this, entry.Value, null);
+                                break;
+                            }
+
                     }
-                    else
-                    {
-                        clsProperty.SetValue(this, entry.Value);
-                    }
-
                 }
             }
         }


Attempt to solve warnings...

Attempt to solve warnings...

--- osu.Game.Rulesets.Mania/Beatmaps/LegacyBeatmapConverter.cs
+++ osu.Game.Rulesets.Mania/Beatmaps/LegacyBeatmapConverter.cs
@@ -40,7 +40,7 @@
                 yield break;
             }

-            IEnumerable<ManiaHitObject> objects = null;
+            IEnumerable<ManiaHitObject> objects;
             switch (beatmap.BeatmapInfo.RulesetID)
             {
                 default:
@@ -74,7 +74,9 @@
             var distanceData = original as IHasDistance;
             var positionData = original as IHasPosition;

-            PatternGenerator conversion = null;
+            // Following lines currently commented out to appease resharper
+
+            //PatternGenerator conversion = null;

             if (distanceData != null)
             {
@@ -89,13 +91,13 @@
                 // Circle
             }

-            if (conversion == null)
-                return new ManiaHitObject[0];
+            //if (conversion == null)
+                return null;

-            Pattern newPattern = conversion.Generate();
-            lastPattern = newPattern;
+            //Pattern newPattern = conversion.Generate();
+            //lastPattern = newPattern;

-            return newPattern.HitObjects;
+            //return newPattern.HitObjects;
         }

         /// <summary>
@@ -113,6 +115,8 @@
                 var endTimeData = HitObject as IHasEndTime;
                 var positionData = HitObject as IHasXPosition;

+                int column = GetColumn(positionData?.X ?? 0);
+
                 var pattern = new Pattern();

                 if (endTimeData != null)
@@ -122,7 +126,7 @@
                         StartTime = HitObject.StartTime,
                         Samples = HitObject.Samples,
                         Duration = endTimeData.Duration,
-                        Column = GetColumn(positionData?.X ?? 0),
+                        Column = column,
                     });
                 }
                 else if (positionData != null)
@@ -131,7 +135,7 @@
                     {
                         StartTime = HitObject.StartTime,
                         Samples = HitObject.Samples,
-                        Column = GetColumn(positionData?.X ?? 0)
+                        Column = column
                     });
                 }


Add comments and XML doc

Add comments and XML doc

--- osu.Game.Rulesets.Osu/Utils/OsuHitObjectGenerationUtils.cs
+++ osu.Game.Rulesets.Osu/Utils/OsuHitObjectGenerationUtils.cs
@@ -210,10 +210,16 @@
             return (timeSinceTimingPoint + 1) % length < 2;
         }

+        /// <summary>
+        /// Generates a random number from a normal distribution using the Box-Muller transform.
+        /// </summary>
         public static float RandomGaussian(Random rng, float mean = 0, float stdDev = 1)
         {
+            // Generate 2 random numbers in the interval (0,1].
+            // x1 must not be 0 since log(0) = undefined.
             double x1 = 1 - rng.NextDouble();
             double x2 = 1 - rng.NextDouble();
+
             double stdNormal = Math.Sqrt(-2 * Math.Log(x1)) * Math.Sin(2 * Math.PI * x2);
             return mean + stdDev * (float)stdNormal;
         }


Remove (soon-to-be) redundant labels.

Remove (soon-to-be) redundant labels.

--- osu.Game/Overlays/Options/Sections/General/LoginOptions.cs
+++ osu.Game/Overlays/Options/Sections/General/LoginOptions.cs
@@ -109,13 +109,11 @@
                 Spacing = new Vector2(0, 5);
                 Children = new Drawable[]
                 {
-                    new SpriteText { Text = "Username" },
                     username = new OsuTextBox
                     {
                         RelativeSizeAxes = Axes.X,
                         Text = api?.Username ?? string.Empty
                     },
-                    new SpriteText { Text = "Password" },
                     password = new OsuPasswordTextBox
                     {
                         RelativeSizeAxes = Axes.X


(NOA): force cp932 encoding for older archives.

--- ArcFormats/Entis/ArcNOA.cs
+++ ArcFormats/Entis/ArcNOA.cs
@@ -93,7 +93,9 @@
             uint id = file.View.ReadUInt32 (8);
             if (0x02000400 != id)
                 return null;
-            var reader = new IndexReader (file, NoaEncoding.Get<Encoding>());
+            bool old_format = file.View.AsciiEqual (0x10, "EMSAC-Binary Archive");
+            Encoding enc = old_format ? Encodings.cp932 : NoaEncoding.Get<Encoding>();
+            var reader = new IndexReader (file, enc);
             if (!reader.ParseRoot() || 0 == reader.Dir.Count)
                 return null;
             if (reader.HasEncrypted)


(LibScheme): added constructors from string key.

--- ArcFormats/Malie/ArcLIB.cs
+++ ArcFormats/Malie/ArcLIB.cs
@@ -123,16 +123,22 @@
         public uint     DataAlign;
         public uint[]   Key;

-        public LibScheme (uint[] key)
-        {
-            DataAlign = 0x1000;
-            Key = key;
+        public LibScheme (uint[] key) : this (0x1000, key)
+        {
         }

         public LibScheme (uint align, uint[] key)
         {
             DataAlign = align;
             Key = key;
+        }
+
+        public LibScheme (string key) : this (Camellia.GenerateKey (key))
+        {
+        }
+
+        public LibScheme (uint align, string key) : this (align, Camellia.GenerateKey (key))
+        {
         }
     }


* add reference to System.IO.Compression * correct bug in CFDATA (incorrect offsets) * add new doc comment to CabinetArchive#ctor * correct stupid folder/file issues (forgot to add to collection) * add retrieval of CFDATA blocks

--- Archives/CabinetArchive.cs
+++ Archives/CabinetArchive.cs
@@ -10,6 +10,7 @@
 using System.Linq;
 using System.Text;
 using System.IO;
+using System.IO.Compression;

 namespace SynapLink.Zener.Archives
 {
@@ -139,7 +140,7 @@

                 var cBytes = minHdr.Skip(0).Take(4);
                 var cdBytes = minHdr.Skip(4).Take(2);
-                var cuBytes = minHdr.Skip(8).Take(2);
+                var cuBytes = minHdr.Skip(6).Take(2);

                 if (!BitConverter.IsLittleEndian)
                 {
@@ -317,6 +318,9 @@
         /// </exception>
         /// <exception cref="System.IO.InvalidDataException">
         ///     Thrown when the stream's data does not pass verification.
+        ///
+        ///     Thrown when the cabinet makes references to an invalid
+        ///     folder.
         /// </exception>
         /// <exception cref="System.NotSupportedException">
         ///     Thrown when the file format version of the provided cabinet
@@ -520,6 +524,8 @@
                             i
                         ));
                 }
+
+                folders.Add(fdr);
             }

             // The first CFFILE entry is at an offset given within the
@@ -543,6 +549,19 @@
                 {
                     continue;
                 }
+
+                files.Add(file);
+            }
+
+            List<List<CFDATA>> dataBlocks = new List<List<CFDATA>>(folders.Count);
+            foreach (var fdr in folders)
+            {
+                List<CFDATA> dBs = new List<CFDATA>(fdr.cCFData);
+                stream.Position = fdr.coffCabStart;
+                for (int i = 0; i < fdr.cCFData; i++)
+                    dBs.Add(new CFDATA(stream, _dataAbLength));
+
+                dataBlocks.Add(dBs);
             }
         }


[intel] 64-bit linker setting?

[intel] 64-bit linker setting?

--- packages/IntelCommon/dev/Scripts/LinkerOptionCollection.cs
+++ packages/IntelCommon/dev/Scripts/LinkerOptionCollection.cs
@@ -192,11 +192,11 @@
             Opus.Core.ValueTypeOption<bool> sixtyFourBitOption = option as Opus.Core.ValueTypeOption<bool>;
             if (sixtyFourBitOption.Value)
             {
-                commandLineBuilder.Add("-m64");
+                commandLineBuilder.Add("-arch elf_x86_64");
             }
             else
             {
-                commandLineBuilder.Add("-m32");
+                commandLineBuilder.Add("-arch elf_i386");
             }
         }


Camera now rotates based on mouse movement.

--- Assets/CameraController.cs
+++ Assets/CameraController.cs
@@ -25,16 +25,16 @@
 		forward = forward.normalized * TRANSLATE_SPEED;

 		if (Input.GetKey (KeyCode.W)) {
-			displacement = forward;
+			displacement += forward;
 		}
 		if (Input.GetKey (KeyCode.S)) {
-			displacement = -forward;
+			displacement += -forward;
 		}
 		if (Input.GetKey (KeyCode.A)) {
-			displacement = -transform.right * TRANSLATE_SPEED;
+			displacement += -transform.right * TRANSLATE_SPEED;
 		}
 		if (Input.GetKey (KeyCode.D)) {
-			displacement = transform.right * TRANSLATE_SPEED;
+			displacement += transform.right * TRANSLATE_SPEED;
 		}
 		if (Input.GetKey (KeyCode.Q)) {
 			rotation = Quaternion.Euler(-eulerAngle);
@@ -42,9 +42,17 @@
 		if (Input.GetKey (KeyCode.E)) {
 			rotation = Quaternion.Euler(eulerAngle);
 		}
-
+
+		//if(Input.GetMouseButtonDown(0))
+		//	transform.Rotate(new Vector3(0.0f, Input.GetAxis("Mouse X"), 0.0f) * 100.0f);
+
+		// Rotate camera based on mouse movement
+		float h = 2.0f * Input.GetAxis("Mouse X");
+		float v = 2.0f * Input.GetAxis("Mouse Y") * -1.0f;
+		Vector3 hi = new Vector3(v, h, 0);
+		gameObject.transform.rotation = Quaternion.Euler(gameObject.transform.rotation.eulerAngles + hi);

 		gameObject.transform.position += displacement;
-		gameObject.transform.rotation = Quaternion.Euler(gameObject.transform.rotation.eulerAngles + rotation.eulerAngles);
+		//gameObject.transform.rotation = Quaternion.Euler(gameObject.transform.rotation.eulerAngles + rotation.eulerAngles);
 	}
 }


removed leftover logging

removed leftover logging

--- Assets/DeltaDNA/Product.cs
+++ Assets/DeltaDNA/Product.cs
@@ -122,7 +122,6 @@

         private static readonly IDictionary<string, int> ISO4217;
         static Product() {
-            long before = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
             ISO4217 = new Dictionary<string, int>();

             using (XmlReader reader = XmlReader.Create(new StringReader((Resources.Load(
@@ -178,8 +177,6 @@
                     }
                 }
             }
-
-            Debug.LogWarning((DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) - before);
         }
     }


Call GetUname() only once

Call GetUname() only once

Came across this by accident. It's probably better to call it just once.

--- src/Baseline/Platform.cs
+++ src/Baseline/Platform.cs
@@ -10,7 +10,7 @@
         {
             var name = GetUname();
             IsWindows = name == string.Empty;
-            IsDarwin = string.Equals(GetUname(), "Darwin", StringComparison.Ordinal);
+            IsDarwin = string.Equals(name, "Darwin", StringComparison.Ordinal);
             IsLinux = (!IsWindows && !IsDarwin);
         }