UI Changes to fit invisible text

UI Changes to fit invisible text

--- MainForm.Designer.cs
+++ MainForm.Designer.cs
@@ -49,7 +49,6 @@
             this.pnlLightCtrl = new System.Windows.Forms.Panel();
             this.btnColorChange = new System.Windows.Forms.Button();
             this.lblBrightnessValue = new System.Windows.Forms.Label();
-            this.lblMax = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.tbBrightness = new System.Windows.Forms.TrackBar();
             this.lblLD_Name = new System.Windows.Forms.Label();
@@ -80,7 +79,7 @@
             //
             // btnConnect
             //
-            this.btnConnect.Location = new System.Drawing.Point(157, 73);
+            this.btnConnect.Location = new System.Drawing.Point(164, 77);
             this.btnConnect.Name = "btnConnect";
             this.btnConnect.Size = new System.Drawing.Size(88, 23);
             this.btnConnect.TabIndex = 0;
@@ -94,9 +93,9 @@
             this.gbConnect.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
             this.gbConnect.Controls.Add(this.label1);
             this.gbConnect.Controls.Add(this.btnConnect);
-            this.gbConnect.Location = new System.Drawing.Point(204, 10);
+            this.gbConnect.Location = new System.Drawing.Point(204, 6);
             this.gbConnect.Name = "gbConnect";
-            this.gbConnect.Size = new System.Drawing.Size(258, 106);
+            this.gbConnect.Size = new System.Drawing.Size(258, 110);
             this.gbConnect.TabIndex = 1;
             this.gbConnect.TabStop = false;
             this.gbConnect.Text = "CONNECT (Required only once)";
@@ -104,9 +103,9 @@
             // label1
             //
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(34, 16);
+            this.label1.Location = new System.Drawing.Point(9, 20);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(211, 26);
+            this.label1.Size = new System.Drawing.Size(243, 30);
             this.label1.TabIndex = 1;
             this.label1.Text = "Press the button on your Philips Hue Bridge\r\nand Click on \"Connect\" button below." +
     "";
@@ -137,20 +136,19 @@
             this.dgvLights.RowHeadersVisible = false;
             this.dgvLights.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
             this.dgvLights.ShowEditingIcon = false;
-            this.dgvLights.Size = new System.Drawing.Size(171, 156);
+            this.dgvLights.Size = new System.Drawing.Size(171, 149);
             this.dgvLights.TabIndex = 2;
             this.dgvLights.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.onLightSelectionChanged);
             this.dgvLights.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.onCellText_Changed);
             //
             // label3
             //
-            this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(7, 226);
+            this.label3.Location = new System.Drawing.Point(6, 220);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(175, 39);
+            this.label3.Size = new System.Drawing.Size(171, 66);
             this.label3.TabIndex = 1;
-            this.label3.Text = "Click Refresh button to see all lights\r\npaired with this bridge.\r\nSelect a light " +
-    "to modify its settings.";
+            this.label3.Text = "Click Refresh button to see all lights paired with this bridge.\r\nSelect a light t" +
+    "o modify its settings.";
             //
             // gbLights
             //
@@ -159,7 +157,7 @@
             this.gbLights.Controls.Add(this.dgvLights);
             this.gbLights.Location = new System.Drawing.Point(10, 118);
             this.gbLights.Name = "gbLights";
-            this.gbLights.Size = new System.Drawing.Size(188, 270);
+            this.gbLights.Size = new System.Drawing.Size(188, 299);
             this.gbLights.TabIndex = 1;
             this.gbLights.TabStop = false;
             this.gbLights.Text = "Connected Hue Lights";
@@ -167,7 +165,7 @@
             // btnRefreshLights
             //
             this.btnRefreshLights.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.btnRefreshLights.Location = new System.Drawing.Point(83, 187);
+            this.btnRefreshLights.Location = new System.Drawing.Point(83, 180);
             this.btnRefreshLights.Name = "btnRefreshLights";
             this.btnRefreshLights.Size = new System.Drawing.Size(95, 37);
             this.btnRefreshLights.TabIndex = 3;
@@ -208,7 +206,7 @@
             //
             // pbFindingHueBridge
             //
-            this.pbFindingHueBridge.Location = new System.Drawing.Point(12, 433);
+            this.pbFindingHueBridge.Location = new System.Drawing.Point(17, 451);
             this.pbFindingHueBridge.MarqueeAnimationSpeed = 50;
             this.pbFindingHueBridge.Name = "pbFindingHueBridge";
             this.pbFindingHueBridge.Size = new System.Drawing.Size(639, 12);
@@ -227,7 +225,7 @@
             this.pnlMain.Controls.Add(this.gbAllOnOff);
             this.pnlMain.Location = new System.Drawing.Point(12, 12);
             this.pnlMain.Name = "pnlMain";
-            this.pnlMain.Size = new System.Drawing.Size(639, 402);
+            this.pnlMain.Size = new System.Drawing.Size(639, 420);
             this.pnlMain.TabIndex = 3;
             //
             // pictureBox1
@@ -245,7 +243,7 @@
             this.gbSelectedLightDetails.Controls.Add(this.pnlLightCtrl);
             this.gbSelectedLightDetails.Location = new System.Drawing.Point(204, 118);
             this.gbSelectedLightDetails.Name = "gbSelectedLightDetails";
-            this.gbSelectedLightDetails.Size = new System.Drawing.Size(425, 270);
+            this.gbSelectedLightDetails.Size = new System.Drawing.Size(425, 299);
             this.gbSelectedLightDetails.TabIndex = 1;
             this.gbSelectedLightDetails.TabStop = false;
             this.gbSelectedLightDetails.Text = "Selected Hue Light Details and Control";
@@ -254,7 +252,6 @@
             //
             this.pnlLightCtrl.Controls.Add(this.btnColorChange);
             this.pnlLightCtrl.Controls.Add(this.lblBrightnessValue);
-            this.pnlLightCtrl.Controls.Add(this.lblMax);
             this.pnlLightCtrl.Controls.Add(this.label2);
             this.pnlLightCtrl.Controls.Add(this.tbBrightness);
             this.pnlLightCtrl.Controls.Add(this.lblLD_Name);
@@ -264,7 +261,7 @@
             this.pnlLightCtrl.Controls.Add(this.lblLD_Manufacturer);
             this.pnlLightCtrl.Location = new System.Drawing.Point(10, 14);
             this.pnlLightCtrl.Name = "pnlLightCtrl";
-            this.pnlLightCtrl.Size = new System.Drawing.Size(407, 250);
+            this.pnlLightCtrl.Size = new System.Drawing.Size(407, 279);
             this.pnlLightCtrl.TabIndex = 4;
             this.pnlLightCtrl.Visible = false;
             //
@@ -273,7 +270,7 @@
             this.btnColorChange.BackColor = System.Drawing.SystemColors.Control;
             this.btnColorChange.BackgroundImage = global::HueDesktop.Properties.Resources.bulb;
             this.btnColorChange.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
-            this.btnColorChange.Location = new System.Drawing.Point(201, 5);
+            this.btnColorChange.Location = new System.Drawing.Point(245, 11);
             this.btnColorChange.Name = "btnColorChange";
             this.btnColorChange.Size = new System.Drawing.Size(70, 70);
             this.btnColorChange.TabIndex = 4;
@@ -284,23 +281,12 @@
             //
             this.lblBrightnessValue.AutoSize = true;
             this.lblBrightnessValue.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblBrightnessValue.Location = new System.Drawing.Point(353, 11);
+            this.lblBrightnessValue.Location = new System.Drawing.Point(358, 6);
             this.lblBrightnessValue.MaximumSize = new System.Drawing.Size(380, 100);
             this.lblBrightnessValue.Name = "lblBrightnessValue";
-            this.lblBrightnessValue.Size = new System.Drawing.Size(33, 15);
+            this.lblBrightnessValue.Size = new System.Drawing.Size(37, 17);
             this.lblBrightnessValue.TabIndex = 1;
             this.lblBrightnessValue.Text = "MAX";
-            //
-            // lblMax
-            //
-            this.lblMax.AutoSize = true;
-            this.lblMax.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblMax.Location = new System.Drawing.Point(317, 38);
-            this.lblMax.MaximumSize = new System.Drawing.Size(380, 100);
-            this.lblMax.Name = "lblMax";
-            this.lblMax.Size = new System.Drawing.Size(33, 15);
-            this.lblMax.TabIndex = 1;
-            this.lblMax.Text = "MAX";
             //
             // label2
             //
@@ -309,19 +295,19 @@
             this.label2.Location = new System.Drawing.Point(13, 21);
             this.label2.MaximumSize = new System.Drawing.Size(380, 100);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(176, 30);
+            this.label2.Size = new System.Drawing.Size(203, 34);
             this.label2.TabIndex = 1;
             this.label2.Text = "Click  on  icon  to  change  color\r\nUse slider to change brightness";
             //
             // tbBrightness
             //
             this.tbBrightness.LargeChange = 50;
-            this.tbBrightness.Location = new System.Drawing.Point(356, 38);
+            this.tbBrightness.Location = new System.Drawing.Point(356, 33);
             this.tbBrightness.Maximum = 254;
             this.tbBrightness.Minimum = 1;
             this.tbBrightness.Name = "tbBrightness";
             this.tbBrightness.Orientation = System.Windows.Forms.Orientation.Vertical;
-            this.tbBrightness.Size = new System.Drawing.Size(40, 199);
+            this.tbBrightness.Size = new System.Drawing.Size(37, 213);
             this.tbBrightness.SmallChange = 10;
             this.tbBrightness.TabIndex = 3;
             this.tbBrightness.TickFrequency = 12;
@@ -337,7 +323,7 @@
             this.lblLD_Name.Location = new System.Drawing.Point(71, 89);
             this.lblLD_Name.MaximumSize = new System.Drawing.Size(380, 100);
             this.lblLD_Name.Name = "lblLD_Name";
-            this.lblLD_Name.Size = new System.Drawing.Size(57, 21);
+            this.lblLD_Name.Size = new System.Drawing.Size(60, 23);
             this.lblLD_Name.TabIndex = 1;
             this.lblLD_Name.Text = "Name:";
             //
@@ -345,10 +331,10 @@
             //
             this.lblLD_Model.AutoSize = true;
             this.lblLD_Model.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblLD_Model.Location = new System.Drawing.Point(66, 131);
+            this.lblLD_Model.Location = new System.Drawing.Point(66, 139);
             this.lblLD_Model.MaximumSize = new System.Drawing.Size(380, 100);
             this.lblLD_Model.Name = "lblLD_Model";
-            this.lblLD_Model.Size = new System.Drawing.Size(62, 21);
+            this.lblLD_Model.Size = new System.Drawing.Size(63, 23);
             this.lblLD_Model.TabIndex = 1;
             this.lblLD_Model.Text = "Model:";
             //
@@ -356,10 +342,10 @@
             //
             this.lblMin.AutoSize = true;
             this.lblMin.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblMin.Location = new System.Drawing.Point(322, 220);
+            this.lblMin.Location = new System.Drawing.Point(358, 255);
             this.lblMin.MaximumSize = new System.Drawing.Size(380, 100);
             this.lblMin.Name = "lblMin";
-            this.lblMin.Size = new System.Drawing.Size(28, 15);
+            this.lblMin.Size = new System.Drawing.Size(32, 17);
             this.lblMin.TabIndex = 1;
             this.lblMin.Text = "OFF";
             //
@@ -367,10 +353,10 @@
             //
             this.lblLD_Type.AutoSize = true;
             this.lblLD_Type.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblLD_Type.Location = new System.Drawing.Point(75, 215);
+            this.lblLD_Type.Location = new System.Drawing.Point(75, 239);
             this.lblLD_Type.MaximumSize = new System.Drawing.Size(380, 100);
             this.lblLD_Type.Name = "lblLD_Type";
-            this.lblLD_Type.Size = new System.Drawing.Size(53, 21);
+            this.lblLD_Type.Size = new System.Drawing.Size(55, 23);
             this.lblLD_Type.TabIndex = 1;
             this.lblLD_Type.Text = "Type: ";
             //
@@ -378,10 +364,10 @@
             //
             this.lblLD_Manufacturer.AutoSize = true;
             this.lblLD_Manufacturer.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblLD_Manufacturer.Location = new System.Drawing.Point(14, 173);
+            this.lblLD_Manufacturer.Location = new System.Drawing.Point(14, 189);
             this.lblLD_Manufacturer.MaximumSize = new System.Drawing.Size(380, 100);
             this.lblLD_Manufacturer.Name = "lblLD_Manufacturer";
-            this.lblLD_Manufacturer.Size = new System.Drawing.Size(114, 21);
+            this.lblLD_Manufacturer.Size = new System.Drawing.Size(120, 23);
             this.lblLD_Manufacturer.TabIndex = 1;
             this.lblLD_Manufacturer.Text = "Manufacturer:";
             //
@@ -421,20 +407,19 @@
             // lblBridgeID
             //
             this.lblBridgeID.AutoSize = true;
-            this.lblBridgeID.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblBridgeID.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.92F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.lblBridgeID.Location = new System.Drawing.Point(6, 54);
             this.lblBridgeID.Name = "lblBridgeID";
-            this.lblBridgeID.Size = new System.Drawing.Size(28, 13);
+            this.lblBridgeID.Size = new System.Drawing.Size(25, 15);
             this.lblBridgeID.TabIndex = 1;
             this.lblBridgeID.Text = "ID: ";
             //
             // lblBridgeName
             //
-            this.lblBridgeName.AutoSize = true;
-            this.lblBridgeName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblBridgeName.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.92F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.lblBridgeName.Location = new System.Drawing.Point(6, 20);
             this.lblBridgeName.Name = "lblBridgeName";
-            this.lblBridgeName.Size = new System.Drawing.Size(43, 13);
+            this.lblBridgeName.Size = new System.Drawing.Size(171, 34);
             this.lblBridgeName.TabIndex = 1;
             this.lblBridgeName.Text = "Name:";
             //
@@ -445,7 +430,7 @@
             this.lblBridgeCnx.Location = new System.Drawing.Point(248, 76);
             this.lblBridgeCnx.MaximumSize = new System.Drawing.Size(380, 100);
             this.lblBridgeCnx.Name = "lblBridgeCnx";
-            this.lblBridgeCnx.Size = new System.Drawing.Size(173, 26);
+            this.lblBridgeCnx.Size = new System.Drawing.Size(176, 30);
             this.lblBridgeCnx.TabIndex = 1;
             this.lblBridgeCnx.Text = "Bridge Connected. \r\nClick Refresh to see paired lights";
             this.lblBridgeCnx.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -453,9 +438,9 @@
             // lblBridge
             //
             this.lblBridge.AutoSize = true;
-            this.lblBridge.Location = new System.Drawing.Point(270, 417);
+            this.lblBridge.Location = new System.Drawing.Point(275, 435);
             this.lblBridge.Name = "lblBridge";
-            this.lblBridge.Size = new System.Drawing.Size(106, 13);
+            this.lblBridge.Size = new System.Drawing.Size(122, 15);
             this.lblBridge.TabIndex = 1;
             this.lblBridge.Text = "Finding Hue Bridge...\r\n";
             //
@@ -468,15 +453,15 @@
             //
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(664, 459);
+            this.ClientSize = new System.Drawing.Size(670, 470);
             this.Controls.Add(this.lblBridge);
             this.Controls.Add(this.pnlMain);
             this.Controls.Add(this.pbFindingHueBridge);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(670, 488);
-            this.MinimumSize = new System.Drawing.Size(670, 488);
+            this.MaximumSize = new System.Drawing.Size(680, 500);
+            this.MinimumSize = new System.Drawing.Size(680, 500);
             this.Name = "MainForm";
             this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
@@ -487,7 +472,6 @@
             ((System.ComponentModel.ISupportInitialize)(this.dgvLights)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.lightBindingSource)).EndInit();
             this.gbLights.ResumeLayout(false);
-            this.gbLights.PerformLayout();
             this.gbAllOnOff.ResumeLayout(false);
             this.pnlMain.ResumeLayout(false);
             this.pnlMain.PerformLayout();
@@ -532,7 +516,6 @@
         private System.Windows.Forms.Label lblLD_Name;
         private System.Windows.Forms.Label lblLD_Type;
         private System.Windows.Forms.TrackBar tbBrightness;
-        private System.Windows.Forms.Label lblMax;
         private System.Windows.Forms.Label lblMin;
         private System.Windows.Forms.Panel pnlLightCtrl;
         private System.Windows.Forms.Button btnColorChange;


Ensure that IMDb finds the correct URL

Ensure that IMDb finds the correct URL

--- TelegramBot/Bot.cs
+++ TelegramBot/Bot.cs
@@ -332,7 +332,7 @@

                             // Search Bing
                             httpClient.AuthorizationHeader = "Basic " + bingKey;
-                            dynamic dimdb = JObject.Parse(httpClient.DownloadString("https://api.datamarket.azure.com/Data.ashx/Bing/Search/Web?Market=%27en-US%27&Adult=%27Moderate%27&Query=%27imdb+" + HttpUtility.UrlEncode(body) + "%27&$format=json&$top=1").Result);
+                            dynamic dimdb = JObject.Parse(httpClient.DownloadString("https://api.datamarket.azure.com/Data.ashx/Bing/Search/Web?Market=%27en-US%27&Adult=%27Moderate%27&Query=%27site%3Aimdb.com%20" + HttpUtility.UrlEncode(body) + "%27&$format=json&$top=1").Result);
                             httpClient.AuthorizationHeader = string.Empty;
                             if (dimdb.d == null || dimdb.d.results == null ||
                                 Enumerable.Count(dimdb.d.results) < 1)
@@ -341,8 +341,11 @@
                                 break;
                             }

+                            // Find correct /combined URL
+                            string imdbUrl = dimdb.d.results[0].Url;
+                            imdbUrl = (imdbUrl.Replace("/business", "").Replace("/combined", "").Replace("/faq", "").Replace("/goofs", "").Replace("/news", "").Replace("/parentalguide", "").Replace("/quotes", "").Replace("/ratings", "").Replace("/synopsis", "").Replace("/trivia", "") + "/combined").Replace("//combined","/combined");
+
                             // Scrape it
-                            string imdbUrl = dimdb.d.results[0].Url + "combined";
                             var imdb = httpClient.DownloadString(imdbUrl).Result.Replace("\r", "").Replace("\n", "");
                             var title = Regex.Match(imdb, @"<title>(IMDb \- )*(.*?) \(.*?</title>", RegexOptions.IgnoreCase).Groups[2].Value.Trim();
                             var year = Regex.Match(imdb, @"<title>.*?\(.*?(\d{4}).*?\).*?</title>", RegexOptions.IgnoreCase).Groups[1].Value.Trim();
@@ -372,14 +375,20 @@
                                     var rt = httpClient.DownloadString((string)drt.d.results[0].Url).Result;
                                     var rtCritic = Regex.Match(rt, @"
.*?(.*?)", RegexOptions.IgnoreCase).Groups[1].Value.Trim();
                                     var rtAudience = Regex.Match(rt, @"
.*?(.*?)", RegexOptions.IgnoreCase).Groups[1].Value.Trim();
-                                    replyText = HttpUtility.HtmlDecode(title) + " (" + year + ") - " + HttpUtility.HtmlDecode(tagline) + "\r\nIMDb: " + rating + " (" + votes + " votes) | RT critic: " + rtCritic + "% | RT audience: " + rtAudience + "\r\n" + HttpUtility.HtmlDecode(plot) + "\r\n";
+                                    replyText = HttpUtility.HtmlDecode(title) + " (" + year + ") - " + HttpUtility.HtmlDecode(tagline) + "\r\nIMDb: " + rating + " (" + votes + " votes) | RT critic: " + rtCritic + "% | RT audience: " + rtAudience + "\r\n" + HttpUtility.HtmlDecode(plot);
                                 }
                                 else
                                 {
                                     var rt = httpClient.DownloadString("http://www.rottentomatoes.com/search/?search=" + HttpUtility.UrlEncode(body)).Result;
                                     var rtCritic = Regex.Match(rt, @"
.*?(.*?)", RegexOptions.IgnoreCase).Groups[1].Value.Trim();
                                     var rtAudience = Regex.Match(rt, @"
.*?(.*?)", RegexOptions.IgnoreCase).Groups[1].Value.Trim();
-                                    replyText = HttpUtility.HtmlDecode(title) + " (" + year + ") - " + HttpUtility.HtmlDecode(tagline) + "\r\nIMDb: " + rating + " (" + votes + " votes) | RT critic: " + rtCritic + "% | RT audience: " + rtAudience + "\r\n" + HttpUtility.HtmlDecode(plot) + "\r\n";
+                                    replyText = HttpUtility.HtmlDecode(title) + " (" + year + ") - " + HttpUtility.HtmlDecode(tagline) + "\r\nIMDb: " + rating + " (" + votes + " votes) | RT critic: " + rtCritic + "% | RT audience: " + rtAudience + "\r\n" + HttpUtility.HtmlDecode(plot);
+                                }
+
+                                // Remove trailing pipe that sometimes occurs
+                                if (replyText.EndsWith("|"))
+                                {
+                                    replyText = replyText.Substring(0, replyText.Length - 2).Trim();
                                 }

                                 // Set referrer URI to grab IMDB poster


Added /usr/bin/code for potential VSCode Paths

VSCode installs into /use/bin/code instead of /usr/local/bin/code now
https://superuser.com/a/1376858

--- src/Assent/Reporters/DiffPrograms/VsCodeDiffProgram.cs
+++ src/Assent/Reporters/DiffPrograms/VsCodeDiffProgram.cs
@@ -18,6 +18,7 @@
             else
             {
                 paths.Add("/usr/local/bin/code");
+                paths.Add("/usr/bin/code");
                 paths.Add("/snap/bin/code");
             }
             DefaultSearchPaths = paths;


removed unnecessary age string

removed unnecessary age string

--- Scripts/UnityExtensions.cs
+++ Scripts/UnityExtensions.cs
@@ -195,11 +195,6 @@
             };
         }

-        public static string ToReadableAgeString(this TimeSpan span)
-        {
-            return string.Format("{0:0}", span.Days / 365.25);
-        }
-
         public static string ToReadableString(this TimeSpan span)
         {
             string formatted = string.Format("{0}{1}{2}{3}",


Share helpers

Share helpers

--- src/Compilers/CSharp/Portable/Parser/LanguageParser.cs
+++ src/Compilers/CSharp/Portable/Parser/LanguageParser.cs
@@ -2800,8 +2800,8 @@

             // `{` or `=>` definitely start a property.  Also allow
             // `; {` and `; =>` as error recovery fo ra misplaced semicolon.
-            if (isStartOfPropertyBody(this.CurrentToken.Kind) ||
-                (this.CurrentToken.Kind is SyntaxKind.SemicolonToken && isStartOfPropertyBody(this.PeekToken(1).Kind)))
+            if (IsStartOfPropertyBody(this.CurrentToken.Kind) ||
+                (this.CurrentToken.Kind is SyntaxKind.SemicolonToken && IsStartOfPropertyBody(this.PeekToken(1).Kind)))
             {
                 result = this.ParsePropertyDeclaration(attributes, modifiers, type, explicitInterfaceOpt, identifierOrThisOpt, typeParameterListOpt);
                 return true;
@@ -2809,10 +2809,10 @@

             result = null;
             return false;
-
-            bool isStartOfPropertyBody(SyntaxKind kind)
-                => kind is SyntaxKind.OpenBraceToken or SyntaxKind.EqualsGreaterThanToken;
-        }
+        }
+
+        private static bool IsStartOfPropertyBody(SyntaxKind kind)
+            => kind is SyntaxKind.OpenBraceToken or SyntaxKind.EqualsGreaterThanToken;

         // Returns null if we can't parse anything (even partially).
         internal MemberDeclarationSyntax ParseMemberDeclaration(SyntaxKind parentKind)
@@ -3038,7 +3038,7 @@
             // e.g. `public int MyProperty; { get; set; }` should still be parsed as a property with a skipped token.
             if (!isGlobalScriptLevel &&
                 kind == SyntaxKind.SemicolonToken &&
-                    this.PeekToken(2).Kind is SyntaxKind.OpenBraceToken or SyntaxKind.EqualsGreaterThanToken)
+                IsStartOfPropertyBody(this.PeekToken(2).Kind))
             {
                 return false;
             }


Added FirstChild and LastChild

Added FirstChild and LastChild

git-svn-id: 16f658619b342a39b0afd2472f072a689916e5a2@157 6f2d7086-9719-0410-ba06-0b8292a297aa

--- psycho/Psycho/Core/Topic.cs
+++ psycho/Psycho/Core/Topic.cs
@@ -514,6 +514,16 @@
                         }
                 }

+                public Topic FirstChild ()
+                {
+                        return this.Subtopics.First;
+                }
+
+                public Topic LastChild ()
+                {
+                        return this.Subtopics.Last;
+                }
+
                 public void AddSubtopic (Topic iTopic)
                 {
                         this.Subtopics.Add (iTopic);


fixed array pop and shift

fixed array pop and shift

--- Tomes/TomeArray.cs
+++ Tomes/TomeArray.cs
@@ -229,15 +229,19 @@
 	}

 	//
-	public void Pop() {
+	public JToken Pop() {
+		JToken last = this[this.Count - 1];
 		this.Del(this.Count - 1);
 		this.Last.Remove();
-	}
-
-	//
-	public void Shift() {
+		return last;
+	}
+
+	//
+	public JToken Shift() {
+		JToken first = this[0];
 		this.Del(0);
 		this.First.Remove();
+		return first;
 	}

 	//


Refining CommentRetrieve methods.

Refining CommentRetrieve methods.

--- Drupal7.Services/DrupalServicesComment.cs
+++ Drupal7.Services/DrupalServicesComment.cs
@@ -10,7 +10,7 @@
 	}

 	[XmlRpcMissingMapping(MappingAction.Ignore)]
-	public struct DrupalComment
+	public class DrupalComment
 	{
 		public struct comment_body_t
 		{
@@ -243,16 +243,16 @@
 			return res;
 		}

-		public DrupalComment CommentRetrieve2(int cid)
-		{
-			this.InitRequest();
-			DrupalComment res = default(DrupalComment);
-			try {
-				res = drupalServiceSystem.CommentRetrieve2(cid);
-			} catch (Exception ex) {
-				this.HandleException(ex, "CommentRetrieve2");
-			}
-			return res;
+		public bool TryCommentRetrieve(int cid, out DrupalComment result)
+		{
+			result = null;
+			this.InitRequest();
+			try {
+				result = drupalServiceSystem.CommentRetrieve2(cid);
+			} catch (Exception ex) {
+				this.HandleException(ex, "TryCommentRetrieve");
+			}
+			return (result != null) && (this.ErrorCode == 0);
 		}

 		public void CommentRetrieveAsync(int cid, object asyncState)


Remove unused code path

Remove unused code path

--- osu.Framework/Graphics/Textures/RawTextureLoaderStore.cs
+++ osu.Framework/Graphics/Textures/RawTextureLoaderStore.cs
@@ -1,10 +1,6 @@
 // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
 // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE

-using System.Diagnostics;
-using System.IO;
-using System.Drawing;
-using System.Drawing.Imaging;
 using osu.Framework.IO.Stores;

 namespace osu.Framework.Graphics.Textures
@@ -18,49 +14,6 @@
             this.store = store;
             (store as ResourceStore<byte[]>)?.AddExtension(@"png");
             (store as ResourceStore<byte[]>)?.AddExtension(@"jpg");
-        }
-
-        private RawTexture loadOther(Stream stream)
-        {
-            RawTexture t = new RawTexture();
-            using (var bmp = (Bitmap)Image.FromStream(stream))
-            {
-                t.Pixels = new byte[bmp.Width * bmp.Height * 4];
-                t.Width = bmp.Width;
-                t.Height = bmp.Height;
-                t.PixelFormat = OpenTK.Graphics.ES30.PixelFormat.Rgba;
-                var pixels = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
-                    ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
-                try
-                {
-                    unsafe
-                    {
-                        byte* p = (byte*)pixels.Scan0;
-
-                        Debug.Assert(p != null);
-
-                        int i = 0;
-                        for (int y = 0; y < bmp.Height; y++)
-                        {
-                            for (int x = 0; x < bmp.Width; x++, i++)
-                            {
-                                int desti = i * 4;
-                                int srci = y * pixels.Stride + x * 3;
-                                // ReSharper disable once PossibleNullReferenceException
-                                t.Pixels[desti] = p[srci + 2];
-                                t.Pixels[desti + 1] = p[srci + 1];
-                                t.Pixels[desti + 2] = p[srci + 0];
-                                t.Pixels[desti + 3] = 255;
-                            }
-                        }
-                    }
-                }
-                finally
-                {
-                    bmp.UnlockBits(pixels);
-                }
-            }
-            return t;
         }

         public override RawTexture Get(string name)


hotfix

hotfix

--- Mvvm/BindableBase.cs
+++ Mvvm/BindableBase.cs
@@ -36,7 +36,7 @@
             if (Equals(storage, value)) return false;

             storage = value;
-            OnPropertyChanged(propertyName);
+            RaisePropertyChanged(propertyName);

             return true;
         }
@@ -49,10 +49,9 @@
         ///     value is optional and can be provided automatically when invoked from compilers
         ///     that support <see cref="CallerMemberNameAttribute" />.
         /// </param>
-        protected void OnPropertyChanged(string propertyName)
+        protected void OnPropertyChanged([CallerMemberName]string propertyName = null)
         {
-            var eventHandler = PropertyChanged;
-            eventHandler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+            RaisePropertyChanged(propertyName);
         }

         /// <summary>
@@ -63,7 +62,13 @@
         protected void OnPropertyChanged<T>(Expression<Func<T>> propertyExpression)
         {
             var propertyName = PropertySupport.ExtractPropertyName(propertyExpression);
-            OnPropertyChanged(propertyName);
+            RaisePropertyChanged(propertyName);
+        }
+
+        private void RaisePropertyChanged(string propertyName)
+        {
+            var eventHandler = PropertyChanged;
+            eventHandler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
         }
     }
 }


Fixed issue in NetworkCODEC for context layers.

git-svn-id: c5150317060de8552ff1058b2431ffc13c353cb7@519 0d3f3ea6-ac51-0410-a1de-edb5cd2a854a

--- encog-core-cs/Neural/Networks/Structure/NetworkCODEC.cs
+++ encog-core-cs/Neural/Networks/Structure/NetworkCODEC.cs
@@ -192,7 +192,7 @@
                         for (int z = 0; z < contextSynapse.FromNeuronCount; z++)
                         {
                             double value = array[result++];
-                            double oldValue = synapse.WeightMatrix[z, x];
+                            double oldValue = contextSynapse.WeightMatrix[z, x];

                             // if this connection is limited, do not update it to anything but zero
                             if (Math.Abs(oldValue) < network.Structure


Resolve mutability issues with EmbedBuilder. (#1010)

* Create new entities on each build call. Added Length property to EmbedBuilder.

* Resolve Length issues per #1012

--- src/Discord.Net.Core/Entities/Messages/EmbedBuilder.cs
+++ src/Discord.Net.Core/Entities/Messages/EmbedBuilder.cs
@@ -1,86 +1,102 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.Collections.Immutable;
+using System.Linq;

 namespace Discord
 {
     public class EmbedBuilder
     {
-        private readonly Embed _embed;
+        private string _title;
+        private string _description;
+        private string _url;
+        private EmbedImage? _image;
+        private EmbedThumbnail? _thumbnail;
+        private List<EmbedFieldBuilder> _fields;

         public const int MaxFieldCount = 25;
         public const int MaxTitleLength = 256;
         public const int MaxDescriptionLength = 2048;
-        public const int MaxEmbedLength = 6000; // user bot limit is 2000, but we don't validate that here.
+        public const int MaxEmbedLength = 6000;

         public EmbedBuilder()
         {
-            _embed = new Embed(EmbedType.Rich);
             Fields = new List<EmbedFieldBuilder>();
         }

         public string Title
         {
-            get => _embed.Title;
+            get => _title;
             set
             {
                 if (value?.Length > MaxTitleLength) throw new ArgumentException($"Title length must be less than or equal to {MaxTitleLength}.", nameof(Title));
-                _embed.Title = value;
-            }
-        }
-
+                _title = value;
+            }
+        }
         public string Description
         {
-            get => _embed.Description;
+            get => _description;
             set
             {
                 if (value?.Length > MaxDescriptionLength) throw new ArgumentException($"Description length must be less than or equal to {MaxDescriptionLength}.", nameof(Description));
-                _embed.Description = value;
+                _description = value;
             }
         }

         public string Url
         {
-            get => _embed.Url;
+            get => _url;
             set
             {
                 if (!value.IsNullOrUri()) throw new ArgumentException("Url must be a well-formed URI", nameof(Url));
-                _embed.Url = value;
+                _url = value;
             }
         }
         public string ThumbnailUrl
         {
-            get => _embed.Thumbnail?.Url;
+            get => _thumbnail?.Url;
             set
             {
                 if (!value.IsNullOrUri()) throw new ArgumentException("Url must be a well-formed URI", nameof(ThumbnailUrl));
-                _embed.Thumbnail = new EmbedThumbnail(value, null, null, null);
+                _thumbnail = new EmbedThumbnail(value, null, null, null);
             }
         }
         public string ImageUrl
         {
-            get => _embed.Image?.Url;
+            get => _image?.Url;
             set
             {
                 if (!value.IsNullOrUri()) throw new ArgumentException("Url must be a well-formed URI", nameof(ImageUrl));
-                _embed.Image = new EmbedImage(value, null, null, null);
-            }
-        }
-        public DateTimeOffset? Timestamp { get => _embed.Timestamp; set { _embed.Timestamp = value; } }
-        public Color? Color { get => _embed.Color; set { _embed.Color = value; } }
-
-        public EmbedAuthorBuilder Author { get; set; }
-        public EmbedFooterBuilder Footer { get; set; }
-        private List<EmbedFieldBuilder> _fields;
+                _image = new EmbedImage(value, null, null, null);
+            }
+        }
         public List<EmbedFieldBuilder> Fields
         {
             get => _fields;
             set
             {
-
                 if (value == null) throw new ArgumentNullException("Cannot set an embed builder's fields collection to null", nameof(Fields));
                 if (value.Count > MaxFieldCount) throw new ArgumentException($"Field count must be less than or equal to {MaxFieldCount}.", nameof(Fields));
                 _fields = value;
+            }
+        }
+
+        public DateTimeOffset? Timestamp { get; set; }
+        public Color? Color { get; set; }
+        public EmbedAuthorBuilder Author { get; set; }
+        public EmbedFooterBuilder Footer { get; set; }
+
+        public int Length
+        {
+            get
+            {
+                int titleLength = Title?.Length ?? 0;
+                int authorLength = Author?.Name?.Length ?? 0;
+                int descriptionLength = Description?.Length ?? 0;
+                int footerLength = Footer?.Text?.Length ?? 0;
+                int fieldSum = Fields.Sum(f => f.Name.Length + f.Value.ToString().Length);
+
+                return titleLength + authorLength + descriptionLength + footerLength + fieldSum;
             }
         }

@@ -180,7 +196,6 @@
             AddField(field);
             return this;
         }
-
         public EmbedBuilder AddField(EmbedFieldBuilder field)
         {
             if (Fields.Count >= MaxFieldCount)
@@ -195,63 +210,54 @@
         {
             var field = new EmbedFieldBuilder();
             action(field);
-            this.AddField(field);
+            AddField(field);
             return this;
         }

         public Embed Build()
         {
-            _embed.Footer = Footer?.Build();
-            _embed.Author = Author?.Build();
+            if (Length > MaxEmbedLength)
+                throw new InvalidOperationException($"Total embed length must be less than or equal to {MaxEmbedLength}");
+
             var fields = ImmutableArray.CreateBuilder<EmbedField>(Fields.Count);
             for (int i = 0; i < Fields.Count; i++)
                 fields.Add(Fields[i].Build());
-            _embed.Fields = fields.ToImmutable();
-
-            if (_embed.Length > MaxEmbedLength)
-            {
-                throw new InvalidOperationException($"Total embed length must be less than or equal to {MaxEmbedLength}");
-            }
-
-            return _embed;
+
+            return new Embed(EmbedType.Rich, Title, Description, Url, Timestamp, Color, _image, null, Author?.Build(), Footer?.Build(), null, _thumbnail, fields.ToImmutable());
         }
     }

     public class EmbedFieldBuilder
     {
+        private string _name;
+        private string _value;
         private EmbedField _field;
-
         public const int MaxFieldNameLength = 256;
         public const int MaxFieldValueLength = 1024;

         public string Name
         {
-            get => _field.Name;
+            get => _name;
             set
             {
                 if (string.IsNullOrWhiteSpace(value)) throw new ArgumentException($"Field name must not be null, empty or entirely whitespace.", nameof(Name));
                 if (value.Length > MaxFieldNameLength) throw new ArgumentException($"Field name length must be less than or equal to {MaxFieldNameLength}.", nameof(Name));
-                _field.Name = value;
+                _name = value;
             }
         }

         public object Value
         {
-            get => _field.Value;
+            get => _value;
             set
             {
                 var stringValue = value?.ToString();
                 if (string.IsNullOrEmpty(stringValue)) throw new ArgumentException($"Field value must not be null or empty.", nameof(Value));
                 if (stringValue.Length > MaxFieldValueLength) throw new ArgumentException($"Field value length must be less than or equal to {MaxFieldValueLength}.", nameof(Value));
-                _field.Value = stringValue;
-            }
-        }
-        public bool IsInline { get => _field.Inline; set { _field.Inline = value; } }
-
-        public EmbedFieldBuilder()
-        {
-            _field = new EmbedField();
-        }
+                _value = stringValue;
+            }
+        }
+        public bool IsInline { get; set; }

         public EmbedFieldBuilder WithName(string name)
         {
@@ -270,46 +276,42 @@
         }

         public EmbedField Build()
-            => _field;
+            => new EmbedField(Name, Value.ToString(), IsInline);
     }

     public class EmbedAuthorBuilder
     {
-        private EmbedAuthor _author;
-
+        private string _name;
+        private string _url;
+        private string _iconUrl;
         public const int MaxAuthorNameLength = 256;

         public string Name
         {
-            get => _author.Name;
+            get => _name;
             set
             {
                 if (value?.Length > MaxAuthorNameLength) throw new ArgumentException($"Author name length must be less than or equal to {MaxAuthorNameLength}.", nameof(Name));
-                _author.Name = value;
+                _name = value;
             }
         }
         public string Url
         {
-            get => _author.Url;
+            get => _url;
             set
             {
                 if (!value.IsNullOrUri()) throw new ArgumentException("Url must be a well-formed URI", nameof(Url));
-                _author.Url = value;
+                _url = value;
             }
         }
         public string IconUrl
         {
-            get => _author.IconUrl;
+            get => _iconUrl;
             set
             {
                 if (!value.IsNullOrUri()) throw new ArgumentException("Url must be a well-formed URI", nameof(IconUrl));
-                _author.IconUrl = value;
-            }
-        }
-
-        public EmbedAuthorBuilder()
-        {
-            _author = new EmbedAuthor();
+                _iconUrl = value;
+            }
         }

         public EmbedAuthorBuilder WithName(string name)
@@ -329,37 +331,33 @@
         }

         public EmbedAuthor Build()
-            => _author;
+            => new EmbedAuthor(Name, Url, IconUrl, null);
     }

     public class EmbedFooterBuilder
     {
-        private EmbedFooter _footer;
+        private string _text;
+        private string _iconUrl;

         public const int MaxFooterTextLength = 2048;

         public string Text
         {
-            get => _footer.Text;
+            get => _text;
             set
             {
                 if (value?.Length > MaxFooterTextLength) throw new ArgumentException($"Footer text length must be less than or equal to {MaxFooterTextLength}.", nameof(Text));
-                _footer.Text = value;
+                _text = value;
             }
         }
         public string IconUrl
         {
-            get => _footer.IconUrl;
+            get => _iconUrl;
             set
             {
                 if (!value.IsNullOrUri()) throw new ArgumentException("Url must be a well-formed URI", nameof(IconUrl));
-                _footer.IconUrl = value;
-            }
-        }
-
-        public EmbedFooterBuilder()
-        {
-            _footer = new EmbedFooter();
+                _iconUrl = value;
+            }
         }

         public EmbedFooterBuilder WithText(string text)
@@ -374,6 +372,6 @@
         }

         public EmbedFooter Build()
-            => _footer;
+            => new EmbedFooter(Text, IconUrl, null);
     }
 }


Added trace.

Added trace.

--- numpy/NumpyDotNet/ndarray.cs
+++ numpy/NumpyDotNet/ndarray.cs
@@ -728,7 +728,7 @@
             if (dtype != null) {
                 rtype = NpyDescr.DescrConverter(cntx.LanguageContext, dtype);
             }
-            return Mean(iAxis, rtype, @out);
+            return Mean(iAxis, GetTypeDouble(this.dtype, rtype), @out);
         }

         public PythonTuple nonzero() {
@@ -910,6 +910,12 @@
             iAxis = NpyUtil_ArgProcessing.AxisConverter(axis);
             cMode = NpyUtil_ArgProcessing.ClipmodeConverter(mode);
             return ArrayReturn(TakeFrom(aIndices, iAxis, @out, cMode));
+        }
+
+        public object trace(CodeContext cntx, int offset = 0, int axis1 = 0, int axis2 = 1,
+            object dtype = null, ndarray @out = null) {
+            ndarray diag = Diagonal(offset, axis1, axis2);
+            return diag.sum(cntx, dtype = dtype, @out = @out);
         }

         public ndarray transpose(params object[] args) {
@@ -1043,6 +1049,16 @@
             }
         }

+        internal static dtype GetTypeDouble(dtype dtype1, dtype dtype2) {
+            if (dtype2 != null) {
+                return dtype2;
+            }
+            if (dtype1.TypeNum < NpyDefs.NPY_TYPES.NPY_FLOAT) {
+                return NpyCoreApi.DescrFromType(NpyDefs.NPY_TYPES.NPY_DOUBLE);
+            } else {
+                return dtype1;
+            }
+        }
         #endregion
     }


Use `Component` instead of `CompositeDrawable`

--- osu.Game/Screens/Edit/Timing/RepeatingButtonBehaviour.cs
+++ osu.Game/Screens/Edit/Timing/RepeatingButtonBehaviour.cs
@@ -6,7 +6,6 @@
 using osu.Framework.Audio;
 using osu.Framework.Audio.Sample;
 using osu.Framework.Graphics;
-using osu.Framework.Graphics.Containers;
 using osu.Framework.Input.Events;
 using osu.Framework.Threading;

@@ -15,7 +14,7 @@
     /// <summary>
     /// Represents a component that provides the behaviour of triggering button clicks repeatedly while holding with mouse.
     /// </summary>
-    public class RepeatingButtonBehaviour : CompositeDrawable
+    public class RepeatingButtonBehaviour : Component
     {
         private const double initial_delay = 300;
         private const double minimum_delay = 80;


some commenting

some commenting

--- MyHalp/MyJobQueue.cs
+++ MyHalp/MyJobQueue.cs
@@ -7,21 +7,11 @@

 namespace MyHalp
 {
+    /// <summary>
+    /// MyJobQueue class, allows to execute jobs in order, eg. game loading.
+    /// </summary>
     public sealed class MyJobQueue
     {
-        /// <summary>
-        /// Create new queue.
-        /// </summary>
-        /// <param name="onDone">Called when the queue execution is done.</param>
-        /// <returns>Your new MyJobQueue.</returns>
-        public static MyJobQueue Create(Action onDone = null)
-        {
-            return new MyJobQueue
-            {
-                _onDone = onDone
-            };
-        }
-
         private Action _onDone;
         private bool _executing;
         private volatile float _progress;
@@ -80,5 +70,18 @@
         {
             return _progress;
         }
+
+        /// <summary>
+        /// Create new queue.
+        /// </summary>
+        /// <param name="onDone">Called when the queue execution is done.</param>
+        /// <returns>Your new MyJobQueue.</returns>
+        public static MyJobQueue Create(Action onDone = null)
+        {
+            return new MyJobQueue
+            {
+                _onDone = onDone
+            };
+        }
     }
 }


Remove placeholder text response

Remove placeholder text response

Weird UX, doesn't feel right compared to the rest of lazer

--- osu.Game/Screens/OnlinePlay/Lounge/DrawableLoungeRoom.cs
+++ osu.Game/Screens/OnlinePlay/Lounge/DrawableLoungeRoom.cs
@@ -225,8 +225,6 @@
             private void joinFailed(string error)
             {
                 passwordTextbox.Text = string.Empty;
-                passwordTextbox.PlaceholderText = "incorrect password";
-                passwordTextbox.Colour = Color4.Red;

                 shakeContainer.OnShakeFinish += () => passwordTextbox.Colour = Color4.White;


No need for workaround

No need for workaround

The whole issue is to allow Raven to index before querying

--- SnittListan.Test/DbTest.cs
+++ SnittListan.Test/DbTest.cs
@@ -21,11 +21,6 @@
 				RunInMemory = true
 			}.Initialize();
 			Session = store.OpenSession();
-
-			// this is a workaround
-			// to be able to query, at least one document must be stored
-			Session.Store(new User("Daniel", "Lidström", "someone@somedomain.com", "some password"));
-			Session.SaveChanges();
 		}

 		public IDocumentSession Session { get; private set; }


OpenMixer hotkey default to None

OpenMixer hotkey default to None

--- EarTrumpet/UI/Services/SettingsService.cs
+++ EarTrumpet/UI/Services/SettingsService.cs
@@ -10,7 +10,7 @@
         public static event EventHandler<bool> UseLegacyIconChanged;

         public static readonly HotkeyData s_defaultFlyoutHotkey = new HotkeyData { Modifiers = Keys.Shift | Keys.Control, Key = Keys.Q };
-        public static readonly HotkeyData s_defaultMixerHotkey = new HotkeyData { Modifiers = Keys.Shift | Keys.Control, Key = Keys.W };
+        public static readonly HotkeyData s_defaultMixerHotkey = new HotkeyData { };

         private static ISettingsBag s_settings = StorageFactory.GetSettings();


Quote mysql tables with backticks (cherry picked from commit 69992f4ab510274fff911d3b6c3bbb3d9497713f)

--- src/FluentMigrator.Runner/Generators/MySqlGenerator.cs
+++ src/FluentMigrator.Runner/Generators/MySqlGenerator.cs
@@ -84,23 +84,23 @@

 		public override string Generate(CreateTableExpression expression)
 		{
-			return FormatExpression("CREATE TABLE {0} ({1}) ENGINE = INNODB", expression.TableName, GetColumnDDL(expression));
+			return FormatExpression("CREATE TABLE `{0}` ({1}) ENGINE = INNODB", expression.TableName, GetColumnDDL(expression));
 		}

 		public override string Generate(CreateColumnExpression expression)
 		{

-			return FormatExpression("ALTER TABLE {0} ADD {1}", expression.TableName, GenerateDDLForColumn(expression.Column));
+			return FormatExpression("ALTER TABLE `{0}` ADD {1}", expression.TableName, GenerateDDLForColumn(expression.Column));
 		}

 		public override string Generate(DeleteTableExpression expression)
 		{
-			return FormatExpression("DROP TABLE {0}", expression.TableName);
+			return FormatExpression("DROP TABLE `{0}`", expression.TableName);
 		}

 		public override string Generate(DeleteColumnExpression expression)
 		{
-			return FormatExpression("ALTER TABLE {0} DROP COLUMN {1}", expression.TableName, expression.ColumnName);
+			return FormatExpression("ALTER TABLE `{0}` DROP COLUMN {1}", expression.TableName, expression.ColumnName);
 		}

 		public override string Generate(CreateForeignKeyExpression expression)
@@ -108,7 +108,7 @@
 			string primaryColumns = GetColumnList(expression.ForeignKey.PrimaryColumns);
 			string foreignColumns = GetColumnList(expression.ForeignKey.ForeignColumns);

-			string sql = "ALTER TABLE {0} ADD CONSTRAINT {1} FOREIGN KEY ({2}) REFERENCES {3} ({4})";
+			string sql = "ALTER TABLE `{0}` ADD CONSTRAINT {1} FOREIGN KEY ({2}) REFERENCES {3} ({4})";

 			return String.Format(sql,
 						  expression.ForeignKey.ForeignTable,
@@ -121,7 +121,7 @@

 		public override string Generate(DeleteForeignKeyExpression expression)
 		{
-			string sql = "ALTER TABLE {0} DROP FOREIGN KEY `{1}`";
+			string sql = "ALTER TABLE `{0}` DROP FOREIGN KEY `{1}`";
 			return String.Format(sql, expression.ForeignKey.PrimaryTable, expression.ForeignKey.Name);
 		}

@@ -163,13 +163,13 @@

 		public override string Generate(RenameTableExpression expression)
 		{
-			return FormatExpression("RENAME TABLE {0} TO {1}", expression.OldName, expression.NewName);
+			return FormatExpression("RENAME TABLE `{0}` TO `{1}`", expression.OldName, expression.NewName);
 		}

 		public override string Generate(RenameColumnExpression expression)
 		{
 			// may need to add definition to end. blerg
-			return FormatExpression("ALTER TABLE {0} CHANGE COLUMN {1} {2}", expression.TableName, expression.OldName, expression.NewName);
+			return FormatExpression("ALTER TABLE `{0}` CHANGE COLUMN {1} {2}", expression.TableName, expression.OldName, expression.NewName);
 		}

 		public override string Generate(InsertDataExpression expression)
@@ -187,7 +187,7 @@

 				string columns = GetColumnList(columnNames);
 				string data = GetDataList(columnData);
-				result.Append(FormatExpression("INSERT INTO {0} ({1}) VALUES ({2});", expression.TableName, columns, data));
+				result.Append(FormatExpression("INSERT INTO `{0}` ({1}) VALUES ({2});", expression.TableName, columns, data));
 			}
 			return result.ToString();
 		}


Fixed error when removing all DisplayableTokens from a field.

--- src/Framework/N2/Details/DisplayableTokensAttribute.cs
+++ src/Framework/N2/Details/DisplayableTokensAttribute.cs
@@ -71,9 +71,11 @@
 						dc.Details[i] = cd;
 					else
 						dc.Details.Add(cd);
-					i++;
-				}
-				if (i > 0)
+					i++;
+                }
+                // Changed: if (i > 0) --> if (i >= 0)
+                // If i == 0, no Tokens were found, so remove all details.
+				if (i >= 0)
 				{
 					var dc = item.GetDetailCollection(detailName, true);
 					for (int j = dc.Details.Count - 1; j >= i; j--)


Formatting.

Formatting.

--- Source/Data/CommandInfo.cs
+++ Source/Data/CommandInfo.cs
@@ -75,6 +75,10 @@
 					yield return objectReader(rd);
 		}

+		#endregion
+
+		#region Query with object reader async
+
 		public Task<List<T>> QueryToListAsync<T>(Func<IDataReader,T> objectReader)
 		{
 			return QueryToListAsync(objectReader, CancellationToken.None);
@@ -167,6 +171,10 @@
 			}
 		}

+		#endregion
+
+		#region Query async
+
 		public Task<List<T>> QueryToListAsync<T>()
 		{
 			return QueryToListAsync<T>(CancellationToken.None);
@@ -271,6 +279,10 @@
 			return DataConnection.ExecuteNonQuery();
 		}

+		#endregion
+
+		#region Execute async
+
 		public Task<int> ExecuteProcAsync()
 		{
 			CommandType = CommandType.StoredProcedure;
@@ -342,6 +354,10 @@
 			return default(T);
 		}

+		#endregion
+
+		#region Execute scalar async
+
 		public Task<T> ExecuteAsync<T>()
 		{
 			return ExecuteAsync<T>(CancellationToken.None);
@@ -445,7 +461,7 @@

 		#endregion

-		#region ExecuteReaderAsync
+		#region ExecuteReader async

 		public Task<DataReaderAsync> ExecuteReaderAsync()
 		{


use UTF-8 instead of ANSI for players name

--- DemoInfo/Helper.cs
+++ DemoInfo/Helper.cs
@@ -14,7 +14,7 @@
 	{
 		public static string ReadCString(this BinaryReader reader, int length)
 		{
-			return ReadCString(reader, length, Encoding.Default);
+			return ReadCString(reader, length, Encoding.UTF8);
 		}

 		public static int ReadInt32SwapEndian(this BinaryReader reader)


Loosened up the timing on a failing test

--- src/Magnum.Specs/Channels/ChannelSubscription_Specs.cs
+++ src/Magnum.Specs/Channels/ChannelSubscription_Specs.cs
@@ -51,7 +51,7 @@
 			using (input.Connect(x =>
 				{
 					x.AddConsumerOf<TestMessage>()
-						.Every(1.Seconds(), c => c.Value)
+						.Every(2.Seconds(), c => c.Value)
 						.UsingConsumer(message => future.Complete(message.Count));
 				}))
 			{
@@ -73,7 +73,7 @@
 				}
 			}

-			future.WaitUntilCompleted(2.Seconds()).ShouldBeTrue();
+			future.WaitUntilCompleted(4.Seconds()).ShouldBeTrue();
 			future.Value.ShouldEqual(expected);
 		}


Couple more tests on the response stream.

--- src/Manos.Tests/Manos.Server/HttpResponseStreamTest.cs
+++ src/Manos.Tests/Manos.Server/HttpResponseStreamTest.cs
@@ -417,6 +417,36 @@
 		}

 		[Test]
+		public void Write_LongerThanBufferInSingleBuffer_SetsCorrectLength ()
+		{
+			var stream = new HttpResponseStream ();
+			var write_buffer = new byte [5];
+
+			stream.Write (write_buffer, 0, 5);
+
+			stream.Position = 2;
+			stream.Write (write_buffer, 0, 5);
+
+			var length = stream.Length;
+			Assert.AreEqual (7, length);
+		}
+
+		[Test]
+		public void Write_ShorterThanBufferInSingleBuffer_SetsCorrectLength ()
+		{
+			var stream = new HttpResponseStream ();
+			var write_buffer = new byte [5];
+
+			stream.Write (write_buffer, 0, 5);
+
+			stream.Position = 2;
+			stream.Write (write_buffer, 0, 2);
+
+			var length = stream.Length;
+			Assert.AreEqual (5, length);
+		}
+
+		[Test]
 		public void Write_InFirstBufferOfTwoBufferStream_SetsCorrectLength ()
 		{
 			var stream = new HttpResponseStream ();


Add skeleton for CleanerSettingsV2

Add skeleton for CleanerSettingsV2

--- CleanerSettings.cs
+++ CleanerSettings.cs
@@ -131,4 +131,36 @@
             return ret;
         }
     }
+
+    public class CleanerSettingsV2 : ICleanerSettings
+    {
+        public bool Enabled { get; private set; }
+        public int Port { get; private set; }
+        public string Username { get; private set; }
+        public string Password { get; private set; }
+        public int IdleTimeBetweenRunsInSeconds { get; private set; }
+
+
+        private string SettingsFile { get; set; }
+        private string DeviceFolder { get; set; }
+
+        public IEnumerable<PerFolderSettings> FoldersSettings => new[] {new PerFolderSettings()};
+
+        public string GetSettingsFile() => this.SettingsFile;
+        public string GetDeviceFolder() => this.DeviceFolder;
+
+
+        private CleanerSettingsV2() { }
+
+
+        public static CleanerSettingsV2 LoadFromFile(string filename)
+        {
+            var ret = new CleanerSettingsV2();
+            return ret;
+        }
+
+        public void Save()
+        {
+        }
+    }
 }


Added informational messages if event source already exists when attempting to add it, or log does not exist when attempting to remove it.

--- EventLogsCreateRemove/EventLogModifier.cs
+++ EventLogsCreateRemove/EventLogModifier.cs
@@ -50,8 +50,15 @@
                             eventSource.Name, eventLog.Name);
                         try
                         {
-                            EventLog.CreateEventSource(eventSource.Name, eventLog.Name);
-                            Console.WriteLine("Done.");
+                            if (EventLog.SourceExists(eventSource.Name))
+                            {
+                                Console.WriteLine("Source already exists.");
+                            }
+                            else
+                            {
+                                EventLog.CreateEventSource(eventSource.Name, eventLog.Name);
+                                Console.WriteLine("Done.");
+                            }
                         }
                         catch (SecurityException ex)
                         {
@@ -59,14 +66,22 @@
                         }
                     }
                     else
-                    {
+                    {
                         Console.WriteLine("Creating event source {0} for event log {1} on machine {2}...",
-                            eventSource.Name, eventLog.Name, _eventLogsConfig.MachineName);
+                            eventSource.Name, eventLog.Name, _eventLogsConfig.MachineName);
                         try
                         {
-                            EventLog.CreateEventSource(eventSource.Name, eventLog.Name,
-                                _eventLogsConfig.MachineName);
-                            Console.WriteLine("Done.");
+                            if (EventLog.SourceExists(eventSource.Name,
+                                _eventLogsConfig.MachineName))
+                            {
+                                Console.WriteLine("Source already exists.");
+                            }
+                            else
+                            {
+                                EventLog.CreateEventSource(eventSource.Name, eventLog.Name,
+                                    _eventLogsConfig.MachineName);
+                                Console.WriteLine("Done.");
+                            }
                         }
                         catch (SecurityException ex)
                         {
@@ -98,8 +113,15 @@
                         eventLog.Name);
                     try
                     {
-                        EventLog.Delete(eventLog.Name);
-                        Console.WriteLine("Done.");
+                        if (!EventLog.Exists(eventLog.Name))
+                        {
+                            Console.WriteLine("Log does not exist.");
+                        }
+                        else
+                        {
+                            EventLog.Delete(eventLog.Name);
+                            Console.WriteLine("Done.");
+                        }
                     }
                     catch (SecurityException ex)
                     {
@@ -112,8 +134,15 @@
                         eventLog.Name, _eventLogsConfig.MachineName);
                     try
                     {
-                        EventLog.Delete(eventLog.Name, _eventLogsConfig.MachineName);
-                        Console.WriteLine("Done.");
+                        if (!EventLog.Exists(eventLog.Name, _eventLogsConfig.MachineName))
+                        {
+                            Console.WriteLine("Log does not exist.");
+                        }
+                        else
+                        {
+                            EventLog.Delete(eventLog.Name, _eventLogsConfig.MachineName);
+                            Console.WriteLine("Done.");
+                        }
                     }
                     catch (SecurityException ex)
                     {


Added a Load method to FileSaveManager.

Added a Load method to FileSaveManager.

--- Storage/FileSaveManager.cs
+++ Storage/FileSaveManager.cs
@@ -65,6 +65,28 @@
         return (T)FileSaveContainers.Get(fileName).Data;
     }

+    public static T Load<T>(string fileName) {
+        Debug.Log("FileSaveManager: Load[{0}]".FormatWith(fileName));
+
+        if (!FileSaveContainers.Has(fileName)) {
+            var fileData = FileSaveUtils.Load<T>(fileName);
+
+            if (fileData == null) {
+                return default(T);
+            }
+
+            var fileSaveContainer = new FileSaveContainer {
+                FileName = fileName,
+                Data = fileData,
+                DataType = typeof(T)
+            };
+
+            FileSaveContainers.Set(fileSaveContainer.FileName, fileSaveContainer);
+        }
+
+        return (T)FileSaveContainers.Get(fileName).Data;
+    }
+
     public static bool Save(string fileName) {
         Debug.Log("FileSaveManager: Save[{0}]".FormatWith(fileName));
         var fileSaveContainer = FileSaveContainers.Get(fileName);


Added sets tracking to gridSquare to simplify adding set based eleminations

--- SudokuSolver/SudokuGrid.cs
+++ SudokuSolver/SudokuGrid.cs
@@ -17,9 +17,8 @@
 		}

 		//helper class
-		//@TODO: make private when done pulling solve logic from Form1
 		//@TODO: clean up
-		public class gridSquare
+		private class gridSquare
 		{
 			int x; //these might not be needed, but they can stay for now
 			int y;
@@ -34,8 +33,11 @@
 			//number of possibilites remaining
 			int possCount;

-			//set whenever possibilities at x,y are changes, cleared whenever x,y is checked.
+			//set whenever possibilities at x,y are changed, cleared whenever x,y is checked. TODO: use for future optimizations? (or remove)
 			bool recheck;
+
+			//set of possible combinations
+			HashSet<HashSet<int>> setList;

 			public SudokuGrid.SolveType solveType { get; set; }

@@ -51,17 +53,48 @@
 					possibilities[i] = true;
 				possCount = 9;

+				initSetList();
+
 				recheck = false; //nothing needs checking to start with
 				solveType = SudokuGrid.SolveType.Unsolved;
 			}

+			private void initSetList()
+			{
+				//fill out setList
+				setList = new HashSet<HashSet<int>>(new gridSquare.SetOfIntEqualityComparer());
+				HashSet<int> temp;
+				for (int i1 = 1; i1 <= 9; i1++)
+				{
+					for (int i2 = i1+1; i2 <= 9; i2++)
+					{
+						//Add pairs
+						temp = new HashSet<int>();
+						temp.Add(i1);
+						temp.Add(i2);
+						setList.Add(temp);
+						////add larger sets TODO: determine how much larger of sets to add. Higher order sets add to compute time and are less likely to advance a solution
+						//for (int i3 = i2 + 1; i3 <= 9; i3++)
+						//{
+						//    //Add triples
+						//    temp = new HashSet<int>();
+						//    temp.Add(i1);
+						//    temp.Add(i2);
+						//    temp.Add(i3);
+						//    setList.Add(temp);
+						//    //TODO: add larger sets?
+						//}
+					}
+				}
+			}
+
 			public gridSquare(gridSquare toCopy)
 			{
 				possibilities = new bool[9 + 1];
 				this.copy(toCopy);
 			}

-			public void copy(gridSquare toCopy)
+			private void copy(gridSquare toCopy)
 			{
 				this.x = toCopy.x;
 				this.y = toCopy.y;
@@ -73,6 +106,7 @@

 				this.recheck = toCopy.recheck;
 				this.solveType = toCopy.solveType;
+				this.setList = new HashSet<HashSet<int>>(toCopy.setList);
 			}

 			public void reset()
@@ -82,6 +116,8 @@
 				for (int i = 1; i <= 9; ++i)
 					possibilities[i] = true;
 				possCount = 9;
+
+				initSetList();

 				recheck = false; //nothing needs checking to start with
 				solveType = SudokuGrid.SolveType.Unsolved;
@@ -141,6 +177,8 @@
 						possibilities[i] = false;
 						if (possCount == 0)
 							solveType = SolveType.Invalid;
+						else
+							setList.RemoveWhere(s => s.Contains(i));
 						return true;
 					}

@@ -165,6 +203,28 @@

 				}
 			}
+
+			public HashSet<HashSet<int>> SetList
+			{
+				get
+				{
+					return setList; //TODO: refactor to not provide full access to member? This helper class is private to SudokuGrid class...
+				}
+			}
+
+			public class SetOfIntEqualityComparer : IEqualityComparer<HashSet<int>>
+			{
+				public bool Equals(HashSet<int> s1, HashSet<int> s2)
+				{
+					return s1.SetEquals(s2);
+				}
+
+				public int GetHashCode(HashSet<int> s)
+				{
+					return s.GetHashCode();
+				}
+			}
+
 		}


Cleanup SQL Name addition

Cleanup SQL Name addition

--- src/MiniProfiler.Storage.SqlServer/SqlServerStorage.cs
+++ src/MiniProfiler.Storage.SqlServer/SqlServerStorage.cs
@@ -42,6 +42,7 @@
 @"insert into MiniProfilers
             (Id,
              RootTimingId,
+             Name,
              Started,
              DurationMilliseconds,
              [User],
@@ -51,6 +52,7 @@
              ClientTimingsRedirectCount)
 select       @Id,
              @RootTimingId,
+             @Name,
              @Started,
              @DurationMilliseconds,
              @User,
@@ -66,6 +68,7 @@
                 {
                     profiler.Id,
                     profiler.Started,
+                    Name = profiler.Name.Truncate(200),
                     User = profiler.User.Truncate(100),
                     RootTimingId = profiler.Root != null ? profiler.Root.Id : (Guid?)null,
                     profiler.DurationMilliseconds,
@@ -350,6 +353,7 @@
                      RowId                                integer not null identity constraint PK_MiniProfilers primary key clustered, -- Need a clustered primary key for SQL Azure
                      Id                                   uniqueidentifier not null, -- don't cluster on a guid
                      RootTimingId                         uniqueidentifier null,
+                     Name                                 nvarchar(200) not null,
                      Started                              datetime not null,
                      DurationMilliseconds                 decimal(7, 1) not null,
                      [User]                               nvarchar(100) null,


Adicionado Calculo Fcp ResultadoTributacao

--- src/MotorTributarioNet/Impostos/ResultadoTributacao.cs
+++ src/MotorTributarioNet/Impostos/ResultadoTributacao.cs
@@ -42,6 +42,7 @@
         private TributacaoCofins Cofins { get; set; }
         private TributacaoIpi Ipi { get; set; }
         private TributacaoDifal Difal { get; set; }
+        private TributacaoFcp TributacaoFcp { get; set; }
         private TributacaoIssqn Issqn { get; set; }
         private TributacaoIbpt Ibpt { get; set; }

@@ -76,6 +77,7 @@
         public decimal ValorIpi { get; private set; }

         public decimal ValorBcDifal { get; private set; }
+        public decimal ValorBcFcp { get; private set; }
         public decimal Fcp { get; private set; }
         public decimal ValorDifal { get; private set; }
         public decimal ValorIcmsOrigem { get; private set; }
@@ -450,6 +452,20 @@
             return Issqn;
         }

+        private TributacaoFcp CalcularFcp()
+        {
+            TributacaoFcp = new TributacaoFcp(_produto, TipoDesconto.Condincional);
+            Fcp = decimal.Zero;
+            ValorBcFcp = decimal.Zero;
+
+            var result = TributacaoFcp.Calcula();
+
+            Fcp = result.Valor;
+            ValorBcFcp = result.BaseCalculo;
+
+            return TributacaoFcp;
+        }
+
         private TributacaoDifal CalcularDifal()
         {


Better user preference management.

Better user preference management.

--- Forum3/Repositories/SettingsRepository.cs
+++ Forum3/Repositories/SettingsRepository.cs
@@ -75,22 +75,9 @@
 		}

 		public string GetSetting(string name, string userId = "") {
-			DataModels.SiteSetting setting = null;
 			var settingValue = string.Empty;

-			if (string.IsNullOrEmpty(userId)) {
-				if (!Settings.ContainsKey(name)) {
-					setting = DbContext.SiteSettings.Where(r => r.Name == name && string.IsNullOrEmpty(r.UserId)).FirstOrDefault();
-
-					lock (Settings) {
-						if (!Settings.ContainsKey(name))
-							Settings.Add(name, setting is null ? string.Empty : setting.Value);
-					}
-				}
-
-				Settings.TryGetValue(name, out settingValue);
-			}
-			else {
+			if (!string.IsNullOrEmpty(userId)) {
 				if (!UserSettings.ContainsKey(userId)) {
 					lock (UserSettings) {
 						UserSettings.TryAdd(userId, new Dictionary<string, string>());
@@ -98,15 +85,28 @@
 				}

 				if (!UserSettings[userId].ContainsKey(name)) {
-					setting = DbContext.SiteSettings.Where(r => r.Name == name && r.UserId == userId).FirstOrDefault();
+					var setting = DbContext.SiteSettings.Where(r => r.Name == name && r.UserId == userId).FirstOrDefault();

 					lock (UserSettings[userId]) {
 						if (!UserSettings[userId].ContainsKey(name))
-							UserSettings[userId].Add(name, setting is null ? string.Empty : setting.Value);
+							UserSettings[userId].Add(name, setting?.Value ?? string.Empty);
 					}
 				}

 				UserSettings[userId].TryGetValue(name, out settingValue);
+			}
+
+			if (string.IsNullOrEmpty(settingValue)) {
+				if (!Settings.ContainsKey(name)) {
+					var setting = DbContext.SiteSettings.Where(r => r.Name == name && string.IsNullOrEmpty(r.UserId)).FirstOrDefault();
+
+					lock (Settings) {
+						if (!Settings.ContainsKey(name))
+							Settings.Add(name, setting?.Value ?? string.Empty);
+					}
+				}
+
+				Settings.TryGetValue(name, out settingValue);
 			}

 			return settingValue;


await prune task of deleting messages

await prune task of deleting messages

There was an issue where it would sometimes delete once or twice or sometimes does not delete at all or would return 404 error

--- src/NadekoBot/Modules/Administration/Administration.cs
+++ src/NadekoBot/Modules/Administration/Administration.cs
@@ -643,7 +643,7 @@

             var enumerable = (await umsg.Channel.GetMessagesAsync()).AsEnumerable();
             enumerable = enumerable.Where(x => x.Author.Id == user.Id);
-            await umsg.Channel.DeleteMessagesAsync(enumerable);
+            await umsg.Channel.DeleteMessagesAsync(enumerable).ConfigureAwait(false);
         }

         // prune x
@@ -656,7 +656,7 @@
             await (msg as IUserMessage).DeleteAsync();
             int limit = (count < 100) ? count : 100;
             var enumerable = (await msg.Channel.GetMessagesAsync(limit: limit));
-            await msg.Channel.DeleteMessagesAsync(enumerable);
+            await msg.Channel.DeleteMessagesAsync(enumerable).ConfigureAwait(false);
         }

         //prune @user [x]
@@ -668,7 +668,7 @@
             var channel = (ITextChannel)msg.Channel;
             int limit = (count < 100) ? count : 100;
             var enumerable = (await msg.Channel.GetMessagesAsync(limit: limit)).Where(m => m.Author == user);
-            await msg.Channel.DeleteMessagesAsync(enumerable);
+            await msg.Channel.DeleteMessagesAsync(enumerable).ConfigureAwait(false);
         }

         [NadekoCommand, Usage, Description, Aliases]


fixed comments

fixed comments

--- src/Numerics/LinearAlgebra/Double/Matrix.Arithmetic.cs
+++ src/Numerics/LinearAlgebra/Double/Matrix.Arithmetic.cs
@@ -152,7 +152,7 @@
         ///
         /// <param name="rightSide">The vector to multiply with.</param>
         /// <returns>The result of the multiplication.</returns>
-        /// <exception cref="ArgumentNullException">If rightSide is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentNullException">If <paramref name="rightSide"/> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentException">If <c>this.ColumnCount != rightSide.Count</c>.</exception>
         public virtual Vector Multiply(Vector rightSide)
         {
@@ -169,7 +169,7 @@
         /// <exception cref="ArgumentNullException">If <paramref name="rightSide"/> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentNullException">If <paramref name="result"/> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentException">If result.Count != this.RowCount.</exception>
-        /// <exception cref="ArgumentException">If this.ColumnCount != rightSide.Count.</exception>
+        /// <exception cref="ArgumentException">If this.ColumnCount != <paramref name="rightSide"/>.Count.</exception>
         public virtual void Multiply(Vector rightSide, Vector result)
         {
             if (rightSide == null)
@@ -222,7 +222,7 @@
         /// <param name="leftSide">The vector to multiply with.</param>
         /// <returns>The result of the multiplication.</returns>
         /// <exception cref="ArgumentNullException">If <paramref name="leftSide"/> is <see langword="null" />.</exception>
-        /// <exception cref="ArgumentException">If this.RowCount != leftSide.Count.</exception>
+        /// <exception cref="ArgumentException">If this.RowCount != <paramref name="leftSide"/>.Count.</exception>
         public virtual Vector LeftMultiply(Vector leftSide)
         {
             var ret = this.CreateVector(this.ColumnCount);
@@ -235,10 +235,10 @@
         ///
         /// <param name="leftSide">The vector to multiply with.</param>
         /// <param name="result">The result of the multiplication.</param>
-        /// <exception cref="ArgumentNullException">If leftSide is <see langword="null" />.</exception>
+        /// <exception cref="ArgumentNullException">If <paramref name="leftSide"/> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentNullException">If the result matrix is <see langword="null" />.</exception>
         /// <exception cref="ArgumentException">If result.Count != this.ColumnCount.</exception>
-        /// <exception cref="ArgumentException">If this.RowCount != leftSide.Count.</exception>
+        /// <exception cref="ArgumentException">If this.RowCount != <paramref name="leftSide"/>.Count.</exception>
         public virtual void LeftMultiply(Vector leftSide, Vector result)
         {
             if (leftSide == null)
@@ -431,7 +431,7 @@
         }

         ///
-        /// Returns a Matrix containing the same values of rightSide.
+        /// Returns a Matrix containing the same values of <paramref name="rightSide"/>.
         ///
         /// <param name="rightSide">The matrix to get the values from.</param>
         /// <returns>A matrix containing a the same values as <paramref name="rightSide"/>.</returns>
@@ -741,10 +741,10 @@
         /// <param name="numberOfColumns">Number of columns.</param>
         /// <param name="distribution">Continuous Random Distribution or Source</param>
         /// <returns>
-        /// An numberOfRows-by-numberOfColumns matrix with elements distributed according to the provided distribution.
+        /// An <c>numberOfRows</c>-by-<c>numberOfColumns</c> matrix with elements distributed according to the provided distribution.
         /// </returns>
-        /// <exception cref="ArgumentException">If the parameter numberOfRows is not positive.</exception>
-        /// <exception cref="ArgumentException">If the parameter numberOfColumns is not positive.</exception>
+        /// <exception cref="ArgumentException">If the parameter <paramref name="numberOfRows"/> is not positive.</exception>
+        /// <exception cref="ArgumentException">If the parameter <paramref name="numberOfColumns"/> is not positive.</exception>
         public virtual Matrix Random(int numberOfRows, int numberOfColumns, IContinuousDistribution distribution)
         {
             if (numberOfRows < 1)
@@ -779,10 +779,10 @@
         /// <param name="numberOfColumns">Number of columns.</param>
         /// <param name="distribution">Continuous Random Distribution or Source</param>
         /// <returns>
-        /// An numberOfRows-by-numberOfColumns matrix with elements distributed according to the provided distribution.
+        /// An <c>numberOfRows</c>-by-<c>numberOfColumns</c> matrix with elements distributed according to the provided distribution.
         /// </returns>
-        /// <exception cref="ArgumentException">If the parameter numberOfRows is not positive.</exception>
-        /// <exception cref="ArgumentException">If the parameter numberOfColumns is not positive.</exception>
+        /// <exception cref="ArgumentException">If the parameter <paramref name="numberOfRows"/> is not positive.</exception>
+        /// <exception cref="ArgumentException">If the parameter <paramref name="numberOfColumns"/> is not positive.</exception>
         public virtual Matrix Random(int numberOfRows, int numberOfColumns, IDiscreteDistribution distribution)
         {
             if (numberOfRows < 1)


previous commit

previous commit

--- src/Peachpie.CodeAnalysis/Semantics/SemanticsBinder.cs
+++ src/Peachpie.CodeAnalysis/Semantics/SemanticsBinder.cs
@@ -786,7 +786,7 @@
                     var boundIndex = (x.Index != null) ? BindExpression(x.Index, BoundAccess.Read) : null;
                     var boundValue = (x is AST.RefItem refItem)
                         ? BindExpression(refItem.RefToGet, islist ? BoundAccess.None.WithWriteRef(0) : BoundAccess.ReadValueCopy)
-                        : BindExpression(((AST.ValueItem)x).ValueExpr, islist ? BoundAccess.Write : BoundAccess.ReadRef);
+                        : BindExpression(((AST.ValueItem)x).ValueExpr, islist ? BoundAccess.Write : BoundAccess.Read);

                     yield return new KeyValuePair<BoundExpression, BoundExpression>(boundIndex, boundValue);
                 }


[AE-493]: Added ExternalId property in Contact model.

--- Contact/Contact.cs
+++ Contact/Contact.cs
@@ -59,6 +59,9 @@

         [JsonProperty("groups")]
         public List<SubscriptionGroup> Groups { get; set; }
+
+        [JsonProperty("externalId")]
+        public string ExternalId { get; set; }
     }

     /// <summary>


minor tweak to remove seperate variable for debugging

--- HomegenieTestApplication/Api/ApiHelper.cs
+++ HomegenieTestApplication/Api/ApiHelper.cs
@@ -13,9 +13,7 @@
         public bool UpdateModule(string host, Module module)
         {
             var url = $"http://{host}/api/HomeAutomation.HomeGenie/Config/Modules.Update";
-
-            var json = JsonConvert.SerializeObject(module);
-            Post(url, json);
+            Post(url, JsonConvert.SerializeObject(module));
             return true;
         }


some variables name change

some variables name change

--- Homeworks/DefiningClassesPart1/GSM/GSM.cs
+++ Homeworks/DefiningClassesPart1/GSM/GSM.cs
@@ -194,17 +194,18 @@
         public override string ToString()
         {
             StringBuilder sb = new StringBuilder();
-            string valuteSymbol = String.Empty;
+            string currencySign = String.Empty;

             if (this.Price != null)
             {
-                valuteSymbol = "$";
+                currencySign = "$";
             }

             sb.AppendLine("/GSM specifications/".PadLeft(30));
             sb.AppendLine("Model:".PadLeft(15) + string.Format("{0, 15}", this.Model));
             sb.AppendLine("Manufacturer:".PadLeft(15) + string.Format("{0, 15}", this.Manufacturer));
-            if (this.Price != null) sb.AppendLine("Price:".PadLeft(15) + string.Format("{0, 14}{1}", this.Price, valuteSymbol));
+
+            if (this.Price != null) sb.AppendLine("Price:".PadLeft(15) + string.Format("{0, 14}{1}", this.Price, currencySign));
             if (this.Owner != null) sb.AppendLine("Owner:".PadLeft(15) + string.Format("{0, 15}", this.Owner) + Environment.NewLine);
             if (this.Battery != null) sb.AppendLine("/Battery/".PadLeft(30) + Environment.NewLine + string.Format("{0, 15}", this.Battery));
             if (this.Display != null) sb.AppendLine("/Display/".PadLeft(30) + Environment.NewLine + string.Format("{0, 15}", this.Display));


Change truncate message

Change truncate message

--- IMDBUtils_VS/IMDBUtils/MainWindow.xaml.cs
+++ IMDBUtils_VS/IMDBUtils/MainWindow.xaml.cs
@@ -207,7 +207,7 @@
                     {
                         if (arrSplited[i].Length > 32767)
                         {
-                            Console.WriteLine("Make this cell truncated to : " + arrSplited[i].Length);
+                            Console.WriteLine("exceed the cell limit : " + arrSplited[i].Length);
                             String truncated = Utils.Utils.TruncateWithOutDot(arrSplited[i], 32767);
                             arrSplited[i] = (truncated);
                         }


adding 2 versions of lottery code, single connection and multiple connections

--- src/ResponseTimeLottery/ResponseTimeLottery/Program.cs
+++ src/ResponseTimeLottery/ResponseTimeLottery/Program.cs
@@ -13,6 +13,47 @@

         private static void Main()
         {
+            //MarsConnection();
+            MultipleConnections();
+        }
+
+        private static void MarsConnection(){
+
+        //QUERIES
+
+            var query1 = "SELECT 1980 --the year that god made me";
+            //var query2 = "WAITFOR DELAY '0:0:5'";
+            var query2 =
+                "select 1000; select top 1000 * from sys.sysindexes cross join sys.sysobjects;create table #ddd(id int); drop table #ddd";
+
+            _lock = new object();
+
+            while (true)
+            {
+                //Create MARS connection
+                var connection = new SqlConnection("Server=.;Integrated Security=SSPI;MultipleActiveResultSets=true;");
+
+                connection.Open();
+
+                QueryCompletions = 0;
+
+                //Run queries on seperate threads
+                Task.Factory.StartNew(() => { RunQuery(connection, query2); }, TaskCreationOptions.LongRunning);
+                Task.Factory.StartNew(() => { RunQuery(connection, query1); }, TaskCreationOptions.LongRunning);
+
+                lock (_lock)
+                    Console.WriteLine("Tasks Scheduled...");
+
+                //Wait for them both to finish
+                while (QueryCompletions < 2)
+                    Thread.Sleep(100);
+
+                connection.Close();
+            }
+        }
+
+        private static void MultipleConnections()
+        {
             //QUERIES

             var query1 = "SELECT 1980 --the year that god made me";
@@ -25,14 +66,20 @@
             while (true)
             {
                 //Create MARS connection
-                var connection = new SqlConnection("Server=.;Integrated Security=SSPI;MultipleActiveResultSets=true;");
-                connection.Open();
+
+                var connection1 = new SqlConnection("Server=.;Integrated Security=SSPI;MultipleActiveResultSets=true;");
+                var connection2 = new SqlConnection("Server=.;Integrated Security=SSPI;MultipleActiveResultSets=true;");
+
+
+                connection1.Open();
+                connection2.Open();

                 QueryCompletions = 0;

                 //Run queries on seperate threads
-                Task.Factory.StartNew(() => { RunQuery(connection, query2); }, TaskCreationOptions.LongRunning);
-                Task.Factory.StartNew(() => { RunQuery(connection, query1); }, TaskCreationOptions.LongRunning);
+                Task.Factory.StartNew(() => { RunQuery(connection1, query2); }, TaskCreationOptions.LongRunning);
+                Task.Factory.StartNew(() => { RunQuery(connection2, query1); }, TaskCreationOptions.LongRunning);
+

                 lock (_lock)
                     Console.WriteLine("Tasks Scheduled...");
@@ -41,7 +88,9 @@
                 while (QueryCompletions < 2)
                     Thread.Sleep(100);

-                connection.Close();
+
+                connection1.Close();
+                connection2.Close();
             }
         }

@@ -62,7 +111,7 @@

             lock (_lock)
             {
-                if (timer.ElapsedMilliseconds > 10)
+                if (timer.ElapsedMilliseconds >= 10)
                     Console.ForegroundColor = ConsoleColor.Red;

                 if (timer.ElapsedMilliseconds < 10)


Whitespace

Whitespace

--- src/Schema.Hypermedia.Test/HypermediaGeneratorTests.cs
+++ src/Schema.Hypermedia.Test/HypermediaGeneratorTests.cs
@@ -109,7 +109,6 @@
             Assert.That(links[1].Href, Is.EqualTo(expected[1]));
         }

-
         [TestCase("/v1/valid")]
         [TestCase("/v1/valid{?id,familyName}")]
         public void ItShouldALinkRequiringNoSubstitution(string expected)


fixed #680

fixed #680

--- src/ScriptEngine/Machine/Contexts/ContextIValueImpl.cs
+++ src/ScriptEngine/Machine/Contexts/ContextIValueImpl.cs
@@ -17,14 +17,7 @@

         public ContextIValueImpl()
         {
-            if (TypeManager.IsKnownType(this.GetType()))
-            {
-                _type = TypeManager.GetTypeByFrameworkType(this.GetType());
-            }
-            else
-            {
-                throw new InvalidOperationException($"Type {GetType()} is not defined");
-            }
+
         }

         public ContextIValueImpl(TypeDescriptor type)
@@ -39,7 +32,7 @@

         public override string ToString()
         {
-            return _type.Name;
+            return _type.Name ?? base.ToString();
         }

         #region IValue Members
@@ -51,7 +44,22 @@

         public TypeDescriptor SystemType
         {
-            get { return _type; }
+            get
+            {
+                if (_type.Name == null)
+                {
+                    if (TypeManager.IsKnownType(this.GetType()))
+                    {
+                        _type = TypeManager.GetTypeByFrameworkType(this.GetType());
+                    }
+                    else
+                    {
+                        throw new InvalidOperationException($"Type {GetType()} is not defined");
+                    }
+                }
+
+                return _type;
+            }
         }

         public decimal AsNumber()


修改ErrorJsonResultException日志记录格式

修改ErrorJsonResultException日志记录格式

--- src/Senparc.Weixin/Senparc.Weixin/Trace/WeixinTrace.cs
+++ src/Senparc.Weixin/Senparc.Weixin/Trace/WeixinTrace.cs
@@ -303,6 +303,7 @@

             LogBegin("[[ErrorJsonResultException]]");
             LogBegin("ErrorJsonResultException");
+            Log("AccessTokenOrAppId：{0}", ex.AccessTokenOrAppId ?? "null");
             Log("URL：{0}", ex.Url);
             Log("errcode：{0}", ex.JsonResult.errcode);
             Log("errmsg：{0}", ex.JsonResult.errmsg);


added project metadata to fix nuget package.

--- src/SixtenLabs.Spawn.CSharp/Properties/AssemblyInfo.cs
+++ src/SixtenLabs.Spawn.CSharp/Properties/AssemblyInfo.cs
@@ -5,10 +5,10 @@
 // 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("SixtenLabs.Spawn.CSharp")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyTitle("Spawn CSharp")]
+[assembly: AssemblyDescription("CSharp Generator for Spawn")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("Sixten Labs")]
 [assembly: AssemblyProduct("SixtenLabs.Spawn.CSharp")]
 [assembly: AssemblyCopyright("Copyright ©  2016")]
 [assembly: AssemblyTrademark("")]


Fix broken test.

Fix broken test.

--- src/EditorFeatures/CSharpTest/Diagnostics/ImplementInterface/ImplementInterfaceTests.cs
+++ src/EditorFeatures/CSharpTest/Diagnostics/ImplementInterface/ImplementInterfaceTests.cs
@@ -2483,7 +2483,7 @@
     }
     struct TestStruct1 : TestInterface
     {
-        public async Task M1()
+        public void M1()
         {
             throw new NotImplementedException();
         }


Move abstract methods to top

Move abstract methods to top

--- src/Features/Core/Portable/Completion/Providers/AbstractDocCommentCompletionProvider.cs
+++ src/Features/Core/Portable/Completion/Providers/AbstractDocCommentCompletionProvider.cs
@@ -97,6 +97,10 @@

         protected abstract IEnumerable<string> GetExistingTopLevelAttributeValues(TSyntax syntax, string tagName, string attributeName);

+        protected abstract IEnumerable<string> GetKeywordNames();
+
+        protected abstract ImmutableArray<IParameterSymbol> GetParameters(ISymbol symbol);
+
         private CompletionItem GetItem(string name)
         {
             if (s_tagMap.TryGetValue(name, out var values))
@@ -201,8 +205,6 @@

             return SpecializedCollections.EmptyEnumerable<CompletionItem>();
         }
-
-        protected abstract IEnumerable<string> GetKeywordNames();

         protected ImmutableArray<CompletionItem> GetTopLevelItems(ISymbol symbol, TSyntax syntax)
         {
@@ -243,8 +245,6 @@
             return items.ToImmutable();
         }

-        protected abstract ImmutableArray<IParameterSymbol> GetParameters(ISymbol symbol);
-
         protected IEnumerable<CompletionItem> GetItemTagItems()
             => new[] { TermElementName, DescriptionElementName }.Select(GetItem);


Cleanup

Cleanup

--- src/Libraries/Thinktecture.IdentityServer.Web.Library/Controller/Issue/HrdController.cs
+++ src/Libraries/Thinktecture.IdentityServer.Web.Library/Controller/Issue/HrdController.cs
@@ -9,17 +9,15 @@
 using System.IdentityModel.Services;
 using System.IdentityModel.Services.Configuration;
 using System.IdentityModel.Tokens;
+using System.Linq;
 using System.Security.Claims;
-using System.Security.Principal;
 using System.Web;
 using System.Web.Mvc;
+using Newtonsoft.Json.Linq;
 using Thinktecture.IdentityServer.Models;
 using Thinktecture.IdentityServer.Repositories;
 using Thinktecture.IdentityServer.TokenService;
 using Thinktecture.IdentityServer.Web.ActionResults;
-using Thinktecture.IdentityServer.Web.Security;
-using System.Linq;
-using Newtonsoft.Json.Linq;

 namespace Thinktecture.IdentityServer.Web.Controllers
 {
@@ -110,7 +108,8 @@
             var principal = ValidateToken(token);
             var issuerName = principal.Claims.First().Issuer;

-            principal.Identities.First().AddClaim(new Claim(Constants.Claims.IdentityProvider, issuerName));
+            principal.Identities.First().AddClaim(
+                new Claim(Constants.Claims.IdentityProvider, issuerName, ClaimValueTypes.String, Constants.LocalIssuer));

             var context = GetContextCookie();
             var message = new SignInRequestMessage(new Uri("http://foo"), context.Realm);
@@ -151,12 +150,12 @@
             throw new System.NotImplementedException();
         }

-        private ActionResult RedirectToIdentityProvider(SignInRequestMessage message)
+        private ActionResult RedirectToIdentityProvider(SignInRequestMessage request)
         {
             IdentityProvider idp = null;
-            if (IdentityProviderRepository.TryGet(message.HomeRealm, out idp))
-            {
-                return RedirectToIdentityProvider(idp, message);
+            if (IdentityProviderRepository.TryGet(request.HomeRealm, out idp))
+            {
+                return RedirectToIdentityProvider(idp, request);
             }

             return View("Error");
@@ -189,11 +188,8 @@
                 throw new InvalidOperationException("cookie");
             }

-            var j = JObject.Parse(HttpUtility.UrlDecode(cookie.Value));
-
-            var c = j.ToObject<Context>();
-
-            return c;
+            var json = JObject.Parse(HttpUtility.UrlDecode(cookie.Value));
+            return json.ToObject<Context>();
         }

         internal class Context


Fix compiler error when using the Svelto profilers

--- ECS/EnginesRoot.cs
+++ ECS/EnginesRoot.cs
@@ -49,7 +49,7 @@
             _implementedInterfaceTypes = new Dictionary<Type, Type[]>();

 #if ENGINE_PROFILER_ENABLED && UNITY_EDITOR
-            GameObject debugEngineObject = new GameObject("Engine Debugger");
+            UnityEngine.GameObject debugEngineObject = new UnityEngine.GameObject("Engine Debugger");
             debugEngineObject.gameObject.AddComponent<EngineProfilerBehaviour>();
 #endif
         }


remove non-UserDefinedTitle when validating conceptual metadata (#4132)

* remove non-UserDefinedTitle when validating conceptual metadata

* address comments

--- src/Microsoft.DocAsCode.Build.ConceptualDocuments/ValidateConceptualDocumentMetadata.cs
+++ src/Microsoft.DocAsCode.Build.ConceptualDocuments/ValidateConceptualDocumentMetadata.cs
@@ -30,9 +30,12 @@
             {
                 return;
             }
-            host.ValidateInputMetadata(
-                model.OriginalFileAndType.File,
-                ((Dictionary<string, object>)model.Content).ToImmutableDictionary().Remove(ConceptualKey));
+            var metadata = ((Dictionary<string, object>)model.Content).ToImmutableDictionary().Remove(ConceptualKey);
+            if(!model.Properties.IsUserDefinedTitle)
+            {
+                metadata = metadata.Remove(Constants.PropertyName.Title);
+            }
+            host.ValidateInputMetadata(model.OriginalFileAndType.File, metadata);
         }

         #region ISupportIncrementalBuildStep Members


Se modifica el excel

Se modifica el excel

--- ToBank/src/IO/FileExcel.cs
+++ ToBank/src/IO/FileExcel.cs
@@ -90,10 +90,13 @@
 				// values. See notes about compatibility.
 				//
 				Range excelRange = sheet.UsedRange;
-				object[,] valueArray = (object[,])excelRange.get_Value(
-					XlRangeValueDataType.xlRangeValueDefault);
+				object[,] valueArray = (object[,])excelRange.get_Value();
+					//XlRangeValueDataType.xlRangeValueDefault);
+
+				// Desde A:10 hasta BS:100, 71 columnas

 				foreach (object element in valueArray) {
+

 				}


Fix Record Graph Type Query

Fix Record Graph Type Query

--- src/Snowflake.Support.GraphQLFrameworkQueries/Types/Model/GameFileExtensionGraphType.cs
+++ src/Snowflake.Support.GraphQLFrameworkQueries/Types/Model/GameFileExtensionGraphType.cs
@@ -13,12 +13,12 @@
             Name = "GameFiles";
             Description = "The files of a game";

-            Field<FileRecordGraphType>("files",
+            Field<ListGraphType<FileRecordGraphType>>("fileRecords",
                 description: "The files for which have metadata and are installed, not all files.",
                 resolve: context => context.Source.Files);

             Field<ListGraphType<FileGraphType>>("programFiles",
-                description: "The files for which have metadata and are installed ",
+                description: "All files inside the program files folder for this game.",
                 arguments: new QueryArguments(new QueryArgument<BooleanGraphType>
                     {Name = "recursive", DefaultValue = false,}),
                 resolve: context => context.GetArgument("recursive", false)


Equality bro

Equality bro

--- Eagleslist/User.cs
+++ Eagleslist/User.cs
@@ -5,7 +5,7 @@

 namespace Eagleslist
 {
-    public class User: IXmlSerializable
+    public class User: IXmlSerializable, IEquatable<User>
     {
         public int ID { get; set; }
         public string SessionID { get; private set; }
@@ -21,6 +21,11 @@
         public User()
         {

+        }
+
+        public bool Equals(User other)
+        {
+            return ID.Equals(other.ID);
         }

         public User(int id, string sessionID, string imageURL, string handle, string email, string bio, bool isMod, bool isFaculty, string AuthError)


PR Feedback

PR Feedback

--- src/VisualStudio/Core/Def/Implementation/ChangeSignature/AddParameterDialogViewModel.cs
+++ src/VisualStudio/Core/Def/Implementation/ChangeSignature/AddParameterDialogViewModel.cs
@@ -51,29 +51,20 @@

         public string CallSiteValue { get; set; }

-        private SymbolDisplayFormat _symbolDisplayFormat = new SymbolDisplayFormat(
+        private static readonly SymbolDisplayFormat s_symbolDisplayFormat = new SymbolDisplayFormat(
             genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters,
             miscellaneousOptions: SymbolDisplayMiscellaneousOptions.UseSpecialTypes);

         public ITypeSymbol? TypeSymbol { get; set; }

-        public string? TypeName
-        {
-            get
-            {
-                return TypeSymbol?.ToDisplayString(_symbolDisplayFormat);
-            }
-        }
+        public string? TypeName => TypeSymbol?.ToDisplayString(s_symbolDisplayFormat);

         public bool TypeBinds => !TypeSymbol!.IsErrorType();

         private bool _isRequired;
         public bool IsRequired
         {
-            get
-            {
-                return _isRequired;
-            }
+            get => _isRequired;
             set
             {
                 if (SetProperty(ref _isRequired, value))
@@ -94,10 +85,7 @@

         public bool IsOptional
         {
-            get
-            {
-                return !_isRequired;
-            }
+            get => !_isRequired;
             set
             {
                 if (_isRequired == value)