Added Status.IsOpen check

Added Status.IsOpen check

--- Algorithm/QCAlgorithm.Trading.cs
+++ Algorithm/QCAlgorithm.Trading.cs
@@ -420,10 +420,7 @@
                     continue;

                 // get open orders
-                var orders = Transactions.GetOrders(x =>
-                    x.Symbol == symbol &&
-                    (x.Status == OrderStatus.Submitted || x.Status == OrderStatus.New || x.Status == OrderStatus.PartiallyFilled))
-                    .ToList();
+                var orders = Transactions.GetOrders(x => x.Symbol == symbol && x.Status.IsOpen()).ToList();

                 // get quantity in portfolio
                 var quantity = Portfolio[symbol].Quantity;


dialogue input button problem

dialogue input button problem


Remove Rigidbody from Tower

Remove Rigidbody from Tower

--- Assets/Scripts/GameController.cs
+++ Assets/Scripts/GameController.cs
@@ -21,7 +21,6 @@
 		for (int x = 0; x < this.gameFieldWidth; x++) {
 			for (int z = 0; z < this.gameFieldHeight; z++) {
 				GameObject newTowerBase = Instantiate (towerBase);
-				newTowerBase.AddComponent<Rigidbody> ();
 				newTowerBase.transform.position = new Vector3 (towerBase.transform.position.x+x, 0.1f, towerBase.transform.position.z-z);
 				this.towerBases [x, z] = newTowerBase;
 			}


Updated spawn

Updated spawn

--- Assets/Scripts/GameController.cs
+++ Assets/Scripts/GameController.cs
@@ -10,7 +10,7 @@
 	public int waves = 0;
 	public float levelTime = 300f;
 	public float enemyRespawnTime = 0.5f;
-	public float allayRespawnTime = 3f;
+	public float allayRespawnTime = 1f;
 	public float respawnLock = 0f;
 	public GameObject allay;
 	public GameObject enemy;
@@ -23,12 +23,14 @@
 	private float allayRespawnCountdown;
 	private float[] buttonsState = {0f, 0f};

+	public static Transform alySpawn;
 	// Use this for initialization
 	void Start ()
 	{
 		countdown = levelTime;
 		allayRespawnCountdown = allayRespawnTime;
 		enemyRespawnCountdown = enemyRespawnTime;
+		alySpawn = allaySpawn;
 	}

 	// Update is called once per frame


Dickbutt Max HP is now Float instead of Int as all the other HP values are also floats

--- Assets/Scripts/Objects/Player.cs
+++ Assets/Scripts/Objects/Player.cs
@@ -23,7 +23,7 @@
     private bool playerMovement = true;
     private int collectablesCount;
     private GameObject gameController;
-    private int maxHP = 100;
+    private float maxHP = 100.0f;

     void Start()
     {


Adjusted fog color from 0.5f to 0.2f

Adjusted fog color from 0.5f to 0.2f


Catch all exceptions on ApplicationEngine.Execute. Catch exception in CheckArraySize

--- neo/SmartContract/ApplicationEngine.cs
+++ neo/SmartContract/ApplicationEngine.cs
@@ -37,9 +37,17 @@
                 case OpCode.PACK:
                 case OpCode.NEWARRAY:
                     {
-                        int size = (int)EvaluationStack.Peek().GetBigInteger();
-                        if (size > MaxArraySize) return false;
-                        return true;
+                        try
+                        {
+                            int size = (int)EvaluationStack.Peek().GetBigInteger();
+                            if (size > MaxArraySize) return false;
+                            return true;
+                        }
+                        catch (Exception)
+                        {
+                            return false;
+                        }
+
                     }
                 default:
                     return true;
@@ -138,6 +146,10 @@
                     gas_consumed = checked(gas_consumed + GetPrice() * ratio);
                 }
                 catch (OverflowException)
+                {
+                    return false;
+                }
+                catch (Exception)
                 {
                     return false;
                 }


fix [1406] and cache DeviceId in platformproxy on net desktop (#1407)

--- core/src/Platforms/net45/NetDesktopPlatformProxy.cs
+++ core/src/Platforms/net45/NetDesktopPlatformProxy.cs
@@ -215,14 +215,17 @@
             return Assembly.GetEntryAssembly()?.GetName()?.Version?.ToString();
         }

-        /// <summary>
-        /// Considered PII, ensure that it is hashed.
+        private static readonly Lazy<string> DeviceId = new Lazy<string>(
+            () => NetworkInterface.GetAllNetworkInterfaces().Where(nic => nic.OperationalStatus == OperationalStatus.Up)
+                                  .Select(nic => nic.GetPhysicalAddress()?.ToString()).FirstOrDefault());
+
+        /// <summary>
+        /// Considered PII, ensure that it is hashed.
         /// </summary>
         /// <returns>Device identifier</returns>
         public string GetDeviceId()
         {
-            return  NetworkInterface.GetAllNetworkInterfaces().Where(nic => nic.OperationalStatus == OperationalStatus.Up)
-                .Select(nic => nic.GetPhysicalAddress()?.ToString()).FirstOrDefault();
+            return DeviceId.Value;
         }

         /// <inheritdoc />


Fixes comment

Fixes comment

--- code/Notification.cs
+++ code/Notification.cs
@@ -79,7 +79,7 @@
 				return;
 			}

-			// do nothing if there is no tag or if the notification behavior is set to "do nothing"
+			// do nothing if the notification behavior is set to "do nothing"
 			if (balloon && Settings.Default.NotificationBehavior == (int)Behavior.DoNothing) {
 				return;
 			}


Updated to validate schema from embedded resources.

--- src/Tasks/SchemaValidatedTask.cs
+++ src/Tasks/SchemaValidatedTask.cs
@@ -24,6 +24,7 @@
 using System.Xml.Schema;
 using System.Xml.Serialization;
 using System.Text;
+using System.Resources;
 using System.Reflection;
 using System.Diagnostics;
 using System.ComponentModel;
@@ -43,30 +44,9 @@
     /// <remarks>None.</remarks>
     public abstract class SchemaValidatedTask : Task
     {
-        private bool _validate = true;
         private object _schemaObject;
-
-        /// <summary>
-        /// Returns or sets whether to validate the
-        /// Task against its XML Schema.
-        /// </summary>
-        /// <value>Whether to validate the
-        /// Task against its XML Schema.</value>
-        /// <remarks>None.</remarks>
-        [TaskAttribute("validate", Required=false)]
-        [BooleanValidator()]
-        public bool Validate
-        {
-            get
-            {
-                return _validate;
-            }
-
-            set
-            {
-                _validate = value;
-            }
-        }
+        private bool _validated = true;
+        private ArrayList _validationExceptions = new ArrayList();

         /// <summary>
         /// Returns the object from the Schema wrapper after
@@ -84,6 +64,18 @@
         }

         /// <summary>
+        /// Occurs when a validation error is raised.
+        /// </summary>
+        /// <param name="sender">The object that sent the event.</param>
+        /// <param name="args">Validation arguments passed in.</param>
+        private void Task_OnSchemaValidate(object sender, ValidationEventArgs args)
+        {
+            _validated = false;
+            _validationExceptions.Add(
+                new BuildException("Validation Error: " + args.Message));
+        }
+
+        /// <summary>
         /// Initializes the task and verifies parameters.
         /// </summary>
         /// <param name="TaskNode">Node that contains the
@@ -92,6 +84,8 @@
         protected override void InitializeTask(XmlNode TaskNode)
         {
             XmlNode taskNode = TaskNode.Clone();
+
+            // Expand all properties in the task and its child elements
             if (taskNode.ChildNodes != null)
             {
                 ExpandPropertiesInNodes(taskNode.ChildNodes);
@@ -104,29 +98,97 @@
                 }
             }

-            if (Validate)
-            {
-                SchemaValidatorAttribute[] taskValidators =
-                    (SchemaValidatorAttribute[])GetType().GetCustomAttributes(
-                    typeof(SchemaValidatorAttribute), true);
-
-                if (taskValidators.Length > 0)
+            // Get the [SchemaValidator(type)] attribute
+            SchemaValidatorAttribute[] taskValidators =
+                (SchemaValidatorAttribute[])GetType().GetCustomAttributes(
+                typeof(SchemaValidatorAttribute), true);
+
+            if (taskValidators.Length > 0)
+            {
+                SchemaValidatorAttribute taskValidator = taskValidators[0];
+                XmlSerializer taskSerializer = new XmlSerializer(taskValidator.ValidatorType);
+
+                // Load the embedded schema resource
+                ResourceManager resMgr = new ResourceManager(
+                    taskValidator.ValidatorType.Namespace,
+                    Assembly.GetExecutingAssembly());
+
+                // Get the "schema" named resource string
+                string schemaXml = resMgr.GetString("schema");
+                XmlTextReader tr = new XmlTextReader(
+                    schemaXml, XmlNodeType.Element, null);
+
+                // Add the schema to a schema collection
+                XmlSchema schema = XmlSchema.Read(tr, null);
+                XmlSchemaCollection schemas = new XmlSchemaCollection();
+                schemas.Add(schema);
+
+                // Create a namespace manager with the schema's namespace
+                NameTable nt = new NameTable();
+                XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt);
+                nsmgr.AddNamespace(String.Empty, GetType().FullName);
+
+                // Create a textreader containing just the Task's Node
+                XmlParserContext ctx = new XmlParserContext(
+                    null, nsmgr, null, XmlSpace.None);
+                ((XmlElement)TaskNode).SetAttribute("xmlns", GetType().FullName);
+                XmlTextReader textReader = new XmlTextReader(
+                    ((XmlElement)TaskNode).OuterXml, XmlNodeType.Element, ctx);
+
+                // Copy the node from the TextReader and indent it (for error
+                // reporting, since NAnt does not retain formatting during a load).
+                StringWriter stringWriter = new StringWriter();
+                XmlTextWriter textWriter = new XmlTextWriter(stringWriter);
+                textWriter.Formatting = Formatting.Indented;
+
+                textWriter.WriteNode(textReader, true);
+
+                //textWriter.Close();
+                XmlTextReader formattedTextReader = new XmlTextReader(
+                    stringWriter.ToString(), XmlNodeType.Document, ctx);
+
+                // Validate the Task's XML against its schema
+                XmlValidatingReader validatingReader = new XmlValidatingReader(
+                    formattedTextReader);
+                validatingReader.ValidationType = ValidationType.Schema;
+                validatingReader.Schemas.Add(schemas);
+                validatingReader.ValidationEventHandler +=
+                    new ValidationEventHandler(Task_OnSchemaValidate);
+
+                while (validatingReader.Read()) {
+                    // Read strictly for validation purposes
+                }
+                validatingReader.Close();
+
+                if (!_validated)
                 {
-                    SchemaValidatorAttribute taskValidator = taskValidators[0];
-                    XmlSerializer taskSerializer = new XmlSerializer(taskValidator.ValidatorType);
-
-                    NameTable taskNameTable = new NameTable();
-                    XmlNamespaceManager taskNSMgr = new XmlNamespaceManager(taskNameTable);
-                    taskNSMgr.AddNamespace("", GetType().FullName);
-
-                    XmlParserContext context = new XmlParserContext(
-                        null, taskNSMgr, null, XmlSpace.None);
-
-                    XmlTextReader taskSchemaReader = new XmlTextReader(
-                        taskNode.OuterXml, XmlNodeType.Element, context);
-
-                    _schemaObject = taskSerializer.Deserialize(taskSchemaReader);
-                }
+                    // Log any validation errors that have ocurred
+                    for (int i = 0; i < _validationExceptions.Count; i++)
+                    {
+                        BuildException ve = (BuildException)_validationExceptions[i];
+                        if (i == _validationExceptions.Count - 1)
+                        {
+                            // If this is the last validation error, throw it
+                            throw ve;
+                        }
+                        Log.WriteLine(LogPrefix + ve.Message);
+                    }
+                }
+
+
+
+                NameTable taskNameTable = new NameTable();
+                XmlNamespaceManager taskNSMgr = new XmlNamespaceManager(taskNameTable);
+                taskNSMgr.AddNamespace("", GetType().FullName);
+
+                XmlParserContext context = new XmlParserContext(
+                    null, taskNSMgr, null, XmlSpace.None);
+
+                XmlTextReader taskSchemaReader = new XmlTextReader(
+                    taskNode.OuterXml, XmlNodeType.Element, context);
+
+                // Deserialize from the Task's XML to the schema wrapper object
+                _schemaObject = taskSerializer.Deserialize(taskSchemaReader);
             }
         }

@@ -155,21 +217,6 @@
     }

     /// <summary>
-    /// Wraps an exception thrown by an XML Schema
-    /// being validated against a task.
-    /// </summary>
-    /// <remarks>None.</remarks>
-    public class SchemaValidationException : Exception
-    {
-        /// <summary>
-        /// Creates a new <see cref="SchemaValidationException"/>.
-        /// </summary>
-        /// <param name="msg">String containing the error message.</param>
-        /// <remarks>None.</remarks>
-        public SchemaValidationException(string msg) : base (msg) {}
-    }
-
-    /// <summary>
     /// Indicates that class should be validated by an XML Schema.
     /// </summary>
     /// <remarks>None.</remarks>


url地址拼接测试 Signed-off-by: virtual <1185513330@qq.com>

url地址拼接测试
Signed-off-by: virtual <89ab707496410b11c2fba8f5ec0112cf133af8fd@qq.com>

--- test/DotCommon.Test/Utility/UrlUtilTest.cs
+++ test/DotCommon.Test/Utility/UrlUtilTest.cs
@@ -106,6 +106,7 @@
         [Theory]
         [InlineData("http://www.baidu.com/abc/def", "http://www.baidu.com", "/abc", "def/")]
         [InlineData("http://10.9.254.19/qos/?id=3", "http://10.9.254.19", "", "/qos", "?id=3")]
+        [InlineData("http://192.168.0.100/group1/01/0A/file1.jpg", "http://192.168.0.100/", "group1", "01/0A/file1.jpg")]
         public void CombineUrl_Test(string expected, params string[] parameters)
         {
             var actual = UrlUtil.CombineUrl(parameters);


another test passing

another test passing

--- test/Rafty.UnitTests/AppendEntriesTests.cs
+++ test/Rafty.UnitTests/AppendEntriesTests.cs
@@ -135,7 +135,7 @@
                .WithEntry(log)
                .WithTerm(1)
                .WithPreviousLogIndex(1)
-               .WithPreviousLogTerm(0)
+               .WithPreviousLogTerm(1)
                .WithLeaderCommitIndex(1)
                .Build();
             //assume node has applied log..


Added suspend logic to thread runner class

--- osu.Framework/Platform/ThreadRunner.cs
+++ osu.Framework/Platform/ThreadRunner.cs
@@ -120,6 +120,16 @@

         public void Start() => ensureCorrectExecutionMode();

+        public void Suspend()
+        {
+            // shut down threads in reverse to ensure audio stops last (other threads may be waiting on a queued event otherwise)
+            foreach (var t in Threads.Reverse())
+                t.Pause();
+
+            // set the active execution mode back to null to set the state checking back to when it can be resumed.
+            activeExecutionMode = null;
+        }
+
         public void Stop()
         {
             const int thread_join_timeout = 30000;
@@ -147,9 +157,8 @@
                 // in the case we have not yet got an execution mode, set this early to allow usage in GameThread.Initialize overrides.
                 activeExecutionMode = ThreadSafety.ExecutionMode = ExecutionMode;

-            // shut down threads in reverse to ensure audio stops last (other threads may be waiting on a queued event otherwise)
-            foreach (var t in Threads.Reverse())
-                t.Pause();
+            // Suspend all threads
+            Suspend();

             switch (ExecutionMode)
             {


Skip beatmap imports where ruleset is not present in realm

Closes #16651.

When a ruleset is not available, the `Find` call would return null. When
a null is passed to the constructor, `BeatmapInfo` would create an "osu"
ruleset, which tries to get stored to realm and fails on duplicate
primary key.

Probably need to add better safeties against this (or change that
constructor...) but this will fix the migration process.

Probably not serious enough to pull the build. This only affects
rulesets like karaoke which have custom beatmaps.

--- osu.Game/Database/EFToRealmMigrator.cs
+++ osu.Game/Database/EFToRealmMigrator.cs
@@ -232,6 +232,7 @@

                 var transaction = r.BeginWrite();
                 int written = 0;
+                int missing = 0;

                 try
                 {
@@ -260,6 +261,12 @@
                         {
                             var ruleset = r.Find<RulesetInfo>(beatmap.RulesetInfo.ShortName);
                             var metadata = getBestMetadata(beatmap.Metadata, beatmapSet.Metadata);
+
+                            if (ruleset == null)
+                            {
+                                log($"Skipping {++missing} beatmaps with missing ruleset");
+                                continue;
+                            }

                             var realmBeatmap = new BeatmapInfo(ruleset, new BeatmapDifficulty(beatmap.BaseDifficulty), metadata)
                             {


Recipes - Index - Layout imporvements

Recipes - Index - Layout imporvements

--- pMixins.Mvc/Views/Recipes/Index.cshtml
+++ pMixins.Mvc/Views/Recipes/Index.cshtml
@@ -5,22 +5,44 @@

-

-
pMixins Recipes

-

-
Basic Mixin

-
AOP - Logging / Exception Handling / Parameter Checking

-
Repository Pattern

-
Context Aware Mixins - IMixinDependency

-
Abstract Mixins

-
Overriding Virtual Mixin Methods

-
Mixin with Non Public / Non Paramaterless Constructor

-
Using Dependency Injection with pMixins

-
Specific Mixin Constructor

-

-

-                Download the source for all recipes Here!
-

+

+
[pMixins] Recipes

+

+            These examples cover common use case scenarios and show off what can be done with [pMixins].
+

+

+            Full source code can for all recipes can be downloaded here!
+

+

+

+
+
Basic Mixin

+
A simple introduction to using [pMixins].  Hello World!

+
+
+
Abstract Mixin

+
Want to Mixin a class that is abstract?  No problem!

+
+
+
Overriding Virtual Mixin Methods

+
How to override virtual Mixin methods in both the Target and Target's children.

+
+
+
Depenendcy Injection and [pMixins]

+
How to wire up Dependency Injection to construct Mixins.

+

+

+
+
AOP - Logging / Exception Handling / Parameter Checking

+
Repository Pattern

+
Context Aware Mixins - IMixinDependency

+
Mixin with Non Public / Non Paramaterless Constructor

+
Specific Mixin Constructor

+

+

+            Download the source for all recipes Here!
+

+


Exceptions: null ref fix

Exceptions: null ref fix

--- Opserver.Core/Data/Exceptions/ExceptionStores.cs
+++ Opserver.Core/Data/Exceptions/ExceptionStores.cs
@@ -128,6 +128,7 @@

         public static IEnumerable<Application> GetApps(string appName)
         {
+            if (Applications == null) yield break;
             foreach (var a in Applications)
             {
                 if (a.Name == appName || appName == null)


No need to run on the same thread

No need to run on the same thread

--- NET/Libraries/Treehopper.Libraries/Sensors/Temperature/Ds18b20.cs
+++ NET/Libraries/Treehopper.Libraries/Sensors/Temperature/Ds18b20.cs
@@ -77,30 +77,30 @@
             {
                 if (Address == 0)
                 {
-                    await oneWire.OneWireReset();
-                    await oneWire.Send(new byte[] {0xCC, 0x44});
+                    await oneWire.OneWireReset().ConfigureAwait(false);
+                    await oneWire.Send(new byte[] { 0xCC, 0x44 }).ConfigureAwait(false);
                 }
                 else
                 {
-                    await oneWire.OneWireResetAndMatchAddress(Address);
-                    await oneWire.Send(0x44);
-                }
-
-                await Task.Delay(750);
+                    await oneWire.OneWireResetAndMatchAddress(Address).ConfigureAwait(false);
+                    await oneWire.Send(0x44).ConfigureAwait(false);
+                }
+
+                await Task.Delay(750).ConfigureAwait(false);
             }

             if (Address == 0)
             {
-                await oneWire.OneWireReset();
-                await oneWire.Send(new byte[] {0xCC, 0xBE});
+                await oneWire.OneWireReset().ConfigureAwait(false);
+                await oneWire.Send(new byte[] {0xCC, 0xBE}).ConfigureAwait(false);
             }
             else
             {
-                await oneWire.OneWireResetAndMatchAddress(Address);
-                await oneWire.Send(0xBE);
-            }
-
-            var data = await oneWire.Receive(2);
+                await oneWire.OneWireResetAndMatchAddress(Address).ConfigureAwait(false);
+                await oneWire.Send(0xBE).ConfigureAwait(false);
+            }
+
+            var data = await oneWire.Receive(2).ConfigureAwait(false);

             Celsius = (short) (data[0] | (data[1] << 8)) / 16d;


add beter comment

add beter comment

--- compiler/frontend/Parser.cs
+++ compiler/frontend/Parser.cs
@@ -27,7 +27,7 @@

         public void error(string str)
         {
-            //TODO: determine location in file
+            //TODO: determine location in file for error messages
             Console.WriteLine ("Error Parsing file: " + filename + ", " + str);
             error_fatal();
         }


React to errorhandler and errorpage extension name changes

--- samples/latest/HelloMvc/Startup.cs
+++ samples/latest/HelloMvc/Startup.cs
@@ -15,7 +15,7 @@
         {
             loggerFactory.AddConsole();

-            app.UseErrorPage();
+            app.UseDeveloperExceptionPage();

             app.UseMvcWithDefaultRoute();


added more udp test cases

added more udp test cases

--- test/SuperSocket.Tests/ProtocolTestBase.cs
+++ test/SuperSocket.Tests/ProtocolTestBase.cs
@@ -60,6 +60,7 @@
         [Theory]
         [InlineData(typeof(RegularHostConfigurator))]
         [InlineData(typeof(SecureHostConfigurator))]
+        [InlineData(typeof(UdpHostConfigurator))]
         public virtual async Task TestMiddleBreak(Type hostConfiguratorType)
         {
             var hostConfigurator = CreateObject<IHostConfigurator>(hostConfiguratorType);
@@ -92,6 +93,7 @@
         [Theory]
         [InlineData(typeof(RegularHostConfigurator))]
         [InlineData(typeof(SecureHostConfigurator))]
+        [InlineData(typeof(UdpHostConfigurator))]
         public virtual async Task TestFragmentRequest(Type hostConfiguratorType)
         {
             var hostConfigurator = CreateObject<IHostConfigurator>(hostConfiguratorType);
@@ -129,6 +131,7 @@
         [Theory]
         [InlineData(typeof(RegularHostConfigurator))]
         [InlineData(typeof(SecureHostConfigurator))]
+        [InlineData(typeof(UdpHostConfigurator))]
         public virtual async Task TestBatchRequest(Type hostConfiguratorType)
         {
             var hostConfigurator = CreateObject<IHostConfigurator>(hostConfiguratorType);
@@ -173,6 +176,7 @@
         [Theory]
         [InlineData(typeof(RegularHostConfigurator))]
         [InlineData(typeof(SecureHostConfigurator))]
+        [InlineData(typeof(UdpHostConfigurator))]
         public virtual async Task TestBreakRequest(Type hostConfiguratorType)
         {
             var hostConfigurator = CreateObject<IHostConfigurator>(hostConfiguratorType);


Optimize retrieving animated values from their last command time.

--- common/Storyboarding/Display/AnimatedValue.cs
+++ common/Storyboarding/Display/AnimatedValue.cs
@@ -62,6 +62,8 @@
         public TValue ValueAtTime(double time)
         {
             if (commands.Count == 0) return DefaultValue;
+            if (time >= EndTime) return EndValue;
+
             ITypedCommand<TValue> previousCommand = null, candidateCommand = null;
             foreach (var command in commands)
             {


Allow CData tags to be embedded in a RichTextEditor controls contents

--- components/editorControls/tinyMCE3/TinyMCE.cs
+++ components/editorControls/tinyMCE3/TinyMCE.cs
@@ -327,23 +327,23 @@
                 // tidy html - refactored, see #30534
                 if (UmbracoSettings.TidyEditorContent)
                 {
-					// always wrap in a
 - using
 was a bad idea
-					parsedString = "
" + parsedString + "
";
-
-					string tidyTxt = library.Tidy(parsedString, false);
+                    // always wrap in a
 - using
 was a bad idea
+                    parsedString = "
" + parsedString + "
";
+
+                    string tidyTxt = library.Tidy(parsedString, false);
                     if (tidyTxt != "[error]")
                     {
-						parsedString = tidyTxt;
-
-						// remove pesky \r\n, and other empty chars
-						parsedString = parsedString.Trim(new char[] { '\r', '\n', '\t', ' ' });
+                        parsedString = tidyTxt;
+
+                        // remove pesky \r\n, and other empty chars
+                        parsedString = parsedString.Trim(new char[] { '\r', '\n', '\t', ' ' });

                         // compensate for breaking macro tags by tidy (?)
                         parsedString = parsedString.Replace("/?>", "/>");

-						// remove the wrapping
 - safer to check that it is still here
-						if (parsedString.StartsWith("
") && parsedString.EndsWith("
"))
-							parsedString = parsedString.Substring("
".Length, parsedString.Length - "

".Length);
+                        // remove the wrapping
 - safer to check that it is still here
+                        if (parsedString.StartsWith("
") && parsedString.EndsWith("
"))
+                            parsedString = parsedString.Substring("
".Length, parsedString.Length - "

".Length);
                     }
                     else
                     {
@@ -366,6 +366,10 @@
                     parsedString = parsedString.Replace(helper.GetBaseUrl(HttpContext.Current) + "/#", "#");
                     parsedString = parsedString.Replace(helper.GetBaseUrl(HttpContext.Current), "");
                 }
+
+                //Allow CDATA nested into RTE without exceptions
+                // GE 2012-01-18
+                parsedString = parsedString.Replace("<![CDATA[", "").Replace("]]>", "");

                 // if text is an empty parargraph, make it all empty
                 if (parsedString.ToLower() == "

")
@@ -486,8 +490,10 @@
         protected override void OnInit(EventArgs e)
         {
             base.OnInit(e);
+            //Allow CDATA nested into RTE without exceptions
+            // GE 2012-01-18
             if (_data != null && _data.Value != null)
-                base.Text = _data.Value.ToString();
+                base.Text = _data.Value.ToString().Replace("", "<![CDATA[").Replace("", "]]>");
         }

         private string replaceMacroTags(string text)


use pattern matching

use pattern matching

--- core/Omego.Extensions/Poco/SmartGetVisitor.cs
+++ core/Omego.Extensions/Poco/SmartGetVisitor.cs
@@ -84,25 +84,19 @@

             base.VisitMember(node);

-            if (Current == null) return node;
-
-            var propertyInfo = node.Member as PropertyInfo;
-            var fieldInfo = node.Member as FieldInfo;
-
-            if (propertyInfo != null || fieldInfo != null)
+            if (Current != null)
             {
-                if (propertyInfo != null)
+                switch (node.Member)
                 {
-                    var member = propertyInfo;
-                    Current = member.GetValue(Current);
+                    case PropertyInfo property:
+                        Current = property.GetValue(Current);
+                        nameQueue.Enqueue(property.Name);
+                        break;
+                    case FieldInfo field:
+                        Current = field.GetValue(Current);
+                        nameQueue.Enqueue(field.Name);
+                        break;
                 }
-                else
-                {
-                    var member = (FieldInfo)node.Member;
-                    Current = member.GetValue(Current);
-                }
-
-                nameQueue.Enqueue(node.Member.Name);
             }

             return node;


Added a method to check for SDK availability. This should address #45

--- CueSDK.cs
+++ CueSDK.cs
@@ -16,6 +16,8 @@
     {
         #region Properties & Fields

+        private static bool _isInitialized;
+
         // ReSharper disable UnusedAutoPropertyAccessor.Global

         /// <summary>
@@ -61,6 +63,47 @@
         #endregion

         #region Methods
+
+        public static bool IsSDKAvailable(CorsairDeviceType? sdkType = null)
+        {
+            try
+            {
+                if (_isInitialized)
+                {
+                    switch (sdkType)
+                    {
+                        case CorsairDeviceType.Keyboard:
+                            return KeyboardSDK != null;
+                        case CorsairDeviceType.Mouse:
+                            return MouseSDK != null;
+                        case CorsairDeviceType.Headset:
+                            return HeadsetSDK != null;
+                        default:
+                            return true;
+                    }
+                }
+                else
+                {
+                    _CUESDK.CorsairPerformProtocolHandshake();
+
+                    if (sdkType == null || sdkType == CorsairDeviceType.Unknown)
+                        return LastError == CorsairError.Success;
+
+                    int deviceCount = _CUESDK.CorsairGetDeviceCount();
+                    for (int i = 0; i < deviceCount; i++)
+                    {
+                        GenericDeviceInfo info = new GenericDeviceInfo((_CorsairDeviceInfo)Marshal.PtrToStructure(_CUESDK.CorsairGetDeviceInfo(i), typeof(_CorsairDeviceInfo)));
+                        if (info.CapsMask.HasFlag(CorsairDeviceCaps.Lighting) && info.Type == sdkType.Value)
+                            return true;
+                    }
+                }
+            }
+            catch
+            {
+                return false;
+            }
+            return false;
+        }

         // ReSharper disable once ExceptionNotThrown
         /// <summary>
@@ -71,7 +114,7 @@
         /// <exception cref="CUEException">Thrown if the CUE-SDK provides an error.</exception>
         public static void Initialize(bool exclusiveAccess = false)
         {
-            if (ProtocolDetails != null)
+            if (_isInitialized)
                 throw new WrapperException("CueSDK is already initialized.");

             ProtocolDetails = new CorsairProtocolDetails(_CUESDK.CorsairPerformProtocolHandshake());
@@ -81,9 +124,7 @@
                 Throw(error);

             if (ProtocolDetails.BreakingChanges)
-                throw new WrapperException("The SDK currently used isn't compatible with the installed version of CUE.\r\n" +
-                    $"CUE-Version: {ProtocolDetails.ServerVersion} (Protocol {ProtocolDetails.ServerProtocolVersion})\r\n" +
-                    $"SDK-Version: {ProtocolDetails.SdkVersion} (Protocol {ProtocolDetails.SdkProtocolVersion})");
+                throw new WrapperException("The SDK currently used isn't compatible with the installed version of CUE.\r\n" + $"CUE-Version: {ProtocolDetails.ServerVersion} (Protocol {ProtocolDetails.ServerProtocolVersion})\r\n" + $"SDK-Version: {ProtocolDetails.SdkVersion} (Protocol {ProtocolDetails.SdkProtocolVersion})");

             if (exclusiveAccess)
             {
@@ -123,6 +164,8 @@
                 if (error != CorsairError.Success)
                     Throw(error);
             }
+
+            _isInitialized = true;
         }

         /// <summary>
@@ -139,7 +182,7 @@
         /// <param name="exclusiveAccess">Specifies whether the application should request exclusive access or not.</param>
         public static void Reinitialize(bool exclusiveAccess)
         {
-            if (ProtocolDetails == null)
+            if (!_isInitialized)
                 throw new WrapperException("CueSDK isn't initialized.");

             KeyboardSDK?.ResetLeds();
@@ -155,9 +198,7 @@
                 Throw(error);

             if (ProtocolDetails.BreakingChanges)
-                throw new WrapperException("The SDK currently used isn't compatible with the installed version of CUE.\r\n" +
-                    $"CUE-Version: {ProtocolDetails.ServerVersion} (Protocol {ProtocolDetails.ServerProtocolVersion})\r\n" +
-                    $"SDK-Version: {ProtocolDetails.SdkVersion} (Protocol {ProtocolDetails.SdkProtocolVersion})");
+                throw new WrapperException("The SDK currently used isn't compatible with the installed version of CUE.\r\n" + $"CUE-Version: {ProtocolDetails.ServerVersion} (Protocol {ProtocolDetails.ServerProtocolVersion})\r\n" + $"SDK-Version: {ProtocolDetails.SdkVersion} (Protocol {ProtocolDetails.SdkProtocolVersion})");

             if (exclusiveAccess)
                 if (!_CUESDK.CorsairRequestControl(CorsairAccessMode.ExclusiveLightingControl))
@@ -180,17 +221,16 @@
             }

             if (KeyboardSDK != null)
-                if (!reloadedDevices.ContainsKey(CorsairDeviceType.Keyboard)
-                || KeyboardSDK.KeyboardDeviceInfo.Model != reloadedDevices[CorsairDeviceType.Keyboard].Model)
+                if (!reloadedDevices.ContainsKey(CorsairDeviceType.Keyboard) || KeyboardSDK.KeyboardDeviceInfo.Model != reloadedDevices[CorsairDeviceType.Keyboard].Model)
                     throw new WrapperException("The previously loaded Keyboard got disconnected.");
             if (MouseSDK != null)
-                if (!reloadedDevices.ContainsKey(CorsairDeviceType.Mouse)
-                || MouseSDK.MouseDeviceInfo.Model != reloadedDevices[CorsairDeviceType.Mouse].Model)
+                if (!reloadedDevices.ContainsKey(CorsairDeviceType.Mouse) || MouseSDK.MouseDeviceInfo.Model != reloadedDevices[CorsairDeviceType.Mouse].Model)
                     throw new WrapperException("The previously loaded Mouse got disconnected.");
             if (HeadsetSDK != null)
-                if (!reloadedDevices.ContainsKey(CorsairDeviceType.Headset)
-                || HeadsetSDK.HeadsetDeviceInfo.Model != reloadedDevices[CorsairDeviceType.Headset].Model)
+                if (!reloadedDevices.ContainsKey(CorsairDeviceType.Headset) || HeadsetSDK.HeadsetDeviceInfo.Model != reloadedDevices[CorsairDeviceType.Headset].Model)
                     throw new WrapperException("The previously loaded Headset got disconnected.");
+
+            _isInitialized = true;
         }

         private static void Throw(CorsairError error)
@@ -200,6 +240,7 @@
             KeyboardSDK = null;
             MouseSDK = null;
             HeadsetSDK = null;
+            _isInitialized = false;

             throw new CUEException(error);
         }


Add SearchDisjunctiveFacetingAsync

Add SearchDisjunctiveFacetingAsync

--- Algolia.Search/Index.cs
+++ Algolia.Search/Index.cs
@@ -631,7 +631,7 @@
         /// @param refinements Dictionary<string, IEnumerable<string>> representing the current refinements
         ///     ex: { "my_facet1" => ["my_value1", "my_value2"], "my_disjunctive_facet1" => ["my_value1", "my_value2"] }
         /// </summary>
-        public JObject SearchDisjunctiveFaceting(Query query, IEnumerable<string> disjunctiveFacets, Dictionary<string, IEnumerable<string>> refinements = null)
+        async public Task<JObject> SearchDisjunctiveFacetingAsync(Query query, IEnumerable<string> disjunctiveFacets, Dictionary<string, IEnumerable<string>> refinements = null)
         {
             if (refinements == null)
                 refinements = new Dictionary<string, IEnumerable<string>>();
@@ -709,7 +709,7 @@
                 queries.Add(new IndexQuery(_indexName, query.clone().SetPage(0).SetNbHitsPerPage(1).SetAttributesToRetrieve(new List<string>()).SetAttributesToHighlight(new List<string>()).SetAttributesToSnippet(new List<string>()).SetFacets(new String[]{disjunctiveFacet}).SetFacetFilters(filters)));
             }

-            JObject answers = _client.MultipleQueries(queries);
+            JObject answers = await _client.MultipleQueriesAsync(queries).ConfigureAwait(_client.getContinueOnCapturedContext());

             // aggregate answers
             // first answer stores the hits + regular facets
@@ -744,5 +744,13 @@
             aggregatedAnswer.Add("disjunctiveFacets", disjunctiveFacetsJSON.ToObject<JToken>());
             return aggregatedAnswer;
         }
+
+        /// <summary>
+        /// Synchronously call <see cref="Index.UpdateUserKeyAsync"/>
+        /// </summary>
+        public JObject SearchDisjunctiveFaceting(Query query, IEnumerable<string> disjunctiveFacets, Dictionary<string, IEnumerable<string>> refinements = null)
+        {
+            return SearchDisjunctiveFacetingAsync(query, disjunctiveFacets, refinements).GetAwaiter().GetResult();
+        }
     }
 }


Implemented AutoCalibration

Implemented AutoCalibration

--- BalanceBoard/Program.cs
+++ BalanceBoard/Program.cs
@@ -1,10 +1,8 @@
 using System;
 using System.Collections.Generic;
 using WiimoteLib;
-using System.Text.RegularExpressions;
 using System.IO.Pipes;
 using System.IO;
-using System.Timers;
 using System.Threading;

 namespace BalanceBoard
@@ -21,7 +19,13 @@
         static Wiimote wiiDevice = null;
         static string Timingformat = "HH:mm:ss:fff";

-
+        // Offsets
+        static float oWeight;
+        static float oTopLeft;
+        static float oTopRight;
+        static float oBottomLeft;
+        static float oBottomRight;
+
         static void Main(string[] args)
         {
             if (args.Length > 0) { if (args[0] == "Debug") { startDebug(); } }
@@ -45,7 +49,6 @@
                     start();
                 }
                 catch (IOException) { Console.WriteLine("Connection Terminated"); }
-                //catch(ObjectDisposedException) { Console.WriteLine("Connection Terminated"); }
                 catch (Exception ex) { Console.WriteLine(ex.ToString()); run = false; }
                 finally { BoardServer.Dispose(); }

@@ -151,7 +154,6 @@
             }
             catch (Exception ex)
             {
-                Console.WriteLine("Error... you broke it");
                 Console.WriteLine(ex.Message, "Error");
             }

@@ -178,13 +180,20 @@
             var rwBottomLeft = wiiDevice.WiimoteState.BalanceBoardState.SensorValuesLb.BottomLeft;
             var rwBottomRight = wiiDevice.WiimoteState.BalanceBoardState.SensorValuesLb.BottomRight;

+            // Auto Calibrate
+            if (rwWeight + oWeight < 0.0) { oWeight = -rwWeight; }
+            if (rwTopLeft + oTopLeft < 0.0) { oTopLeft = -rwTopLeft; }
+            if (rwTopRight + oTopRight < 0.0) { oTopRight = -rwTopRight; }
+            if (rwBottomLeft + oBottomLeft < 0.0) { oBottomLeft = -rwBottomLeft; }
+            if (rwBottomRight + oBottomRight < 0.0) { oBottomRight = -rwBottomRight; }
+
             // Format Raw Data
             string Timing = DateTime.Now.ToString(Timingformat);
-            var weight = rwWeight.ToString("0.0");
-            var topleft = rwTopLeft.ToString("0.0");
-            var topright = rwTopRight.ToString("0.0");
-            var bottomeleft = rwBottomLeft.ToString("0.0");
-            var bottomright = rwBottomRight.ToString("0.0");
+            var weight = (oWeight+rwWeight).ToString("0.0");
+            var topleft = (oTopLeft+rwTopLeft).ToString("0.0");
+            var topright = (oTopRight+rwTopRight).ToString("0.0");
+            var bottomeleft = (oBottomLeft+rwBottomLeft).ToString("0.0");
+            var bottomright = (oBottomRight+rwBottomRight).ToString("0.0");

             // Output Raw data
             Dictionary<string, string> bdata = new Dictionary<string, string>()


Can now select & deselect draging object

--- Bork/MainWindow.xaml.cs
+++ Bork/MainWindow.xaml.cs
@@ -124,19 +124,29 @@
                 return;
             var ptOnScreen = new Vec2(e.GetPosition(this));
             var ptInGame = screenToWindow(ptOnScreen);
-            beingDragged.setPosition(ptInGame.X, ptInGame.Y);
-            Console.Out.WriteLine(beingDragged.containsPoint(aruImage.getPosition()));
+            if (beingDragged != null)
+            {
+                beingDragged.setPosition(ptInGame.X, ptInGame.Y);
+                Console.Out.WriteLine(beingDragged.containsPoint(aruImage.getPosition()));
+            }
         }

         private void grid_MouseDown(object sender, MouseButtonEventArgs e)
         {
             mouseDown = true;
+            var ptOnScreen = new Vec2(e.GetPosition(this));
+            var ptInGame = screenToWindow(ptOnScreen);
+            beingDragged = null;
             foreach (var ctrl in grid.Children)
             {
                 if (!(ctrl is GameDisplayObject))
                     continue;
-                beingDragged = (GameDisplayObject)ctrl;
-                break;
+                var gdo = ctrl as GameDisplayObject;
+                if (gdo.containsPoint(ptInGame))
+                {
+                    beingDragged = (GameDisplayObject)ctrl;
+                    break;
+                }
             }
         }


Expanded markedForDeletion to UIElement from RichImage

--- Bork/MainWindow.xaml.cs
+++ Bork/MainWindow.xaml.cs
@@ -24,7 +24,7 @@
         private bool mouseDown = false;
         private GameDisplayObject beingDragged;
         private Dictionary<ulong, int> singleUseSpriteLifetimes = new Dictionary<ulong, int>();
-        private List<RichImage> markedForDeletion = new List<RichImage>();
+        private List<UIElement> markedForDeletion = new List<UIElement>();

         public MainWindow()
         {
@@ -96,9 +96,9 @@
                 {
                     canvasClearEveryUpdate.Children.Clear();
                 }
-                foreach (var image in markedForDeletion)
-                {
-                    grid.Children.Remove(image);
+                foreach (var obj in markedForDeletion)
+                {
+                    grid.Children.Remove(obj);
                 }
                 markedForDeletion.Clear();
                 foreach (var ctrl in grid.Children)


Return of the formatting

Return of the formatting

--- CSharp/FastNoiseLite.cs
+++ CSharp/FastNoiseLite.cs
@@ -39,13 +39,66 @@
     private const short INLINE = 256; // MethodImplOptions.AggressiveInlining;
     private const short OPTIMISE = 512; // MethodImplOptions.AggressiveOptimization;

-    public enum NoiseType { OpenSimplex2, OpenSimplex2S, Cellular, Perlin, ValueCubic, Value };
-    public enum RotationType3D { None, ImproveXYPlanes, ImproveXZPlanes };
-    private enum TransformType3D { None, ImproveXYPlanes, ImproveXZPlanes, DefaultOpenSimplex2 };
-    public enum FractalType { None, FBm, Ridged, PingPong, DomainWarpProgressive, DomainWarpIndependent };
-    public enum CellularDistanceFunction { Euclidean, EuclideanSq, Manhattan, Hybrid };
-    public enum CellularReturnType { CellValue, Distance, Distance2, Distance2Add, Distance2Sub, Distance2Mul, Distance2Div };
-    public enum DomainWarpType { OpenSimplex2, OpenSimplex2Reduced, BasicGrid };
+    public enum NoiseType
+    {
+        OpenSimplex2,
+        OpenSimplex2S,
+        Cellular,
+        Perlin,
+        ValueCubic,
+        Value
+    };
+
+    public enum RotationType3D
+    {
+        None,
+        ImproveXYPlanes,
+        ImproveXZPlanes
+    };
+
+    public enum FractalType
+    {
+        None,
+        FBm,
+        Ridged,
+        PingPong,
+        DomainWarpProgressive,
+        DomainWarpIndependent
+    };
+
+    public enum CellularDistanceFunction
+    {
+        Euclidean,
+        EuclideanSq,
+        Manhattan,
+        Hybrid
+    };
+
+    public enum CellularReturnType
+    {
+        CellValue,
+        Distance,
+        Distance2,
+        Distance2Add,
+        Distance2Sub,
+        Distance2Mul,
+        Distance2Div
+    };
+
+    public enum DomainWarpType
+    {
+        OpenSimplex2,
+        OpenSimplex2Reduced,
+        BasicGrid
+    };
+
+    private enum TransformType3D
+    {
+        None,
+        ImproveXYPlanes,
+        ImproveXZPlanes,
+        DefaultOpenSimplex2
+    };

     private int mSeed = 1337;
     private float mFrequency = 0.01f;


small refactor to c#7

small refactor to c#7

--- Classes/RadiusPacket.cs
+++ Classes/RadiusPacket.cs
@@ -30,11 +30,7 @@
             get;
             private set;
         }
-        public IDictionary<String, List<Object>> Attributes
-        {
-            get;
-            set;
-        }
+        public IDictionary<String, List<Object>> Attributes { get; set; } = new Dictionary<String, List<Object>>();
         public Byte[] SharedSecret
         {
             get;
@@ -201,7 +197,6 @@
         {
             return new RadiusPacket
             {
-                Attributes = new Dictionary<String, List<object>>(),
                 Code = responseCode,
                 SharedSecret = SharedSecret,
                 Identifier = Identifier,
@@ -376,30 +371,25 @@
         /// <returns></returns>
         private static Byte[] GetAttributeValueBytes(Object value)
         {
-            byte[] contentBytes;
-            if (value.GetType() == typeof(String))
-            {
-                contentBytes = Encoding.Default.GetBytes((String)value);
-            }
-            else if (value.GetType() == typeof(UInt32))
-            {
-                contentBytes = BitConverter.GetBytes((UInt32)value);
-                Array.Reverse(contentBytes);
-            }
-            else if (value.GetType() == typeof(Byte[]))
-            {
-                contentBytes = (Byte[])value;
-            }
-            else if (value.GetType() == typeof(IPAddress))
-            {
-                contentBytes = ((IPAddress)value).GetAddressBytes();
-            }
-            else
-            {
-                throw new NotImplementedException();
-            }
-
-            return contentBytes;
+            switch (value)
+            {
+                case String _value:
+                    return Encoding.UTF8.GetBytes(_value);
+
+                case UInt32 _value:
+                    var contentBytes = BitConverter.GetBytes(_value);
+                    Array.Reverse(contentBytes);
+                    return contentBytes;
+
+                case Byte[] _value:
+                    return _value;
+
+                case IPAddress _value:
+                    return _value.GetAddressBytes();
+
+                default:
+                    throw new NotImplementedException();
+            }
         }
     }
 }


convert some methods to stateless

convert some methods to stateless

--- Classes/RadiusServer.cs
+++ Classes/RadiusServer.cs
@@ -12,7 +12,7 @@
 {
     public sealed class RadiusServer : IDisposable
     {
-        private readonly ILog _log = LogManager.GetLogger(typeof(RadiusServer));
+        private static readonly ILog _log = LogManager.GetLogger(typeof(RadiusServer));
         private readonly IUdpClientWrapper _server;
         private readonly RadiusDictionary _dictionary;
         private readonly Dictionary<IPAddress, PacketHandlerContainer> _packetHandlers = new Dictionary<IPAddress, PacketHandlerContainer>();
@@ -112,7 +112,7 @@
                     if (_packetHandlers.TryGetValue(sender.Address, out var handler))
                     {
                         var responsePacket = GetResponsePacket(handler.packetHandler, handler.secret, packetbytes, sender);
-                        SendResponsePacket(responsePacket, sender);
+                        SendResponsePacket(responsePacket, sender, _dictionary);
                     }
                     else
                     {
@@ -153,7 +153,7 @@
         /// Log packet bytes for debugging
         /// </summary>
         /// <param name="packetbytes"></param>
-        private void DumpPacketBytes(byte[] packetbytes)
+        private static void DumpPacketBytes(Byte[] packetbytes)
         {
             try
             {
@@ -215,11 +215,11 @@
         /// </summary>
         /// <param name="responsepacket"></param>
         /// <param name="sender"></param>
-        private void SendResponsePacket(IRadiusPacket responsepacket, IPEndPoint recipient)
+        private static void SendResponsePacket(IRadiusPacket responsepacket, IPEndPoint recipient, RadiusDictionary dictionary)
         {
             using (var client = new UdpClient())
             {
-                var responseBytes = GetBytes(responsepacket);
+                var responseBytes = GetBytes(responsepacket, dictionary);
                 client.Send(responseBytes, responseBytes.Length, recipient);
             }

@@ -231,7 +231,7 @@
         /// Dump the packet attributes to the log
         /// </summary>
         /// <param name="packet"></param>
-        private void DumpPacket(IRadiusPacket packet)
+        private static void DumpPacket(IRadiusPacket packet)
         {
             var sb = new StringBuilder();
             sb.AppendLine($"Packet dump for {packet.Identifier}:");
@@ -254,7 +254,7 @@
         /// Get the raw packet bytes
         /// </summary>
         /// <returns></returns>
-        public Byte[] GetBytes(IRadiusPacket packet)
+        public static Byte[] GetBytes(IRadiusPacket packet, RadiusDictionary dictionary)
         {
             var packetbytes = new Byte[20]; // Should be 20 + AVPs...
             packetbytes[0] = (Byte)packet.Code;
@@ -290,8 +290,8 @@

                     // Figure out what kind of attribute this is
-                    var attributeType = _dictionary.Attributes.SingleOrDefault(o => o.Value.Name == attribute.Key);
-                    if (_dictionary.Attributes.ContainsValue(attributeType.Value))
+                    var attributeType = dictionary.Attributes.SingleOrDefault(o => o.Value.Name == attribute.Key);
+                    if (dictionary.Attributes.ContainsValue(attributeType.Value))
                     {
                         var attributeLength = (Byte)(2 + contentBytes.Length);
                         var attributeBytes = new Byte[attributeLength];
@@ -306,7 +306,7 @@
                     else
                     {
                         // Maybe this is a vendor attribute?
-                        var vendorAttributeType = _dictionary.VendorAttributes.SingleOrDefault(o => o.Name == attribute.Key);
+                        var vendorAttributeType = dictionary.VendorAttributes.SingleOrDefault(o => o.Name == attribute.Key);
                         if (vendorAttributeType != null)
                         {
                             var attributeLength = (Byte)(8 + contentBytes.Length);  // minimum length for a VSA is 8 + content
@@ -362,7 +362,7 @@
         /// <param name="responselength"></param>
         /// <param name="attributes"></param>
         /// <returns>Response authenticator for the packet</returns>
-        private Byte[] CreateResponseAuthenticator(PacketCode responseCode, Byte[] radiusSharedSecret, Byte identifier, Byte[] requestAuthenticator, Int16 responselength, Byte[] attributes)
+        private static Byte[] CreateResponseAuthenticator(PacketCode responseCode, Byte[] radiusSharedSecret, Byte identifier, Byte[] requestAuthenticator, Int16 responselength, Byte[] attributes)
         {
             var responseAuthenticator = new Byte[20 + radiusSharedSecret.Length + attributes.Length];
             responseAuthenticator[0] = (Byte)responseCode;
@@ -395,6 +395,12 @@
         }

+        /// <summary>
+        /// Convert byte array to hex string representation.
+        /// Used for debugging, testing and packet dumps
+        /// </summary>
+        /// <param name="bytes"></param>
+        /// <returns></returns>
         public static String ByteArrayToString(Byte[] bytes)
         {
             var hex = new StringBuilder(bytes.Length * 2);


Fixes bug in SeriesSampler.SampleCharts

Fixes bug in SeriesSampler.SampleCharts

--- Common/SeriesSampler.cs
+++ Common/SeriesSampler.cs
@@ -103,6 +103,7 @@
             foreach (var chart in charts.Values)
             {
                 var sampledChart = new Chart(chart.Name, chart.ChartType);
+                sampledCharts.Add(sampledChart.Name, sampledChart);
                 foreach (var series in chart.Series.Values)
                 {
                     var sampledSeries = Sample(series, start, stop);


Added additional logging on composer dll loading

--- Common/Util/Composer.cs
+++ Common/Util/Composer.cs
@@ -22,7 +22,9 @@
 using System.ComponentModel.Composition.ReflectionModel;
 using System.IO;
 using System.Linq;
+using System.Reflection;
 using QuantConnect.Configuration;
+using QuantConnect.Logging;

 namespace QuantConnect.Util
 {
@@ -78,49 +80,67 @@
         public T GetExportedValueByTypeName<T>(string typeName)
             where T : class
         {
-            lock (_exportedValuesLockObject)
+            try
             {
-                T instance;
-                IEnumerable values;
-                var type = typeof (T);
-                if (_exportedValues.TryGetValue(type, out values))
+                lock (_exportedValuesLockObject)
                 {
-                    // if we've alread loaded this part, then just reserve the same one
-                    instance = values.OfType<T>().FirstOrDefault(x => x.GetType().MatchesTypeName(typeName));
-                    if (instance != null)
+                    T instance;
+                    IEnumerable values;
+                    var type = typeof(T);
+                    if (_exportedValues.TryGetValue(type, out values))
                     {
-                        return instance;
+                        // if we've alread loaded this part, then just reserve the same one
+                        instance = values.OfType<T>().FirstOrDefault(x => x.GetType().MatchesTypeName(typeName));
+                        if (instance != null)
+                        {
+                            return instance;
+                        }
                     }
+
+                    // we want to get the requested part without instantiating each one of that type
+                    var selectedPart = _compositionContainer.Catalog.Parts
+                        .Select(x => new { part = x, Type = ReflectionModelServices.GetPartType(x).Value })
+                        .Where(x => type.IsAssignableFrom(x.Type))
+                        .Where(x => x.Type.MatchesTypeName(typeName))
+                        .Select(x => x.part)
+                        .FirstOrDefault();
+
+                    if (selectedPart == null)
+                    {
+                        throw new ArgumentException(
+                            "Unable to locate any exports matching the requested typeName: " + typeName, "typeName");
+                    }
+
+                    var exportDefinition =
+                        selectedPart.ExportDefinitions.First(
+                            x => x.ContractName == AttributedModelServices.GetContractName(type));
+                    instance = (T)selectedPart.CreatePart().GetExportedValue(exportDefinition);
+
+                    // cache the new value for next time
+                    if (values == null)
+                    {
+                        values = new List<T> { instance };
+                        _exportedValues[type] = values;
+                    }
+                    else
+                    {
+                        ((List<T>)values).Add(instance);
+                    }
+
+                    return instance;
+                }
+            }
+            catch (ReflectionTypeLoadException err)
+            {
+                foreach (var exception in err.LoaderExceptions)
+                {
+                    Log.Error(exception);
+                    Log.Error(exception.ToString());
                 }

-                // we want to get the requested part without instantiating each one of that type
-                var selectedPart = _compositionContainer.Catalog.Parts
-                    .Select(x => new {part = x, Type = ReflectionModelServices.GetPartType(x).Value})
-                    .Where(x => type.IsAssignableFrom(x.Type))
-                    .Where(x => x.Type.MatchesTypeName(typeName))
-                    .Select(x => x.part)
-                    .FirstOrDefault();
+                if (err.InnerException != null) Log.Error(err.InnerException);

-                if (selectedPart == null)
-                {
-                    throw new ArgumentException("Unable to locate any exports matching the requested typeName: " + typeName, "typeName");
-                }
-
-                var exportDefinition = selectedPart.ExportDefinitions.First(x => x.ContractName == AttributedModelServices.GetContractName(type));
-                instance = (T) selectedPart.CreatePart().GetExportedValue(exportDefinition);
-
-                // cache the new value for next time
-                if (values == null)
-                {
-                    values = new List<T> {instance};
-                    _exportedValues[type] = values;
-                }
-                else
-                {
-                    ((List<T>) values).Add(instance);
-                }
-
-                return instance;
+                throw;
             }
         }
         /// <summary>


Use OnApplyData method

Use OnApplyData method

--- Core2D/Editor/Editor.cs
+++ Core2D/Editor/Editor.cs
@@ -517,7 +517,7 @@
         /// - The styles library using <see cref="Core2D.Xaml.Collections.Styles"/> container.
         /// - The shapes library using <see cref="Core2D.Xaml.Collections.Shapes"/> container.
         /// - The groups library using <see cref="Core2D.Xaml.Collections.Groups"/> container.
-        /// - The data for current container using <see cref="Core2D.Data"/> class.
+        /// - The <see cref="Core2D.Data"/> class.
         /// - The <see cref="Core2D.Database"/> class.
         /// - The <see cref="Core2D.Layer"/> class.
         /// - The <see cref="Core2D.Template"/> class.
@@ -566,10 +566,18 @@
                 }
                 else if (item is Data)
                 {
-                    var page = _project.CurrentContainer as Page;
-                    if (page != null)
-                    {
-                        page.Data = item as Data;
+                    if (_renderers[0].State.SelectedShape != null
+                        || (_renderers[0].State.SelectedShapes != null && _renderers[0].State.SelectedShapes.Count > 0))
+                    {
+                        OnApplyData(item as Data);
+                    }
+                    else
+                    {
+                        var page = _project.CurrentContainer as Page;
+                        if (page != null)
+                        {
+                            page.Data = item as Data;
+                        }
                     }
                 }
                 else if (item is Database)


Add basic loop option

Add basic loop option

You may specify a loop in pulses, beats, or measures. The loop-end point
is implied to be the song's end.

--- mareep/errand/jolt.cs
+++ mareep/errand/jolt.cs
@@ -1,6 +1,7 @@

 using System;
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO;
 using System.Text;

@@ -10,11 +11,14 @@
 	class JoltErrand : MidiReader, IErrand {

 		string mInput, mOutput;
+		long mLoop;
+		LoopTimeUnit mLoopTimeUnit;

 		StreamWriter mWriter;

 		Track mRootTrack;
 		Track[] mChannelTracks;
+		bool[] mChannelOpen;

 		public JoltErrand() {
 			mRootTrack = new Track();
@@ -22,6 +26,8 @@
 			for (var i = 0; i < 16; ++i) {
 				mChannelTracks[i] = new Track();
 			}
+			mChannelOpen = new bool[16];
+			mLoop = -1;
 		}

 		public void LoadParams(string[] arguments) {
@@ -47,6 +53,40 @@
 			}

 			mOutput = parameter[0];
+
+			parameter = mareep.GetLastCmdParam(cmdline, "-loop");
+
+			if (parameter != null) {
+				if (parameter.Count == 0) {
+					mLoop = 0;
+					mLoopTimeUnit = LoopTimeUnit.Pulses;
+				}
+
+				if (parameter.Count > 0 && !Int64.TryParse(parameter[0], NumberStyles.None, null, out mLoop)) {
+					mareep.WriteError("JOLT: bad loop value '{0}'.", parameter[0]);
+				}
+
+				if (parameter.Count > 1) {
+					switch (parameter[1].ToLowerInvariant()) {
+						case "pulses":
+						case "ticks": {
+							mLoopTimeUnit = LoopTimeUnit.Pulses;
+							break;
+						}
+						case "beats":
+						case "quarters": {
+							mLoopTimeUnit = LoopTimeUnit.Beats;
+							break;
+						}
+						case "bars":
+						case "measures": {
+							mLoopTimeUnit = LoopTimeUnit.Measures;
+							break;
+						}
+						default: mareep.WriteError("JOLT: bad time unit '{0}'.", parameter[1]); break;
+					}
+				}
+			}
 		}

 		public void Perform() {
@@ -57,6 +97,17 @@
 					mareep.WriteError("JOLT: format-2 MIDIs are not supported.");
 				}

+				mareep.WriteMessage("Format-{0} MIDI {1} division {2} tracks\n", Format, Division, TrackCount);
+
+				if (mLoop >= 0) {
+					switch (mLoopTimeUnit) {
+						case LoopTimeUnit.Beats: mLoop *= Division; break;
+						case LoopTimeUnit.Measures: mLoop *= (Division * 4); break;
+					}
+
+					mareep.WriteMessage("Loop enabled: {0} ticks\n", mLoop, Division);
+				}
+
 				LoadTracks();
 			}

@@ -71,7 +122,7 @@
 				mWriter.WriteLine();
 				mWriter.WriteLine("ROOT_TRACK_BEGIN:");
 				for (var i = 0; i < 16; ++i) {
-					if (mChannelTracks[i].Count == 0) {
+					if (!mChannelOpen[i]) {
 						continue;
 					}

@@ -85,8 +136,13 @@
 				mWriter.WriteLine("ROOT_TRACK_END:");
 				mWriter.WriteLine();

+				if (mLoop >= 0) {
+					mWriter.WriteLine(".undefinelabel LOOP");
+					mWriter.WriteLine();
+				}
+
 				for (var i = 0; i < 16; ++i) {
-					if (mChannelTracks[i].Count == 0) {
+					if (!mChannelOpen[i]) {
 						continue;
 					}

@@ -97,6 +153,12 @@
 					mChannelTracks[i].Write(mWriter);
 					mWriter.WriteLine("TRACK_{0}_END:", i);
 					mWriter.WriteLine();
+
+					if (mLoop >= 0) {
+						mWriter.WriteLine(".undefinelabel LOOP");
+						mWriter.WriteLine();
+					}
+
 				}

 				mWriter.Flush();
@@ -107,8 +169,19 @@
 			EventInfo ev;
 			var duration = 0L;

+			if (mLoop >= 0) {
+				mRootTrack.AddEvent(mLoop, "LOOP: # -----------------------------------------------------------------------");
+
+				for (var i = 0; i < 16; ++i) {
+					if (mLoop >= 0) {
+						mChannelTracks[i].AddEvent(mLoop, "LOOP: # -----------------------------------------------------------------------");
+					}
+				}
+			}
+
 			for (var i = 0; i < TrackCount; ++i) {
 				GotoTrack(i);
+
 				var time = 0L;

 				while (ReadEvent(out ev)) {
@@ -136,33 +209,42 @@
 				}
 			}

-			mRootTrack.AddEvent(duration, "finish");
+			var finalcommand = (mLoop >= 0 ? "jmp @LOOP" : "finish");
+
+			mRootTrack.AddEvent(duration, finalcommand);

 			for (var i = 0; i < 16; ++i) {
-				if (mChannelTracks[i].Count == 0) {
+				if (!mChannelOpen[i]) {
 					continue;
 				}

-				mChannelTracks[i].AddEvent(duration, "finish");
+				mChannelTracks[i].AddEvent(duration, finalcommand);
 			}
 		}

 		void ReadNoteOn(long time, EventInfo ev) {
 			if (ev.velocity > 0) {
 				mChannelTracks[ev.channel].AddNoteOn(time, ev.key, ev.velocity);
+				mChannelOpen[ev.channel] = true;
 			} else {
 				ReadNoteOff(time, ev);
 			}
 		}
 		void ReadNoteOff(long time, EventInfo ev) {
 			mChannelTracks[ev.channel].AddNoteOff(time, ev.key);
+			mChannelOpen[ev.channel] = true;
 		}
 		void ReadControlChange(long time, EventInfo ev) {
+			var open = true;
+
 			switch (ev.controller) {
 				case 7: mChannelTracks[ev.channel].AddEvent(time, "timedparam 0, {0}s", ev.value); break;
 				case 10: mChannelTracks[ev.channel].AddEvent(time, "timedparam 3, {0}s", ev.value); break;
 				case 32: mChannelTracks[ev.channel].AddEvent(time, "load rbank, {0}b", ev.value); break;
-			}
+				default: open = false; break;
+			}
+
+			mChannelOpen[ev.channel] |= open;
 		}
 		void ReadProgramChange(long time, EventInfo ev) {
 			var program = ev.program;
@@ -170,9 +252,11 @@
 				program = (228 + (program % 12));
 			}
 			mChannelTracks[ev.channel].AddEvent(time, "load rprogram, {0}b", program);
+			mChannelOpen[ev.channel] = true;
 		}
 		void ReadPitchWheel(long time, EventInfo ev) {
 			mChannelTracks[ev.channel].AddEvent(time, "timedparam 1, {0}h", (ev.pitch - 8192));
+			mChannelOpen[ev.channel] = true;
 		}
 		void ReadTempo(long time, EventInfo ev) {
 			mRootTrack.AddEvent(time, "tempo {0}h", (60000000 / ev.tempo));
@@ -181,7 +265,15 @@
 		void WriteSeparator() {
 			mWriter.WriteLine("# -----------------------------------------------------------------------------");
 		}
-
+
+		enum LoopTimeUnit {
+
+			Pulses,
+			Beats,
+			Measures,
+
+		}
+
 	}

 	class Track {


csharp: changed users description

csharp: changed users description

--- web/documentserver-example/csharp/Users.cs
+++ web/documentserver-example/csharp/Users.cs
@@ -27,6 +27,7 @@
             "File author by default",
             "He doesn’t belong to any of the groups",
             "He can review all the changes",
+            "He can do everything with the comments",
             "The file favorite state is undefined"
         };

@@ -34,6 +35,7 @@
         {
             "He belongs to Group2",
             "He can review only his own changes or the changes made by the users who don’t belong to any of the groups",
+            "He can view every comment, edit his comments and the comments left by the users who don't belong to any of the groups and remove only his comments",
             "This file is favorite"
         };

@@ -41,6 +43,7 @@
         {
             "He belongs to Group3",
             "He can review only the changes made by the users from Group2",
+            "He can view the comments left by the users from Group2 and Group3 and edit the comments left by the users from Group2",
             "This file isn’t favorite",
             "He can’t copy data from the file into the clipboard",
             "He can’t download the file",
@@ -52,6 +55,7 @@
             "The user without a name. The name is requested upon the editor opening",
             "He doesn’t belong to any of the groups",
             "He can review all the changes",
+            "He can do everything with the comments",
             "The file favorite state is undefined",
             "He cannot mention others in the comments"
         };
@@ -78,7 +82,7 @@
                     {
                         { "view",  "."  },
                         { "edit", new List<string>() { "group-2", "" } },
-                        { "remove", new List<string>() {"group-2"} }
+                        { "remove", new List<string>() { "group-2" } }
                     },
                     true,
                     new List<string>(),
@@ -93,7 +97,7 @@
                     new Dictionary<string,object>()
                     {
                         { "view", new List<string>() { "group-2", "group-3" } },
-                        { "edit", new List<string>() {"group-2"} },
+                        { "edit", new List<string>() { "group-2" } },
                         { "remove", new List<string>() { } }
                     },
                     false,
@@ -106,7 +110,7 @@
                     null,
                     null,
                     null,
-                    new Dictionary<string,object>(),
+                    new Dictionary<string, object>(),
                     null,
                     new List<string>(),
                     descr_user_0


アクションによる位置移動機能の拡張

アクションによる位置移動機能の拡張

--- DiceStg-Online/Point.cs
+++ DiceStg-Online/Point.cs
@@ -1,7 +1,7 @@
 namespace DiceStg_Online
 {
     /// <summary>
-    /// 場所を表す構造体
+    /// 場所を表すクラス
     /// </summary>
     class Point
     {
@@ -14,7 +14,9 @@
         /// Y座標の位置
         /// </summary>
         public int Y { get; set; }
-
+
+        public Point() : this(0, 0) { }
+
         /// <summary>
         /// 座標の指定して初期化する
         /// </summary>
@@ -41,7 +43,7 @@

             return p;
         }
-
+
         public static Point operator+ (Point p1, Point p2)
         {
             return new Point(p1.X + p2.X, p1.Y + p2.Y);
@@ -62,4 +64,26 @@
             return new Point(p.X - v, p.Y - v);
         }
     }
+
+    static class PointExtensions
+    {
+        public static Point Move(this Point p, Actions action)
+        {
+            switch (action)
+            {
+                case Actions.MoveUp:
+                    return new Point(p.X, p.Y - 1);
+                case Actions.MoveDown:
+                    return new Point(p.X, p.Y + 1);
+                case Actions.MoveLeft:
+                    return new Point(p.X - 1, p.Y);
+                case Actions.MoveRight:
+                    return new Point(p.X + 1, p.Y);
+                case Actions.DoNothing:
+                    return p;
+            }
+
+            return p;
+        }
+    }
 }


Updated combat wave trigger to use the new ExpectComponentInScene function

Added new method to Utils for finding a named object of a specified type in the scene.

--- Assets/Code/Utils.cs
+++ Assets/Code/Utils.cs
@@ -100,4 +100,24 @@
         }
         return components[0];
     }
+
+    /// <summary>
+    /// Find a component of specified type in the scene and throw an exception if it was not found or multiple were found.
+    /// </summary>
+    public static ComponentT ExpectComponentInScene<ComponentT>(string name) where ComponentT : Component
+    {
+        var components = UnityEngine.Object.FindObjectsOfType<ComponentT>()
+            .Where(component => component.gameObject.name == name)
+            .ToArray();
+
+        if (components.Length < 1)
+        {
+            throw new ApplicationException(string.Format("Tried to find an instance of {0} in the scene but it was not present.", typeof(ComponentT).Name));
+        }
+        else if (components.Length > 1)
+        {
+            throw new ApplicationException(string.Format("Tried to find a single instance of {0} in the scene but multiple were found.", typeof(ComponentT).Name));
+        }
+        return components[0];
+    }
 }


Only retry HTTP GET requests

Only retry HTTP GET requests

--- DotCMIS/binding/http.cs
+++ DotCMIS/binding/http.cs
@@ -263,7 +263,7 @@
                     }
                     catch (WebException we)
                     {
-                        if (ExceptionFixabilityDecider.CanExceptionBeFixedByRetry(we) == false || retry == 5) {
+                        if (method != "GET" || !ExceptionFixabilityDecider.CanExceptionBeFixedByRetry(we) || retry == 5) {
                             watch.Stop();
                             Trace.WriteLineIf(DotCMISDebug.DotCMISSwitch.TraceInfo, string.Format("[{0}] received response after {1} ms", tag.ToString(), watch.ElapsedMilliseconds.ToString()));
                             return new Response(we);


add -s switch to suppress hits to console. Useful when used with -o

--- bstrings/Program.cs
+++ bstrings/Program.cs
@@ -92,6 +92,9 @@
             _fluentCommandLineParser.Setup(arg => arg.Quiet)
                 .As('q').SetDefault(false).WithDescription("Quiet mode (Do not show header or total number of hits)");

+            _fluentCommandLineParser.Setup(arg => arg.QuietQuiet)
+       .As('s').SetDefault(false).WithDescription("Really Quiet mode (Do not display hits to console. Speeds up processing when using -o)");
+
             _fluentCommandLineParser.Setup(arg => arg.MaximumLength)
                 .As('x').SetDefault(-1).WithDescription("Maximum string length. Default is unlimited");

@@ -527,7 +530,12 @@
                             hit.IndexOf(_fluentCommandLineParser.Object.LookForString, StringComparison.InvariantCultureIgnoreCase) >= 0)
                         {
                             counter += 1;
-                            _logger.Info(hit);
+
+                            if (!_fluentCommandLineParser.Object.QuietQuiet)
+                            {
+                                _logger.Info(hit);
+                            }
+
                             sw?.WriteLine(hit);
                         }
                         else if (_fluentCommandLineParser.Object.LookForRegex.Length > 0)
@@ -537,14 +545,24 @@
                                 continue;
                             }
                             counter += 1;
+
+                            if (!_fluentCommandLineParser.Object.QuietQuiet)
+                            {
+                                _logger.Info(hit);
+                            }
+
+                            sw?.WriteLine(hit);
+                        }
+                    }
+                    else
+                    {
+                        counter += 1;
+
+                        if (!_fluentCommandLineParser.Object.QuietQuiet)
+                        {
                             _logger.Info(hit);
-                            sw?.WriteLine(hit);
-                        }
-                    }
-                    else
-                    {
-                        counter += 1;
-                        _logger.Info(hit);
+                        }
+
                         sw?.WriteLine(hit);
                     }
                 }
@@ -882,6 +900,7 @@
         public bool SortLength { get; set; } = false;
         public bool SortAlpha { get; set; } = false;
         public bool Quiet { get; set; } = false;
+        public bool QuietQuiet { get; set; } = false;
         public bool GetPatterns { get; set; } = false;
     }
 }


Added an extra comment

Added an extra comment

git-svn-id: 95472bb50cfb75dbf91fed26dc933cae36d5c45c@25 1ca100b6-b014-4248-a4f8-5dbb9f49130a

--- Example3/CustomEvent.cs
+++ Example3/CustomEvent.cs
@@ -9,6 +9,9 @@
     {
         private string m_AdditionalInformation;

+        /// <summary>
+        /// Additional information about our event
+        /// </summary>
         public string AdditionalInformation
         {
             get { return m_AdditionalInformation; }


[Rust] Add missing #region, fix compiling

--- Games/Unity/Oxide.Game.Rust/RustCore.cs
+++ Games/Unity/Oxide.Game.Rust/RustCore.cs
@@ -369,8 +369,6 @@
         }

-        #region Helpers
-
         /// <summary>
         /// Returns the BasePlayer for the specified name, ID, or IP address string
         /// </summary>


Improve logging

Improve logging

--- GenSync/Synchronization/Synchronizer.cs
+++ GenSync/Synchronization/Synchronizer.cs
@@ -392,6 +392,9 @@

       entitySyncStates.Execute (s => s.AddSyncronizationJob (aJobs, bJobs, logger.CreateEntitySynchronizationLogger(), synchronizationContext));

+      s_logger.InfoFormat($"A repository jobs: Create {aJobs.CreateJobs.Count} , Update {aJobs.UpdateJobs.Count} , Delete {aJobs.DeleteJobs.Count}");
+      s_logger.InfoFormat($"B repository jobs: Create {bJobs.CreateJobs.Count} , Update {bJobs.UpdateJobs.Count} , Delete {bJobs.DeleteJobs.Count}");
+
       using (var progress = totalProgress.StartProcessing (aJobs.TotalJobCount + bJobs.TotalJobCount))
       {
         await _atypeWriteRepository.PerformOperations (aJobs.CreateJobs, aJobs.UpdateJobs, aJobs.DeleteJobs, progress, synchronizationContext);


Further increasing performance

Further increasing performance

--- BatMap/MapContext.cs
+++ BatMap/MapContext.cs
@@ -42,14 +42,27 @@
             var inType = typeof(TIn);
             var outType = typeof(TOut);

-            var count = source.Count();
-            var retVal = new List<TOut>(count);
-            if (count == 0) return retVal;
+            List<TOut> retVal;
+            var sourceList = source as IList<TIn>;
+            if (sourceList != null) {
+                var count = sourceList.Count;
+                retVal = new List<TOut>(count);
+                if (count == 0) return retVal;

-            var mapDefinition = (IMapDefinition<TIn, TOut>)_mapper.GetMapDefinition(inType, outType);
-            var mapper = PreserveReferences ? mapDefinition.MapperWithCache : mapDefinition.Mapper;
-            foreach (var i in source) {
-                retVal.Add(mapper(i, this));
+                var mapDefinition = (IMapDefinition<TIn, TOut>) _mapper.GetMapDefinition(inType, outType);
+                var mapper = PreserveReferences ? mapDefinition.MapperWithCache : mapDefinition.Mapper;
+                for (var i = 0; i < count; i++) {
+                    retVal.Add(mapper(sourceList[i], this));
+                }
+            }
+            else {
+                retVal = new List<TOut>();
+
+                var mapDefinition = (IMapDefinition<TIn, TOut>)_mapper.GetMapDefinition(inType, outType);
+                var mapper = PreserveReferences ? mapDefinition.MapperWithCache : mapDefinition.Mapper;
+                foreach (var i in source) {
+                    retVal.Add(mapper(i, this));
+                }
             }

             return retVal;


[Modify] Polish it

[Modify] Polish it

--- websocket-sharp/Net/HttpListenerRequest.cs
+++ websocket-sharp/Net/HttpListenerRequest.cs
@@ -77,7 +77,6 @@
     private Uri                    _urlReferrer;
     private bool                   _urlSet;
     private string                 _userHostName;
-    private bool                   _userHostNameSet;
     private string[]               _userLanguages;
     private bool                   _websocketRequest;
     private bool                   _websocketRequestSet;
@@ -664,7 +663,7 @@

       var lower = name.ToLower (CultureInfo.InvariantCulture);
       if (lower == "host") {
-        if (_userHostNameSet) {
+        if (_userHostName != null) {
           _context.ErrorMessage = "Invalid Host header";
           return;
         }
@@ -675,8 +674,6 @@
         }

         _userHostName = val;
-        _userHostNameSet = true;
-
         return;
       }


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Net/WebHeaderCollection.cs
+++ websocket-sharp/Net/WebHeaderCollection.cs
@@ -1229,13 +1229,13 @@
     /// </param>
     /// <exception cref="ArgumentException">
     ///   <para>
+    ///   <paramref name="value"/> contains an invalid character.
+    ///   </para>
+    ///   <para>
+    ///   -or-
+    ///   </para>
+    ///   <para>
     ///   <paramref name="header"/> is a restricted header.
-    ///   </para>
-    ///   <para>
-    ///   -or-
-    ///   </para>
-    ///   <para>
-    ///   <paramref name="value"/> contains an invalid character.
     ///   </para>
     /// </exception>
     /// <exception cref="ArgumentOutOfRangeException">


[Modify] Edit it

[Modify] Edit it

--- websocket-sharp/Net/WebHeaderCollection.cs
+++ websocket-sharp/Net/WebHeaderCollection.cs
@@ -1362,6 +1362,12 @@
     ///   -or-
     ///   </para>
     ///   <para>
+    ///   <paramref name="headerName"/> is a string of spaces.
+    ///   </para>
+    ///   <para>
+    ///   -or-
+    ///   </para>
+    ///   <para>
     ///   <paramref name="headerName"/> contains an invalid character.
     ///   </para>
     /// </exception>


fix(notifications): execute activation of notification when the app is already launched #22

--- Gitter/Gitter/Gitter.Shared/App.xaml.cs
+++ Gitter/Gitter/Gitter.Shared/App.xaml.cs
@@ -23,6 +23,8 @@
 using Gitter.Views;
 using Microsoft.ApplicationInsights;
 using Microsoft.ApplicationInsights.Extensibility;
+using Microsoft.Practices.ServiceLocation;
+using Gitter.ViewModel;
 #if WINDOWS_PHONE_APP
 using GitHub.Services;
 #endif
@@ -51,7 +53,7 @@
         public static TelemetryClient TelemetryClient;

         /// <summary>
-        /// Selected Room Name when the app is launched (from Toast Notification)
+        /// Selected Room Name when the app is launched (from toast notification)
         /// </summary>
         public static string RoomName;

@@ -95,6 +97,17 @@

             // Ensure the current window is active
             Window.Current.Activate();
+
+            // Execute Toast Notification when the app is already launched
+            if (ServiceLocator.Current != null)
+            {
+                // Select room if there is a value in the app launcher
+                if (!string.IsNullOrWhiteSpace(RoomName))
+                {
+                    ViewModelLocator.Main.SelectRoom(RoomName);
+                    RoomName = string.Empty;
+                }
+            }
         }

         private Frame CreateRootFrame()


Added minprefix length to optimise fuzzy lookups

--- GoatTrip.DAL/LocationGroupRepository.cs
+++ GoatTrip.DAL/LocationGroupRepository.cs
@@ -43,6 +43,7 @@
              groupingStrategy.Fields.Select(f => f.Name).ToArray(),
              _analyzer);
             parser.DefaultOperator = QueryParser.Operator.AND;
+            parser.FuzzyPrefixLength = 3;
             Query luceneQuery = parser.Parse(query);
             return luceneQuery;
         }


fixed modulo

fixed modulo

--- AccelerationInput.cs
+++ AccelerationInput.cs
@@ -74,7 +74,7 @@

 			if(thisIndex < 0)
 			{
-				thisIndex = instance.historySize - 1;
+				thisIndex += instance.historySize;
 			}

 			addedAccels += instance.history[thisIndex];