Converted ReplaceNewLines Replacement property to auto property and init in constructor.

--- src/NLog/LayoutRenderers/Wrappers/ReplaceNewLinesLayoutRendererWrapper.cs
+++ src/NLog/LayoutRenderers/Wrappers/ReplaceNewLinesLayoutRendererWrapper.cs
@@ -51,19 +51,14 @@
         /// </summary>
         public ReplaceNewLinesLayoutRendererWrapper()
         {
+            Replacement = " ";
         }

-
-        private string _replacement = " ";
         /// <summary>
         /// Gets or sets a value indicating the string that should be used for separating lines.
         /// </summary>
         [DefaultValue(" ")]
-        public string Replacement
-        {
-            get { return _replacement; }
-            set { _replacement = value; }
-        }
+        public string Replacement { get; set; }

         /// <summary>


Fixed the text to use the one from 307 and also used strong instead of b

--- src/SFA.DAS.EmployerFinance.Web/Views/Transfers/FinancialBreakdown.cshtml
+++ src/SFA.DAS.EmployerFinance.Web/Views/Transfers/FinancialBreakdown.cshtml
@@ -85,7 +85,7 @@

             How are my committed funds calculated?

-
Your committed funds are calculated by subtracting your total estimated spend from your @Model.Data.TotalAvailableTransferAllowance.ToString("C0", culture) total available transfer allowance.

+
Your committed funds are calculated by subtracting your total estimated spend from your @Model.Data.TotalAvailableTransferAllowance.ToString("C0", culture) total available transfer allowance.


Refactored Create a Cohort link

Refactored Create a Cohort link

--- src/SFA.DAS.ProviderApprenticeshipsService.Web/Views/Account/Index.cshtml
+++ src/SFA.DAS.ProviderApprenticeshipsService.Web/Views/Account/Index.cshtml
@@ -20,50 +20,81 @@

-
-@if (Model.ShowCreateCohortLink)
-{
-

-

-            Create a cohort
-

-
Create new cohorts on behalf of an employer.

-

-

-}
-
+
+
+

-

-

-

-                    Your cohorts
-

-
Review, edit, approve and add apprentices to new cohorts.

-

+        @if (Model.ShowCreateCohortLink)
+        {
+

+

+

+                        Create a cohort
+

+
Create new cohorts on behalf of an employer.

+

+

+

+

+                        Your cohorts
+

+
Review, edit, approve and add apprentices to new cohorts.

+

+

-

-

-                    Manage your apprentices
-

-

-                    View and update approved apprentice records.
-

-

+

+

+

+                        Manage your apprentices
+

+
View and update approved apprentice records.

+

+

+

+

+                        Organisations and agreements
+

+
Find and view organisations and their agreement IDs.

+

+

-

-

-

-

-                    Organisations and agreements
-

-
Find and view organisations and their agreement IDs.

-

+
+
+        } else {
+

+

+

+                        Your cohorts
+

+
Review, edit, approve and add apprentices to new cohorts.

+

+

+

+

+                        Manage your apprentices
+

+
View and update approved apprentice records.

+

+

-

+

+

+

+                        Organisations and agreements
+

+
Find and view organisations and their agreement IDs.

+

+

+

+        }

+
+
+
+
 @if (@Model.ShowAcademicYearBanner)
 {


Hopefully fixed the "Server cannot append header after HTTP headers have been sent" exception

--- src/Sentinel.OAuth/Providers/OAuth/SentinelAuthorizationServerProvider.cs
+++ src/Sentinel.OAuth/Providers/OAuth/SentinelAuthorizationServerProvider.cs
@@ -5,6 +5,7 @@
     using System.Text.RegularExpressions;
     using System.Threading.Tasks;

+    using Microsoft.Owin;
     using Microsoft.Owin.Security;
     using Microsoft.Owin.Security.OAuth;

@@ -267,14 +268,24 @@
             this.options.Logger.DebugFormat("Authenticating resource owner flow for user '{0}'", Regex.Escape(context.UserName));

             // Enable cors on authenticate requests, as they will always be from another server
-            if (context.OwinContext.Response.Headers["Access-Control-Allow-Origin"] == null)
-            {
-                context.OwinContext.Response.Headers.Add("Access-Control-Allow-Origin", new[] { "*" });
-            }
-            else
-            {
-                context.OwinContext.Response.Headers.Set("Access-Control-Allow-Origin", "*");
-            }
+            context.OwinContext.Response.OnSendingHeaders(
+                state =>
+                {
+                    var response = state as OwinResponse;
+
+                    if (response != null && !response.Headers.IsReadOnly)
+                    {
+                        if (response.Headers.ContainsKey("Access-Control-Allow-Origin"))
+                        {
+                            response.Headers.Set("Access-Control-Allow-Origin", "*");
+                        }
+                        else
+                        {
+                            response.Headers.Append("Access-Control-Allow-Origin", "*");
+                        }
+                    }
+                },
+                context.OwinContext.Response);

             var user = await this.options.UserManager.AuthenticateUserWithPasswordAsync(context.UserName, context.Password);


Avoid null reference exception by getting parameter by GetOrDefault method

--- src/biz.dfch.CS.Appclusive.Scheduler.Extensions/PowerShellScriptPlugin.cs
+++ src/biz.dfch.CS.Appclusive.Scheduler.Extensions/PowerShellScriptPlugin.cs
@@ -117,7 +117,7 @@
             Logger.WriteLine(message.ToString());
             message.Clear();

-            var scriptPathAndName = parameters[SCRIPT_NAME_KEY] as string;
+            var scriptPathAndName = parameters.GetOrDefault(SCRIPT_NAME_KEY, "") as string;
             parameters.Remove(SCRIPT_NAME_KEY);

             var scriptParameters = (Dictionary<string, object>) parameters;


Fixed +3040 startcode recognition for HKKAZ messages

Fixed +3040 startcode recognition for HKKAZ messages and refactored from
Goto to while-loop.

--- libfintx/Main.cs
+++ libfintx/Main.cs
@@ -23,6 +23,7 @@

 using System;
 using System.Collections.Generic;
+using System.Text.RegularExpressions;
 using System.Threading;
 using System.Windows.Forms;

@@ -139,26 +140,19 @@

                 MT940.Serialize(Transactions, Account);

-                Further:
-
-                if (BankCode.Contains("+3040::"))
-                {
-                    Helper.Parse_Message(BankCode);
-
-                    var Startpoint = Helper.Parse_String(BankCode, "vor:", "'");
-
-                    var BankCode_ = Transaction.HKKAZ(Account, BLZ, IBAN, BIC, URL, HBCIVersion, UserID, PIN, startDateStr, endDateStr, Startpoint);
+
+                string BankCode_ = BankCode;
+                while (BankCode_.Contains("+3040::"))
+                {
+                    Helper.Parse_Message(BankCode_);
+
+                    var Startpoint = new Regex(@"\+3040::[^:]+:(?<startpoint>[^']+)'").Match(BankCode_).Groups["startpoint"].Value;
+
+                    BankCode_ = Transaction.HKKAZ(Account, BLZ, IBAN, BIC, URL, HBCIVersion, UserID, PIN, startDateStr, endDateStr, Startpoint);

                     var Transactions_ = ":20:STARTUMS" + Helper.Parse_String(BankCode_, ":20:STARTUMS", "'HNSHA");

                     MT940.Serialize(Transactions_, Account);
-
-                    if (BankCode_.Contains("+3040::"))
-                    {
-                        BankCode = BankCode_;
-
-                        goto Further;
-                    }
                 }

                 return "OK";
@@ -320,9 +314,9 @@
         /// Bank return codes
         /// </returns>
         public static string Transfer_Terminated(int BLZ, string AccountHolder, string AccountHolderIBAN, string AccountHolderBIC, string Receiver, string ReceiverIBAN, string ReceiverBIC,
-			string Amount, string Purpose, string ExecutionDay, string URL, int HBCIVersion, string UserID,
+            string Amount, string Purpose, string ExecutionDay, string URL, int HBCIVersion, string UserID,
             string PIN, string HIRMS, PictureBox pictureBox, bool Anonymous)
-		{
+        {
             if (Transaction.INI(BLZ, URL, HBCIVersion, UserID, PIN, Anonymous) == true)
             {
                 TransactionConsole.Output = string.Empty;
@@ -839,14 +833,14 @@
         public static string Collect(int BLZ, string AccountHolder, string AccountHolderIBAN, string AccountHolderBIC, string Payer, string PayerIBAN, string PayerBIC,
             decimal Amount, string Purpose, string SettlementDate, string MandateNumber, string MandateDate, string CeditorIDNumber, string URL, int HBCIVersion, string UserID,
             string PIN, string HIRMS, PictureBox pictureBox, bool Anonymous)
-        {
+        {
             if (Transaction.INI(BLZ, URL, HBCIVersion, UserID, PIN, Anonymous) == true)
             {
-				TransactionConsole.Output = string.Empty;
-
-				if (!String.IsNullOrEmpty(HIRMS))
-					Segment.HIRMS = HIRMS;
-
+                TransactionConsole.Output = string.Empty;
+
+                if (!String.IsNullOrEmpty(HIRMS))
+                    Segment.HIRMS = HIRMS;
+
                 var BankCode = Transaction.HKDSE(BLZ, AccountHolder, AccountHolderIBAN, AccountHolderBIC, Payer, PayerIBAN, PayerBIC,
                     Convert.ToDecimal(Amount), Purpose, SettlementDate, MandateNumber, MandateDate, CeditorIDNumber, URL, HBCIVersion, UserID, PIN);

@@ -859,10 +853,10 @@
                     foreach (var item in values)
                     {
                         if (!item.StartsWith("HIRMS"))
-							TransactionConsole.Output = item.Replace("::", ": ");
-                    }
-
-					var HITAN = "HITAN" + Helper.Parse_String(BankCode.Replace("?'", "").Replace("?:", ":").Replace("
", Environment.NewLine).Replace("?+", "??"), "'HITAN", "'");
+                            TransactionConsole.Output = item.Replace("::", ": ");
+                    }
+
+                    var HITAN = "HITAN" + Helper.Parse_String(BankCode.Replace("?'", "").Replace("?:", ":").Replace("
", Environment.NewLine).Replace("?+", "??"), "'HITAN", "'");

                     string HITANFlicker = string.Empty;

@@ -1389,7 +1383,7 @@
         /// Bank return codes
         /// </returns>
         public static string TAN(string TAN, string URL, int HBCIVersion, int BLZ, string UserID, string PIN)
-        {
+        {
             var BankCode = Transaction.TAN(TAN, URL, HBCIVersion, BLZ, UserID, PIN);

             if (BankCode.Contains("+0020::"))
@@ -1490,34 +1484,34 @@
         /// TAN mechanism
         /// </returns>
         public static string TAN_Scheme()
-		{
-			return Segment.HIRMSf;
-		}
-
-		///
+        {
+            return Segment.HIRMSf;
+        }
+
+        ///
         /// Set assembly informations
         ///
         /// <param name="Buildname"></param>
         /// <param name="Version"></param>
         public static void Assembly(string Buildname, string Version)
-		{
-			Program.Buildname = Buildname;
-			Program.Version = Version;
+        {
+            Program.Buildname = Buildname;
+            Program.Version = Version;

             Log.Write(Buildname);
             Log.Write(Version);
         }

-		///
+        ///
         /// Get assembly buildname
         ///
         /// <returns>
         /// Buildname
         /// </returns>
         public static string Buildname()
-		{
-			return Program.Buildname;
-		}
+        {
+            return Program.Buildname;
+        }

         ///
         /// Get assembly version
@@ -1526,9 +1520,9 @@
         /// Version
         /// </returns>
         public static string Version()
-		{
-			return Program.Version;
-		}
+        {
+            return Program.Version;
+        }

         ///
         /// Transactions output console
@@ -1537,9 +1531,9 @@
         /// Bank return codes
         /// </returns>
         public static string Transaction_Output()
-		{
-			return TransactionConsole.Output;
-		}
+        {
+            return TransactionConsole.Output;
+        }

         ///
         /// Enable / Disable Tracing


Removed the checked for transaction scope since this results in concurrent session scopes which has negative side-affects.  In particular it locks up SQL Lite.

git-svn-id: bab0c2de90ee11a20376049c2cdee62584491f34@5494 73e77b4c-caa6-f847-a29a-24ab75ae54b6

--- ActiveRecord/Castle.ActiveRecord/Framework/Validators/IsUniqueValidator.cs
+++ ActiveRecord/Castle.ActiveRecord/Framework/Validators/IsUniqueValidator.cs
@@ -73,8 +73,8 @@

 			SessionScope scope = null;
 			FlushMode? originalMode = null;
-			if (SessionScope.Current == null ||
-				SessionScope.Current.ScopeType != SessionScopeType.Transactional)
+			if (SessionScope.Current == null /*||
+				SessionScope.Current.ScopeType != SessionScopeType.Transactional*/)
 			{
 				scope = new SessionScope();
 			}


Improve spin when lightly tapping keys

Improve spin when lightly tapping keys

--- Assets/Resources/Microgames/_Bosses/PaperThief/Scripts/PaperThiefNitori.cs
+++ Assets/Resources/Microgames/_Bosses/PaperThief/Scripts/PaperThiefNitori.cs
@@ -256,7 +256,10 @@
             }
         }

-        int actualDirection = (int)Mathf.Sign(_rigidBody2D.velocity.x);
+        int actualDirection = _rigidBody2D.velocity.x == 0 ? 0 : (int)Mathf.Sign(_rigidBody2D.velocity.x);
+        if (actualDirection == 0 && direction != 0)
+            actualDirection = direction;
+
         updateSpinner((direction == 0 || (direction != 0 && actualDirection != direction)) ? 0 : actualDirection);

         updateWalkSpeed(direction, grounded);


Fix a bug in inventory that was putting incorrect values into the database.

--- Aurora/Services/DataService/Connectors/Database/LocalInventoryConnector.cs
+++ Aurora/Services/DataService/Connectors/Database/LocalInventoryConnector.cs
@@ -127,7 +127,7 @@
                 "flags","inventoryID","avatarID","parentFolderID","inventoryGroupPermissions"}, new object[20]{
                     item.AssetID, item.AssetType, item.Name, item.Description, item.NextPermissions, item.CurrentPermissions,
                     item.InvType, item.CreatorId, item.BasePermissions, item.EveryOnePermissions, item.SalePrice, item.SaleType,
-                    item.CreationDate, item.GroupID, item.GroupOwned, item.Flags, item.ID, item.Owner,
+                    item.CreationDate, item.GroupID, item.GroupOwned ? "1" : "0", item.Flags, item.ID, item.Owner,
                     item.Folder, item.GroupPermissions});
         }


Fixed collision partitioning with PreventDoubleChecksPerFrame


Amend.

Amend.

--- Gu.Wpf.UiAutomation/AutomationElements/Infrastructure/AutomationElement.cs
+++ Gu.Wpf.UiAutomation/AutomationElements/Infrastructure/AutomationElement.cs
@@ -158,7 +158,7 @@
             {
                 if (parent.ControlType == ControlType.Window)
                 {
-                    window = parent.AsWindow(parent.Parent == null);
+                    window = parent.AsWindow(parent.Parent?.Name == "Desktop");
                     return true;
                 }


add back in baby_step_z_offset to black list

issue: MatterHackers/MCCentral#5477
Imported new printer baby step z offset not cleared

--- MatterControlLib/SlicerConfiguration/Settings/PrinterSettingsExtensions.cs
+++ MatterControlLib/SlicerConfiguration/Settings/PrinterSettingsExtensions.cs
@@ -42,6 +42,7 @@
 			[SettingsKey.print_leveling_data] = "",
 			[SettingsKey.print_leveling_enabled] = "0",
 			[SettingsKey.probe_has_been_calibrated] = "0",
+			[SettingsKey.baby_step_z_offset] = "0",
 			[SettingsKey.xy_offsets_have_been_calibrated] = "0",
 			[SettingsKey.filament_has_been_loaded] = "0",
 			[SettingsKey.filament_1_has_been_loaded] = "0"


documentation tweak

documentation tweak

--- OBeautifulCode.AutoFakeItEasy/Generators/RandomNumericSequenceGenerator.cs
+++ OBeautifulCode.AutoFakeItEasy/Generators/RandomNumericSequenceGenerator.cs
@@ -18,7 +18,7 @@
     using Ploeh.AutoFixture.Kernel;

     /// <summary>
-    /// Creates a sequence of random, unique, numbers.
+    /// Creates a sequence of random, unique numbers.
     /// </summary>
     public class RandomNumericSequenceGenerator : ISpecimenBuilder
     {
@@ -40,7 +40,7 @@
         }

         /// <summary>
-        /// Creates an anonymous number.
+        /// Creates a random number.
         /// </summary>
         /// <param name="request">The request that describes what to create.</param>
         /// <param name="context">A context that can be used to create other specimens.</param>


Add note deprecating MarshalByRefObject use in new code

--- examples/TestExport.cs
+++ examples/TestExport.cs
@@ -7,6 +7,8 @@
 using NDesk.DBus;
 using org.freedesktop.DBus;

+//NOTE: MarshalByRefObject use is not recommended in new code
+//See TestExportInterface.cs for a more current example
 public class ManagedDBusTestExport
 {
 	public static void Main ()


bugfix dde count methods that do not return a  number

--- CmcLibNet.Database/CommenceDatabase.Metadata.cs
+++ CmcLibNet.Database/CommenceDatabase.Metadata.cs
@@ -1228,7 +1228,7 @@
         private int GetDDECount(string[] args)
         {
             string result = DDERequest(BuildDDERequestCommand(args));
-            return (result == null) ? -1 : Convert.ToInt32(result);
+            return (int.TryParse(result, out int outval)) ? outval: -1;
         }

         /// <inheritdoc />


Fix the tests

Fix the tests

--- Espera/Espera.Core.Tests/AnalyticsClientTest.cs
+++ Espera/Espera.Core.Tests/AnalyticsClientTest.cs
@@ -14,7 +14,7 @@
             [Fact]
             public async Task Authenticates()
             {
-                var coreSettings = new CoreSettings { EnableAutomaticReports = true, AnalyticsToken = "cooltoken" };
+                var coreSettings = new CoreSettings { EnableAutomaticReports = true, AnalyticsToken = "cooltoken", BuddyAnalyticsUpgraded = true };

                 var endpoint = Substitute.For<IAnalyticsEndpoint>();
                 var client = new AnalyticsClient(endpoint);
@@ -52,7 +52,7 @@
             [Fact]
             public async Task DoesntCreateUserIfAnalyticsTokenIsSaved()
             {
-                var coreSettings = new CoreSettings { EnableAutomaticReports = true, AnalyticsToken = "cooltoken" };
+                var coreSettings = new CoreSettings { EnableAutomaticReports = true, AnalyticsToken = "cooltoken", BuddyAnalyticsUpgraded = true };

                 var endpoint = Substitute.For<IAnalyticsEndpoint>();
                 var client = new AnalyticsClient(endpoint);
@@ -73,6 +73,19 @@
                 await client.InitializeAsync(coreSettings);

                 endpoint.Received().RecordDeviceInformationAsync();
+            }
+
+            [Fact]
+            public async Task RecreatesAnalyticsTokenIfNecessacry()
+            {
+                var coreSettings = new CoreSettings { EnableAutomaticReports = true, AnalyticsToken = "cooltoken", BuddyAnalyticsUpgraded = false };
+
+                var endpoint = Substitute.For<IAnalyticsEndpoint>();
+                var client = new AnalyticsClient(endpoint);
+
+                await client.InitializeAsync(coreSettings);
+
+                Assert.NotEqual("cooltoken", coreSettings.AnalyticsToken);
             }

             [Fact]
@@ -104,7 +117,7 @@
                 await client.RecordBugReportAsync("blabla");

                 Assert.True(client.IsAuthenticated);
-                endpoint.Received().RecordErrorAsync(new Exception("blabla"), Arg.Any<string>());
+                endpoint.Received().RecordErrorAsync(Arg.Is<Exception>(x => x.Message == "blabla"), null);
             }

             [Fact]


Fixed PM97 - Having several bolded words in a single sentence bolds everything from the first word to the last word.

--- ProjectMarkdown.MarkdownLibrary/ExtensionMethods/StringExtensionMethods.cs
+++ ProjectMarkdown.MarkdownLibrary/ExtensionMethods/StringExtensionMethods.cs
@@ -38,21 +38,24 @@
                 {
                     if (i != 0 && i != tagSplit.Length - 1)
                     {
-                        if (tag == MarkdownParser.PairedMarkdownTags.Bold)
+                        if (tagSplit[i][0] != ' ' && tagSplit[i][tagSplit[i].Length - 1] != ' ')
                         {
-                            tagSplit[i] = new Bold(tagSplit[i]).ToString();
-                        }
-                        else if (tag == MarkdownParser.PairedMarkdownTags.Italic)
-                        {
-                            tagSplit[i] = new Italic(tagSplit[i]).ToString();
-                        }
-                        else if (tag == MarkdownParser.PairedMarkdownTags.InlineCode)
-                        {
-                            tagSplit[i] = new InlineCode(tagSplit[i]).ToString();
-                        }
-                        else if (tag == MarkdownParser.PairedMarkdownTags.StrikeThrough)
-                        {
-                            tagSplit[i] = new StrikeThrough(tagSplit[i]).ToString();
+                            if (tag == MarkdownParser.PairedMarkdownTags.Bold)
+                            {
+                                tagSplit[i] = new Bold(tagSplit[i]).ToString();
+                            }
+                            else if (tag == MarkdownParser.PairedMarkdownTags.Italic)
+                            {
+                                tagSplit[i] = new Italic(tagSplit[i]).ToString();
+                            }
+                            else if (tag == MarkdownParser.PairedMarkdownTags.InlineCode)
+                            {
+                                tagSplit[i] = new InlineCode(tagSplit[i]).ToString();
+                            }
+                            else if (tag == MarkdownParser.PairedMarkdownTags.StrikeThrough)
+                            {
+                                tagSplit[i] = new StrikeThrough(tagSplit[i]).ToString();
+                            }
                         }
                     }
                     output += tagSplit[i];


Added basic footer text

Added basic footer text

--- res/assets/templates/footer.cs
+++ res/assets/templates/footer.cs
@@ -1,3 +1,3 @@

-
+Generated with Doclava.


Fixed Egl.IsRequired unit test.

Fixed Egl.IsRequired unit test.

--- OpenGL.Net.Test/Egl.cs
+++ OpenGL.Net.Test/Egl.cs
@@ -60,10 +60,16 @@
 		[Test]
 		public void Egl_IsRequired()
 		{
+			if (Egl.IsAvailable == false)
+				Assert.Inconclusive("EGL not available");
+
+			Egl.IsRequired = false;
+			if (Egl.IsRequired)
+				Assert.Inconclusive("EGL is mandatory");
 			Assert.IsFalse(Egl.IsRequired);

 			Egl.IsRequired = true;
-			Assert.AreEqual(Egl.IsAvailable, Egl.IsRequired);
+			Assert.IsTrue(Egl.IsRequired);

 			Egl.IsRequired = false;
 			Assert.IsFalse(Egl.IsRequired);


+ Zooming will now not change window center

--- SmaSTraDesigner/code/local/SmaSTraDesigner/Controls/UcTreeDesigner.xaml.cs
+++ SmaSTraDesigner/code/local/SmaSTraDesigner/Controls/UcTreeDesigner.xaml.cs
@@ -896,22 +896,22 @@
                 {
                     scaletransform = new ScaleTransform(1, 1);
                     cnvBackground.RenderTransform = scaletransform;
+                    scaletransform.CenterX = cnvBackground.Width / 2;
+                    scaletransform.CenterY = cnvBackground.Height / 2;
                 }

                 if (e.Delta > 0)
                 {
                     scaletransform.ScaleX *= scaleRate;
                     scaletransform.ScaleY *= scaleRate;
-                    scvCanvas.ScrollToVerticalOffset(scvCanvas.VerticalOffset * scaleRate);
-                    scvCanvas.ScrollToHorizontalOffset(scvCanvas.HorizontalOffset * scaleRate);
                 }
                 else
                 {
                     scaletransform.ScaleX /= scaleRate;
                     scaletransform.ScaleY /= scaleRate;
-                    scvCanvas.ScrollToVerticalOffset(scvCanvas.VerticalOffset / scaleRate);
-                    scvCanvas.ScrollToHorizontalOffset(scvCanvas.HorizontalOffset / scaleRate);
                 }
+
+                e.Handled = true;
             }
         }


Fix build error.

Fix build error.

--- Source/PropertyTools.Wpf/DataGrid/ControlFactory/DataGridControlFactory.cs
+++ Source/PropertyTools.Wpf/DataGrid/ControlFactory/DataGridControlFactory.cs
@@ -9,12 +9,15 @@

 namespace PropertyTools.Wpf
 {
+    using System.Linq;
     using System.Windows;
     using System.Windows.Controls;
     using System.Windows.Controls.Primitives;
     using System.Windows.Data;
     using System.Windows.Media;
     using System.Windows.Shapes;
+
+    using PropertyTools.DataAnnotations;

     /// <summary>
     /// Creates display and edit controls for the DataGrid.


Fixed custom Grafana binding validation for openHistorian (needed save).

--- Source/Tools/ConfigurationSetupUtility/Screens/SetupCompleteScreen.xaml.cs
+++ Source/Tools/ConfigurationSetupUtility/Screens/SetupCompleteScreen.xaml.cs
@@ -423,6 +423,8 @@
                     categorizedSettings.AppendChild(grafanaBindings);
                 }
             }
+
+            configFile.Save(configFileName);
         }

         private void ValidateAssemblyBindings()


added a check for negative option price

added a check for negative option price

--- ACQ.Quant/Options/BjerksundStensland.cs
+++ ACQ.Quant/Options/BjerksundStensland.cs
@@ -46,21 +46,32 @@
         public static double Price(double spot, double strike, double time, double rate, double dividend, double sigma, bool isCall)
         {
             double price;
+
             if (isCall)
-                price = PriceCall(spot, strike, time, rate, dividend, sigma);
+                price = PriceCall(spot, strike, time, rate, rate - dividend, sigma);
             else
-                price = PriceCall(strike,spot, time, rate- dividend, -dividend, sigma);
+                price = PriceCall(strike, spot, time, dividend, dividend - rate, sigma);
             return price;
         }
+

-
-        private static double PriceCall(double spot, double strike, double time, double rate, double dividend, double sigma)
+        /// <summary>
+        /// Note that formula takes cost of carry b = (r - q), instead of dividend
+        /// </summary>
+        /// <param name="spot"></param>
+        /// <param name="strike"></param>
+        /// <param name="time"></param>
+        /// <param name="rate"></param>
+        /// <param name="carry_cost">r - dividend</param>
+        /// <param name="sigma"></param>
+        /// <returns></returns>
+        private static double PriceCall(double spot, double strike, double time, double rate, double carry_cost, double sigma)
         {
             double K = strike;
             double S = spot;
             double t = time;
             double r = rate;
-            double b = dividend;
+            double b = carry_cost;
             double v = sigma;
             double v2 = v * v;

@@ -87,8 +98,8 @@
                 I1 = B0 + (BInfinity - B0) * (1 - Exp(ht1));
                 I2 = B0 + (BInfinity - B0) * (1 - Exp(ht2));
                 alfa1 = (I1 - K) * Pow(I1, -Beta);
-                alfa2 = (I2 - K) * Pow(I2, -Beta);
-
+                alfa2 = (I2 - K) * Pow(I2, -Beta); //I2 can become negative
+
                 if (S >= I2)
                     price = S - K;
                 else
@@ -108,7 +119,7 @@
                 }
             }

-            return price;
+            return price < 0 ? Double.NaN : price ;
         }

         private static double phi(double S, double t, double gamma, double h, double i, double r, double b, double v)


Updated CSU to add COMTRADE and Modbus protocols to database if they do not exist.

--- Source/Tools/ConfigurationSetupUtility/Screens/SetupCompleteScreen.xaml.cs
+++ Source/Tools/ConfigurationSetupUtility/Screens/SetupCompleteScreen.xaml.cs
@@ -219,6 +219,9 @@

                         // Always make sure new configuration entity records are defined in the database.
                         ValidateConfigurationEntity();
+
+                        // Always make sure openHistorian specific protocols exist
+                        ValidateProtocols();

                         // Always make sure that node settings defines the alarm service URL.
                         ValidateNodeSettings();
@@ -554,7 +557,7 @@
             const string insertNodeInfoQuery = "INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeInfo', 'NodeInfo', 'Defines information about the nodes in the database', 18, 1)";

             const string countCompressionSettingsQuery = "SELECT COUNT(*) FROM ConfigurationEntity WHERE RuntimeName = 'CompressionSettings'";
-            const string insertCompressionSettingsQuery = "INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1);";
+            const string insertCompressionSettingsQuery = "INSERT INTO ConfigurationEntity(SourceName, RuntimeName, Description, LoadOrder, Enabled) VALUES('NodeCompressionSetting', 'CompressionSettings', 'Defines information about measurement compression settings', 19, 1)";

             IDbConnection connection = null;
             int configurationEntityCount;
@@ -572,6 +575,38 @@

                 if (configurationEntityCount == 0)
                     connection.ExecuteNonQuery(insertCompressionSettingsQuery);
+            }
+            finally
+            {
+                if ((object)connection != null)
+                    connection.Dispose();
+            }
+        }
+
+        private void ValidateProtocols()
+        {
+            const string countModbusQuery = "SELECT COUNT(*) FROM Protocol WHERE Acronym = 'Modbus'";
+            const string insertModbusQuery = "INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('Modbus', 'Modbus Poller', 'Measurement', 'Device', 'ModbusAdapters.dll', 'ModbusAdapters.ModbusPoller', 13)";
+
+            const string countComtradeQuery = "SELECT COUNT(*) FROM Protocol WHERE Acronym = 'COMTRADE'";
+            const string insertComtradeQuery = "INSERT INTO Protocol(Acronym, Name, Type, Category, AssemblyName, TypeName, LoadOrder) VALUES('COMTRADE', 'COMTRADE Import', 'Measurement', 'Imported', 'TestingAdapters.dll', 'TestingAdapters.VirtualInputAdapter', 14)";
+
+            IDbConnection connection = null;
+            int configurationEntityCount;
+
+            try
+            {
+                connection = OpenNewConnection();
+
+                configurationEntityCount = Convert.ToInt32(connection.ExecuteScalar(countModbusQuery));
+
+                if (configurationEntityCount == 0)
+                    connection.ExecuteNonQuery(insertModbusQuery);
+
+                configurationEntityCount = Convert.ToInt32(connection.ExecuteScalar(countComtradeQuery));
+
+                if (configurationEntityCount == 0)
+                    connection.ExecuteNonQuery(insertComtradeQuery);
             }
             finally
             {


Improvements

Improvements

--- Source/Web/Charity.Web/Areas/Donors/Controllers/FoodDonationsController.cs
+++ Source/Web/Charity.Web/Areas/Donors/Controllers/FoodDonationsController.cs
@@ -274,39 +274,5 @@

             return new SelectList(foodCategories, "Value", "Text");
         }
-
-        private string UploadImage(HttpPostedFileBase image)
-        {
-            string imageUrl = string.Empty;
-            List<string> validImageTypes = new List<string>()
-            {
-                "image/gif",
-                "image/jpeg",
-                "image/pjpeg",
-                "image/png"
-            };
-
-            if (image == null || image.ContentLength == 0)
-            {
-                ModelState.AddModelError("", "This field is required");
-            }
-            else if (!validImageTypes.Contains(image.ContentType))
-            {
-                ModelState.AddModelError("", "Please choose either a GIF, JPG or PNG image.");
-            }
-
-            if (ModelState.IsValid)
-            {
-                if (image != null && image.ContentLength > 0)
-                {
-                    var uploadDir = "~/Content/Images/Donations_Food";
-                    var imagePath = Path.Combine(Server.MapPath(uploadDir), image.FileName);
-                    imageUrl = Path.Combine(uploadDir, image.FileName);
-                    image.SaveAs(imagePath);
-                }
-            }
-
-            return imageUrl;
-        }
     }
-}
+}


Try Branche Dev

Try Branche Dev

--- myFirstProgramCSharp/myFirstProgramCSharp/Program.cs
+++ myFirstProgramCSharp/myFirstProgramCSharp/Program.cs
@@ -12,7 +12,8 @@
         {
             Console.ForegroundColor = ConsoleColor.Blue;
             Console.BackgroundColor = ConsoleColor.Yellow;
-            Console.WriteLine("Hello World !");
+            string name = Console.ReadLine();
+            Console.WriteLine("Hello World !" + name);
             Console.Read();
         }
     }


PR 56: Merge pbi/4893-RegexAreaPath to master +semver:minor

 - Added ability to use the area path prefix (mich easyer than regex) and fixed
 - Fixed Bug +semver:patch

Related work items: #4905, #4893

--- TfsWitMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs
+++ TfsWitMigrator.Core/Execution/MigrationContext/WorkItemMigrationContext.cs
@@ -205,8 +205,8 @@
             } else
             {
                 var regex = new Regex(Regex.Escape(oldWi.Project.Name));
-                newwit.AreaPath = regex.Replace(oldWi.AreaPath, "newwit.Project.Name", 1);
-                newwit.IterationPath = regex.Replace(oldWi.IterationPath, "newwit.Project.Name", 1);
+                newwit.AreaPath = regex.Replace(oldWi.AreaPath, newwit.Project.Name, 1);
+                newwit.IterationPath = regex.Replace(oldWi.IterationPath, newwit.Project.Name, 1);
             }

             newwit.Fields["System.ChangedDate"].Value = oldWi.Fields["System.ChangedDate"].Value;


Forgotten changes (#6935)

Forgotten changes (#6935)


Removed unused using.

Removed unused using.

--- Gu.Localization.Tests/Internals/CultureTests.cs
+++ Gu.Localization.Tests/Internals/CultureTests.cs
@@ -1,6 +1,5 @@
 namespace Gu.Localization.Tests.Internals
 {
-    using System;
     using System.Collections.Generic;
     using System.Globalization;
     using NUnit.Framework;


Amend.

Amend.

--- Gu.State.Tests/DiffTests/ReferenceLoopsTests.cs
+++ Gu.State.Tests/DiffTests/ReferenceLoopsTests.cs
@@ -1,6 +1,7 @@
 namespace Gu.State.Tests.DiffTests
 {
     using System;
+    using System.Linq;

     using NUnit.Framework;

@@ -27,7 +28,7 @@
             var result = this.DiffMethod(x, y, ReferenceHandling.StructuralWithReferenceLoops);
             var actual = result.ToString("", " ");
             Assert.AreEqual(expected, actual);
-            //Assert.AreSame(result, result.Diffs.Single(d => d.X == x.Child).Diffs.Last(d => d.X == x));
+            Assert.AreSame(result, result.Diffs.Single(d => d.X == x.Child).Diffs.Last(d => d.X == x));
         }

         [TestCase("p", "c", "Empty")]


calling scroll to caret function in text box adapter also

--- Acrolinx.Demo.Sidebar/TextBoxAdapter.cs
+++ Acrolinx.Demo.Sidebar/TextBoxAdapter.cs
@@ -36,6 +36,7 @@
         protected override void SelectRawRange(IRange range, Format format)
         {
             TextBox.Select(range.Start, range.Length);
+            TextBox.ScrollToCaret();
             TextBox.Focus();
         }


Use a NamedEnum rather than POL.RegionText().

--- POLUtils/POLUtilsUI.cs
+++ POLUtils/POLUtilsUI.cs
@@ -50,7 +50,7 @@
     }

     private void UpdateSelectedRegion() {
-      this.txtSelectedRegion.Text      = POL.RegionText(POL.SelectedRegion);
+      this.txtSelectedRegion.Text      = new NamedEnum(POL.SelectedRegion).Name;
       this.btnChooseRegion.Enabled     = POL.MultipleRegionsAvailable;
       this.btnFFXIConfigEditor.Enabled = POL.IsAppInstalled(AppID.FFXI);
       this.btnFFXIDataBrowser.Enabled  = POL.IsAppInstalled(AppID.FFXI);


Fix line endings in Processor.cs

Fix line endings in Processor.cs

--- Zelig/Zelig/RunTime/DeviceModels/ModelForPXA27x/HardwareModel/Processor.cs
+++ Zelig/Zelig/RunTime/DeviceModels/ModelForPXA27x/HardwareModel/Processor.cs
@@ -43,7 +43,7 @@
                     return 0;
                 }
             }
-
+
             public static uint DefaultThreadPoolThreads
             {
                 [RT.ConfigurationOption( "System__Runtime_DefaultThreadPoolThreads" )]
@@ -51,8 +51,8 @@
                 {
                     return Int32.MaxValue;
                 }
-            }
-
+            }
+
             public static uint DefaultTimerPoolThreads
             {
                 [RT.ConfigurationOption( "System__Runtime_DefaultTimerPooThreads" )]


Improve the smooth scrolling by stopping in a nearly constant amount of

2009-01-25  Gabriel Burt  <gabriel.burt@gmail.com>

	* src/Libraries/Hyena.Gui/Hyena.Widgets/SmoothScrolledWindow.cs: Improve
	the smooth scrolling by stopping in a nearly constant amount of
	time, and avoiding several small (1px) movements at the end of slowing
	down by making the minimum velocity 2px per cycle

svn path=/trunk/banshee/; revision=4960

--- Hyena.Gui/Hyena.Widgets/SmoothScrolledWindow.cs
+++ Hyena.Gui/Hyena.Widgets/SmoothScrolledWindow.cs
@@ -54,7 +54,7 @@

         protected virtual double DecelerateCore (double velocity)
         {
-            return velocity - 3;
+            return velocity - Math.Max (3, 0.2 * velocity);
         }

         private double TargetValue {
@@ -71,6 +71,7 @@
             }
         }

+        // Smoothly get us to the target value
         private bool OnTimeout ()
         {
             double delta = target_value - value;
@@ -91,9 +92,9 @@
             }

             velocity = hypothetical <= 0 ? Decelerate (velocity) : Accelerate (velocity);
-
-            // Speed limit: 1 px / 20 ms = 50px / second
-            value = Math.Round (value + Math.Max (velocity, 1) * sign);
+
+            // Minimum speed: 2 px / 20 ms = 100px / second
+            value = Math.Round (value + Math.Max (velocity, 2) * sign);

             // Don't go past the target value
             value = (sign == 1) ? Math.Min (value, target_value) : Math.Max (value, target_value);


UFT-3 on click on texture, it will move to the last index in List which keep all textures on canvas.

--- Assets/Assets/Editor/FreeAtlasEditor.cs
+++ Assets/Assets/Editor/FreeAtlasEditor.cs
@@ -108,13 +108,15 @@
 		if (Event.current.type == EventType.MouseUp){
 			textureState=TextureState.passive;
 			isDragging = false;
-			if (FreeAtlasEditor.stopDragging!=null)
-				FreeAtlasEditor.stopDragging();
+			if (FreeAtlasEditor.onStopDragging!=null)
+				FreeAtlasEditor.onStopDragging();
 		} else if (Event.current.type == EventType.MouseDown && canvasRect.Contains (Event.current.mousePosition)){
 			textureState=TextureState.onDrag;
 			isDragging = true;
 			textureState=TextureState.onDrag;
-			mouseStartPosition=Event.current.mousePosition;
+			mouseStartPosition=Event.current.mousePosition;
+			if (FreeAtlasEditor.onTextureOnCanvasClick!=null)
+				FreeAtlasEditor.onTextureOnCanvasClick(this);
 			Event.current.Use();
 		}
 		Color color=GUI.color;
@@ -146,8 +148,8 @@
 				mouseStartPosition=Event.current.mousePosition;

 			}
-			if (FreeAtlasEditor.dragInProgress!=null)
-				FreeAtlasEditor.dragInProgress();
+			if (FreeAtlasEditor.onDragInProgress!=null)
+				FreeAtlasEditor.onDragInProgress();

 			//if dragging lets color it to drag color border

@@ -199,6 +201,8 @@
 public delegate void DragInProgress();
 public delegate void StopDragging();
 public delegate void AtlasSizeChanged(int width, int height);
+public delegate void TextureOnCanvasClick(TextureOnCanvas textureOnCanvas);
+

 public class FreeAtlasEditor : EditorWindow {
 	[SerializeField]
@@ -222,11 +226,13 @@

 	public Vector2 scrollPosition = Vector2.zero;

-	public static DragInProgress dragInProgress;
-	public static StopDragging stopDragging;
+	public static DragInProgress onDragInProgress;
+	public static StopDragging onStopDragging;
 	public static AtlasSizeChanged onAtlasSizeChanged;
-
-
+	public static TextureOnCanvasClick onTextureOnCanvasClick;
+
+	private TextureOnCanvas clickedTextureOnCanvas;
+	private bool recreateTexturesPositions=false;

 	[MenuItem ("Window/Free Atlas Maker")]
@@ -250,25 +256,45 @@

 		recreateAtlasBG ();
 		texturesOnCanvas=new List<TextureOnCanvas>();
-		dragInProgress+=onDragInProgress;
-		stopDragging+=onStopDragging;
-
-	}
-
-
-	private void onDragInProgress(){
+
+		//init listeners
+		onDragInProgress+=onDragInProgressListener;
+		onStopDragging+=onStopDraggingListener;
+		onTextureOnCanvasClick+=onTextureOnCanvasClickListener;
+	}
+
+
+	private void onDragInProgressListener(){
 		Repaint();
 	}

-	private void onStopDragging(){
+	private void onStopDraggingListener(){
 		Repaint();
 	}
+
+	// we cant move this element to the last position in the list, because in paralel iterator can use list
+	// because of that we will just store this value, and in nex frame in OnGUI function
+	// we will move this object to the last position
+	private void onTextureOnCanvasClickListener (TextureOnCanvas textureOnCanvas)
+	{
+		clickedTextureOnCanvas=textureOnCanvas;
+		recreateTexturesPositions=true;
+	}
+
 	void Update(){
 		Repaint();
 	}

 	void OnGUI () {
+
+		//check if in previous frame we clicked on texture, if we did, move this texture to the last index in collection
+		if (recreateTexturesPositions){
+			texturesOnCanvas.Remove(clickedTextureOnCanvas);
+			texturesOnCanvas.Add(clickedTextureOnCanvas);
+			recreateTexturesPositions=false;
+		}
+

 		EditorGUILayout.BeginVertical();
 			EditorGUILayout.BeginHorizontal (GUILayout.MinHeight(100f));
@@ -408,8 +434,8 @@
 		    Object.DestroyImmediate((Object) texture);
 		    AssetDatabase.ImportAsset(assetPath);
 		    TextureImporter textureImporter = AssetImporter.GetAtPath(assetPath) as TextureImporter;
-		    textureImporter.textureFormat=TextureImporterFormat.ARGB32;//   set_textureFormat((TextureImporterFormat) -3);
-		    textureImporter.textureType=TextureImporterType.Advanced;// set_textureType((TextureImporterType) 2);
+		    textureImporter.textureFormat=TextureImporterFormat.ARGB32;
+		    textureImporter.textureType=TextureImporterType.Advanced;
 			textureImporter.mipmapEnabled=false;
 			textureImporter.wrapMode=TextureWrapMode.Clamp;
 			textureImporter.filterMode=FilterMode.Point;
@@ -440,8 +466,8 @@
 		      File.WriteAllBytes(assetPath, bytes);
 			 AssetDatabase.ImportAsset(assetPath);
 		    TextureImporter textureImporter = AssetImporter.GetAtPath(assetPath) as TextureImporter;
-		     textureImporter.textureFormat=TextureImporterFormat.ARGB32;//   set_textureFormat((TextureImporterFormat) -3);
-		    textureImporter.textureType=TextureImporterType.Advanced;// set_textureType((TextureImporterType) 2);
+		     textureImporter.textureFormat=TextureImporterFormat.ARGB32;
+		    textureImporter.textureType=TextureImporterType.Advanced;
 			textureImporter.mipmapEnabled=false;
 			textureImporter.wrapMode=TextureWrapMode.Repeat;
 			textureImporter.filterMode=FilterMode.Point;


[Bugfix] to get rid of wrong Entering and Exiting Markers

--- Assets/Paradigms/SearchAndFind/Trial.cs
+++ Assets/Paradigms/SearchAndFind/Trial.cs
@@ -488,7 +488,7 @@
         }

         #endregion
-
+
         /// <summary>
         /// This is the method of interest. It implements the behaviour whenever the subject moves from unit to unit.
         /// </summary>
@@ -499,7 +499,7 @@
             {
                 lastUnit = currentUnit;
                 currentUnit = evt.MazeUnit;
-
+
                 if (lastUnit != null)
                     paradigm.marker.Write(MarkerPattern.FormatMazeUnitEvent(lastUnit, MazeUnitEventType.Exiting));

@@ -600,6 +600,11 @@
             if (conditionConfig.useTeleportation)
             {
                 paradigm.hud.ShowInstruction("Geschafft! Entspann dich, du wirst zum Endpunkt teleportiert.", "Sehr gut!");
+
+                // important here... to get rid of the last MazeUnitEvent when the subject gets teleported!
+                // It's to late - so do it here!
+                mazeInstance.MazeUnitEventOccured -= SubjectMovesWithinTheMaze;
+                paradigm.marker.Write(MarkerPattern.FormatMazeUnitEvent(currentUnit, MazeUnitEventType.Exiting));

                 StartCoroutine(BeginTeleportation());

@@ -678,6 +683,9 @@

             paradigm.fogControl.DisappeareImmediately();

+            currentUnit = null;
+            lastUnit = null;
+
             currentPathElement = null;

             if (path != null && path.Inverse)


issue #205 fixed

issue #205 fixed

--- Assets/Scripts/Misc/ResolutionScript.cs
+++ Assets/Scripts/Misc/ResolutionScript.cs
@@ -5,9 +5,9 @@

 	// Use this for initialization
 	void Start () {
-		Screen.SetResolution(1280, 720, true);
+		Screen.SetResolution(1280, 720, false);
 	}
-
+
 	// Update is called once per frame
 	void Update () {


ignore warning for Animation in Pedestrian

the warning was: „CS0108: `Pedestrian.animation' hides inherited member
`UnityEngine.Component.animation'. Use the new keyword if hiding was
intended“

--- Assets/Scripts/Pedestrian/Pedestrian.cs
+++ Assets/Scripts/Pedestrian/Pedestrian.cs
@@ -28,9 +28,10 @@
 	//GameObject tile;

 	private AgentView agentView = null;
+	#pragma warning disable 108
 	private Animation animation;
+	#pragma warning restore 108
 	private LODGroup lodGroup;
-
 	private int index;
 	private bool targetReached = true;


Add buffer to Stage Controller start in editor to prevent premature scene activation

--- Assets/Scripts/Stage/StageController.cs
+++ Assets/Scripts/Stage/StageController.cs
@@ -14,12 +14,15 @@
 	[Range(1, MAX_SPEED)]
 	public int speed;
 	public bool godMode, muteMusic;
+    public float editorStartDelay = .2f;

 	public int maxStockpiledScenes;
     public ThreadPriority sceneLoadPriority;

 	private int microgameCount, life;
 	private bool microgameVictoryStatus, victoryDetermined;
+    private bool sceneStarted;
+    private float sceneStartTime;

 	public AnimationPart animationPart = AnimationPart.Intro;

@@ -68,50 +71,61 @@
         OneUp,          //9 - Player has won the boss stage and gets an extra life | 8 beats (placeholder)
         WonStage        //10 - Player has won a character stage for the first time | 8 beats, ends stage
 	}
-
-	void Start()
-	{
-        AssetsUnloadingBusy = false;
-		beatLength = outroSource.clip.length / 4f;
-		Application.backgroundLoadingPriority = sceneLoadPriority;
-		voicePlayer.loadClips(stage.getVoiceSet());
-
-		setAnimationPart(AnimationPart.Intro);
-		resetStage(Time.time, true);
-        Cursor.visible = false;
-	}
-
-	void resetStage(float startTime, bool firstTime)
-	{
-		stage.onStageStart();
-
-		microgameCount = 0;
-		speed = stage.getStartSpeed();
-		Time.timeScale = getSpeedMult();
-		animationStartTime = startTime;
-
-		microgameQueue = new Queue<MicrogameInstance>();
-		updateMicrogameQueue(maxStockpiledScenes);
-
-		resetLifeIndicators();
-		MicrogameNumber.instance.resetNumber();
-
-		introSource.pitch = getSpeedMult();
-		if (!muteMusic && firstTime)
-			AudioHelper.playScheduled(introSource, startTime - Time.time);
-        updateMicrogameTraits();
-
-		invokeIntroAnimations();
-	}
-
-	void Awake()
-	{
-		instance = this;
+
+    void Awake()
+    {
+        instance = this;
         sceneAnimators = transform.root.GetComponentsInChildren<Animator>();
         if (commandDisplay == null)
             commandDisplay = transform.parent.Find("UI").Find("Command").GetComponent<CommandDisplay>();
         if (controlDisplay == null)
             controlDisplay = transform.parent.Find("UI").Find("Control Display").GetComponent<ControlDisplay>();
+    }
+
+    void Start()
+	{
+        AssetsUnloadingBusy = false;
+		beatLength = outroSource.clip.length / 4f;
+		Application.backgroundLoadingPriority = sceneLoadPriority;
+		voicePlayer.loadClips(stage.getVoiceSet());
+
+        setAnimationPart(AnimationPart.Intro);
+
+        Time.timeScale = 0f;
+        Cursor.visible = false;
+        sceneStartTime = Time.realtimeSinceStartup + (Application.isEditor ? editorStartDelay : 0f); // Editor mode has a bug when trying to load scenes async too soon and will activate them anyway
+    }
+
+    private void Update()
+    {
+        if (!sceneStarted && Time.realtimeSinceStartup >= sceneStartTime)
+        {
+            resetStage(Time.time, true);
+            sceneStarted = true;
+        }
+    }
+
+    void resetStage(float startTime, bool firstTime)
+    {
+        stage.onStageStart();
+
+        microgameCount = 0;
+        speed = stage.getStartSpeed();
+        Time.timeScale = getSpeedMult();
+        animationStartTime = startTime;
+
+        microgameQueue = new Queue<MicrogameInstance>();
+        updateMicrogameQueue(maxStockpiledScenes);
+
+        resetLifeIndicators();
+        MicrogameNumber.instance.resetNumber();
+
+        introSource.pitch = getSpeedMult();
+        if (!muteMusic && firstTime)
+            AudioHelper.playScheduled(introSource, startTime - Time.time);
+        updateMicrogameTraits();
+
+        invokeIntroAnimations();
     }

 	void updateMicrogameQueue(int maxQueueSize)
@@ -409,8 +423,14 @@
 	}

 	void startMicrogame()
-	{
-		getCurrentMicrogameInstance().asyncOperation.allowSceneActivation = true;
+    {
+        if (MicrogameController.instance != null)
+        {
+            Debug.LogError("Microgame scene(s) activated prematurely. Try restarting the scene or setting Editor Start Delay higher in Stage Controller");
+            Debug.Break();
+        }
+
+        getCurrentMicrogameInstance().asyncOperation.allowSceneActivation = true;
         stage.onMicrogameStart(microgameCount);
     }


Small bugfix in config store

Small bugfix in config store

--- Astrobot/Mappers/Config/ServerConfig.cs
+++ Astrobot/Mappers/Config/ServerConfig.cs
@@ -23,10 +23,7 @@
         /// </summary>
         public static List<Objects.Config.ServerSettingsServerConfig> DefaultConfig => new List<ServerSettingsServerConfig>()
         {
-            return new List<Objects.Config.ServerSettingsServerConfig>()
-                   {

-                   };
         };

         /// <summary>


Fixed BasicSpriteDrawing sample

Fixed BasicSpriteDrawing sample

wasn’t actually drawing due to empty rectangle being used in
constructor of sprite

--- BasicSpriteDrawing/SpriteDrawingGame.cs
+++ BasicSpriteDrawing/SpriteDrawingGame.cs
@@ -53,7 +53,7 @@
         {
             m_SpriteManager = new SpriteManager(Content, new SpriteBatch(m_Graphics.GraphicsDevice));

-            m_Sprite = m_SpriteManager.CreateSprite("Sprites/ship",new Rectangle());
+            m_Sprite = m_SpriteManager.CreateSprite("Sprites/ship");
         }

         /// <summary>


[fix] fix for module loading constructor selection

--- BigDataPipeline.Core/ModuleContainer.cs
+++ BigDataPipeline.Core/ModuleContainer.cs
@@ -376,7 +376,7 @@
         /// <returns></returns>
         private InstanceFactory CreateFactory (Type type)
         {
-            return CreateFactory (type.GetConstructors ().OrderByDescending (i => i.GetParameters ().Length).First ());
+            return CreateFactory (type.GetConstructors ().OrderBy (i => i.GetParameters ().Length).First ());
         }

         /// <summary>
@@ -389,35 +389,43 @@
             // code http://rogeralsing.com/2008/02/28/linq-expressions-creating-objects/
             Type type = ctor.DeclaringType;
             ParameterInfo[] paramsInfo = ctor.GetParameters ();
-            // prepare parameters
-            //create a single param of type object[]
-            var param = Expression.Parameter (typeof (object[]), "args");
-
-            var argsExp = new Expression[paramsInfo.Length];
-
-            //pick each arg from the params array
-            //and create a typed expression of them
-            for (int i = 0; i < paramsInfo.Length; i++)
-            {
-                var index = Expression.Constant (i);
-                Type paramType = paramsInfo[i].ParameterType;
-
-                var paramAccessorExp = Expression.ArrayIndex (param, index);
-
-                var paramCastExp = Expression.Convert (paramAccessorExp, paramType);
-
-                argsExp[i] = paramCastExp;
-            }
-
-            //make a NewExpression that calls the
-            //ctor with the args we just created
-            var newExp = Expression.New (ctor, argsExp);
-
-            //create a lambda with the New
-            //Expression as body and our param object[] as arg
-            var lambda = Expression.Lambda (typeof (InstanceFactory), newExp, param);
-
-            //compile it
+            LambdaExpression lambda;
+
+            if (paramsInfo.Length > 0)
+            {
+                // prepare parameters
+                // create a single param of type object[]
+                var param = Expression.Parameter (typeof (object[]), "args");
+
+                var argsExp = new Expression[paramsInfo.Length];
+
+                // pick each arg from the params array
+                // and create a typed expression of them
+                for (int i = 0; i < paramsInfo.Length; i++)
+                {
+                    var index = Expression.Constant (i);
+                    Type paramType = paramsInfo[i].ParameterType;
+
+                    var paramAccessorExp = Expression.ArrayIndex (param, index);
+
+                    var paramCastExp = Expression.Convert (paramAccessorExp, paramType);
+
+                    argsExp[i] = paramCastExp;
+                }
+
+                // make a NewExpression that calls the
+                // ctor with the args we just created
+                var newExp = Expression.New (ctor, argsExp);
+
+                // create a lambda with the New
+                // Expression as body and our param object[] as arg
+                lambda = Expression.Lambda (typeof (InstanceFactory), newExp, param);
+            }
+            else
+            {
+                lambda = Expression.Lambda (typeof (InstanceFactory), Expression.New (ctor));
+            }
+            // compile it
             var compiled = (InstanceFactory)lambda.Compile ();
             return compiled;
         }


ModuleContainer review ii

ModuleContainer review ii

--- BigDataPipeline.Core/ModuleContainer.cs
+++ BigDataPipeline.Core/ModuleContainer.cs
@@ -66,7 +66,7 @@
         /// scan for the types derived from listOfInterfaces.
         /// </summary>
         /// <param name="modulesFolder">The modules folder.</param>
-        /// <param name="listOfInterfaces">The list of interfaces or base types.</param>
+        /// <param name="listOfInterfaces">The list of interfaces or base types.</param>
         public void LoadModules (string modulesFolder, Type[] listOfInterfaces = null)
         {
             lock (padlock)
@@ -236,6 +236,10 @@
                     {
                         _logger.Warn (ex);
                     }
+
+                    // check if types were listed!
+                    if (types == null)
+                        continue;

                     // search for types derived from desired types list (listOfInterfaces)
                     for (int i = 0; i < types.Length; i++)


Update code

Update code

--- BindingSample/BindingConsole/Program.cs
+++ BindingSample/BindingConsole/Program.cs
@@ -110,26 +110,30 @@

         static void Bind_Collection()
         {
-            // Binding Source for collection.
-            var people = new ObservableCollection<Person1>
-            {
-                new Person1 { Id = 123, Name = "Taro" },
-            };
+            var taro = new Person1 { Id = 123, Name = "Taro" };
+            var jiro = new Person1 { Id = 234, Name = "Jiro" };
+
+            // Binding Source (collection).
+            var people = new ObservableCollection<Person1> { taro };

             // Binding Target.
             var itemsControl = new ItemsControl();
             Console.WriteLine(itemsControl.Items.Count);

             // Binds target to source.
-            var binding = new Binding { Source = people };
-            itemsControl.SetBinding(ItemsControl.ItemsSourceProperty, binding);
+            // MEMO: Binding Source のオブジェクト自体が変更されないのであれば、
+            // ItemsSource プロパティのデータ バインディングは必須ではありません。
+            itemsControl.ItemsSource = people;
             Console.WriteLine(itemsControl.Items.Count);

-            // Changes source value.
-            people.Add(new Person1 { Id = 234, Name = "Jiro" });
+            // Changes source collection.
+            people.Add(jiro);
             Console.WriteLine(itemsControl.Items.Count);
             people.RemoveAt(0);
             Console.WriteLine(itemsControl.Items.Count);
+
+            // MEMO: ItemsSource に値を設定している場合、Items を直接変更しようとすると例外が発生します。
+            //itemsControl.Items.Add(jiro);
         }
     }
 }


fix NPE with warmedtxes not being initted in time

--- BitSharp.Core/Builders/UtxoLookAhead.cs
+++ BitSharp.Core/Builders/UtxoLookAhead.cs
@@ -32,7 +32,7 @@
         private readonly AutoResetEvent txLoadedEvent = new AutoResetEvent(false);
         private readonly ConcurrentQueue<Tuple<BlockTx, CompletionCount>> pendingWarmedTxes = new ConcurrentQueue<Tuple<BlockTx, CompletionCount>>();
         private TransformManyBlock<BlockTx, Tuple<UInt256, CompletionCount>> queueUnspentTxLookup;
-        private BlockingCollection<BlockTx> warmedTxes;
+        private BlockingCollection<BlockTx> warmedTxes = new BlockingCollection<BlockTx>();
         private bool completeAdding;

         public UtxoLookAhead(IEnumerable<BlockTx> blockTxes, DeferredChainStateCursor deferredChainStateCursor)
@@ -80,7 +80,6 @@
             try
             {
                 var stopwatch = Stopwatch.StartNew();
-                warmedTxes = new BlockingCollection<BlockTx>();

                 // queue each utxo entry to be warmed up: each input's previous transaction, and each new transaction
                 queueUnspentTxLookup = InitQueueUnspentTxLookup();


Generate codes before build if last build has error >> Bit VS Extension V1

--- BitTools/BitVSExtensionV1/BitPackage.cs
+++ BitTools/BitVSExtensionV1/BitPackage.cs
@@ -135,6 +135,14 @@
             _workspace.WorkspaceChanged += _workspace_WorkspaceChanged;
         }

+        private async void _workspace_WorkspaceChanged(object sender, WorkspaceChangeEventArgs e)
+        {
+            if (e.Kind == WorkspaceChangeKind.SolutionAdded)
+            {
+                await DoOnSolutionReadyOrChange();
+            }
+        }
+
         private async Task DoOnSolutionReadyOrChange()
         {
             if (!File.Exists(_workspace.CurrentSolution.FilePath))
@@ -188,6 +196,7 @@

             _shouldGeneratedProjects = new List<Project> { };
             generateCodesForTheFirstTimeExecuted = false;
+            thereWasAnErrorInBuild = false;
         }

         private bool CurrentSolutionHasBitConfigV1JsonFile()
@@ -267,14 +276,6 @@
             }
         }

-        private async void _workspace_WorkspaceChanged(object sender, WorkspaceChangeEventArgs e)
-        {
-            if (e.Kind == WorkspaceChangeKind.SolutionAdded)
-            {
-                await DoOnSolutionReadyOrChange();
-            }
-        }
-
         private void RedirectAssembly(string shortName, Version targetVersion, string publicKeyToken)
         {
             Assembly ResolveEventHandler(object sender, ResolveEventArgs args)
@@ -298,13 +299,18 @@

         private async void _buildEvents_OnBuildBegin(vsBuildScope scope, vsBuildAction action)
         {
-            if (generateCodesForTheFirstTimeExecuted == false)
-            {
-                generateCodesForTheFirstTimeExecuted = true;
+            if (!CurrentSolutionHasBitConfigV1JsonFile())
+                return;
+
+            if (generateCodesForTheFirstTimeExecuted == false || thereWasAnErrorInBuild == true)
+            {
                 _shouldGeneratedProjects = _workspace.CurrentSolution.Projects.Where(p => p.Language == LanguageNames.CSharp).ToList();
                 await GenerateCodes();
             }

+            generateCodesForTheFirstTimeExecuted = true;
+            thereWasAnErrorInBuild = false;
+
             _shouldGeneratedProjects.Clear();
         }

@@ -312,6 +318,8 @@
         {
             if (!CurrentSolutionHasBitConfigV1JsonFile())
                 return;
+
+            thereWasAnErrorInBuild = thereWasAnErrorInBuild && success;

             Project proj = _workspace.CurrentSolution.Projects.Where(p => p.Language == LanguageNames.CSharp)
                                 .ExtendedSingle($"Lookin for {project} in [ {(string.Join(",", _workspace.CurrentSolution.Projects.Select(prj => prj.Name)))} ]", prj => Path.GetFileName(prj.FilePath) == project.Split('\\').Last());
@@ -406,5 +414,7 @@
         private IVsStatusbar _statusBar;

         private bool generateCodesForTheFirstTimeExecuted = false;
+
+        private bool thereWasAnErrorInBuild = false;
     }
 }


use Configuration property to prevent NRE

--- BuildingThemes/BuildingThemesManager.cs
+++ BuildingThemes/BuildingThemesManager.cs
@@ -185,7 +185,7 @@

         private void AddImportedTheme(List<Configuration.Building> builtInBuildings, string themeName, string stylePackage, out Configuration.Theme theme)
         {
-            theme = _configuration.getTheme(themeName);
+            theme = Configuration.getTheme(themeName);
             if (theme == null)
             {
                 theme = new Configuration.Theme
@@ -193,7 +193,7 @@
                     name = themeName,
                     stylePackage = stylePackage
                 };
-                _configuration.themes.Add(theme);
+                Configuration.themes.Add(theme);
             }
             theme.isBuiltIn = true;
             if (builtInBuildings == null)


#21 update concrete srvers

#21 update concrete srvers

--- src/Arma3BE.Client.Modules.BEServerModule/BEServiceLogic.cs
+++ src/Arma3BE.Client.Modules.BEServerModule/BEServiceLogic.cs
@@ -1,4 +1,7 @@
 using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Linq;
 using System.Threading;
 using Arma3BE.Client.Infrastructure.Events;
 using Arma3BE.Client.Infrastructure.Events.BE;
@@ -33,6 +36,8 @@
                 .Subscribe(SettingsChanged);
         }

+
+
         private void SettingsChanged(SettingsStore settings)
         {
             _playersUpdater.SetTimer(SettingsStore.Instance.PlayersUpdateSeconds);
@@ -45,21 +50,27 @@
                    .Publish(new BECommand(message.ServerId, CommandType.Players));
         }

-        private void UpdatePlayers()
+        private void UpdatePlayers(HashSet<Guid> servers)
         {
             foreach (var server in _beService.ConnectedServers())
             {
-                _aggregator.GetEvent<BEMessageEvent<BECommand>>()
-                   .Publish(new BECommand(server, CommandType.Players));
+                if (servers.Contains(server))
+                {
+                    _aggregator.GetEvent<BEMessageEvent<BECommand>>()
+                        .Publish(new BECommand(server, CommandType.Players));
+                }
             }
         }

-        private void UpdateBans()
+        private void UpdateBans(HashSet<Guid> servers)
         {
             foreach (var server in _beService.ConnectedServers())
             {
-                _aggregator.GetEvent<BEMessageEvent<BECommand>>()
-                   .Publish(new BECommand(server, CommandType.Bans));
+                if (servers.Contains(server))
+                {
+                    _aggregator.GetEvent<BEMessageEvent<BECommand>>()
+                        .Publish(new BECommand(server, CommandType.Bans));
+                }
             }
         }
     }
@@ -67,12 +78,13 @@
     public class TimedAction : DisposeObject
     {
         private int _interval;
-        private readonly Action _action;
+        private readonly Action<HashSet<Guid>> _action;

         private Timer _timer;
-        private bool _requiredCall;

-        public TimedAction(int interval, Action action)
+        private ConcurrentDictionary<Guid, byte> _servers = new ConcurrentDictionary<Guid, byte>();
+
+        public TimedAction(int interval, Action<HashSet<Guid>> action)
         {
             _interval = interval;
             _action = action;
@@ -80,9 +92,9 @@
             _timer = new Timer(Tick, null, Interval(), Timeout.Infinite);
         }

-        public void Update()
+        public void Update(Guid server)
         {
-            _requiredCall = true;
+            _servers.AddOrUpdate(server, 0, (guid, b) => b);
         }

         public void SetTimer(int intervalInSeconds)
@@ -96,15 +108,16 @@
         private int Interval()
         {
             var i = _interval;
-            return Math.Max(1000, i*1000);
+            return Math.Max(5000, i*1000);
         }

         private void Tick(object state)
         {
-            if (_requiredCall)
+            if (_servers.Any())
             {
-                _requiredCall = false;
-                _action();
+                var set = new HashSet<Guid>(_servers.Keys.ToArray());
+                _servers.Clear();
+                _action(set);
             }

             _timer?.Change(Interval(), Timeout.Infinite);


Update text case for CreateSampleLesson

Update text case for CreateSampleLesson

--- Assetts/Classes/GGProduction/LetterStorm/Data/Collections/LessonBookTests.cs
+++ Assetts/Classes/GGProduction/LetterStorm/Data/Collections/LessonBookTests.cs
@@ -12,18 +12,19 @@
         {
             // Create a lesson book with a sample lesson
             LessonBook lessonBook = new LessonBook();
-            lessonBook.CreateSampleLesson();
+            lessonBook.CreateSampleLessons();

             // Verify a lesson was created and that it has the correct name
-            Assert.AreEqual(1, lessonBook.Lessons.Count);
-            Assert.AreEqual("Sample Lesson", lessonBook.Lessons[0].Name);
+            Assert.AreEqual(5, lessonBook.Lessons.Count);
+            Assert.AreEqual("K5 Sample", lessonBook.Lessons[0].Name);

             // Verify the lesson's words were created
-            Assert.AreEqual(4, lessonBook.Lessons[0].Words.Count);
+            Assert.AreEqual(5, lessonBook.Lessons[0].Words.Count);
             Assert.AreEqual("cat", lessonBook.Lessons[0].Words[0].Text);
             Assert.AreEqual("dog", lessonBook.Lessons[0].Words[1].Text);
-            Assert.AreEqual("fish", lessonBook.Lessons[0].Words[2].Text);
-            Assert.AreEqual("horse", lessonBook.Lessons[0].Words[3].Text);
+            Assert.AreEqual("bug", lessonBook.Lessons[0].Words[2].Text);
+            Assert.AreEqual("fish", lessonBook.Lessons[0].Words[3].Text);
+            Assert.AreEqual("horse", lessonBook.Lessons[0].Words[4].Text);
         }
     }
 }


Refactoring.

Refactoring.

--- AudioWorks/Extensions/AudioWorks.Extensions.Flac/FlacAudioMetadataEncoder.cs
+++ AudioWorks/Extensions/AudioWorks.Extensions.Flac/FlacAudioMetadataEncoder.cs
@@ -19,40 +19,30 @@
         public void WriteMetadata(FileStream stream, AudioMetadata metadata, SettingDictionary settings)
         {
             var padding = GetPadding(settings);
-            NativeVorbisCommentBlock vorbisCommentBlock = null;

-            try
+            using (var chain = new NativeMetadataChain(stream))
+            using (var comments = new MetadataToVorbisCommentAdapter(metadata))
             {
-                using (var chain = new NativeMetadataChain(stream))
-                {
-                    chain.Read();
+                chain.Read();

-                    vorbisCommentBlock = new MetadataToVorbisCommentAdapter(metadata);
+                // Iterate over the existing blocks, replacing and deleting as needed:
+                using (var iterator = chain.GetIterator())
+                    UpdateChain(iterator, comments, padding);

-                    // Iterate over the existing blocks, replacing and deleting as needed:
-                    using (var iterator = chain.GetIterator())
-                        UpdateChain(iterator, vorbisCommentBlock, padding);
+                // If FLAC requests a temporary file, use a MemoryStream instead. Then overwrite the original:
+                if (chain.CheckIfTempFileNeeded(!padding.HasValue))
+                    using (var tempStream = new MemoryStream())
+                    {
+                        chain.WriteWithTempFile(!padding.HasValue, tempStream);

-                    // If FLAC requests a temporary file, use a MemoryStream instead. Then overwrite the original:
-                    if (chain.CheckIfTempFileNeeded(!padding.HasValue))
-                        using (var tempStream = new MemoryStream())
-                        {
-                            chain.WriteWithTempFile(!padding.HasValue, tempStream);
-
-                            // Clear the original stream, and copy the temporary one over it:
-                            stream.SetLength(tempStream.Length);
-                            stream.Position = 0;
-                            tempStream.WriteTo(stream);
-                        }
-                    else
-                        chain.Write(!padding.HasValue);
-                }
+                        // Clear the original stream, and copy the temporary one over it:
+                        stream.SetLength(tempStream.Length);
+                        stream.Position = 0;
+                        tempStream.WriteTo(stream);
+                    }
+                else
+                    chain.Write(!padding.HasValue);
             }
-            finally
-            {
-                vorbisCommentBlock?.Dispose();
-            }
-
         }

         [Pure]


Update CertificateMixed.cs

Update CertificateMixed.cs

--- Core/OfficeDevPnP.Core/IdentityModel/TokenProviders/ADFS/CertificateMixed.cs
+++ Core/OfficeDevPnP.Core/IdentityModel/TokenProviders/ADFS/CertificateMixed.cs
@@ -68,7 +68,7 @@
         private GenericXmlSecurityToken RequestToken(string serialNumber, Uri certificateMixed, string relyingPartyIdentifier)
         {
             GenericXmlSecurityToken genericToken = null;
-            using (var factory = new WSTrustChannelFactory(new UserNameWSTrustBinding(SecurityMode.TransportWithMessageCredential), new EndpointAddress(certificateMixed)))
+            using (var factory = new WSTrustChannelFactory(new CertificateWSTrustBinding(SecurityMode.TransportWithMessageCredential), new EndpointAddress(certificateMixed)))
             {
                 factory.TrustVersion = TrustVersion.WSTrust13;
                 // Hookup the user and password


update

update

--- Demos/CSharpGL.Demos/08AnalyzedPointSprite/Form08AnalyzedPointSprite.Load.cs
+++ Demos/CSharpGL.Demos/08AnalyzedPointSprite/Form08AnalyzedPointSprite.Load.cs
@@ -14,7 +14,7 @@
         {
             {
                 var camera = new Camera(
-                    new vec3(0, 0, 1), new vec3(0, 0, 0), new vec3(0, 1, 0),
+                    new vec3(3, 4, 5) * 2, new vec3(0, 0, 0), new vec3(0, 1, 0),
                     CameraType.Perspecitive, this.glCanvas1.Width, this.glCanvas1.Height);
                 var rotator = new SatelliteManipulater();
                 rotator.Bind(camera, this.glCanvas1);


Added verbose logging for dashboard instance grain

--- Derivco.Orniscient/Derivco.Orniscient.Proxy/Grains/DashboardInstanceGrain.cs
+++ Derivco.Orniscient/Derivco.Orniscient.Proxy/Grains/DashboardInstanceGrain.cs
@@ -146,7 +146,7 @@

         public async Task OnNextAsync(DiffModel item, StreamSequenceToken token = null)
         {
-            _logger.Verbose($"OnNextAsync called with {item.NewGrains.Count} new items");
+            _logger.Verbose($"OnNextAsync called with {item.NewGrains.Count} new grains, {item.RemovedGrains.Count} removed grains");

             List<UpdateModel> previousSummary = null;
             if (InSummaryMode)
@@ -180,6 +180,7 @@
                     var removed = previousSummary.Where(grain => !updatedSummary.Any(currentGrain => currentGrain.Id == grain.Id)).Select(grain => grain.Id).ToList();
                     diffModel.RemovedGrains = removed;
                 }
+                _logger.Verbose($"DashboardInstanceGrain sending out {diffModel.NewGrains.Count} new grains, {diffModel.RemovedGrains.Count} removed grains");
                 await _dashboardInstanceStream.OnNextAsync(diffModel);
             }
             else
@@ -198,6 +199,7 @@
                 {
                     item.SummaryView = InSummaryMode;
                     item.SessionId = SessionId;
+                    _logger.Verbose($"DashboardInstanceGrain sending out {item.NewGrains?.Count} new grains, {item.RemovedGrains?.Count} removed grains");
                     await _dashboardInstanceStream.OnNextAsync(item);
                 }
             }


Add VerifyIsNull and VerifyIsNotNull extension methods

--- src/Atata/Extensions/IUIComponentValueProviderExtensions.cs
+++ src/Atata/Extensions/IUIComponentValueProviderExtensions.cs
@@ -46,6 +46,58 @@
                 verificationMessageArgs);
         }

+        public static TOwner VerifyIsTrue<TOwner>(this IUIComponentValueProvider<bool, TOwner> provider)
+            where TOwner : PageObject<TOwner>
+        {
+            return provider.Verify(
+                (actual, message) => ATAssert.IsTrue(actual, message),
+                "is {0}",
+                bool.TrueString);
+        }
+
+        public static TOwner VerifyIsTrue<TOwner>(this IUIComponentValueProvider<bool?, TOwner> provider)
+            where TOwner : PageObject<TOwner>
+        {
+            return provider.Verify(
+                (actual, message) => ATAssert.IsTrue(actual, message),
+                "is {0}",
+                bool.TrueString);
+        }
+
+        public static TOwner VerifyIsFalse<TOwner>(this IUIComponentValueProvider<bool, TOwner> provider)
+            where TOwner : PageObject<TOwner>
+        {
+            return provider.Verify(
+                (actual, message) => ATAssert.IsFalse(actual, message),
+                "is {0}",
+                bool.FalseString);
+        }
+
+        public static TOwner VerifyIsFalse<TOwner>(this IUIComponentValueProvider<bool?, TOwner> provider)
+            where TOwner : PageObject<TOwner>
+        {
+            return provider.Verify(
+                (actual, message) => ATAssert.IsFalse(actual, message),
+                "is {0}",
+                bool.FalseString);
+        }
+
+        public static TOwner VerifyIsNull<TValue, TOwner>(this IUIComponentValueProvider<TValue, TOwner> provider)
+            where TOwner : PageObject<TOwner>
+        {
+            return provider.Verify(
+                (actual, message) => ATAssert.IsNull(actual, message),
+                "is null");
+        }
+
+        public static TOwner VerifyIsNotNull<TValue, TOwner>(this IUIComponentValueProvider<TValue, TOwner> provider)
+            where TOwner : PageObject<TOwner>
+        {
+            return provider.Verify(
+                (actual, message) => ATAssert.IsNotNull(actual, message),
+                "is not null");
+        }
+
         public static TOwner VerifyEquals<TValue, TOwner>(this IUIComponentValueProvider<TValue, TOwner> provider, TValue expected)
             where TOwner : PageObject<TOwner>
         {
@@ -134,42 +186,6 @@
                 (actual, message) => ATAssert.DoesNotMatch(pattern, actual, message),
                 "does not match pattern \"{0}\"",
                 pattern);
-        }
-
-        public static TOwner VerifyIsTrue<TOwner>(this IUIComponentValueProvider<bool, TOwner> provider)
-            where TOwner : PageObject<TOwner>
-        {
-            return provider.Verify(
-                (actual, message) => ATAssert.IsTrue(actual, message),
-                "is {0}",
-                bool.TrueString);
-        }
-
-        public static TOwner VerifyIsTrue<TOwner>(this IUIComponentValueProvider<bool?, TOwner> provider)
-            where TOwner : PageObject<TOwner>
-        {
-            return provider.Verify(
-                (actual, message) => ATAssert.IsTrue(actual, message),
-                "is {0}",
-                bool.TrueString);
-        }
-
-        public static TOwner VerifyIsFalse<TOwner>(this IUIComponentValueProvider<bool, TOwner> provider)
-            where TOwner : PageObject<TOwner>
-        {
-            return provider.Verify(
-                (actual, message) => ATAssert.IsFalse(actual, message),
-                "is {0}",
-                bool.FalseString);
-        }
-
-        public static TOwner VerifyIsFalse<TOwner>(this IUIComponentValueProvider<bool?, TOwner> provider)
-            where TOwner : PageObject<TOwner>
-        {
-            return provider.Verify(
-                (actual, message) => ATAssert.IsFalse(actual, message),
-                "is {0}",
-                bool.FalseString);
         }

         public static TOwner VerifyUntilMatchesAny<TOwner>(this IUIComponentValueProvider<string, TOwner> provider, TermMatch match, params string[] expectedValues)


Hide Score when showing winners. Fix "votes" showing when there is only one vote.

--- src/CompetitionPlatform/Views/Project/ResultsPartial.cshtml
+++ src/CompetitionPlatform/Views/Project/ResultsPartial.cshtml
@@ -113,6 +113,8 @@

             @foreach (var winner in Model.Winners)
             {
+                var voteVotes = winner.Votes == 1 ? "vote" : "votes";
+
                 if (winner.Place == 1)
                 {

@@ -130,7 +132,7 @@

                                         @winner.FullName

-                                    Score: @winner.Score/100 · @winner.Votes votes
+                                    @winner.Votes @voteVotes

@@ -159,7 +161,7 @@

                                         @winner.FullName

-                                    Score: @winner.Score/100 · @winner.Votes votes
+                                    @winner.Votes @voteVotes


Refactor to make use of batch options validator

--- CSF.Zpt/BatchRendering/BatchRenderer.cs
+++ CSF.Zpt/BatchRendering/BatchRenderer.cs
@@ -17,6 +17,7 @@

     private readonly IRenderingJobFactory _jobFactory;
     private readonly IRenderingSettingsFactory _settingsFactory;
+    private readonly IBatchRenderingOptionsValidator _optionsValidator;

     #endregion

@@ -143,27 +144,7 @@
     /// <param name="options">Options.</param>
     protected virtual void ValidateBatchOptions(IBatchRenderingOptions options)
     {
-      if(options.InputStream == null && !options.InputPaths.Any())
-      {
-        string message = Resources.ExceptionMessages.BatchOptionsMustHaveInputStreamOrPaths;
-        throw new InvalidBatchRenderingOptionsException(message, BatchRenderingFatalErrorType.NoInputsSpecified);
-      }
-      else if(options.InputStream != null && options.InputPaths.Any())
-      {
-        string message = Resources.ExceptionMessages.BatchOptionsMustNotHaveBothInputStreamAndPaths;
-        throw new InvalidBatchRenderingOptionsException(message, BatchRenderingFatalErrorType.InputCannotBeBothStreamAndPaths);
-      }
-
-      if(options.OutputStream == null && options.OutputPath == null)
-      {
-        string message = Resources.ExceptionMessages.BatchOptionsMustHaveOutputStreamOrPath;
-        throw new InvalidBatchRenderingOptionsException(message, BatchRenderingFatalErrorType.NoOutputsSpecified);
-      }
-      else if(options.OutputStream != null && options.OutputPath != null)
-      {
-        string message = Resources.ExceptionMessages.BatchOptionsMustNotHaveBothOutputStreamAndPath;
-        throw new InvalidBatchRenderingOptionsException(message, BatchRenderingFatalErrorType.OutputCannotBeBothStreamAndPaths);
-      }
+      _optionsValidator.Validate(options);
     }

     /// <summary>
@@ -207,11 +188,14 @@
     /// </summary>
     /// <param name="renderingJobFactory">Rendering job factory.</param>
     /// <param name="settingsFactory">Rendering settings factory.</param>
+    /// <param name="optionsValidator">Options validator.</param>
     public BatchRenderer(IRenderingJobFactory renderingJobFactory = null,
-                         IRenderingSettingsFactory settingsFactory = null)
+                         IRenderingSettingsFactory settingsFactory = null,
+                         IBatchRenderingOptionsValidator optionsValidator = null)
     {
       _jobFactory = renderingJobFactory?? new RenderingJobFactory();
       _settingsFactory = settingsFactory?? new RenderingSettingsFactory();
+      _optionsValidator = optionsValidator?? new BatchRenderingOptionsValidator();
     }

     #endregion


WinForms - override Control.DefaultSize return 200x100

When ChromiumWebBrowser is hosted in a FlowLayoutPanel the Dock = DockStyle.Fill
ends up with a browser having no width/height depending on the option layout.

As Control.DefaultSize returns Size.Empty, looking at WebBrowserBase it defaults to Size(75, 23)
which seems way too small to be meaningful. We'll default to 200x100 for now.

https://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/Control.cs,17f6db7866977c1a

Related to issue #3019

--- CefSharp.WinForms/ChromiumWebBrowser.cs
+++ CefSharp.WinForms/ChromiumWebBrowser.cs
@@ -918,6 +918,17 @@
         }

         /// <summary>
+        /// Gets the default size of the control.
+        /// </summary>
+        /// <value>
+        /// The default <see cref="T:System.Drawing.Size" /> of the control.
+        /// </value>
+        protected override Size DefaultSize
+        {
+            get { return new Size(200, 100); }
+        }
+
+        /// <summary>
         /// Makes certain keys as Input keys when CefSettings.MultiThreadedMessageLoop = false
         /// </summary>
         /// <param name="keyData">key data</param>


Update _Navbar.cshtml

Update _Navbar.cshtml

--- input/_Navbar.cshtml
+++ input/_Navbar.cshtml
@@ -7,7 +7,6 @@
         Tuple.Create("Documentation", Context.GetLink("docs")),
         Tuple.Create("API", Context.GetLink("api")),
         Tuple.Create("Contribute", Context.GetLink("contribute")),
-        Tuple.Create("Donate", Context.GetLink("donate")),
         Tuple.Create("Support", Context.GetLink("support")),
         Tuple.Create("About", Context.GetLink("about")),
     };


update.

update.

--- Microsoft.ContentModerator.AMSComponent/AMSComponentClient/VideoReviewAPI.cs
+++ Microsoft.ContentModerator.AMSComponent/AMSComponentClient/VideoReviewAPI.cs
@@ -338,12 +338,12 @@
             {
                 metadata.AddRange(new List<Metadata>()
                 {
+                    new Metadata() { Key = "adultTextScore", Value = uploadResult.AdultScore.ToString() },
                     new Metadata() { Key = "at", Value = uploadResult.AdultTag.ToString() },
-                    new Metadata() { Key = "adultTextScore", Value = uploadResult.AdultScore.ToString() },
+                    new Metadata() { Key = "racyTextScore", Value = uploadResult.RacyScore.ToString() },
                     new Metadata() { Key = "rt", Value = uploadResult.RacyTag.ToString() },
-                    new Metadata() { Key = "racyTextScore", Value = uploadResult.RacyScore.ToString() },
-                    new Metadata() { Key = "ot", Value = uploadResult.OffensiveTag.ToString() },
-                    new Metadata() { Key = "offensiveTextScore", Value = uploadResult.OffensiveScore.ToString() }
+                    new Metadata() { Key = "offensiveTextScore", Value = uploadResult.OffensiveScore.ToString() },
+                    new Metadata() { Key = "ot", Value = uploadResult.OffensiveTag.ToString() }
                 });
             }
             return metadata;


Fixed issue

Fixed issue

--- src/Lix.Commons/Repositories/Linq2Sql/Linq2SqlUnitOfWork.cs
+++ src/Lix.Commons/Repositories/Linq2Sql/Linq2SqlUnitOfWork.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Data;
 using System.Data.Common;
 using System.Data.Linq;

@@ -66,7 +67,7 @@
         /// </summary>
         public void Begin()
         {
-            if (this.IsActive)
+            if (this.IsActive || this.DataContext.Transaction != null)
             {
                 throw new InvalidOperationException("A unit of work has already begun for this session.");
             }
@@ -99,6 +100,7 @@
             this.Transaction.Commit();
             this.Transaction.Dispose();
             this.Transaction = null;
+            this.DataContext.Transaction = null;

             this.wasTransactionCommitted = true;
             this.wasTransactionRolledback = false;


Moves callback processing to background thread

--- Keiser.MvxPlugins.Bluetooth.Droid/LE/Adapter.cs
+++ Keiser.MvxPlugins.Bluetooth.Droid/LE/Adapter.cs
@@ -49,7 +49,8 @@
                 {
                     _manager = (BluetoothManager)_context.GetSystemService(Context.BluetoothService);
                     _adapter = _manager.Adapter;
-                    Task.Run(() => ClearBluedroidCache());
+                    ClearBluedroidCache();
+                    //Task.Run(() => ClearBluedroidCache());
                     GetWifi();
                 }
                 catch { }
@@ -84,17 +85,18 @@
         protected IScanCallback _scanCallback;
         public void OnLeScan(BluetoothDevice device, int rssi, byte[] scanRecord)
         {
- /*           Task.Run(() =>
-                {
-#if DEBUG
-                    Trace.Info("Queued Scan Found Device: " + basicDevice.ID);
-#endif
-                    _scanCallback.ScanCallback(basicDevice);
-                    SetCheckTimer();
-                });
-  * */
-
-            Task.Factory.StartNew(() => {
+            /*           Task.Run(() =>
+                           {
+           #if DEBUG
+                               Trace.Info("Queued Scan Found Device: " + basicDevice.ID);
+           #endif
+                               _scanCallback.ScanCallback(basicDevice);
+                               SetCheckTimer();
+                           });
+             * */
+
+            Task.Factory.StartNew(() =>
+            {
                 Device basicDevice = new Device(device, rssi, scanRecord);
 #if DEBUG
                 Trace.Info("Queued Scan Found Device: " + basicDevice.ID);
@@ -102,7 +104,7 @@
                 _scanCallback.ScanCallback(basicDevice);
                 SetCheckTimer();
             }
-            , TaskCreationOptions.LongRunning);
+            , TaskCreationOptions.LongRunning);
         }

         public void StartScan(IScanCallback scanCallback, bool toggleRadios = true)
@@ -144,7 +146,8 @@
             CancelCheckTimer();
             IsScanning = false;
             EnableWifi();
-            Task.Run(() => ClearBluedroidCache());
+            ClearBluedroidCache();
+            //Task.Run(() => ClearBluedroidCache());
         }

         private void StopActualScan()
@@ -184,7 +187,7 @@
             if (timeout == 0)
                 timeout = CheckTimeout;
             CancelCheckTimer();
-            CheckTimer = new Timer(_ => RadioCheckTimeout(), null, timeout, 0);
+            CheckTimer = new Timer(_ => RadioReload(), null, timeout, 0);
         }

         protected void CancelCheckTimer()
@@ -196,7 +199,7 @@
             CheckTimer = null;
         }

-        protected void RadioCheckTimeout()
+        protected void RadioReload()
         {
             if (IsScanning)
             {
@@ -206,7 +209,9 @@
                 CancelScanTimer();
                 _adapter.StopLeScan(this);
                 _adapter.Disable();
+                while (_adapter.State != State.Off) { System.Threading.Thread.Sleep(10); }
                 _adapter.Enable();
+                while (_adapter.State != State.On) { System.Threading.Thread.Sleep(10); }
                 _adapter.StartLeScan(this);
                 SetScanTimer();
                 SetCheckTimer(LongCheckTimeout);
@@ -215,16 +220,19 @@

         protected void ClearBluedroidCache()
         {
+            Task.Factory.StartNew(() =>
+            {
 #if DEBUG
             Trace.Info("Clearing Bluedroid Cache");
 #endif
-            _adapter.StopLeScan(this);
-            _adapter.Disable();
-            RunSystemCommand("pm disable com.android.bluetooth");
-            RunSystemCommand("am force-stop com.android.bluetooth");
-            RunSystemCommand("rm -rf /data/misc/bluedroid/*");
-            RunSystemCommand("pm enable com.android.bluetooth");
-            _adapter.Enable();
+                _adapter.StopLeScan(this);
+                _adapter.Disable();
+                RunSystemCommand("pm disable com.android.bluetooth");
+                RunSystemCommand("am force-stop com.android.bluetooth");
+                RunSystemCommand("rm -rf /data/misc/bluedroid/*");
+                RunSystemCommand("pm enable com.android.bluetooth");
+                _adapter.Enable();
+            }, TaskCreationOptions.LongRunning);
         }

         private static void RunSystemCommand(string command)


refactor: Remove unused AsyncCommandManager.PleaseShutdown

--- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
+++ OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -377,23 +377,5 @@
                 }
             }
         }
-
-        #region Check llRemoteData channels
-
-        #endregion
-
-        #region Check llListeners
-
-        #endregion
-
-        /// <summary>
-        /// If set to true then threads and stuff should try to make a graceful exit
-        /// </summary>
-        public bool PleaseShutdown
-        {
-            get { return _PleaseShutdown; }
-            set { _PleaseShutdown = value; }
-        }
-        private bool _PleaseShutdown = false;
     }
-}
+}


Update GoogleAnalyticsPlatform.cs

Update GoogleAnalyticsPlatform.cs

--- Plugin.GoogleAnalytics/Plugin.GoogleAnalytics.Mac/GoogleAnalyticsPlatform.cs
+++ Plugin.GoogleAnalytics/Plugin.GoogleAnalytics.Mac/GoogleAnalyticsPlatform.cs
@@ -13,7 +13,10 @@

         private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
         {
+            if (!Current.Config.ReportUncaughtExceptions)
+                return;
+
             Current.Tracker.SendException(e.ExceptionObject as Exception, true);
         }
     }
-}+}


Removed the NotPortedyet Attribute

Removed the NotPortedyet Attribute

--- RefactoringEssentials/CSharp/Diagnostics/Custom/RedundantInternalAnalyzer.cs
+++ RefactoringEssentials/CSharp/Diagnostics/Custom/RedundantInternalAnalyzer.cs
@@ -8,7 +8,6 @@
 namespace RefactoringEssentials.CSharp.Diagnostics
 {
     [DiagnosticAnalyzer(LanguageNames.CSharp)]
-    [NotPortedYet]
     /// <summary>
     /// Finds redundant internal modifiers.
     /// </summary>


Fix incorrect CUDA device buffer allocation for offset host data

--- Sigma.Core/Handlers/Backends/SigmaDiff/NativeGpu/CudaFloat32BackendHandle.cs
+++ Sigma.Core/Handlers/Backends/SigmaDiff/NativeGpu/CudaFloat32BackendHandle.cs
@@ -58,14 +58,22 @@
 			CudaDeviceVariable<float> deviceBuffer;
 			if (_allocatedDeviceBuffers.TryGetValue(hostData, out deviceBuffer))
 			{
-				return (CudaDeviceVariable<T>) (object) deviceBuffer;
+				// TODO temp fix to make sure the returned data is of the right size, maybe manage offset / length separately for host data, unfortunately cuda doesn't support buffer overlap
+				if (deviceBuffer.SizeInBytes == cudaLengthBytes)
+				{
+					return (CudaDeviceVariable<T>)(object)deviceBuffer;
+				}
+				else
+				{
+					_allocatedDeviceBuffers.Remove(hostData);
+				}
 			}

 			deviceBuffer = new CudaDeviceVariable<float>(CudaContext.AllocateMemory(cudaLengthBytes), true, cudaLengthBytes);

 			_allocatedDeviceBuffers.Add(hostData, deviceBuffer);

-			return (CudaDeviceVariable<T>)(object) deviceBuffer;
+			return (CudaDeviceVariable<T>)(object)deviceBuffer;
 		}

 		/// <inheritdoc />
@@ -475,7 +483,7 @@
 			a = a.DeepCopy();
 			CudaSigmaDiffDataBuffer<float> aData = _InternalInternalise(a);

-			int len = (int) aData.Length;
+			int len = (int)aData.Length;

 			// TODO optimise using kernel for (matrix - scalar) operation
 			// unlike openblas, cublas does not support zero-stride vectors (the scalar b), so we will have to write our own kernel
@@ -483,7 +491,7 @@
 			{
 				for (int i = 0; i < len; i++)
 				{
-					aref[i] = aref[i] - b;
+					aref[i] = aref[i] - b;
 				}
 			}

@@ -494,7 +502,7 @@
 		public override unsafe ShapedDataBufferView<float> Sub_S_M(float other, ShapedDataBufferView<float> a)
 		{
 			int len = a.Length;
-			ShapedDataBufferView<float> result = new ShapedDataBufferView<float>(CreateDataBuffer(CreateUninitialisedArray(len)), (long[]) a.Shape.Clone());
+			ShapedDataBufferView<float> result = new ShapedDataBufferView<float>(CreateDataBuffer(CreateUninitialisedArray(len)), (long[])a.Shape.Clone());
 			float[] aData = a.DataBuffer.Data, resData = result.DataBuffer.Data;
 			int aOffset = a.DataBuffer.Offset, resOffset = result.DataBuffer.Offset;

@@ -526,7 +534,7 @@
 			float alpha = 1.0f, beta = 0.0f;
 			int m = a.Rows, n = b.Cols, k = b.Rows;

-			CudaBlasHandle.Gemm(Operation.NonTranspose, Operation.NonTranspose, n, m, k, alpha, bData.GetContextBuffer(), n,
+			CudaBlasHandle.Gemm(Operation.NonTranspose, Operation.NonTranspose, n, m, k, alpha, bData.GetContextBuffer(), n,
 				aData.GetContextBuffer(), k, beta, zData.GetContextBuffer(), n);

 			zData.FlagDeviceModified();
@@ -572,7 +580,7 @@
 			}

 			int len = Math.Min(a.Length, b.Length);
-			ShapedDataBufferView<float> result = new ShapedDataBufferView<float>(CreateDataBuffer(CreateUninitialisedArray(len)), (long[]) b.Shape.Clone());
+			ShapedDataBufferView<float> result = new ShapedDataBufferView<float>(CreateDataBuffer(CreateUninitialisedArray(len)), (long[])b.Shape.Clone());

 			float[] aData = a.DataBuffer.Data, bData = b.DataBuffer.Data, resData = result.DataBuffer.Data;
 			int aOffset = a.DataBuffer.Offset, bOffset = b.DataBuffer.Offset, resOffset = result.DataBuffer.Offset;


Synchrophasor: Added success and failure messages to the Configuration Setup Utility progress screen.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openpdc/Synchrophasor/Current Version;C58836

--- Source/Tools/ConfigurationSetupUtility/Screens/SetupInProgressScreen.xaml.cs
+++ Source/Tools/ConfigurationSetupUtility/Screens/SetupInProgressScreen.xaml.cs
@@ -832,6 +832,7 @@
         // Allows the user to proceed to the next screen if the setup succeeded.
         private void OnSetupSucceeded()
         {
+            AppendStatusMessage("Operation succeeded. Click next to continue.");
             UpdateProgressBar(100);
             CanGoForward = true;
         }
@@ -839,6 +840,7 @@
         // Allows the user to go back to previous screens or cancel the setup if it failed.
         private void OnSetupFailed()
         {
+            AppendStatusMessage("Operation failed. Click the back button to try again.");
             UpdateProgressBar(0);
             m_canGoBack = true;
             CanCancel = true;


calculation of grid width and rounding

calculation of grid width and rounding

--- TerrificNet.ViewEngine/ViewEngines/TemplateHandler/Grid/GridHelperHandler.cs
+++ TerrificNet.ViewEngine/ViewEngines/TemplateHandler/Grid/GridHelperHandler.cs
@@ -28,7 +28,7 @@
 			double margin = GetValue(parameters, "margin", 0);
 			double padding = GetValue(parameters, "padding", 0);

-			gridStack.Push((gridStack.CurrentWidth - padding - margin) * ratio);
+			gridStack.Push((int)(((gridStack.CurrentWidth - margin) * ratio) - padding));
 		}

 		private static double GetValue(IDictionary<string, string> parameters, string key, double defaultValue)


9814: set default script lang

9814: set default script lang

--- a_mini/projects/PixelFarm/Typography/Typography.TextServices/TextServices.cs
+++ a_mini/projects/PixelFarm/Typography/Typography.TextServices/TextServices.cs
@@ -55,10 +55,13 @@
                  currentCulture.ThreeLetterISOLanguageName,
                  out langFullName))
             {
+                scLang = Typography.OpenFont.ScriptLangs.GetRegisteredScriptLangFromLanguageName(langFullName);
                 SetDefaultScriptLang(scLang);
-                SetCurrentScriptLang(Typography.OpenFont.ScriptLangs.GetRegisteredScriptLangFromLanguageName(langFullName));
+                SetCurrentScriptLang(scLang);
                 return true;
             }
+
+            throw new System.NotSupportedException();
             return false;
         }
         public void SetDefaultScriptLang(ScriptLang scLang)


Fixed log commands part 2

Fixed log commands part 2

--- src/NadekoBot/Modules/Administration/Commands/LogCommand.cs
+++ src/NadekoBot/Modules/Administration/Commands/LogCommand.cs
@@ -732,7 +732,7 @@
             [OwnerOnly]
             public async Task LogServer(PermissionAction action)
             {
-                var channel = (ITextChannel)msg.Channel;
+                var channel = (ITextChannel)Context.Channel;
                 LogSetting logSetting;
                 using (var uow = DbHandler.UnitOfWork())
                 {
@@ -767,7 +767,7 @@
             [OwnerOnly]
             public async Task LogIgnore()
             {
-                var channel = (ITextChannel)imsg.Channel;
+                var channel = (ITextChannel)Context.Channel;
                 int removed;
                 using (var uow = DbHandler.UnitOfWork())
                 {
@@ -796,7 +796,7 @@
             [OwnerOnly]
             public async Task LogEvents()
             {
-                await imsg.Channel.SendConfirmAsync("Log events you can subscribe to:", String.Join(", ", Enum.GetNames(typeof(LogType)).Cast<string>()));
+                await Context.Channel.SendConfirmAsync("Log events you can subscribe to:", String.Join(", ", Enum.GetNames(typeof(LogType)).Cast<string>()));
             }

             [NadekoCommand, Usage, Description, Aliases]
@@ -805,7 +805,7 @@
             [OwnerOnly]
             public async Task Log(LogType type)
             {
-                var channel = (ITextChannel)imsg.Channel;
+                var channel = (ITextChannel)Context.Channel;
                 ulong? channelId = null;
                 using (var uow = DbHandler.UnitOfWork())
                 {


Update Print.cshtml

Update Print.cshtml

--- CodeComb.Web/Views/Contest/Print.cshtml
+++ CodeComb.Web/Views/Contest/Print.cshtml
@@ -13,7 +13,7 @@
                     @if (Model.Format != ContestFormat.OI && DateTime.Now >= Model.Begin || IsMaster)
                     {

-
+

                     }
                     @if (DateTime.Now >= Model.Begin)
@@ -53,4 +53,4 @@

-
+