Updated to support QuerySingle() calls which return a null-valued-result, e.g. default(Guid?)- it now returns a reader with one row containing a null, as Dapper actually would

--- Dapper.MoqTests/MockDatabase.cs
+++ Dapper.MoqTests/MockDatabase.cs
@@ -58,9 +58,32 @@
             var result = method.Invoke(this, parametersArray);
             var reader = result as IDataReader;
             if (result == null)
+            {
+                if (method.Name == nameof(QuerySingle))
+                    return GetQuerySingleDataReader(command, method.GetGenericArguments()[0]);
+
                 return GetEmptyDataReader(command);
+            }

             return reader ?? result.GetDataReader();
+        }
+
+        private IDataReader GetQuerySingleDataReader(IDbCommand command, Type rowType)
+        {
+            if (Nullable.GetUnderlyingType(rowType) != null)
+                rowType = typeof(object); //because DataTable doesn't support Nullable<T> as a column-type
+
+            var dataTable = new DataTable
+            {
+                Columns =
+                {
+                    { "Column0", rowType }
+                }
+            };
+
+            dataTable.Rows.Add((object)null);
+
+            return new DataTableReader(dataTable);
         }

         private DataTableReader GetEmptyDataReader(IDbCommand command)


Several more unit tests

Several more unit tests

--- Xamarin.InAppPurchasing.Tests/iOSTests.cs
+++ Xamarin.InAppPurchasing.Tests/iOSTests.cs
@@ -1,8 +1,6 @@
 using System;
 using System.Net.Http;
-using System.Net.Http.Headers;
 using System.Threading.Tasks;
-using Newtonsoft.Json;
 using NUnit.Framework;

 namespace Xamarin.InAppPurchasing.Tests
@@ -30,5 +28,52 @@
             var response = await httpClient.PostAsync(Url, content);
             response.EnsureSuccessStatusCode();
         }
+
+        [Test, ExpectedException(typeof(HttpRequestException))]
+        public async Task VerifyAppleBadData()
+        {
+            await _client.Verify(new AppleReceipt
+            {
+                BundleId = "com.hitcents.nbalife",
+                Id = "com.hitcents.nbalife.pack1",
+                TransactionId = "woot",
+                Data = Guid.NewGuid().ToByteArray(),
+            });
+        }
+
+        [Test, ExpectedException(typeof(HttpRequestException))]
+        public async Task VerifyAppleWrongId()
+        {
+            await _client.Verify(new AppleReceipt
+            {
+                BundleId = "com.hitcents.nbalife",
+                Id = "com.somethingwrong.pack1",
+                TransactionId = "1000000257392859",
+                Data = Convert.FromBase64String(AppleReceipt),
+            });
+        }
+
+        [Test, ExpectedException(typeof(HttpRequestException))]
+        public async Task VerifyAppleBadTransactionId()
+        {
+            await _client.Verify(new AppleReceipt
+            {
+                Id = "com.hitcents.nbalife.pack1",
+                TransactionId = "wrong",
+                Data = Convert.FromBase64String(AppleReceipt),
+            });
+        }
+
+        [Test, ExpectedException(typeof(HttpRequestException))]
+        public async Task VerifyAppleWrongBundleId()
+        {
+            await _client.Verify(new AppleReceipt
+            {
+                Id = "com.hitcents.nbalife.pack1",
+                BundleId = "com.somethingwrong",
+                TransactionId = "1000000257392859",
+                Data = Convert.FromBase64String(AppleReceipt),
+            });
+        }
     }
 }


Escaping undescore in notebook tab label.

--- Xwt.Gtk/Xwt.GtkBackend/NotebookBackend.cs
+++ Xwt.Gtk/Xwt.GtkBackend/NotebookBackend.cs
@@ -112,9 +112,22 @@
 		Gtk.Widget CreateLabel(NotebookTab tab)
 		{
 			var vbox = new Gtk.HBox();
+			Gtk.Label label = new Gtk.Label ();

-			Gtk.Label label = new Gtk.Label(tab.Label);
-			label.Show();
+            /* INTRODUCED BY houen */
+
+            if (tab.Label.Contains("\\_"))
+            {
+                label.Text = tab.Label.Replace("\\_", "_");
+            }
+            else
+            {
+                label.TextWithMnemonic = tab.Label.Replace("\\_", "_");
+            }
+
+            /* INTRODUCED BY houen */
+
+			label.Show ();
 			vbox.PackStart(label);

 			if(!label.Text.StartsWith(char.ConvertFromUtf32(0x200B)))


Check selected date between Min Max on properties change in WPF CalendarBackend

--- Xwt.WPF/Xwt.WPFBackend/CalendarBackend.cs
+++ Xwt.WPF/Xwt.WPFBackend/CalendarBackend.cs
@@ -81,18 +81,24 @@

 		public DateTime MinDate {
 			get {
-				return Widget.DisplayDateStart;
+				return Widget.DisplayDateStart ?? DateTime.MinValue;
 			}
 			set {
+				if (Widget.SelectedDate < value) {
+					Widget.SelectedDate = value;
+				}
 				Widget.DisplayDateStart = value;
 			}
 		}

 		public DateTime MaxDate {
 			get {
-				return Widget.DisplayDateEnd;
+				return Widget.DisplayDateEnd ?? DateTime.MaxValue;
 			}
 			set {
+				if (Widget.SelectedDate > value) {
+					Widget.SelectedDate = value;
+				}
 				Widget.DisplayDateEnd = value;
 			}
 		}


Avoid performing size updates when not running windowed

--- osu.Framework/Platform/SDL2DesktopWindow.cs
+++ osu.Framework/Platform/SDL2DesktopWindow.cs
@@ -887,7 +887,8 @@

                 case SDL.SDL_WindowEventID.SDL_WINDOWEVENT_RESIZED:
                 case SDL.SDL_WindowEventID.SDL_WINDOWEVENT_SIZE_CHANGED:
-                    updateWindowSize();
+                    if (windowState == WindowState.Normal)
+                        updateWindowSize();
                     break;

                 case SDL.SDL_WindowEventID.SDL_WINDOWEVENT_MINIMIZED:


Remove assertion of `ScoreInfo.Combo` being database persisted

--- osu.Game.Tests/Scores/IO/ImportScoreTest.cs
+++ osu.Game.Tests/Scores/IO/ImportScoreTest.cs
@@ -50,7 +50,6 @@
                     Assert.AreEqual(toImport.TotalScore, imported.TotalScore);
                     Assert.AreEqual(toImport.Accuracy, imported.Accuracy);
                     Assert.AreEqual(toImport.MaxCombo, imported.MaxCombo);
-                    Assert.AreEqual(toImport.Combo, imported.Combo);
                     Assert.AreEqual(toImport.User.Username, imported.User.Username);
                     Assert.AreEqual(toImport.Date, imported.Date);
                     Assert.AreEqual(toImport.OnlineID, imported.OnlineID);


Introduce migrations for drawings

Introduce migrations for drawings

--- osu.Game.Tournament/IO/TournamentStorage.cs
+++ osu.Game.Tournament/IO/TournamentStorage.cs
@@ -54,8 +54,21 @@
             {
                 Logger.Log("Migrating bracket to default tournament storage.");
                 var bracketFile = new System.IO.FileInfo(host.Storage.GetFullPath("bracket.json"));
-                attemptOperation(() => bracketFile.CopyTo(Path.Combine(destination.FullName, bracketFile.Name), true));
-                bracketFile.Delete();
+                moveFile(bracketFile, destination);
+            }
+
+            if (host.Storage.Exists("drawings.txt"))
+            {
+                Logger.Log("Migrating drawings to default tournament storage.");
+                var drawingsFile = new System.IO.FileInfo(host.Storage.GetFullPath("drawings.txt"));
+                moveFile(drawingsFile, destination);
+            }
+
+            if (host.Storage.Exists("drawings_results.txt"))
+            {
+                Logger.Log("Migrating drawings results to default tournament storage.");
+                var drawingsResultsFile = new System.IO.FileInfo(host.Storage.GetFullPath("drawings_results.txt"));
+                moveFile(drawingsResultsFile, destination);
             }

             if (source.Exists)
@@ -97,6 +110,12 @@
                 attemptOperation(target.Delete);
         }

+        private void moveFile(System.IO.FileInfo file, DirectoryInfo destination)
+        {
+            attemptOperation(() => file.CopyTo(Path.Combine(destination.FullName, file.Name), true));
+            file.Delete();
+        }
+
         private void attemptOperation(Action action, int attempts = 10)
         {
             while (true)


Add missing entries to `switch` statement and guard against out of range

--- osu.Game/Online/Leaderboards/Leaderboard.cs
+++ osu.Game/Online/Leaderboards/Leaderboard.cs
@@ -278,10 +278,18 @@
                         replacePlaceholder(new MessagePlaceholder(@"Please invest in an osu!supporter tag to view this leaderboard!"));
                         break;

-                    default:
+                    case PlaceholderState.Retrieving:
+                        Debug.Assert(scores?.Any() != true);
+                        replacePlaceholder(null);
+                        break;
+
+                    case PlaceholderState.Successful:
                         Debug.Assert(scores?.Any() == true);
                         replacePlaceholder(null);
                         break;
+
+                    default:
+                        throw new ArgumentOutOfRangeException();
                 }
             }
         }


Give HitObjectComposer a SelectionLayer

Give HitObjectComposer a SelectionLayer

--- osu.Game/Rulesets/Edit/HitObjectComposer.cs
+++ osu.Game/Rulesets/Edit/HitObjectComposer.cs
@@ -12,6 +12,7 @@
 using osu.Framework.Logging;
 using osu.Framework.Timing;
 using osu.Game.Beatmaps;
+using osu.Game.Rulesets.Edit.Layers.Selection;
 using osu.Game.Rulesets.Edit.Tools;
 using osu.Game.Rulesets.UI;
 using osu.Game.Screens.Edit.Screens.Compose.RadioButtons;
@@ -77,7 +78,8 @@
                                     Alpha = 0,
                                     AlwaysPresent = true,
                                 },
-                                rulesetContainer
+                                rulesetContainer,
+                                new SelectionLayer(rulesetContainer.Playfield)
                             }
                         }
                     },


[packages,Publisher] Generic files can indicate whether they are executable (relevant to OSX frameworks)

--- packages/Publisher/bam/Scripts/Collation.cs
+++ packages/Publisher/bam/Scripts/Collation.cs
@@ -318,7 +318,8 @@
         IncludeFiles<DependentModule>(
             string parameterizedFilePath,
             string subdir,
-            CollatedFile reference) where DependentModule : Bam.Core.Module, new()
+            CollatedFile reference,
+            bool isExecutable = false) where DependentModule : Bam.Core.Module, new()
         {
             var dependent = Bam.Core.Graph.Instance.FindReferencedModule<DependentModule>();
             if (null == dependent)
@@ -329,26 +330,44 @@
             var copyFileModule = this.CreateCollatedFile(reference, Bam.Core.TokenizedString.CreateVerbatim(subdir));
             copyFileModule.SourceModule = dependent;
             copyFileModule.SourcePath = dependent.CreateTokenizedString(parameterizedFilePath);
+
+            if (isExecutable)
+            {
+                if (this.IsReferenceAWindowedApp(reference))
+                {
+                    this.AddOSXChangeIDNameForBinary(copyFileModule);
+                }
+            }
         }

         public void
         IncludeFile(
             string parameterizedFilePath,
             string subdir,
-            CollatedFile reference)
-        {
-            var tokenString = this.CreateTokenizedString(parameterizedFilePath);
-            this.IncludeFile(tokenString, subdir, reference);
+            CollatedFile reference,
+            bool isExecutable = false)
+        {
+            var tokenString = Bam.Core.TokenizedString.CreateVerbatim(parameterizedFilePath);
+            this.IncludeFile(tokenString, subdir, reference, isExecutable);
         }

         public void
         IncludeFile(
             Bam.Core.TokenizedString parameterizedFilePath,
             string subdir,
-            CollatedFile reference)
+            CollatedFile reference,
+            bool isExecutable = false)
         {
             var copyFileModule = this.CreateCollatedFile(reference, Bam.Core.TokenizedString.CreateVerbatim(subdir));
             copyFileModule.SourcePath = parameterizedFilePath;
+
+            if (isExecutable)
+            {
+                if (this.IsReferenceAWindowedApp(reference))
+                {
+                    this.AddOSXChangeIDNameForBinary(copyFileModule);
+                }
+            }
         }

         public void


[packages,Python,3.5.1] _struct module is now an extension on non-Windows builds

--- packages/Python-3.5.1/bam/Scripts/Python.cs
+++ packages/Python-3.5.1/bam/Scripts/Python.cs
@@ -502,6 +502,11 @@
             var builtinModuleSource = this.CreateCSourceContainer("$(packagedir)/Modules/main.c");
             builtinModuleSource.AddFiles("$(packagedir)/Modules/getbuildinfo.c");

+            if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
+            {
+                builtinModuleSource.AddFiles("$(packagedir)/Modules/_struct.c");
+            }
+
             builtinModuleSource.AddFiles("$(packagedir)/Modules/arraymodule.c");
             builtinModuleSource.AddFiles("$(packagedir)/Modules/atexitmodule.c");
             builtinModuleSource.AddFiles("$(packagedir)/Modules/audioop.c");
@@ -548,7 +553,6 @@
             builtinModuleSource.AddFiles("$(packagedir)/Modules/_randommodule.c");
             builtinModuleSource.AddFiles("$(packagedir)/Modules/_sre.c");
             builtinModuleSource.AddFiles("$(packagedir)/Modules/_stat.c");
-            builtinModuleSource.AddFiles("$(packagedir)/Modules/_struct.c");
             builtinModuleSource.AddFiles("$(packagedir)/Modules/_threadmodule.c");
             builtinModuleSource.AddFiles("$(packagedir)/Modules/_tracemalloc.c");
             builtinModuleSource.AddFiles("$(packagedir)/Modules/_weakref.c");


Implemented a utility method for escaping commandline arguments

--- Duplicati/Library/Utility/Utility.cs
+++ Duplicati/Library/Utility/Utility.cs
@@ -1496,5 +1496,74 @@
                 }
             }
         }
+
+        /// <summary>
+        /// The regular expression matching all know non-quoted commandline characters
+        /// </summary>
+        private static readonly Regex COMMANDLINE_SAFE = new Regex(@"[A-Za-z0-9\-_/:\.]*");
+        /// <summary>
+        /// Special characters that needs to be escaped on Linux
+        /// </summary>
+        private static readonly Regex COMMANDLINE_ESCAPED_LINUX = new Regex(@"[""|$|`|\\|!]");
+
+        /// <summary>
+        /// Wraps a single argument in quotes suitable for the passing on the commandline
+        /// </summary>
+        /// <returns>The wrapped commandline element.</returns>
+        /// <param name="arg">The argument to wrap.</param>
+        /// <param name="allowEnvExpansion">A flag indicating if environment variables are allowed to be expanded</param>
+        public static string WrapCommandLineElement(string arg, bool allowEnvExpansion)
+        {
+            if (string.IsNullOrWhiteSpace(arg))
+                return arg;
+
+            if (!Library.Utility.Utility.IsClientWindows)
+            {
+                // We could consider using single quotes that prevents all expansions
+                //if (!allowEnvExpansion)
+                //    return "'" + arg.Replace("'", "\\'") + "'";
+
+                // Linux is using backslash to escape, except for !
+                arg = COMMANDLINE_ESCAPED_LINUX.Replace(arg, (match) =>
+                {
+                    if (match.Value == "!")
+                        return "\"'!'\"";
+
+                    if (match.Value == "$" && allowEnvExpansion)
+                        return match.Value;
+
+                    return "\\" + match.Value;
+                });
+            }
+            else
+            {
+                // Windows needs only needs " replaced with "",
+                // but is prone to %var% expansion when used in
+                // immediate mode (i.e. from command prompt)
+
+                // TODO: I have not found a way to avoid escaping %varname%,
+                // and sadly it expands only if the variable exists
+                // making it even rarer and harder to diagnose when
+                // it happens
+                arg = arg.Replace("\"", "\"\"");
+            }
+
+            // Check that all characters are in the safe set
+            if (COMMANDLINE_SAFE.Match(arg).Length != arg.Length)
+                return "\"" + arg + "\"";
+            else
+                return arg;
+        }
+
+        /// <summary>
+        /// Wrap a set of commandline arguments suitable for the commandline
+        /// </summary>
+        /// <returns>A commandline string.</returns>
+        /// <param name="args">The arguments to create into a commandline.</param>
+        /// <param name="allowEnvExpansion">A flag indicating if environment variables are allowed to be expanded</param>
+        public static string WrapAsCommandLine(IEnumerable<string> args, bool allowEnvExpansion = false)
+        {
+            return string.Join(" ", args.Select(x => WrapCommandLineElement(x, allowEnvExpansion)));
+        }
     }
 }


version bump

version bump

--- Dynamitey/Properties/AssemblyInfo.cs
+++ Dynamitey/Properties/AssemblyInfo.cs
@@ -26,4 +26,4 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.3")]
+[assembly: AssemblyVersion("1.0.9")]


improved usability of windlight parameter error messages

--- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
+++ OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
@@ -268,162 +268,421 @@
                 {
                     case (int)ScriptBaseClass.WL_SUN_MOON_POSITION:
                         idx++;
-                        wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx);
+                        try
+                        {
+                            wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_SUN_MOON_POSITION: arg #{0} - parameter 1 must be float", idx));
+                        }
                         break;
                     case (int)ScriptBaseClass.WL_AMBIENT:
                         idx++;
+                        try
+                        {
+                            iQ = rules.GetQuaternionItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_AMBIENT: arg #{0} - parameter 1 must be rotation", idx));
+                        }
+                        wl.ambient = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
+                        break;
+                    case (int)ScriptBaseClass.WL_BIG_WAVE_DIRECTION:
+                        idx++;
+                        try
+                        {
+                            iV = rules.GetVector3Item(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_BIG_WAVE_DIRECTION: arg #{0} - parameter 1 must be vector", idx));
+                        }
+                        wl.bigWaveDirection = new Vector2((float)iV.x, (float)iV.y);
+                        break;
+                    case (int)ScriptBaseClass.WL_BLUE_DENSITY:
+                        idx++;
+                        try
+                        {
+                            iQ = rules.GetQuaternionItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_BLUE_DENSITY: arg #{0} - parameter 1 must be rotation", idx));
+                        }
+                        wl.blueDensity = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
+                        break;
+                    case (int)ScriptBaseClass.WL_BLUR_MULTIPLIER:
+                        idx++;
+                        try
+                        {
+                            wl.blurMultiplier = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_BLUR_MULTIPLIER: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_CLOUD_COLOR:
+                        idx++;
+                        try
+                        {
+                            iQ = rules.GetQuaternionItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_COLOR: arg #{0} - parameter 1 must be rotation", idx));
+                        }
+                        wl.cloudColor = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
+                        break;
+                    case (int)ScriptBaseClass.WL_CLOUD_COVERAGE:
+                        idx++;
+                        try
+                        {
+                            wl.cloudCoverage = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_COVERAGE: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_CLOUD_DETAIL_XY_DENSITY:
+                        idx++;
+                        try
+                        {
+                            iV = rules.GetVector3Item(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_DETAIL_XY_DENSITY: arg #{0} - parameter 1 must be vector", idx));
+                        }
+                        wl.cloudDetailXYDensity = iV;
+                        break;
+                    case (int)ScriptBaseClass.WL_CLOUD_SCALE:
+                        idx++;
+                        try
+                        {
+                            wl.cloudScale = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_SCALE: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X:
+                        idx++;
+                        try
+                        {
+                            wl.cloudScrollX = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_SCROLL_X: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK:
+                        idx++;
+                        try
+                        {
+                            wl.cloudScrollXLock = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_SCROLL_Y_LOCK: arg #{0} - parameter 1 must be integer", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y:
+                        idx++;
+                        try
+                        {
+                            wl.cloudScrollY = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_SCROLL_Y: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK:
+                        idx++;
+                        try
+                        {
+                            wl.cloudScrollYLock = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_SCROLL_Y_LOCK: arg #{0} - parameter 1 must be integer", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_CLOUD_XY_DENSITY:
+                        idx++;
+                        try
+                        {
+                            iV = rules.GetVector3Item(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_CLOUD_XY_DENSITY: arg #{0} - parameter 1 must be vector", idx));
+                        }
+                        wl.cloudXYDensity = iV;
+                        break;
+                    case (int)ScriptBaseClass.WL_DENSITY_MULTIPLIER:
+                        idx++;
+                        try
+                        {
+                            wl.densityMultiplier = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_DENSITY_MULTIPLIER: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_DISTANCE_MULTIPLIER:
+                        idx++;
+                        try
+                        {
+                            wl.distanceMultiplier = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_DISTANCE_MULTIPLIER: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_DRAW_CLASSIC_CLOUDS:
+                        idx++;
+                        try
+                        {
+                            wl.drawClassicClouds = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_DRAW_CLASSIC_CLOUDS: arg #{0} - parameter 1 must be integer", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_EAST_ANGLE:
+                        idx++;
+                        try
+                        {
+                            wl.eastAngle = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_EAST_ANGLE: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_FRESNEL_OFFSET:
+                        idx++;
+                        try
+                        {
+                            wl.fresnelOffset = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_FRESNEL_OFFSET: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_FRESNEL_SCALE:
+                        idx++;
+                        try
+                        {
+                            wl.fresnelScale = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_FRESNEL_SCALE: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_HAZE_DENSITY:
+                        idx++;
+                        try
+                        {
+                            wl.hazeDensity = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_HAZE_DENSITY: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_HAZE_HORIZON:
+                        idx++;
+                        try
+                        {
+                            wl.hazeHorizon = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_HAZE_HORIZON: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_HORIZON:
+                        idx++;
+                        try
+                        {
+                            iQ = rules.GetQuaternionItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_HORIZON: arg #{0} - parameter 1 must be rotation", idx));
+                        }
+                        wl.horizon = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
+                        break;
+                    case (int)ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION:
+                        idx++;
+                        try
+                        {
+                            iV = rules.GetVector3Item(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_LITTLE_WAVE_DIRECTION: arg #{0} - parameter 1 must be vector", idx));
+                        }
+                        wl.littleWaveDirection = new Vector2((float)iV.x, (float)iV.y);
+                        break;
+                    case (int)ScriptBaseClass.WL_MAX_ALTITUDE:
+                        idx++;
+                        try
+                        {
+                            wl.maxAltitude = (ushort)rules.GetLSLIntegerItem(idx).value;
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_MAX_ALTITUDE: arg #{0} - parameter 1 must be integer", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_NORMAL_MAP_TEXTURE:
+                        idx++;
+                        try
+                        {
+                            wl.normalMapTexture = new UUID(rules.GetLSLStringItem(idx).m_string);
+                        }
+                        catch (ArgumentException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_NORMAL_MAP_TEXTURE: arg #{0} - parameter 1 must be key", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE:
+                        idx++;
+                        try
+                        {
+                            iV = rules.GetVector3Item(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_REFLECTION_WAVELET_SCALE: arg #{0} - parameter 1 must be vector", idx));
+                        }
+                        wl.reflectionWaveletScale = iV;
+                        break;
+                    case (int)ScriptBaseClass.WL_REFRACT_SCALE_ABOVE:
+                        idx++;
+                        try
+                        {
+                            wl.refractScaleAbove = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_REFRACT_SCALE_ABOVE: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_REFRACT_SCALE_BELOW:
+                        idx++;
+                        try
+                        {
+                            wl.refractScaleBelow = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_REFRACT_SCALE_BELOW: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_SCENE_GAMMA:
+                        idx++;
+                        try
+                        {
+                            wl.sceneGamma = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_SCENE_GAMMA: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_STAR_BRIGHTNESS:
+                        idx++;
+                        try
+                        {
+                            wl.starBrightness = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_STAR_BRIGHTNESS: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_SUN_GLOW_FOCUS:
+                        idx++;
+                        try
+                        {
+                            wl.sunGlowFocus = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_SUN_GLOW_FOCUS: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_SUN_GLOW_SIZE:
+                        idx++;
+                        try
+                        {
+                            wl.sunGlowSize = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_SUN_GLOW_SIZE: arg #{0} - parameter 1 must be float", idx));
+                        }
+                        break;
+                    case (int)ScriptBaseClass.WL_SUN_MOON_COLOR:
+                        idx++;
                         iQ = rules.GetQuaternionItem(idx);
-                        wl.ambient = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
-                        break;
-                    case (int)ScriptBaseClass.WL_BIG_WAVE_DIRECTION:
-                        idx++;
-                        iV = rules.GetVector3Item(idx);
-                        wl.bigWaveDirection = new Vector2((float)iV.x, (float)iV.y);
-                        break;
-                    case (int)ScriptBaseClass.WL_BLUE_DENSITY:
-                        idx++;
-                        iQ = rules.GetQuaternionItem(idx);
-                        wl.blueDensity = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
-                        break;
-                    case (int)ScriptBaseClass.WL_BLUR_MULTIPLIER:
-                        idx++;
-                        wl.blurMultiplier = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_COLOR:
-                        idx++;
-                        iQ = rules.GetQuaternionItem(idx);
-                        wl.cloudColor = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_COVERAGE:
-                        idx++;
-                        wl.cloudCoverage = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_DETAIL_XY_DENSITY:
-                        idx++;
-                        iV = rules.GetVector3Item(idx);
-                        wl.cloudDetailXYDensity = iV;
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCALE:
-                        idx++;
-                        wl.cloudScale = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X:
-                        idx++;
-                        wl.cloudScrollX = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_X_LOCK:
-                        idx++;
-                        wl.cloudScrollXLock = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y:
-                        idx++;
-                        wl.cloudScrollY = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_SCROLL_Y_LOCK:
-                        idx++;
-                        wl.cloudScrollYLock = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
-                        break;
-                    case (int)ScriptBaseClass.WL_CLOUD_XY_DENSITY:
-                        idx++;
-                        iV = rules.GetVector3Item(idx);
-                        wl.cloudXYDensity = iV;
-                        break;
-                    case (int)ScriptBaseClass.WL_DENSITY_MULTIPLIER:
-                        idx++;
-                        wl.densityMultiplier = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_DISTANCE_MULTIPLIER:
-                        idx++;
-                        wl.distanceMultiplier = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_DRAW_CLASSIC_CLOUDS:
-                        idx++;
-                        wl.drawClassicClouds = rules.GetLSLIntegerItem(idx).value == 1 ? true : false;
-                        break;
-                    case (int)ScriptBaseClass.WL_EAST_ANGLE:
-                        idx++;
-                        wl.eastAngle = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_FRESNEL_OFFSET:
-                        idx++;
-                        wl.fresnelOffset = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_FRESNEL_SCALE:
-                        idx++;
-                        wl.fresnelScale = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_HAZE_DENSITY:
-                        idx++;
-                        wl.hazeDensity = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_HAZE_HORIZON:
-                        idx++;
-                        wl.hazeHorizon = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_HORIZON:
-                        idx++;
-                        iQ = rules.GetQuaternionItem(idx);
-                        wl.horizon = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
-                        break;
-                    case (int)ScriptBaseClass.WL_LITTLE_WAVE_DIRECTION:
-                        idx++;
-                        iV = rules.GetVector3Item(idx);
-                        wl.littleWaveDirection = new Vector2((float)iV.x, (float)iV.y);
-                        break;
-                    case (int)ScriptBaseClass.WL_MAX_ALTITUDE:
-                        idx++;
-                        wl.maxAltitude = (ushort)rules.GetLSLIntegerItem(idx).value;
-                        break;
-                    case (int)ScriptBaseClass.WL_NORMAL_MAP_TEXTURE:
-                        idx++;
-                        wl.normalMapTexture = new UUID(rules.GetLSLStringItem(idx).m_string);
-                        break;
-                    case (int)ScriptBaseClass.WL_REFLECTION_WAVELET_SCALE:
-                        idx++;
-                        iV = rules.GetVector3Item(idx);
-                        wl.reflectionWaveletScale = iV;
-                        break;
-                    case (int)ScriptBaseClass.WL_REFRACT_SCALE_ABOVE:
-                        idx++;
-                        wl.refractScaleAbove = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_REFRACT_SCALE_BELOW:
-                        idx++;
-                        wl.refractScaleBelow = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_SCENE_GAMMA:
-                        idx++;
-                        wl.sceneGamma = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_STAR_BRIGHTNESS:
-                        idx++;
-                        wl.starBrightness = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_SUN_GLOW_FOCUS:
-                        idx++;
-                        wl.sunGlowFocus = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_SUN_GLOW_SIZE:
-                        idx++;
-                        wl.sunGlowSize = (float)rules.GetLSLFloatItem(idx);
-                        break;
-                    case (int)ScriptBaseClass.WL_SUN_MOON_COLOR:
-                        idx++;
-                        iQ = rules.GetQuaternionItem(idx);
-                        wl.sunMoonColor = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
+                        try
+                        {
+                            wl.sunMoonColor = new Vector4((float)iQ.x, (float)iQ.y, (float)iQ.z, (float)iQ.s);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_SUN_MOON_COLOR: arg #{0} - parameter 1 must be rotation", idx));
+                        }
                         break;
                     case (int)ScriptBaseClass.WL_UNDERWATER_FOG_MODIFIER:
                         idx++;
-                        wl.underwaterFogModifier = (float)rules.GetLSLFloatItem(idx);
+                        try
+                        {
+                            wl.underwaterFogModifier = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_UNDERWATER_FOG_MODIFIER: arg #{0} - parameter 1 must be float", idx));
+                        }
                         break;
                     case (int)ScriptBaseClass.WL_WATER_COLOR:
                         idx++;
-                        iV = rules.GetVector3Item(idx);
+                        try
+                        {
+                            iV = rules.GetVector3Item(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_WATER_COLOR: arg #{0} - parameter 1 must be vector", idx));
+                        }
                         wl.waterColor = iV;
                         break;
                     case (int)ScriptBaseClass.WL_WATER_FOG_DENSITY_EXPONENT:
                         idx++;
-                        wl.waterFogDensityExponent = (float)rules.GetLSLFloatItem(idx);
+                        try
+                        {
+                            wl.waterFogDensityExponent = (float)rules.GetLSLFloatItem(idx);
+                        }
+                        catch (InvalidCastException)
+                        {
+                            throw new InvalidCastException(string.Format("Error running rule WL_WATER_FOG_DENSITY_EXPONENT: arg #{0} - parameter 1 must be float", idx));
+                        }
                         break;
                 }
                 idx++;
@@ -457,7 +716,16 @@

                 if (LightShareModule.EnableWindlight)
                 {
-                    RegionLightShareData wl = getWindlightProfileFromRules(rules);
+                    RegionLightShareData wl;
+                    try
+                    {
+                        wl = getWindlightProfileFromRules(rules);
+                    }
+                    catch(InvalidCastException e)
+                    {
+                        LSShoutError(e.Message);
+                        return 0;
+                    }
                     wl.valid = true;
                     m_host.ParentGroup.Scene.StoreWindlightProfile(wl);
                     success = 1;
@@ -522,7 +790,16 @@

                 if (LightShareModule.EnableWindlight)
                 {
-                    RegionLightShareData wl = getWindlightProfileFromRules(rules);
+                    RegionLightShareData wl;
+                    try
+                    {
+                        wl = getWindlightProfileFromRules(rules);
+                    }
+                    catch(InvalidCastException e)
+                    {
+                        LSShoutError(e.Message);
+                        return 0;
+                    }
                     World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string));
                     success = 1;
                 }


Revert "reintroduced the check for temporary assets to prevent them being stored permanently"

This reverts commit bc145cd5aac9894fc671bb357d574b5a2e7c5d91.

--- OpenSim/Services/ScatteredAssetService/ScatteredAssetService.cs
+++ OpenSim/Services/ScatteredAssetService/ScatteredAssetService.cs
@@ -206,11 +206,11 @@

             m_log.DebugFormat("[SCATTERED ASSET SERVICE] ENTRY Store <{0}>", asset.ID);

-            if(asset.Temporary)
-            {
-				m_log.DebugFormat("[SCATTERED ASSET SERVICE] EXIT <{0}> is temporary, not stored anywhere", asset.ID);
-                return asset.ID;
-            }
+            //if(asset.Temporary)
+            //{
+			//	m_log.DebugFormat("[SCATTERED ASSET SERVICE] EXIT <{0}> is temporary, not stored anywhere", asset.ID);
+            //    return asset.ID;
+            //}

             // If the local data base exists, and the ID is
             // a valid UUID. Look to see if the asset


#1174 Don't paste object inside itself

#1174 Don't paste object inside itself

--- EditorController/EditorController.cs
+++ EditorController/EditorController.cs
@@ -1824,6 +1824,13 @@

                 if (e.ElemType == ElementType.Walkthrough || (e.ElemType == ElementType.Object && e.Type == ObjectType.Object))
                 {
+                    // But don't paste a copy of an object inside itself
+
+                    if (m_clipboardElements.Any(clipboardElement => clipboardElement == e))
+                    {
+                        return e.Parent;
+                    }
+
                     return e;
                 }
                 return null;


added comments

added comments

--- Examples/EndOfProcessTime/Program.cs
+++ Examples/EndOfProcessTime/Program.cs
@@ -6,6 +6,7 @@

 namespace EndOfProcessTime
 {
+    // Demonstrating the process time limit usage
     class Program
     {
         static System.Threading.ManualResetEvent finishEvent = new System.Threading.ManualResetEvent(false);
@@ -35,6 +36,11 @@
             }
         }

+        /// <summary>
+        /// The event handler for the OnEndOfProcessTime event
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="args"></param>
         static void Events_OnEndOfProcessTime(object sender, EndOfProcessTimeEventArgs args)
         {
             Console.WriteLine("Process {0} has reached its time limit", args.Win32Name);


Versioning home page - features

Versioning home page - features

--- WebSite/Views/Home/Index.cshtml
+++ WebSite/Views/Home/Index.cshtml
@@ -2,19 +2,42 @@
 @using WebSite.App_Code

 @{
-    ViewBag.Title = "JSNLog - Better JavaScript Logging";
+    ViewBag.Title = "Better JavaScript Logging";
     Layout = "~/Views/Shared/_Layout.cshtml";
 }

 @section Hero {

+@if (PageVersions.CurrentVersion() == "NetJs")
+{

Client side logging integrated with ASP.NET and MVC

+
+
             JSNLog lets you insert loggers in your client side JavaScript,
             configure them in your web.config, and store their messages
             in your server side logs - without any server side coding.

+}
+@if (PageVersions.CurrentVersion() == "JsOnly")
+{
+
JavaScript logging redone

+

+                small
+                simple
+                efficient - reduce bandwidth
+                easy to integrate with server
+                easy to use
+                well documented
+
+
+
+            JSNLog lets you insert loggers in your client side JavaScript,
+            configure them in your web.config, and store their messages
+            in your server side logs - without any server side coding.
+

+}

         @Html.Raw(Html.Partial("Partials/_DownloadButton").ToHtmlString())
@@ -31,6 +54,8 @@

+@if (PageVersions.CurrentVersion() == "NetJs")
+{
     @Feature(
         "",
         @"Works with your server side loggers",
@@ -45,35 +70,78 @@
 Supports Log4Net, NLog, Elmah, Common.Logging.

")
+}

         @Feature(
             "",
             @"Insert loggers in your JavaScript",
             @"
JL(""jsLogger"").fatal(""log message"");
")

+@if (PageVersions.CurrentVersion() == "NetJs")
+{
     @Feature(
         "",
         @"Configure loggers in your web.config",
         @"
<logger name=""jslogger"" level=""FATAL"" />

 ")
-
+}
+
+@if (PageVersions.CurrentVersion() == "NetJs")
+{
     @Feature(
         "",
         @"Or configure them in your JavaScript code",
         @"
JL(""jsLogger"").setOptions({ ""level"": 4000 });

 ")
-
+}
+@if (PageVersions.CurrentVersion() == "JsOnly")
+{
+    @Feature(
+        "",
+        @"Configure loggers in your JavaScript code",
+        @"
JL(""jsLogger"").setOptions({ ""level"": 4000 });

+")
+}
+
+@*===========================================================*@
+
+@if (PageVersions.CurrentVersion() == "NetJs")
+{
     @Feature(
         "",
         @"Reduce AJAX requests by batching log messages",
         @"
<ajaxAppender name=""appender1"" batchSize=""3""/>

 ")
-
+}
+@if (PageVersions.CurrentVersion() == "JsOnly")
+{
+    @Feature(
+        "",
+        @"Reduce AJAX requests by batching log messages",
+        @"
appender.setOptions({ ""batchSize"": 3 });

+")
+}
+
+@*===========================================================*@
+
+@if (PageVersions.CurrentVersion() == "NetJs")
+{
     @Feature(
         "",
         @"Only log for certain user agents or IP addresses",
         @"
<logger userAgentRegex="MSIE 7|MSIE 8" />

 ")
+}
+@if (PageVersions.CurrentVersion() == "JsOnly")
+{
+    @Feature(
+        "",
+        @"Configure loggers in your JavaScript code",
+        @"
JL().setOptions({ ""userAgentRegex"": ""MSIE 7|MSIE 8"" });

+")
+}
+
+@*===========================================================*@

     @Feature(
         "",
@@ -93,15 +161,28 @@
 });

 ")

+@if (PageVersions.CurrentVersion() == "NetJs")
+{
     @Feature(
         "",
         @"Suppress messages that match a regular expression",
         @"
<logger disallow=""suppress me"" />

 ")
+}
+@if (PageVersions.CurrentVersion() == "JsOnly")
+{
+    @Feature(
+        "",
+        @"Suppress messages that match a regular expression",
+        @"
JL(""jsLogger"").setOptions({ ""disallow"": ""suppress me"" });

+")
+}

+@if (PageVersions.CurrentVersion() == "NetJs")
+{
     @Feature(
         "",
         @"Store client side log messages in your server side logs",
@@ -114,6 +195,7 @@

...

 ")
+}

     @Feature(
         "",


Better format

Better format

--- RDFSharp/Semantics/OWL/Validator/RDFOntologyValidatorRuleset.cs
+++ RDFSharp/Semantics/OWL/Validator/RDFOntologyValidatorRuleset.cs
@@ -772,8 +772,7 @@
             {

                 #region Domain VS Range
-                if (((RDFOntologyObjectProperty)invOf.TaxonomySubject).Domain != null &&
-                    ((RDFOntologyObjectProperty)invOf.TaxonomyObject).Range != null)
+                if (((RDFOntologyObjectProperty)invOf.TaxonomySubject).Domain != null && ((RDFOntologyObjectProperty)invOf.TaxonomyObject).Range != null)
                 {
                     if (!ontology.Model.ClassModel.CheckIsRangeOf(((RDFOntologyObjectProperty)invOf.TaxonomySubject).Domain, (RDFOntologyObjectProperty)invOf.TaxonomyObject))
                     {
@@ -788,8 +787,7 @@
                 #endregion

                 #region Range VS Domain
-                if (((RDFOntologyObjectProperty)invOf.TaxonomySubject).Range != null &&
-                    ((RDFOntologyObjectProperty)invOf.TaxonomyObject).Domain != null)
+                if (((RDFOntologyObjectProperty)invOf.TaxonomySubject).Range != null && ((RDFOntologyObjectProperty)invOf.TaxonomyObject).Domain != null)
                 {
                     if (!ontology.Model.ClassModel.CheckIsDomainOf(((RDFOntologyObjectProperty)invOf.TaxonomySubject).Range, (RDFOntologyObjectProperty)invOf.TaxonomyObject))
                     {


Fix failing tests (#1288)

Fix failing tests (#1288)

--- test/IIS.FunctionalTests/Inprocess/StdOutRedirectionTests.cs
+++ test/IIS.FunctionalTests/Inprocess/StdOutRedirectionTests.cs
@@ -81,6 +81,7 @@
         }

         [ConditionalFact]
+        [RequiresIIS(IISCapability.PoolEnvironmentVariables)]
         [SkipIfDebug]
         public async Task EnableCoreHostTraceLogging_TwoLogFilesCreated()
         {
@@ -108,6 +109,7 @@
         }

         [ConditionalTheory]
+        [RequiresIIS(IISCapability.PoolEnvironmentVariables)]
         [SkipIfDebug]
         [InlineData("CheckLargeStdErrWrites")]
         [InlineData("CheckLargeStdOutWrites")]
@@ -131,6 +133,7 @@
         }

         [ConditionalTheory]
+        [RequiresIIS(IISCapability.PoolEnvironmentVariables)]
         [SkipIfDebug]
         [InlineData("CheckLargeStdErrWrites")]
         [InlineData("CheckLargeStdOutWrites")]


Fixed a lot of predictor stuff to work with the new dynamic input / output system.

--- SharpGenetics/SharpGenetics/Predictor/NeuralNetworkPredictor.cs
+++ SharpGenetics/SharpGenetics/Predictor/NeuralNetworkPredictor.cs
@@ -139,31 +139,41 @@

         public NeuralNetworkPredictor(RunParameters Parameters, int RandomSeed)
         {
-            int InputLayerSize = 0;
             MinVal.Clear();
             MaxVal.Clear();
-            MinOutputVal.Clear(); //TODO make these dynamic based on first few generations
+            MinOutputVal.Clear();
             MaxOutputVal.Clear();
-            foreach(var P in Parameters.JsonParams.parameters)
-            {
-                if(P.enabled.Value)
+
+            int OutputLayerSize = 0;
+            foreach(var E in Parameters.JsonParams.evaluators)
+            {
+                if(E.enabled.Value)
+                {
+                    OutputLayerSize++;
+                    MinOutputVal.Add(0);
+                    MaxOutputVal.Add(0);
+                }
+            }
+
+            int InputLayerSize = 0;
+            foreach (var P in Parameters.JsonParams.parameters)
+            {
+                if (P.enabled.Value)
                 {
                     InputLayerSize++;
                     MinVal.Add(P.rangeMin.Value);
                     MaxVal.Add(P.rangeMax.Value);
+
+                    if(P.minimise.Value != "ignore")
+                    {
+                        OutputLayerSize++;
+                        MinOutputVal.Add(0);
+                        MaxOutputVal.Add(Math.Max(Math.Abs((double)P.rangeMin * (double)P.weight), Math.Abs((double)P.rangeMax * (double)P.weight)));
+                    }
                 }
             }
             InputLayer = InputLayerSize;

-            int OutputLayerSize = 0;
-            foreach(var E in Parameters.JsonParams.evaluators)
-            {
-                if(E.enabled.Value)
-                {
-                    OutputLayerSize++;
-                    MinOutputVal.Add(0);
-                }
-            }
             OutputLayer = OutputLayerSize;

             HiddenLayer = (int)(double)Parameters.GetParameter("extra_Predictor_HiddenLayerCount");
@@ -214,7 +224,14 @@
             //Maybe only add different inputs / outputs?
             lock (NetworkLock)
             {
+                //Add max outputs to MaxOutputVal
+                for(int i=0;i<Outputs.Count;i++)
+                {
+                    MaxOutputVal[i] = Math.Max(MaxOutputVal[i], Outputs[i]);
+                }
+
                 NetworkTrainingData.Add(new InputOutputPair(ParamsToSend, Outputs, MinVal, MinOutputVal, MaxVal, MaxOutputVal));
+
                 if (NetworkTrainingData.Count > MaxTrainingData)
                 {
                     NetworkTrainingData.RemoveAt(0);
@@ -222,7 +239,7 @@
             }
         }

-        public  List<double> Predict(List<double> Input)
+        public List<double> Predict(List<double> Input)
         {
             List<double> Result = new List<double>();
             lock (NetworkLock)
@@ -358,15 +375,15 @@
             error /= TrainingSet.Count * 4 / 5;
             error /= TrainingEpochsPerGeneration;

-            double Diff = 0;
-            double DiffOnTraining = 0;
+            List<double> Diff = new List<double>(new double[OutputLayer]);
+            List<double> DiffOnTraining = new List<double>(new double[OutputLayer]);

             foreach (var In in ValidationSet)
             {
                 var outputVal = Network.Compute(In.Inputs.ToArray());
                 for (int i = 0; i < In.Outputs.Count; i++)
                 {
-                    Diff += Math.Abs(In.Outputs[i] - outputVal[i]);
+                    Diff[i] += Math.Abs(In.Outputs[i] - outputVal[i]);
                 }
             }

@@ -375,17 +392,18 @@
                 var outputVal = Network.Compute(In.Inputs.ToArray());
                 for (int i = 0; i < In.Outputs.Count; i++)
                 {
-                    DiffOnTraining += Math.Abs(In.Outputs[i] - outputVal[i]);
-                }
-            }
-
-            DiffPerSample = Math.Max(Diff / (ValidationSet.Count * OutputLayer), DiffOnTraining / (NetworkTrainingData.Count * OutputLayer));
-
-            DiffPerSampleNotNormalised = DiffPerSample * (MaxOutputVal[0] - MinOutputVal[0]) + MinOutputVal[0]; //TODO: change to per objective
-
-            //NetworkAccuracy = 1.0d - (DiffPerSampleNotNormalised / MaxThresholdVal);
-            //NetworkAccuracy = 1.0d - (Diff / (MaxTrainingData * 3 / 5) * 10); // /300 * 20000 / 2000 (divided by 100 samples and 3 vals per sample, multiplied by maxval, divided by what I want the base error to be)
-
+                    DiffOnTraining[i] += Math.Abs(In.Outputs[i] - outputVal[i]);
+                }
+            }
+
+            DiffPerSample = Math.Max(Diff.Sum() / (ValidationSet.Count * OutputLayer), DiffOnTraining.Sum() / (NetworkTrainingData.Count * OutputLayer));
+
+            DiffPerSampleNotNormalised = 0;
+
+            for (int i = 0; i < OutputLayer; i++)
+            {
+                DiffPerSampleNotNormalised += Diff[i] * (MaxOutputVal[i] - MinOutputVal[i]) + MinOutputVal[i];
+            }
         }

         public  void AtStartOfGeneration(List<PopulationMember> Population, double PredictionAcceptanceThreshold, int Generation)


fix AutoCompleteBasic

fix AutoCompleteBasic

--- Signum.React.Extensions.Selenium/LineProxies/EntityBaseProxy.cs
+++ Signum.React.Extensions.Selenium/LineProxies/EntityBaseProxy.cs
@@ -162,7 +162,7 @@
         }
         public static void AutoCompleteBasic(IWebElement autoCompleteElement, Lite<IEntity> lite)
         {
-            autoCompleteElement.SafeSendKeys(lite.Id.ToString());
+            autoCompleteElement.SafeSendKeys("id:" + lite.Id.ToString());
             //Selenium.FireEvent(autoCompleteLocator, "keyup");

             var listLocator = By.CssSelector(".typeahead.dropdown-menu");


Don't crash if web site is not available.

--- Source/TimesheetParser.Business/ViewModel/CrmPluginViewModel.cs
+++ Source/TimesheetParser.Business/ViewModel/CrmPluginViewModel.cs
@@ -1,9 +1,12 @@
-using System.Threading.Tasks;
+using System.Diagnostics;
+using System.Threading.Tasks;
 using System.Windows.Input;
 using GalaSoft.MvvmLight;
 using GalaSoft.MvvmLight.Command;
 using Heavysoft.TimesheetParser.PluginInterfaces;
 using TimesheetParser.Business.Services;
+using System;
+using System.Net.Http;

 namespace TimesheetParser.Business.ViewModel
 {
@@ -73,6 +76,20 @@
                         passwordService.DeleteCredential();
                     }
                 }
+                catch (AggregateException ae)
+                {
+                    foreach (var e in ae.InnerExceptions)
+                    {
+                        if (e is HttpRequestException)
+                        {
+                            IsConnected = false;
+                        }
+                        else
+                        {
+                            throw e;
+                        }
+                    }
+                }
                 finally
                 {
                     IsBusy = false;


refactor: makes tests related to 'property' of IdiomaticMembers more

robust.

--- test/Experiment.IdiomsUnitTest/IdiomaticMembersTest.cs
+++ test/Experiment.IdiomsUnitTest/IdiomaticMembersTest.cs
@@ -147,7 +147,7 @@

             var actual = sut.ToArray();

-            var result = actual.All(m => (GetMemberKinds(m) & MemberKinds.Property) != MemberKinds.None);
+            var result = actual.All(IsProperty);
             Assert.True(result, "Only Properties.");
         }

@@ -164,6 +164,17 @@
             Assert.True(result, "Constructor or Method.");
         }

+        [Fact]
+        public void SutEnumeratesWritablePropertiesWhenMemberKindsIsGetProperty()
+        {
+            var sut = new IdiomaticMembers(typeof(ClassWithMembers), MemberKinds.GetProperty);
+
+            var actual = sut.ToArray();
+
+            var result = actual.All(IsWritableProperty);
+            Assert.True(result, "Only Properties.");
+        }
+
         private static Accessibilities GetAccessibilities(MemberInfo member)
         {
             return member.ToReflectionElement().Accept(new AccessibilityCollector()).Value.Single();
@@ -172,6 +183,19 @@
         private static MemberKinds GetMemberKinds(MemberInfo member)
         {
             return member.ToReflectionElement().Accept(new MemberKindCollector()).Value.Single();
+        }
+
+        private static bool IsProperty(MemberInfo member)
+        {
+            return GetMemberKinds(member) == MemberKinds.GetProperty
+                || GetMemberKinds(member) == MemberKinds.SetProperty
+                || GetMemberKinds(member) == MemberKinds.Property;
+        }
+
+        private static bool IsWritableProperty(MemberInfo member)
+        {
+            return GetMemberKinds(member) == MemberKinds.GetProperty
+                || GetMemberKinds(member) == MemberKinds.Property;
         }
     }
 }


1. Fixed strings concatenations using string.Join instead of + 2. Fixed floating point values formatting in WKT

--- Terradue.GeoJson/Terradue/GeoJson/Geometry/FeatureExtensions.cs
+++ Terradue.GeoJson/Terradue/GeoJson/Geometry/FeatureExtensions.cs
@@ -21,10 +21,14 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
 using System;
-using Terradue.GeoJson.Feature;
+using Terradue.GeoJson.Feature;
+using System.Linq;
+using System.Globalization;

 namespace Terradue.GeoJson.Geometry {
-    public static class FeatureExtensions {
+    public static class FeatureExtensions {
+
+        static readonly IFormatProvider ci = CultureInfo.InvariantCulture;

         public static string ToWkt(this Terradue.GeoJson.Feature.Feature feature)
         {
@@ -108,65 +112,31 @@
         }

         static string GeometryToWktString(Point point) {
-
             return GeometryToWktString(point.Position);
-
         }

-        static string GeometryToWktString(MultiPoint multiPoint) {
-
-            string multiPointWkt = "";
-            string sep = "";
-            foreach (var polygon in multiPoint.Points) {
-                multiPointWkt += sep + GeometryToWktString(polygon);
-                sep = ",";
-            }
-
-            return multiPointWkt;
-
+        static string GeometryToWktString(MultiPoint multiPoint) {
+            return string.Join(",", multiPoint.Points.Select(GeometryToWktString));
         }

         static string GeometryToWktString(IPosition position) {

             if ( position is GeographicPosition)
-                return string.Format("{0} {1}", ((GeographicPosition)position).Longitude, ((GeographicPosition)position).Latitude);
+                return string.Format(ci, "{0} {1}", ((GeographicPosition)position).Longitude, ((GeographicPosition)position).Latitude);

             return "";
         }

-        static string GeometryToWktString(LineString lineString) {
-
-            string linestring = "";
-            string sep = "";
-            foreach (var position in lineString.Positions) {
-                linestring += sep + GeometryToWktString(position);
-                sep = ",";
-            }
-
-            return linestring;
-
+        static string GeometryToWktString(LineString lineString) {
+            return string.Join(",", lineString.Positions.Select(GeometryToWktString));
         }

-        static string GeometryToWktString(Polygon polygon) {
-
-            string polygonWkt = "";
-            foreach (var linestring in polygon.LineStrings) {
-                polygonWkt += "(" + GeometryToWktString(linestring) + ")";
-            }
-
-            return polygonWkt;
-
+        static string GeometryToWktString(Polygon polygon) {
+            return string.Join(",", polygon.LineStrings.Select(GeometryToWktString));
         }

-        static string GeometryToWktString(MultiPolygon multiPolygon) {
-
-            string multiPolygonWkt = "";
-            foreach (var polygon in multiPolygon.Polygons) {
-                multiPolygonWkt += "(" + GeometryToWktString(polygon) + ")";
-            }
-
-            return multiPolygonWkt;
-
+        static string GeometryToWktString(MultiPolygon multiPolygon) {
+            return string.Join(",", multiPolygon.Polygons.Select(GeometryToWktString));
         }
     }
 }


better desc

better desc

Signed-off-by: Emmanuel Mathot <367ff60fe70ac02365998fe620af37ff67ae3274@gmail.com>

--- Terradue.ServiceModel.Ogc.OwsContext/Properties/AssemblyInfo.cs
+++ Terradue.ServiceModel.Ogc.OwsContext/Properties/AssemblyInfo.cs
@@ -6,13 +6,15 @@

 \namespace Terradue.ServiceModel.Ogc.OwsContext
 @{
-    DotNetOgcOwsContext Software Package
+    Terradue .Net C# library implementing the OGC Ows Context Conceptual Model and Atom Representation

     \xrefitem sw_version "Versions" "Software Package Version" 1.0.6

     \xrefitem sw_link "Link" "Software Package Link" [DotNetOgcOwsContext](https://github.com/Terradue/DotNetOgcOwsContext)

     \xrefitem sw_license "License" "Software License" [GPLv3](https://github.com/Terradue/DotNetOgcOwsContext/blob/master/LICENSE)
+
+    \xrefitem sw_req "Require" "Software Dependencies" \ref Terradue.ServiceModel.Syndication

     \ingroup Model
 @}


Fixed deadlock when hitting breakpoint with VS 2017

--- src/AssemblyLoader.cs
+++ src/AssemblyLoader.cs
@@ -818,6 +818,8 @@

             var assembly = args.LoadedAssembly;
             if (assembly.GlobalAssemblyCache || assembly.IsDynamic) return;
+            var name = assembly.GetName();
+            if (name.Name.StartsWith("Microsoft.VisualStudio.Debugger")) return;

             var package = FindPackageWithFile(Path.GetFileName(assembly.Location));
             if (package != null)


Remove unneeded local variable

Remove unneeded local variable

--- Winston/Fetchers/HttpFetcher.cs
+++ Winston/Fetchers/HttpFetcher.cs
@@ -14,16 +14,15 @@
         public async Task<TempPackage> FetchAsync(Package pkg, Progress progress)
         {
             var result = new TempPackage { WorkDirectory = new TempDirectory("winston") };
-            var actualLocation = pkg.Location;
             using (var handler = new HttpClientHandler { AllowAutoRedirect = true })
             using (var client = NetUtils.HttpClient(handler))
-            using (var response = await client.GetAsync(actualLocation, HttpCompletionOption.ResponseHeadersRead))
+            using (var response = await client.GetAsync(pkg.Location, HttpCompletionOption.ResponseHeadersRead))
             {
                 result.MimeType = response.Content.Headers.ContentType?.MediaType;

                 // Try to get the right file name to give hints about the file type to the extractor
                 result.FileName = response.Content.Headers.ContentDisposition?.FileName?.Trim('\"', '\\', '\'') ??
-                                  actualLocation.LastSegment() ??
+                                  pkg.Location.LastSegment() ??
                                   pkg.Filename ??
                                   "package";


Improve history

Improve history

--- WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
+++ WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -67,7 +67,7 @@
 				if (found != default) // if found
 				{
 					txRecordList.Remove(found);
-					var newRecord = (coin.Confirmed, found.amount + coin.Amount, $"{found.label}, {coin.Label}", coin.TransactionId);
+					var newRecord = (found.confirmed, found.amount + coin.Amount, $"{found.label}, {coin.Label}", coin.TransactionId);
 					txRecordList.Add(newRecord);
 				}
 				else
@@ -86,7 +86,8 @@
 					}
 					else
 					{
-						txRecordList.Add((coin.Confirmed, (Money.Zero - coin.Amount), "", coin.SpenderTransactionId));
+						bool guessConfirmed = !Global.MemPoolService.TransactionHashes.Contains(coin.SpenderTransactionId); // If it's not in the mempool it's likely confirmed.
+						txRecordList.Add((guessConfirmed, (Money.Zero - coin.Amount), "", coin.SpenderTransactionId));
 					}
 				}
 			}


Test case is added to test fixture.

Test case is added to test fixture.

--- tests/BooCompiler.Tests/CompilerWarningsTestFixture.cs
+++ tests/BooCompiler.Tests/CompilerWarningsTestFixture.cs
@@ -148,6 +148,12 @@
 		}

 		[Test]
+		public void BCW0011_19()
+		{
+			RunCompilerTestCase(@"BCW0011-19.boo");
+		}
+
+		[Test]
 		public void BCW0011_2()
 		{
 			RunCompilerTestCase(@"BCW0011-2.boo");


Check for netcore tests

Check for netcore tests

--- src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Runtime/UseAsyncMethodInAsyncContextTests.cs
+++ src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Runtime/UseAsyncMethodInAsyncContextTests.cs
@@ -81,6 +81,7 @@
             await VerifyVB.VerifyAnalyzerAsync(testVB);
         }

+#if NETCOREAPP
         [Fact]
         public async Task TaskWait_InIAsyncEnumerableAsyncMethod_ShouldReportWarning()
         {
@@ -104,7 +105,26 @@
                 TestCode = testCS,
             };
             await csTestVerify.RunAsync();
-        }
+
+            var testVB = @"
+Imports System
+Imports System.Collections.Generic
+Imports System.Linq
+Imports System.Threading.Tasks
+
+Module Program
+    Sub Main()
+        FooAsync()
+    End Sub
+    Function FooAsync() As IAsyncEnumerable(Of Integer)
+        [|Task.Delay(TimeSpan.FromSeconds(5)).Wait()|]
+        Return Nothing
+    End Function
+End Module
+";
+            await VerifyVB.VerifyAnalyzerAsync(testVB);
+        }
+#endif

         [Fact]
         public async Task TaskOfTResultInTaskReturningMethodGeneratesWarning()


Sync EasingCore

Sync EasingCore

--- Assets/FancyScrollView/Sources/Runtime/Scroller/EasingCore.cs
+++ Assets/FancyScrollView/Sources/Runtime/Scroller/EasingCore.cs
@@ -1,27 +1,8 @@
-//
-// EasingCore - https://github.com/setchi/EasingCore
-//
-// The MIT License (MIT)
-//
-// Copyright (c) 2019 setchi
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
+/*
+ * EasingCore (https://github.com/setchi/EasingCore)
+ * Copyright (c) 2019 setchi
+ * Licensed under MIT (https://github.com/setchi/EasingCore/blob/master/LICENSE)
+ */

 using System;
 using UnityEngine;
@@ -68,147 +49,147 @@
         /// <summary>
         /// Gets the easing function
         /// </summary>
-        /// <param name="type">ease type</param>
-        /// <returns>easing function</returns>
+        /// <param name="type">Ease type</param>
+        /// <returns>Easing function</returns>
         public static Func<float, float> Get(Ease type)
         {
             switch (type)
             {
-                case Ease.Linear: return Linear;
-                case Ease.InBack: return InBack;
-                case Ease.InBounce: return InBounce;
-                case Ease.InCirc: return InCirc;
-                case Ease.InCubic: return InCubic;
-                case Ease.InElastic: return InElastic;
-                case Ease.InExpo: return InExpo;
-                case Ease.InQuad: return InQuad;
-                case Ease.InQuart: return InQuart;
-                case Ease.InQuint: return InQuint;
-                case Ease.InSine: return InSine;
-                case Ease.OutBack: return OutBack;
-                case Ease.OutBounce: return OutBounce;
-                case Ease.OutCirc: return OutCirc;
-                case Ease.OutCubic: return OutCubic;
-                case Ease.OutElastic: return OutElastic;
-                case Ease.OutExpo: return OutExpo;
-                case Ease.OutQuad: return OutQuad;
-                case Ease.OutQuart: return OutQuart;
-                case Ease.OutQuint: return OutQuint;
-                case Ease.OutSine: return OutSine;
-                case Ease.InOutBack: return InOutBack;
-                case Ease.InOutBounce: return InOutBounce;
-                case Ease.InOutCirc: return InOutCirc;
-                case Ease.InOutCubic: return InOutCubic;
-                case Ease.InOutElastic: return InOutElastic;
-                case Ease.InOutExpo: return InOutExpo;
-                case Ease.InOutQuad: return InOutQuad;
-                case Ease.InOutQuart: return InOutQuart;
-                case Ease.InOutQuint: return InOutQuint;
-                case Ease.InOutSine: return InOutSine;
-                default: return Linear;
+                case Ease.Linear: return linear;
+                case Ease.InBack: return inBack;
+                case Ease.InBounce: return inBounce;
+                case Ease.InCirc: return inCirc;
+                case Ease.InCubic: return inCubic;
+                case Ease.InElastic: return inElastic;
+                case Ease.InExpo: return inExpo;
+                case Ease.InQuad: return inQuad;
+                case Ease.InQuart: return inQuart;
+                case Ease.InQuint: return inQuint;
+                case Ease.InSine: return inSine;
+                case Ease.OutBack: return outBack;
+                case Ease.OutBounce: return outBounce;
+                case Ease.OutCirc: return outCirc;
+                case Ease.OutCubic: return outCubic;
+                case Ease.OutElastic: return outElastic;
+                case Ease.OutExpo: return outExpo;
+                case Ease.OutQuad: return outQuad;
+                case Ease.OutQuart: return outQuart;
+                case Ease.OutQuint: return outQuint;
+                case Ease.OutSine: return outSine;
+                case Ease.InOutBack: return inOutBack;
+                case Ease.InOutBounce: return inOutBounce;
+                case Ease.InOutCirc: return inOutCirc;
+                case Ease.InOutCubic: return inOutCubic;
+                case Ease.InOutElastic: return inOutElastic;
+                case Ease.InOutExpo: return inOutExpo;
+                case Ease.InOutQuad: return inOutQuad;
+                case Ease.InOutQuart: return inOutQuart;
+                case Ease.InOutQuint: return inOutQuint;
+                case Ease.InOutSine: return inOutSine;
+                default: return linear;
             }
+
+            float linear(float t) => t;
+
+            float inBack(float t) => t * t * t - t * Mathf.Sin(t * Mathf.PI);
+
+            float outBack(float t) => 1f - inBack(1f - t);
+
+            float inOutBack(float t) =>
+                t < 0.5f
+                    ? 0.5f * inBack(2f * t)
+                    : 0.5f * outBack(2f * t - 1f) + 0.5f;
+
+            float inBounce(float t) => 1f - outBounce(1f - t);
+
+            float outBounce(float t) =>
+                t < 4f / 11.0f ?
+                    (121f * t * t) / 16.0f :
+                t < 8f / 11.0f ?
+                    (363f / 40.0f * t * t) - (99f / 10.0f * t) + 17f / 5.0f :
+                t < 9f / 10.0f ?
+                    (4356f / 361.0f * t * t) - (35442f / 1805.0f * t) + 16061f / 1805.0f :
+                    (54f / 5.0f * t * t) - (513f / 25.0f * t) + 268f / 25.0f;
+
+            float inOutBounce(float t) =>
+                t < 0.5f
+                    ? 0.5f * inBounce(2f * t)
+                    : 0.5f * outBounce(2f * t - 1f) + 0.5f;
+
+            float inCirc(float t) => 1f - Mathf.Sqrt(1f - (t * t));
+
+            float outCirc(float t) => Mathf.Sqrt((2f - t) * t);
+
+            float inOutCirc(float t) =>
+                t < 0.5f
+                    ? 0.5f * (1 - Mathf.Sqrt(1f - 4f * (t * t)))
+                    : 0.5f * (Mathf.Sqrt(-((2f * t) - 3f) * ((2f * t) - 1f)) + 1f);
+
+            float inCubic(float t) => t * t * t;
+
+            float outCubic(float t) => inCubic(t - 1f) + 1f;
+
+            float inOutCubic(float t) =>
+                t < 0.5f
+                    ? 4f * t * t * t
+                    : 0.5f * inCubic(2f * t - 2f) + 1f;
+
+            float inElastic(float t) => Mathf.Sin(13f * (Mathf.PI * 0.5f) * t) * Mathf.Pow(2f, 10f * (t - 1f));
+
+            float outElastic(float t) => Mathf.Sin(-13f * (Mathf.PI * 0.5f) * (t + 1)) * Mathf.Pow(2f, -10f * t) + 1f;
+
+            float inOutElastic(float t) =>
+                t < 0.5f
+                    ? 0.5f * Mathf.Sin(13f * (Mathf.PI * 0.5f) * (2f * t)) * Mathf.Pow(2f, 10f * ((2f * t) - 1f))
+                    : 0.5f * (Mathf.Sin(-13f * (Mathf.PI * 0.5f) * ((2f * t - 1f) + 1f)) * Mathf.Pow(2f, -10f * (2f * t - 1f)) + 2f);
+
+            float inExpo(float t) => Mathf.Approximately(0.0f, t) ? t : Mathf.Pow(2f, 10f * (t - 1f));
+
+            float outExpo(float t) => Mathf.Approximately(1.0f, t) ? t : 1f - Mathf.Pow(2f, -10f * t);
+
+            float inOutExpo(float v) =>
+                Mathf.Approximately(0.0f, v) || Mathf.Approximately(1.0f, v)
+                    ? v
+                    : v < 0.5f
+                        ?  0.5f * Mathf.Pow(2f, (20f * v) - 10f)
+                        : -0.5f * Mathf.Pow(2f, (-20f * v) + 10f) + 1f;
+
+            float inQuad(float t) => t * t;
+
+            float outQuad(float t) => -t * (t - 2f);
+
+            float inOutQuad(float t) =>
+                t < 0.5f
+                    ?  2f * t * t
+                    : -2f * t * t + 4f * t - 1f;
+
+            float inQuart(float t) => t * t * t * t;
+
+            float outQuart(float t)
+            {
+                var u = t - 1f;
+                return u * u * u * (1f - t) + 1f;
+            }
+
+            float inOutQuart(float t) =>
+                t < 0.5f
+                    ? 8f * inQuart(t)
+                    : -8f * inQuart(t - 1f) + 1f;
+
+            float inQuint(float t) => t * t * t * t * t;
+
+            float outQuint(float t) => inQuint(t - 1f) + 1f;
+
+            float inOutQuint(float t) =>
+                t < 0.5f
+                    ? 16f * inQuint(t)
+                    : 0.5f * inQuint(2f * t - 2f) + 1f;
+
+            float inSine(float t) => Mathf.Sin((t - 1f) * (Mathf.PI * 0.5f)) + 1f;
+
+            float outSine(float t) => Mathf.Sin(t * (Mathf.PI * 0.5f));
+
+            float inOutSine(float t) => 0.5f * (1f - Mathf.Cos(t * Mathf.PI));
         }
-
-        static float Linear(float t) => t;
-
-        static float InBack(float t) => t * t * t - t * Mathf.Sin(t * Mathf.PI);
-
-        static float OutBack(float t) => 1f - InBack(1f - t);
-
-        static float InOutBack(float t) =>
-            t < 0.5f
-                ? 0.5f * InBack(2f * t)
-                : 0.5f * OutBack(2f * t - 1f) + 0.5f;
-
-        static float InBounce(float t) => 1f - OutBounce(1f - t);
-
-        static float OutBounce(float t) =>
-            t < 4f / 11.0f ?
-                (121f * t * t) / 16.0f :
-            t < 8f / 11.0f ?
-                (363f / 40.0f * t * t) - (99f / 10.0f * t) + 17f / 5.0f :
-            t < 9f / 10.0f ?
-                (4356f / 361.0f * t * t) - (35442f / 1805.0f * t) + 16061f / 1805.0f :
-                (54f / 5.0f * t * t) - (513f / 25.0f * t) + 268f / 25.0f;
-
-        static float InOutBounce(float t) =>
-            t < 0.5f
-                ? 0.5f * InBounce(2f * t)
-                : 0.5f * OutBounce(2f * t - 1f) + 0.5f;
-
-        static float InCirc(float t) => 1f - Mathf.Sqrt(1f - (t * t));
-
-        static float OutCirc(float t) => Mathf.Sqrt((2f - t) * t);
-
-        static float InOutCirc(float t) =>
-            t < 0.5f
-                ? 0.5f * (1 - Mathf.Sqrt(1f - 4f * (t * t)))
-                : 0.5f * (Mathf.Sqrt(-((2f * t) - 3f) * ((2f * t) - 1f)) + 1f);
-
-        static float InCubic(float t) => t * t * t;
-
-        static float OutCubic(float t) => InCubic(t - 1f) + 1f;
-
-        static float InOutCubic(float t) =>
-            t < 0.5f
-                ? 4f * t * t * t
-                : 0.5f * InCubic(2f * t - 2f) + 1f;
-
-        static float InElastic(float t) => Mathf.Sin(13f * (Mathf.PI * 0.5f) * t) * Mathf.Pow(2f, 10f * (t - 1f));
-
-        static float OutElastic(float t) => Mathf.Sin(-13f * (Mathf.PI * 0.5f) * (t + 1)) * Mathf.Pow(2f, -10f * t) + 1f;
-
-        static float InOutElastic(float t) =>
-            t < 0.5f
-                ? 0.5f * Mathf.Sin(13f * (Mathf.PI * 0.5f) * (2f * t)) * Mathf.Pow(2f, 10f * ((2f * t) - 1f))
-                : 0.5f * (Mathf.Sin(-13f * (Mathf.PI * 0.5f) * ((2f * t - 1f) + 1f)) * Mathf.Pow(2f, -10f * (2f * t - 1f)) + 2f);
-
-        static float InExpo(float t) => Mathf.Approximately(0.0f, t) ? t : Mathf.Pow(2f, 10f * (t - 1f));
-
-        static float OutExpo(float t) => Mathf.Approximately(1.0f, t) ? t : 1f - Mathf.Pow(2f, -10f * t);
-
-        static float InOutExpo(float v) =>
-            Mathf.Approximately(0.0f, v) || Mathf.Approximately(1.0f, v)
-                ? v
-                : v < 0.5f
-                    ?  0.5f * Mathf.Pow(2f, (20f * v) - 10f)
-                    : -0.5f * Mathf.Pow(2f, (-20f * v) + 10f) + 1f;
-
-        static float InQuad(float t) => t * t;
-
-        static float OutQuad(float t) => -t * (t - 2f);
-
-        static float InOutQuad(float t) =>
-            t < 0.5f
-                ?  2f * t * t
-                : -2f * t * t + 4f * t - 1f;
-
-        static float InQuart(float t) => t * t * t * t;
-
-        static float OutQuart(float t)
-        {
-            var u = t - 1f;
-            return u * u * u * (1f - t) + 1f;
-        }
-
-        static float InOutQuart(float t) =>
-            t < 0.5f
-                ? 8f * InQuart(t)
-                : -8f * InQuart(t - 1f) + 1f;
-
-        static float InQuint(float t) => t * t * t * t * t;
-
-        static float OutQuint(float t) => InQuint(t - 1f) + 1f;
-
-        static float InOutQuint(float t) =>
-            t < 0.5f
-                ? 16f * InQuint(t)
-                : 0.5f * InQuint(2f * t - 2f) + 1f;
-
-        static float InSine(float t) => Mathf.Sin((t - 1f) * (Mathf.PI * 0.5f)) + 1f;
-
-        static float OutSine(float t) => Mathf.Sin(t * (Mathf.PI * 0.5f));
-
-        static float InOutSine(float t) => 0.5f * (1f - Mathf.Cos(t * Mathf.PI));
     }
 }


Fixed Moment post action

Fixed Moment post action

--- Azure/backend/BackendService/Controllers/MomentsController.cs
+++ Azure/backend/BackendService/Controllers/MomentsController.cs
@@ -37,6 +37,7 @@
             return Json(result);
         }

+        [HttpPost]
         public HttpStatusCodeResult Post([FromBody]MomentBody body)
         {
             var recipients = body.Recipients;


fix: check out of bound for picking

fix: check out of bound for picking

--- CSharpGL/OpenGLObjects/ColorCodedPicking/ColorCodedPicking.cs
+++ CSharpGL/OpenGLObjects/ColorCodedPicking/ColorCodedPicking.cs
@@ -21,13 +21,15 @@
         /// <param name="pickableElements">在哪些对象中执行拾取操作</param>
         /// <returns></returns>
         public static PickedGeometry Pick(
-            RenderEventArgs arg,
+            RenderEventArgs arg,
             int x, int y, int canvasWidth, int canvasHeight,
             params IColorCodedPicking[] pickableElements)
         {
+            if (x < 0 || canvasWidth <= x || y < 0 || canvasHeight <= y) { return null; }
+
             Rectangle rect = new Rectangle(x, y, 1, 1);
-            List<Tuple<Point, PickedGeometry>> list = Pick(arg,
-                rect, canvasWidth, canvasHeight,  pickableElements);
+            List<Tuple<Point, PickedGeometry>> list = Pick(arg,
+                rect, canvasWidth, canvasHeight, pickableElements);
             if (list.Count > 0)
             { return list[0].Item2; }
             else
@@ -46,12 +48,14 @@
         /// <param name="pickableElements">在哪些对象中执行拾取操作</param>
         /// <returns></returns>
         public static List<Tuple<Point, PickedGeometry>> Pick(
-            RenderEventArgs e,
-            int x, int y, int radius, int width, int height,
+            RenderEventArgs e,
+            int x, int y, int radius, int canvasWidth, int canvasHeight,
              params IColorCodedPicking[] pickableElements)
         {
+            if (x < 0 || canvasWidth <= x || y < 0 || canvasHeight <= y) { return null; }
+
             Rectangle rect = new Rectangle(x - radius, y - radius, radius * 2, radius * 2);
-            return Pick(e, rect, width, height,  pickableElements);
+            return Pick(e, rect, canvasWidth, canvasHeight, pickableElements);
         }

         /// <summary>
@@ -64,14 +68,14 @@
         /// <param name="pickableElements">在哪些对象中执行拾取操作</param>
         /// <returns></returns>
         public static List<Tuple<Point, PickedGeometry>> Pick(
-            RenderEventArgs arg,
+            RenderEventArgs arg,
             Rectangle rect, int canvasWidth, int canvasHeight,
             params IColorCodedPicking[] pickableElements)
         {
             var result = new List<Tuple<Point, PickedGeometry>>();
             if (pickableElements.Length == 0) { return result; }

-            Render4Picking(arg,  pickableElements);
+            Render4Picking(arg, pickableElements);

             for (int row = 0; row < rect.Width; row++)
             {
@@ -80,7 +84,9 @@
                     int x = rect.X + col;
                     int y = rect.Y + row;

-                    PickedGeometry pickedGeometry = ReadPixel(arg,
+                    if (x < 0 || canvasWidth <= x || y < 0 || canvasHeight <= y) { continue; }
+
+                    PickedGeometry pickedGeometry = ReadPixel(arg,
                         x, y, canvasWidth, canvasHeight, pickableElements);

                     if (pickedGeometry != null)
@@ -115,7 +121,7 @@
         }

         private static PickedGeometry ReadPixel(
-            RenderEventArgs arg,
+            RenderEventArgs arg,
             int x, int y, int canvasWidth, int canvasHeight,
             params IColorCodedPicking[] pickableElements)
         {


parameterType is never used

parameterType is never used

--- Core/System/Linq/Expressions/Interpreter/LocalAccess.net30.cs
+++ Core/System/Linq/Expressions/Interpreter/LocalAccess.net30.cs
@@ -486,6 +486,7 @@
             internal Parameter(int index, Type parameterType)
                 : base(index)
             {
+                GC.KeepAlive(parameterType);
             }

             public override int Run(InterpretedFrame frame)


Oops. Bad naming on a Rotten Tomatoes enum.

--- Holders/RottenTomatoes/Misc.cs
+++ Holders/RottenTomatoes/Misc.cs
@@ -15,7 +15,7 @@
     public class Rating
     {
         public RatingType Type { get; set; }
-        public Rating Rating { get; set; }
+        public RottenRating RottenTomatoRating { get; set; }
         public Int32 Score { get; set; }
     }

@@ -31,7 +31,7 @@
         Audience
     }

-    public enum Rating
+    public enum RottenRating
     {
         Fresh,
         Upright,


SimpleTextCommand: Added ability to add comands (INCOMPLETE)

--- Applebot/SimpleTextCommand/SimpleTextCommand.cs
+++ Applebot/SimpleTextCommand/SimpleTextCommand.cs
@@ -16,10 +16,11 @@
         private XmlNodeList _patterns;
         private string _configLocation;
         private XmlDocument _settings;
+        private XmlNode _rootNode;

         public SimpleTextCommand()
         {
-            _expressions.Add(new Regex("^!text"));
+            _expressions.Add(new Regex("^!text\\b"));

             _configLocation = "SimpleTextCommand.xml";

@@ -27,8 +28,8 @@

             if (!File.Exists(_configLocation)) {
                 Logger.Log(Logger.Level.WARNING, "SimpleTextCommand config not found, one will be created");
-                XmlNode initRootNode = _settings.CreateElement("patterns");
-                _settings.AppendChild(initRootNode);
+                _rootNode = _settings.CreateElement("patterns");
+                _settings.AppendChild(_rootNode);

                 XmlNode samplePattern = _settings.CreateElement("pattern");

@@ -40,11 +41,10 @@
                 sampleResponse.Value = "Responding to SimpleTextCommand \"check\".";
                 samplePattern.Attributes.Append(sampleResponse);

-                initRootNode.AppendChild(samplePattern);
+                _rootNode.AppendChild(samplePattern);

                 _settings.Save(_configLocation);
             }
-

             try
             {
@@ -55,14 +55,14 @@
                 Logger.Log(Logger.Level.ERROR, "Couldn't load SimpleTextCommand config file");
             }

-            XmlNodeList patterns = _settings.SelectNodes("/patterns/pattern");
-            _patterns = patterns;
+            _rootNode = _settings.FirstChild;
+            _patterns = _settings.SelectNodes("/patterns/pattern");

-            foreach(XmlNode node in patterns)
+            foreach(XmlNode node in _patterns)
             {
                 string trigger = node.Attributes["trigger"].Value;
                 Logger.Log(Logger.Level.LOG, "SimpleTextCommand: Adding pattern \"" + trigger + "\"");
-                _expressions.Add(new Regex("^!" + trigger + "\b"));
+                _expressions.Add(new Regex("^!" + trigger + "\\b"));
             }

         }
@@ -83,6 +83,34 @@
             }
         }

+        private void UpdateXml()
+        {
+            _patterns = _settings.SelectNodes("/patterns/pattern");
+            _settings.Save(_configLocation);
+        }
+
+        private void AddPattern(string trigger, string response)
+        {
+            lock (_settings)
+            {
+                XmlNode samplePattern = _settings.CreateElement("pattern");
+
+                XmlAttribute sampleTrigger = _settings.CreateAttribute("trigger");
+                sampleTrigger.Value = trigger;
+                samplePattern.Attributes.Append(sampleTrigger);
+
+                XmlAttribute sampleResponse = _settings.CreateAttribute("response");
+                sampleResponse.Value = response;
+                samplePattern.Attributes.Append(sampleResponse);
+
+                _rootNode.AppendChild(samplePattern);
+
+                UpdateXml();
+                _expressions.Add(new Regex("^!" + trigger + "\\b"));
+            }
+
+        }
+
         public void Execute(string user, string message, BotCore sender, BotSettings settings)
         {
             string[] parts = message.Split(' ');
@@ -98,16 +126,27 @@
                     return;
                 }

-                sender.WriteChatMessage("Administrative command placeholder", false);
+                //if (parts.Length < 3)
+                //{
+                //    sender.WriteChatMessage("Missing parameters.", false);
+                //    return;
+                //}
+
+                AddPattern(parts[2], parts[3]);
+
+                sender.WriteChatMessage("Added pattern " + parts[2] + ".", false);
                 return;
             }

-            foreach (XmlNode node in _patterns)
+            lock (_patterns)
             {
-                string trigger = node.Attributes["trigger"].Value;
-                if (trigger == message.Substring(1))
+                foreach (XmlNode node in _patterns)
                 {
-                    sender.WriteChatMessage(node.Attributes["response"].Value, false);
+                    string trigger = node.Attributes["trigger"].Value;
+                    if (trigger == message.Substring(1))
+                    {
+                        sender.WriteChatMessage(node.Attributes["response"].Value, false);
+                    }
                 }
             }


version bump 0.2.3-alpha

version bump 0.2.3-alpha

--- Archetype.Serializer/Properties/AssemblyInfo.cs
+++ Archetype.Serializer/Properties/AssemblyInfo.cs
@@ -32,8 +32,8 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.2.2")]
-[assembly: AssemblyInformationalVersion("0.2.2-alpha")]
-[assembly: AssemblyFileVersion("0.2.2-alpha")]
+[assembly: AssemblyVersion("0.2.3")]
+[assembly: AssemblyInformationalVersion("0.2.3-alpha")]
+[assembly: AssemblyFileVersion("0.2.3-alpha")]

 [assembly: InternalsVisibleTo("Archetype.Serializer.Test")]


Four4Sample - negative to odd power (integer & rational)

--- projects/Four4Sample/Four4.Test/EvalTest.cs
+++ projects/Four4Sample/Four4.Test/EvalTest.cs
@@ -134,6 +134,8 @@
         [InlineData("4 44 ^", "NaN")]
         [InlineData(".4 44 ^", "NaN")]
         [InlineData("4 44 - 4 R ^", "1600")]
+        [InlineData("4 R 4 - 4 .4_ / R ^", "-8")]
+        [InlineData(".4 4 - 4 .4_ / R ^", "-5832/125")]
         public void Exponent(string input, string result)
         {
             Test(input, result);


Fix for start point not being executed on startup.

--- Assets/Fungus/Scripts/Components/SaveManager.cs
+++ Assets/Fungus/Scripts/Components/SaveManager.cs
@@ -147,6 +147,16 @@

         protected System.Action loadAction;

+        protected virtual void Start()
+        {
+            // The OnSceneLoaded callback above may not be called for the initial scene load in the game,
+            // so we call ExecuteStartBlock when the SaveManager starts up too.
+            if (loadAction == null)
+            {
+                loadAction = ExecuteStartBlock;
+            }
+        }
+
         protected virtual void Update()
         {
             // Execute any previously scheduled load action