StateChanged only if we have a Glow effect

--- MahApps.Metro/Behaviours/GlowWindowBehavior.cs
+++ MahApps.Metro/Behaviours/GlowWindowBehavior.cs
@@ -19,7 +19,6 @@

             this.AssociatedObject.Loaded += AssociatedObjectOnLoaded;
             this.AssociatedObject.Unloaded += AssociatedObjectUnloaded;
-            this.AssociatedObject.StateChanged += AssociatedObjectStateChanged;
         }

         void AssociatedObjectStateChanged(object sender, EventArgs e)
@@ -101,6 +100,9 @@
             {
                 return;
             }
+
+            this.AssociatedObject.StateChanged -= AssociatedObjectStateChanged;
+            this.AssociatedObject.StateChanged += AssociatedObjectStateChanged;

             if (makeGlowVisibleTimer == null)
             {


Got Single test passing

Got Single test passing

--- MedallionOData/Client/LinqToODataTranslator.cs
+++ MedallionOData/Client/LinqToODataTranslator.cs
@@ -342,6 +342,12 @@
                         // TODO won't work because default object is null but default of others is not
                         this._resultTranslator = MakeTranslator<object>(e => e.FirstOrDefault());
                         return Take(source, 1);
+                    case "Single":
+                        this._resultTranslator = MakeTranslator<object>(e => e.Single());
+                        return Take(source, 2);
+                    case "SingleOrDefault":
+                        this._resultTranslator = MakeTranslator<object>(e => e.SingleOrDefault());
+                        return Take(source, 2);
 					default:
 						throw new ODataCompileException("Query operator " + call.Method + " is not supported in OData");
 				}


RuntimeInvoke for ToString needs to force its way into the actually implemented overload by passing an empty type args array

--- MonoDevelop.Debugger.Win32/CorObjectAdaptor.cs
+++ MonoDevelop.Debugger.Win32/CorObjectAdaptor.cs
@@ -277,7 +277,7 @@
 				MethodInfo met = OverloadResolve (cctx, "ToString", targetType, new CorType[0], BindingFlags.Public | BindingFlags.Instance, false);
 				if (met != null && met.DeclaringType.FullName != "System.Object") {
 					var args = new object[0];
-					object ores = RuntimeInvoke (ctx, targetType, objr, "ToString", args, args);
+					object ores = RuntimeInvoke (ctx, targetType, objr, "ToString", new object[0], args, args);
 					var res = GetRealObject (ctx, ores) as CorStringValue;
                     if (res != null)
                         return res.String;


Fixeddouble playing songs

Fixeddouble playing songs

--- MusicPlayer.Shared/Playback/AudioFadePlayer.cs
+++ MusicPlayer.Shared/Playback/AudioFadePlayer.cs
@@ -306,7 +306,7 @@
 				return;
 			if (!data.Item1)
 				return;
-			await player.PrepareData (data.Item2,true);
+			await player.PrepareData (data.Item2, false);

 		}


BulletSim: change how prim mass is saved so it is always calculated but zero is given if not physical.

--- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -133,10 +133,7 @@
         _parentPrim = null;     // not a child or a parent
         _vehicle = new BSDynamics(this);    // add vehicleness
         _childrenPrims = new List<BSPrim>();
-        if (_isPhysical)
-            _mass = CalculateMass();
-        else
-            _mass = 0f;
+        _mass = CalculateMass();
         // do the actual object creation at taint time
         _scene.TaintedObject(delegate()
         {
@@ -181,8 +178,8 @@
             _size = value;
             _scene.TaintedObject(delegate()
             {
-                if (_isPhysical) _mass = CalculateMass();   // changing size changes the mass
-                BulletSimAPI.SetObjectScaleMass(_scene.WorldID, _localID, _scale, _mass, _isPhysical);
+                _mass = CalculateMass();   // changing size changes the mass
+                BulletSimAPI.SetObjectScaleMass(_scene.WorldID, _localID, _scale, Mass, IsPhysical);
                 RecreateGeomAndObject();
             });
         }
@@ -192,7 +189,7 @@
             _pbs = value;
             _scene.TaintedObject(delegate()
             {
-                if (_isPhysical) _mass = CalculateMass();   // changing the shape changes the mass
+                _mass = CalculateMass();   // changing the shape changes the mass
                 RecreateGeomAndObject();
             });
         }
@@ -278,6 +275,8 @@
                 child._parentPrim = this;    // the child has gained a parent
                 // RecreateGeomAndObject();    // rebuild my shape with the new child added
                 LinkAChildToMe(pchild);     // build the physical binding between me and the child
+
+                _mass = CalculateMass();
             }
         });
         return;
@@ -306,6 +305,8 @@
                     // RecreateGeomAndObject();    // rebuild my shape with the child removed
                     UnlinkAChildFromMe(pchild);
                 }
+
+                _mass = CalculateMass();
             }
             else
             {
@@ -364,9 +365,17 @@
             });
         }
     }
+
+    // Return the effective mass of the object. Non-physical objects do not have mass.
     public override float Mass {
-        get { return _mass; }
-    }
+        get {
+            if (IsPhysical)
+                return _mass;
+            else
+                return 0f;
+        }
+    }
+
     public override OMV.Vector3 Force {
         get { return _force; }
         set {
@@ -446,7 +455,8 @@
     // Called from Scene when doing simulation step so we're in taint processing time.
     public void StepVehicle(float timeStep)
     {
-        _vehicle.Step(timeStep);
+        if (IsPhysical)
+            _vehicle.Step(timeStep);
     }

     // Allows the detection of collisions with inherently non-physical prims. see llVolumeDetect for more
@@ -543,20 +553,13 @@
     {
         // m_log.DebugFormat("{0}: ID={1}, SetObjectDynamic: IsStatic={2}, IsSolid={3}", LogHeader, _localID, IsStatic, IsSolid);
         // non-physical things work best with a mass of zero
-        if (IsStatic)
-        {
-            _mass = 0f;
-        }
-        else
+        if (!IsStatic)
         {
             _mass = CalculateMass();
-            // If it's dynamic, make sure the hull has been created for it
-            // This shouldn't do much work if the object had previously been built
             RecreateGeomAndObject();
-
-        }
-        DetailLog("{0},SetObjectDynamic,taint,static={1},solid={2},mass={3}", LocalID, IsStatic, IsSolid, _mass);
-        BulletSimAPI.SetObjectProperties(_scene.WorldID, LocalID, IsStatic, IsSolid, SubscribedEvents(), _mass);
+        }
+        DetailLog("{0},SetObjectDynamic,taint,static={1},solid={2},mass={3}", LocalID, IsStatic, IsSolid, Mass);
+        BulletSimAPI.SetObjectProperties(_scene.WorldID, LocalID, IsStatic, IsSolid, SubscribedEvents(), Mass);
     }

     // prims don't fly
@@ -1273,7 +1276,7 @@
         shape.Rotation = _orientation;
         shape.Velocity = _velocity;
         shape.Scale = _scale;
-        shape.Mass = _isPhysical ? _mass : 0f;
+        shape.Mass = Mass;
         shape.Buoyancy = _buoyancy;
         shape.HullKey = _hullKey;
         shape.MeshKey = _meshKey;


Fix assembly info.

Fix assembly info.

--- ParallelMSpecRunner/Properties/AssemblyInfo.cs
+++ ParallelMSpecRunner/Properties/AssemblyInfo.cs
@@ -5,12 +5,12 @@
 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("ParallelMSpecRunner")]
+[assembly: AssemblyTitle("IvanZ.TeamCity.ParallelMSpecRunner")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ParallelMSpecRunner")]
-[assembly: AssemblyCopyright("Copyright ©  2014")]
+[assembly: AssemblyProduct("mspec-teamcity-prunner")]
+[assembly: AssemblyCopyright("Copyright © Ivan Zlatev 2014")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

@@ -32,5 +32,5 @@
 // You can specify all the values or you can default the Build and Revision Numbers
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyFileVersion("1.0.0.0")]


Update Attack.cs

Update Attack.cs


[FIXED] Creating new forum (#464)

[FIXED] Creating new forum (#464)

--- yafsrc/YetAnotherForum.NET/pages/admin/editforum.ascx.cs
+++ yafsrc/YetAnotherForum.NET/pages/admin/editforum.ascx.cs
@@ -83,12 +83,14 @@
         /// </param>
         protected void BindDataAccessMaskId([NotNull] object sender, [NotNull] EventArgs e)
         {
-            if (sender is DropDownList dropDownList)
-            {
-                dropDownList.DataSource = this.GetRepository<AccessMask>().GetByBoardId();
-                dropDownList.DataValueField = "ID";
-                dropDownList.DataTextField = "Name";
-            }
+            if (!(sender is DropDownList dropDownList))
+            {
+                return;
+            }
+
+            dropDownList.DataSource = this.GetRepository<AccessMask>().GetByBoardId();
+            dropDownList.DataValueField = "ID";
+            dropDownList.DataTextField = "Name";
         }

         /// <summary>
@@ -150,11 +152,9 @@
         /// </returns>
         protected int? GetQueryStringAsInt([NotNull] string name)
         {
-            int value;
-
             if (this.Request.QueryString.GetFirstOrDefault(name) != null && int.TryParse(
                     this.Request.QueryString.GetFirstOrDefault(name),
-                    out value))
+                    out var value))
             {
                 return value;
             }
@@ -214,7 +214,6 @@

             if (!forumId.HasValue)
             {
-
                 this.LocalizedLabel1.LocalizedTag = this.LocalizedLabel2.LocalizedTag = "NEW_FORUM";

                 var sortOrder = 1;
@@ -222,7 +221,7 @@
                 try
                 {
                     // Currently creating a New Forum, and auto fill the Forum Sort Order + 1
-                    var forum = this.GetRepository<Types.Models.Forum>().List(this.PageContext.PageBoardID, null)
+                    var forum = this.GetRepository<Forum>().List(this.PageContext.PageBoardID, null)
                         .OrderByDescending(a => a.SortOrder).FirstOrDefault();

                     sortOrder = forum.SortOrder + sortOrder;
@@ -235,10 +234,9 @@
                 this.SortOrder.Text = sortOrder.ToString();

                 return;
-
-            }
-
-            var dt = this.GetRepository<Types.Models.Forum>().List(this.PageContext.PageBoardID, forumId);
+            }
+
+            var dt = this.GetRepository<Forum>().List(this.PageContext.PageBoardID, forumId);

             var row = dt.FirstOrDefault();
             this.Name.Text = row.Name;
@@ -291,7 +289,6 @@

             this.remoteurl.Text = row.RemoteURL;

-
             this.NewGroupRow.Visible = false;
         }

@@ -399,7 +396,7 @@
         /// </summary>
         private void BindParentList()
         {
-            this.ParentList.DataSource = this.GetRepository<Types.Models.Forum>().ListAllFromCatAsDataTable(
+            this.ParentList.DataSource = this.GetRepository<Forum>().ListAllFromCatAsDataTable(
                 this.PageContext.PageBoardID,
                 this.CategoryList.SelectedValue.ToType<int>());

@@ -427,7 +424,7 @@
         /// </summary>
         private void ClearCaches()
         {
-            // clear moderatorss cache
+            // clear moderators cache
             this.Get<IDataCache>().Remove(Constants.Cache.ForumModerators);

             // clear category cache...
@@ -465,8 +462,6 @@
                 return;
             }

-            short sortOrder;
-
             if (!ValidationHelper.IsValidPosShort(this.SortOrder.Text.Trim()))
             {
                 this.PageContext.AddLoadMessage(
@@ -475,7 +470,7 @@
                 return;
             }

-            if (!short.TryParse(this.SortOrder.Text.Trim(), out sortOrder))
+            if (!short.TryParse(this.SortOrder.Text.Trim(), out var sortOrder))
             {
                 this.PageContext.AddLoadMessage(this.GetText("ADMIN_EDITFORUM", "MSG_NUMBER"), MessageTypes.warning);
                 return;
@@ -522,7 +517,8 @@
             // If we update a forum ForumID > 0
             if (forumId.HasValue && parentId != null)
             {
-                var dependency = this.GetRepository<Types.Models.Forum>().SaveParentsChecker(forumId.Value, parentId.Value);
+                var dependency = this.GetRepository<Forum>()
+                    .SaveParentsChecker(forumId.Value, parentId.Value);
                 if (dependency > 0)
                 {
                     this.PageContext.AddLoadMessage(this.GetText("ADMIN_EDITFORUM", "MSG_CHILD_PARENT"));
@@ -530,7 +526,7 @@
                 }
             }

-            // inital access mask
+            // initial access mask
             if (!forumId.HasValue && !forumCopyId.HasValue)
             {
                 if (this.AccessMaskID.SelectedValue.Length == 0)
@@ -545,10 +541,9 @@
             // duplicate name checking...
             if (!forumId.HasValue)
             {
-                var forumList = this.GetRepository<Types.Models.Forum>().List(this.PageContext.PageBoardID, null);
-
-                if (forumList.Any() && !this.Get<YafBoardSettings>().AllowForumsWithSameName
-                                    && forumList.Any(dr => dr.Name == this.Name.Text.Trim()))
+                var forumList = this.GetRepository<Forum>().Get(f => f.Name == this.Name.Text.Trim());
+
+                if (forumList.Any() && !this.Get<YafBoardSettings>().AllowForumsWithSameName)
                 {
                     this.PageContext.AddLoadMessage(
                         this.GetText("ADMIN_EDITFORUM", "MSG_FORUMNAME_EXISTS"),
@@ -564,7 +559,7 @@
                 themeUrl = this.ThemeList.SelectedValue;
             }

-            var newForumId = this.GetRepository<Types.Models.Forum>().Save(
+            var newForumId = this.GetRepository<Forum>().Save(
                 forumId,
                 this.CategoryList.SelectedValue,
                 parentId,


removed hardcoded identity

removed hardcoded identity

--- Presentation.Web/Controllers/BaseController.cs
+++ Presentation.Web/Controllers/BaseController.cs
@@ -39,9 +39,7 @@
             _logger.Log("Before initialize Basecontroller. User.Identity.Name=" + User.Identity.Name, "web", 3);
             base.Initialize(requestContext);

-            string[] httpUser = User.Identity.Name.Split('\\');
-            httpUser[0] = "MIRACLE";
-            httpUser[1] = "at";
+            string[] httpUser = User.Identity.Name.Split('\\')
             //TESTETTSTESTESTESTEST

             _logger.Log("httpuserinitials: " + httpUser[1] + "httOrganisation: " + httpUser[0], "web", 3);


Incremented version.

Incremented version.

--- src/Abp.Samples.Blog.Core/AbpSampleBlogConsts.cs
+++ src/Abp.Samples.Blog.Core/AbpSampleBlogConsts.cs
@@ -2,6 +2,6 @@
 {
     public class AbpSampleBlogConsts
     {
-        public const string Version = "0.1.0.0";
+        public const string Version = "0.2.0.0";
     }
 }


Better logic around response headers

Better logic around response headers

--- src/Adapters/Gate.Adapters.Nancy/NancyAdapter.cs
+++ src/Adapters/Gate.Adapters.Nancy/NancyAdapter.cs
@@ -74,8 +74,14 @@
                                 var nancyResponse = context.Response;
                                 var status = String.Format("{0} {1}", (int)nancyResponse.StatusCode, nancyResponse.StatusCode);
                                 var headers = nancyResponse.Headers.ToDictionary(kv => kv.Key, kv => (IEnumerable<string>)new[] { kv.Value }, StringComparer.OrdinalIgnoreCase);
-                                headers["Content-Type"] = new[] { nancyResponse.ContentType };
-                                headers["Set-Cookie"] = nancyResponse.Cookies.Select(cookie => cookie.ToString());
+                                if (!string.IsNullOrWhiteSpace(nancyResponse.ContentType))
+                                {
+                                    headers["Content-Type"] = new[] { nancyResponse.ContentType };
+                                }
+                                if (nancyResponse.Cookies != null && nancyResponse.Cookies.Count != 0)
+                                {
+                                    headers["Set-Cookie"] = nancyResponse.Cookies.Select(cookie => cookie.ToString());
+                                }

                                 result(
                                     status,


Added SceneNode.RemoveAndDestroyChild( String name )
      SceneNode.RemoveAndDestroyChild( int index )
      SceneNode.RemoveAndDestroyAllChildren()

git-svn-id: ad71a101fa69fb252e58119732bf51384d5dbd95@1511 bb9bf1cf-960d-0410-9a3a-baeba60cf407

--- Projects/Axiom/Source/Engine/Core/SceneNode.cs
+++ Projects/Axiom/Source/Engine/Core/SceneNode.cs
@@ -406,7 +406,7 @@
         }

         /// <summary>
-        ///    Removes the specifed object from this scene node.
+        ///    Removes the specified object from this scene node.
         /// </summary>
         /// <remarks>
         ///    Bounds for this SceneNode are also updated.
@@ -481,6 +481,74 @@
             if ( objectList.Count <= index )
                 return null;
             return objectList[ index ];
+        }
+
+        /// <summary>
+        /// This method removes and destroys the child and all of its children.
+        /// </summary>
+        /// <param name="name">name of the node to remove and destroy</param>
+        /// <remarks>
+        /// Unlike removeChild, which removes a single named child from this
+        /// node but does not destroy it, this method destroys the child
+        /// and all of it's children.
+        /// <para>
+        /// Use this if you wish to recursively destroy a node as well as
+        /// detaching it from it's parent. Note that any objects attached to
+        /// the nodes will be detached but will not themselves be destroyed.
+        /// </para>
+        /// </remarks>
+        public virtual void RemoveAndDestroyChild( String name )
+        {
+            SceneNode child = (SceneNode)this.GetChild( name );
+            child.RemoveAndDestroyAllChildren();
+
+            this.RemoveChild( name );
+            child.Creator.DestroySceneNode( name );
+        }
+
+        /// <summary>
+        /// This method removes and destroys the child and all of its children.
+        /// </summary>
+        /// <param name="index">index of the node to remove and destroy</param>
+        /// <remarks>
+        /// Unlike removeChild, which removes a single named child from this
+        /// node but does not destroy it, this method destroys the child
+        /// and all of it's children.
+        /// <para>
+        /// Use this if you wish to recursively destroy a node as well as
+        /// detaching it from it's parent. Note that any objects attached to
+        /// the nodes will be detached but will not themselves be destroyed.
+        /// </para>
+        /// </remarks>
+        public virtual void RemoveAndDestroyChild( int index )
+        {
+            SceneNode child = (SceneNode) this.GetChild( index );
+            child.RemoveAndDestroyAllChildren();
+
+            this.RemoveChild( index );
+            child.Creator.DestroySceneNode( child.Name );
+        }
+
+        /// <summary>
+        /// Removes and destroys all children of this node.
+        /// </summary>
+        /// <remarks>
+        /// Use this to destroy all child nodes of this node and remove
+        /// them from the scene graph. Note that all objects attached to this
+        /// node will be detached but will not be destroyed.
+        /// </remarks>
+        public virtual void RemoveAndDestroyAllChildren()
+        {
+            while( this.childNodes.Count!=  0)
+            {
+                SceneNode sn = (SceneNode)this.childNodes[ 0 ];
+                // increment iterator before destroying (iterator invalidated by
+                // SceneManager::destroySceneNode because it causes removal from parent)
+                sn.RemoveAndDestroyAllChildren();
+                sn.Creator.DestroySceneNode( sn.Name );
+            }
+            childNodes.Clear();
+            NeedUpdate();
         }

         /// <summary>
@@ -783,6 +851,40 @@
         ///		remain the same). If you need more control, use the <see cref="Orientation"/>
         ///		property.
         /// </remarks>
+        /// <param name="x">The x component of the direction vector.</param>
+        /// <param name="y">The y component of the direction vector.</param>
+        /// <param name="z">The z component of the direction vector.</param>
+        /// <param name="relativeTo">The space in which this direction vector is expressed.</param>
+        /// <param name="localDirection">The vector which normally describes the natural direction
+        ///		of the node, usually -Z.
+        ///	</param>
+        public void SetDirection(Real x, Real y, Real z, TransformSpace relativeTo, Vector3 localDirectionVector)
+        {
+            Vector3 dir;
+            dir.x = x;
+            dir.y = y;
+            dir.z = z;
+            SetDirection(dir, relativeTo, localDirectionVector);
+        }
+
+        public void SetDirection(Real x, Real y, Real z )
+        {
+            SetDirection(x,y,z,TransformSpace.Local,Vector3.NegativeUnitZ);
+        }
+        public void SetDirection(Real x, Real y, Real z, TransformSpace relativeTo )
+        {
+            SetDirection(x, y, z, relativeTo, Vector3.NegativeUnitZ);
+        }
+
+        /// <summary>
+        ///		Sets the node's direction vector ie it's local -z.
+        /// </summary>
+        /// <remarks>
+        ///		Note that the 'up' vector for the orientation will automatically be
+        ///		recalculated based on the current 'up' vector (i.e. the roll will
+        ///		remain the same). If you need more control, use the <see cref="Orientation"/>
+        ///		property.
+        /// </remarks>
         /// <param name="vec">The direction vector.</param>
         /// <param name="relativeTo">The space in which this direction vector is expressed.</param>
         /// <param name="localDirection">The vector which normally describes the natural direction
@@ -865,6 +967,16 @@
             }
         }

+        public void SetDirection(Vector3 vec)
+        {
+            SetDirection(vec, TransformSpace.Local, Vector3.NegativeUnitZ);
+        }
+
+        public void SetDirection(Vector3 vec, TransformSpace relativeTo)
+        {
+            SetDirection(vec, relativeTo, Vector3.NegativeUnitZ);
+        }
+
         /// <summary>
         ///    Allows retrieval of the nearest lights to the center of this SceneNode.
         /// </summary>


wasn't checking for null vendors.

wasn't checking for null vendors.

--- Purchasing.Web/Views/Order/_OrdersTable.cshtml
+++ Purchasing.Web/Views/Order/_OrdersTable.cshtml
@@ -77,7 +77,7 @@
         }
         else
         {
-            result.Append("" + @Html.Encode(item.Vendor.DisplayName) + "	");
+            result.Append("" + @Html.Encode(item.Vendor != null ? item.Vendor.DisplayName : string.Empty) + "	");
         }
     }


Adição método para recuperar logos dos bancos.

--- src/Boleto.Net/BoletoImpressao/BoletoBancario.cs
+++ src/Boleto.Net/BoletoImpressao/BoletoBancario.cs
@@ -1177,8 +1177,7 @@

             var assembly = Assembly.GetExecutingAssembly();

-            var streamLogo = assembly.GetManifestResourceStream("BoletoNet.Imagens." + CodigoBanco.ToString("000") + ".jpg");
-            string base64Logo = Convert.ToBase64String(new BinaryReader(streamLogo).ReadBytes((int)streamLogo.Length));
+            string base64Logo = Convert.ToBase64String(ObterLogoDoBanco(CodigoBanco));
             string fnLogo = string.Format("data:image/gif;base64,{0}", base64Logo);

             var streamBarra = assembly.GetManifestResourceStream("BoletoNet.Imagens.barra.gif");
@@ -1281,6 +1280,17 @@
             return cb.ToBitmap();
         }

+        /// <summary>
+        /// Obtem o array de bytes da logo do banco.
+        /// </summary>
+        /// <returns>bytes da logo</returns>
+        public static byte[] ObterLogoDoBanco(short codigoBanco)
+        {
+            var assembly = Assembly.GetExecutingAssembly();
+            var streamLogo = assembly.GetManifestResourceStream(string.Format("BoletoNet.Imagens.{0}.jpg", codigoBanco.ToString("000")));
+            return new BinaryReader(streamLogo).ReadBytes((int)streamLogo.Length);
+        }
+
         private void CopiarStream(Stream entrada, Stream saida)
         {
             int bytesLidos = 0;


Additional test logic

Additional test logic

--- SQLDatabase.Tests/ConfigurationFactoryClass.cs
+++ SQLDatabase.Tests/ConfigurationFactoryClass.cs
@@ -20,16 +20,19 @@
             }

             [TestMethod]
-            public void ReturnsSomethingWithValues()
+            public void ReturnsValuesFromSources()
             {
-                var factory = new ConfigurationFactory(new IConfigurationSource[] { new MemoryConfigurationSource { InitialData = new[]
+                var data = new[]
                 {
-                    new KeyValuePair<string, string>("hello", "world")
-                } } });
+                    new KeyValuePair<string, string>("hello", "world"),
+                    new KeyValuePair<string, string>("goodbye", "moon")
+                };
+                var factory = new ConfigurationFactory(new IConfigurationSource[] { new MemoryConfigurationSource { InitialData = data} });
                 var config = factory.CreateConfiguration();
                 var children = config.GetChildren();
-                Assert.IsNotNull(children);
-                Assert.IsTrue(children.Any());
+                Assert.IsNotNull(children, $"{nameof(children)} is null");
+                Assert.IsTrue(children.Any(), $"{nameof(children)} is empty");
+                Assert.IsTrue(config.AsEnumerable().Zip(data, (one, other) => one.Key == other.Key && one.Value == other.Value).Aggregate(true, (a, b) => a && b), $"{nameof(config)} doesn't return name values we put in");
             }
         }
     }


[CSHARP-280] Integration tests for timer-based reconnections

--- src/Cassandra.IntegrationTests/Core/PoolTests.cs
+++ src/Cassandra.IntegrationTests/Core/PoolTests.cs
@@ -457,12 +457,21 @@
             Assert.AreEqual(4, connectionAttempts);
         }

-        /// <summary>
-        /// Execute a couple of time.
-        /// Set the host as down manually.
-        /// Do nothing for a while, letting the reconnection policy to kick in.
-        /// Check if the node is considered as down.
-        /// </summary>
+        /// Tests that reconnection attempts are made automatically in the background
+        ///
+        /// Reconnection_Attempts_Are_Made_In_The_Background tests that the driver automatically reschedules host
+        /// reconnections using timers in the background. It first creates a Cassandra cluster with 2 nodes, and verifies
+        /// that the control connection is created against the first host. It then manually sets the 2nd node as down (even
+        /// though it is still up), verifying that the driver see that host 2 as down. Finally it waits 5 seconds for the
+        /// timer-based reconnection policy to kick in, and verifies that the driver sees the 2nd host as back up.
+        ///
+        /// @since 2.7.0
+        /// @jira_ticket CSHARP-280
+        /// @expected_result Host 2 should be automatically reconnected in the background after being set as down
+        ///
+        /// @test_assumptions
+        ///    - A Cassandra cluster with 2 nodes
+        /// @test_category connection:reconnection
         [Test]
         public void Reconnection_Attempts_Are_Made_In_The_Background()
         {
@@ -470,26 +479,43 @@

             var cluster = Cluster.Builder()
                                  .AddContactPoint(testCluster.InitialContactPoint)
-                                 //TODO: Make sure that heartbeat is disabled
                                  .WithPoolingOptions(
                                      new PoolingOptions()
-                                         .SetCoreConnectionsPerHost(HostDistance.Local, 2))
+                                         .SetCoreConnectionsPerHost(HostDistance.Local, 2)
+                                         .SetHeartBeatInterval(0))
                                  .WithReconnectionPolicy(new ConstantReconnectionPolicy(2000))
                                  .Build();
             var session = (Session)cluster.Connect();
             TestHelper.Invoke(() => session.Execute("SELECT * FROM system.local"), 10);
             var host = cluster.AllHosts().First(h => TestHelper.GetLastAddressByte(h) == 2);
-            //Check that the control connection is connected to another host
+            // Check that the control connection is connected to another host
             Assert.AreNotEqual(cluster.Metadata.ControlConnection.BindAddress, host.Address);
             Assert.True(host.IsUp);
-            Trace.TraceInformation("Setting host as down");
+            Trace.TraceInformation("Setting host 2 of 2 as down");
             host.SetDown();
             Assert.False(host.IsUp);
-            Trace.TraceInformation("Waiting");
+            Trace.TraceInformation("Waiting for 5 seconds");
             Thread.Sleep(5000);
             Assert.True(host.IsUp);
         }

+        /// Tests that reconnection attempts are made multiple times in the background
+        ///
+        /// Reconnection_Attempted_Multiple_Times tests that the driver automatically reschedules host reconnections using
+        /// timers in the background multiple times. It first creates a Cassandra cluster with a single node, and verifies
+        /// that the driver considers it as up. It then stops the single node and verifies that the driver considers the node
+        /// as down, by both executing a query and retreiving a NoHostAvailableException, and checking the host status manually.
+        /// It then waits 15 seconds before verifying once more that the host is seen as down by the driver. Finally it restarts
+        /// the single node, waits 5 seconds for the timer-based reconnection policy to kick in, and verifies that the driver sees
+        /// the host as back up.
+        ///
+        /// @since 2.7.0
+        /// @jira_ticket CSHARP-280
+        /// @expected_result The host should be attempted to be reconnected multiple times in the background
+        ///
+        /// @test_assumptions
+        ///    - A Cassandra cluster with a single node
+        /// @test_category connection:reconnection
         [Test]
         public void Reconnection_Attempted_Multiple_Times()
         {
@@ -507,17 +533,17 @@
                 TestHelper.Invoke(() => session.Execute("SELECT * FROM system.local"), 10);
                 var host = cluster.AllHosts().First();
                 Assert.True(host.IsUp);
-                Trace.TraceInformation("Stopping node");
+                Trace.TraceInformation("Stopping node 1 of 1");
                 testCluster.Stop(1);
-                //Make sure the node is considered down
+                // Make sure the node is considered down
                 Assert.Throws<NoHostAvailableException>(() => session.Execute("SELECT * FROM system.local"));
                 Assert.False(host.IsUp);
-                Trace.TraceInformation("Waiting");
+                Trace.TraceInformation("Waiting for 15 seconds");
                 Thread.Sleep(15000);
                 Assert.False(host.IsUp);
-                Trace.TraceInformation("Restarting node");
+                Trace.TraceInformation("Restarting node 1 of 1");
                 testCluster.Start(1);
-                Trace.TraceInformation("Waiting 2");
+                Trace.TraceInformation("Waiting for 5 seconds");
                 Thread.Sleep(5000);
                 Assert.True(host.IsUp);
             }


Works on Android.

Works on Android.

--- Sensus.Shared/Probes/Location/AltitudeDatum.cs
+++ Sensus.Shared/Probes/Location/AltitudeDatum.cs
@@ -56,7 +56,7 @@
         public AltitudeDatum(DateTimeOffset timestamp, double hPa)
             : base(timestamp)
         {
-            // convert hPa to altitude:  http://www.srh.noaa.gov/images/epz/wxcalc/pressureAltitude.pdf
+            // convert hPa to altitude:  https://www.weather.gov/media/epz/wxcalc/pressureAltitude.pdf
             _altitude = (1 - Math.Pow((hPa / 1013.25), 0.190284)) * 145366.45;
         }


Superexpert: issue 26701-Fixed issue OnActiveTabIndex not firing at tab index 0

--- Server/AjaxControlToolkit/Tabs/TabContainer.cs
+++ Server/AjaxControlToolkit/Tabs/TabContainer.cs
@@ -100,7 +100,6 @@
                 for (int i = 0; i <= ActiveTabIndex && i < Tabs.Count; i++) {
                     if (!Tabs[i].Visible) counter--;
                 }
-                if (counter < 0) counter = 0;
                 return counter;
             }
         }
@@ -429,7 +428,7 @@
         protected override bool LoadPostData(string postDataKey, NameValueCollection postCollection) {
             int tabIndex = ActiveTabIndex;
             bool result = base.LoadPostData(postDataKey, postCollection);
-            if (tabIndex != ActiveTabIndex) {
+            if (ActiveTabIndex == 0 || tabIndex != ActiveTabIndex) {
                 return true;
             }
             return result;
@@ -483,7 +482,6 @@
                 int parseIndex = eventArgument.IndexOf(":", StringComparison.Ordinal);
                 Debug.Assert(parseIndex != -1, "Expected new active tab index!");
                 if (parseIndex != -1 && Int32.TryParse(eventArgument.Substring(parseIndex + 1), out parseIndex)) {
-                    parseIndex = getServerActiveTabIndex(parseIndex);
                     if (parseIndex != ActiveTabIndex) {
                         ActiveTabIndex = parseIndex;
                         OnActiveTabChanged(EventArgs.Empty);


added support for CancellationToken in ReadAsync for WinRT

--- src/CombinationStream-Net20/CombinationStream.cs
+++ src/CombinationStream-Net20/CombinationStream.cs
@@ -108,7 +108,7 @@

             while (count > 0)
             {
-                int bytesRead = await _currentStream.ReadAsync(buffer, buffPostion, count);
+                int bytesRead = await _currentStream.ReadAsync(buffer, buffPostion, count, cancellationToken);
                 result += bytesRead;
                 buffPostion += bytesRead;
                 _postion += bytesRead;


fix service name bug with '/' slash

fix service name bug with '/' slash

--- SignalGo.Server.Owin/SignalGoHttpMiddleware.cs
+++ SignalGo.Server.Owin/SignalGoHttpMiddleware.cs
@@ -37,7 +37,7 @@
             //}

             string uri = context.Request.Path.Value + context.Request.QueryString.ToString();
-            string serviceName = uri.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault();
+            string serviceName = uri.Contains('/') ? uri.Substring(0, uri.LastIndexOf('/')).Trim('/') : "";
             bool isWebSocketd = context.Request.Headers.ContainsKey("Sec-WebSocket-Key");
             if (!BaseProvider.ExistService(serviceName, CurrentServerBase) && !isWebSocketd && !context.Request.Headers.ContainsKey("signalgo-servicedetail") && context.Request.Headers["content-type"] != "SignalGo Service Reference")
             {


WeatherDataLoader: actually build weather data for Yahoo

--- SimpleWeather/WeatherData/WeatherDataLoader.cs
+++ SimpleWeather/WeatherData/WeatherDataLoader.cs
@@ -104,6 +104,8 @@
                         {
                             root = (WeatherYahoo.Rootobject)JsonConvert.DeserializeObject(content, typeof(WeatherYahoo.Rootobject));
                         });
+
+                        weather = new Weather(root);
                     }
                 }
                 catch (Exception ex)


Cleanup

Cleanup

--- SnapMD.VirtualCare.ApiModels/Enums/UserType.cs
+++ SnapMD.VirtualCare.ApiModels/Enums/UserType.cs
@@ -5,6 +5,7 @@
     [ModelName("ApiModels.UserType")]
     public enum UserType
     {
+        Unknown = 0,
         Customer = 1,
         Clinician = 2
     }


log error from exceptions on 2fa registration

--- src/Core/Services/Implementations/UserService.cs
+++ src/Core/Services/Implementations/UserService.cs
@@ -405,8 +405,9 @@
                 await UpdateTwoFactorProviderAsync(user, TwoFactorProviderType.U2f);
                 return true;
             }
-            catch(U2fException)
-            {
+            catch(U2fException e)
+            {
+                Logger.LogError(e, "Complete U2F registration error.");
                 return false;
             }
         }


Updated required fields in AssemblyInfo.cs.

--- src/Dapper.SimpleSave/Properties/AssemblyInfo.cs
+++ src/Dapper.SimpleSave/Properties/AssemblyInfo.cs
@@ -6,11 +6,11 @@
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
 [assembly: AssemblyTitle("Dapper.SimpleSave")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyDescription("Dapper.SimpleSave")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyCompany("Paymentsense")]
 [assembly: AssemblyProduct("Dapper.SimpleSave")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
+[assembly: AssemblyCopyright("Copyright © Paymentsense 2015")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


DateTimeExtensions.Truncate

DateTimeExtensions.Truncate

--- src/DotNetCommons/Temporal/DateTimeExtensions.cs
+++ src/DotNetCommons/Temporal/DateTimeExtensions.cs
@@ -216,4 +216,15 @@
                 throw new ArgumentOutOfRangeException(nameof(format), format, null);
         }
     }
-}+
+    /// <summary>
+    /// Truncates a DateTime to a specified resolution. A convenient source for resolution is TimeSpan.TicksPerXXXX constants.
+    /// From https://stackoverflow.com/questions/1004698/how-to-truncate-milliseconds-off-of-a-net-datetime
+    /// </summary>
+    /// <param name="date">The DateTime object to truncate</param>
+    /// <param name="resolution">e.g. to round to nearest second, TimeSpan.TicksPerSecond</param>
+    public static DateTime Truncate(this DateTime date, long resolution)
+    {
+        return new DateTime(date.Ticks - (date.Ticks % resolution), date.Kind);
+    }
+}


AVN: added a limit on how many times we try to block an assertion, before suppressing it.

--- AddOns/AngelicVerifierNull/AngelicVerifierNull/Program.cs
+++ AddOns/AngelicVerifierNull/AngelicVerifierNull/Program.cs
@@ -666,6 +666,9 @@
             }
         }

+        // How many times an assertion has been blocked for an entrypoint
+        static Dictionary<Tuple<string, string>, int> AssertionBlockedCount = new Dictionary<Tuple<string, string>, int>();
+
         //Run Corral over different assertions (modulo errorLimit)
         // Returns true if the call finishes conclusively
         private static bool RunCorralIterative(AvnInstrumentation instr, int corralTimeout)
@@ -759,28 +762,48 @@
                 }
                 else if (eeStatus.Item1 == REFINE_ACTIONS.BLOCK_PATH)
                 {
-                    var constraintId = instr.SuppressInput(eeStatus.Item2, failingEntryPoint);
-                    pendingTraces.Add(constraintId, traceInfo);
-                    Stats.count("blocked.count");
-
-                    // Check inconsistency
-                    var inconsistent = CheckInconsistency(instr, failingEntryPoint);
-
-                    if (inconsistent.Count != 0)
+                    // check how many times we've blocked this guy
+                    var done = false;
+                    if (assertLoc != null)
                     {
-                        Debug.Assert(inconsistent.Contains(constraintId));
-                        Console.WriteLine("Hard constraint inconsistency detected: ", inconsistent.Print());
-                        // drop asserts
-                        PrintAndSuppressAssert(instr, pendingTraces.Where(tup => inconsistent.Contains(tup.Key)).Select(tup => tup.Value));
-                        // drop constraints
-                        inconsistent.Iter(id => instr.RemoveInputSuppression(id, failingEntryPoint));
-                        // drop traces
-                        inconsistent.Iter(id => pendingTraces.Remove(id));
+                        var key = Tuple.Create(assertLoc.ToString(), failingEntryPoint);
+                        if (!AssertionBlockedCount.ContainsKey(key))
+                            AssertionBlockedCount[key] = 0;
+                        AssertionBlockedCount[key]++;
+
+                        if (AssertionBlockedCount[key] > MAX_ASSERT_BLOCK_COUNT)
+                        {
+                            Console.WriteLine("Unable to block {0} after {1} tries; hence suppressing", assertLoc, MAX_ASSERT_BLOCK_COUNT);
+                            SuppressAssert(instr, new List<ErrorTraceInfo> { traceInfo });
+                            done = true;
+                        }
                     }
-                    else
-                    {
-                        // Relax env constraints
-                        RelaxEnvironmentConstraints(instr, failingEntryPoint);
+
+                    if (!done)
+                    {
+                        var constraintId = instr.SuppressInput(eeStatus.Item2, failingEntryPoint);
+                        pendingTraces.Add(constraintId, traceInfo);
+                        Stats.count("blocked.count");
+
+                        // Check inconsistency
+                        var inconsistent = CheckInconsistency(instr, failingEntryPoint);
+
+                        if (inconsistent.Count != 0)
+                        {
+                            Debug.Assert(inconsistent.Contains(constraintId));
+                            Console.WriteLine("Hard constraint inconsistency detected: ", inconsistent.Print());
+                            // drop asserts
+                            PrintAndSuppressAssert(instr, pendingTraces.Where(tup => inconsistent.Contains(tup.Key)).Select(tup => tup.Value));
+                            // drop constraints
+                            inconsistent.Iter(id => instr.RemoveInputSuppression(id, failingEntryPoint));
+                            // drop traces
+                            inconsistent.Iter(id => pendingTraces.Remove(id));
+                        }
+                        else
+                        {
+                            // Relax env constraints
+                            RelaxEnvironmentConstraints(instr, failingEntryPoint);
+                        }
                     }

                 }
@@ -1548,6 +1571,7 @@
         private enum REFINE_ACTIONS { SHOW_AND_SUPPRESS, SUPPRESS, BLOCK_PATH };
         private const int MAX_REPEATED_FIELDS_IN_BLOCKS = 4;
         private const int MAX_REPEATED_BLOCK_EXPR = 2; // maximum number of repeated block expr
+        private const int MAX_ASSERT_BLOCK_COUNT = 10; // maximum times we try to block an assertion
         private static Dictionary<string, int> fieldInBlockCount = new Dictionary<string, int>();
         private static Dictionary<Tuple<string, string>, int> blockExprCount = new Dictionary<Tuple<string, string>, int>(); // count repeated block expr
         private static Tuple<REFINE_ACTIONS,Expr> CheckWithExplainError(Program nprog, Implementation mainImpl,


Remove unused variable

Remove unused variable

--- src/Host/Client/Impl/Session/RSessionProvider.cs
+++ src/Host/Client/Impl/Session/RSessionProvider.cs
@@ -26,7 +26,6 @@
         private readonly IConsole _console;

         private volatile bool _isConnected;
-        private volatile bool _isRunning;

         private int _sessionCounter;
         private Task _updateHostLoadLoopTask;


Assembly info

Assembly info

--- src/ITC.UnifaunOnline/Properties/AssemblyInfo.cs
+++ src/ITC.UnifaunOnline/Properties/AssemblyInfo.cs
@@ -5,12 +5,12 @@
 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("ITC.UnifaunOnline")]
-[assembly: AssemblyDescription("")]
+[assembly: AssemblyTitle("UnifaunOnline Order XML Generator")]
+[assembly: AssemblyDescription("UnifaunOnline Order XML Generator")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("ITCompaniet AB")]
 [assembly: AssemblyProduct("ITC.UnifaunOnline")]
-[assembly: AssemblyCopyright("Copyright ©  2016")]
+[assembly: AssemblyCopyright("Copyright © ITCompaniet AB 2016")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


Fix type-o of 'Validation' in OperationResultException.BuildValiationMessage

--- src/Invio.Validation/OperationResultException.cs
+++ src/Invio.Validation/OperationResultException.cs
@@ -8,7 +8,7 @@
         public OperationResultBase OperationResult { get; }

         public OperationResultException(ISet<ValidationIssue> validationIssues)
-            : base(BuildValiationIssuesMessage(validationIssues)) {
+            : base(BuildValidationIssuesMessage(validationIssues)) {
             if (validationIssues == null) {
                 throw new ArgumentNullException(nameof(validationIssues));
             }
@@ -18,7 +18,7 @@

         public OperationResultException(ISet<ValidationIssue> validationIssues, Exception innerException)
-            : base(BuildValiationIssuesMessage(validationIssues), innerException) {
+            : base(BuildValidationIssuesMessage(validationIssues), innerException) {
             if (validationIssues == null) {
                 throw new ArgumentNullException(nameof(validationIssues));
             }
@@ -27,7 +27,7 @@
         }

         public OperationResultException(OperationResultBase operationResult)
-            : base(BuildValiationIssuesMessage(operationResult)) {
+            : base(BuildValidationIssuesMessage(operationResult)) {
             if (operationResult == null) {
                 throw new ArgumentNullException(nameof(operationResult));
             }
@@ -36,7 +36,7 @@
         }

         public OperationResultException(OperationResultBase operationResult, Exception innerException)
-            : base(BuildValiationIssuesMessage(operationResult), innerException) {
+            : base(BuildValidationIssuesMessage(operationResult), innerException) {
             if (operationResult == null) {
                 throw new ArgumentNullException(nameof(operationResult));
             }
@@ -44,16 +44,16 @@
             this.OperationResult = operationResult;
         }

-        private static String BuildValiationIssuesMessage(
+        private static String BuildValidationIssuesMessage(
             OperationResultBase operationResult) {
             if (operationResult == null) {
                 throw new ArgumentNullException(nameof(operationResult));
             }

-            return BuildValiationIssuesMessage(operationResult.ValidationIssues);
+            return BuildValidationIssuesMessage(operationResult.ValidationIssues);
         }

-        private static String BuildValiationIssuesMessage(
+        private static String BuildValidationIssuesMessage(
             ISet<ValidationIssue> validationIssues) {
             if (validationIssues == null) {
                 throw new ArgumentNullException(nameof(validationIssues));


Added workaround for wrong default scripts location

--- samples/photo_album_mvc4/Views/Home/Upload.cshtml
+++ samples/photo_album_mvc4/Views/Home/Upload.cshtml
@@ -39,7 +39,7 @@
 {
     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

-    @Html.Raw(Model.Cloudinary.GetCloudinaryJsConfig(true))
+    @Html.Raw(Model.Cloudinary.GetCloudinaryJsConfig(false, "/Scripts"))

     <script>
         $(function () {


Remove Canadian Styling of bool

Remove Canadian Styling of bool

--- CRP.Mvc/Views/ItemManagement/_TabTransactions.cshtml
+++ CRP.Mvc/Views/ItemManagement/_TabTransactions.cshtml
@@ -12,7 +12,7 @@
                 Amount
                 Payment Type
                 Paid
-                Active Eh
+                Active


Fixed usage of Color-property

Fixed usage of Color-property

--- smithNgine/Gfx/MenuEntry.cs
+++ smithNgine/Gfx/MenuEntry.cs
@@ -23,7 +23,7 @@
         #endregion

         #region Properties
-        public Color Color
+        public Color TextColor
         {
             get;
             set;
@@ -40,7 +40,7 @@
         {
             this.font = font;
             this.label = label;
-            Color = Color.Black;
+            TextColor = Color.Black;
             entryOrigin = font.MeasureString(label) / 2;
         }
         #endregion
@@ -56,7 +56,7 @@
             base.Draw(spriteBatch);

             // Draw the text
-            spriteBatch.DrawString(font, label, this.Position, Color, Rotation, entryOrigin, Scale, SpriteEffects.None, Order);
+            spriteBatch.DrawString(font, label, this.Position, TextColor, Rotation, entryOrigin, Scale, SpriteEffects.None, Order);
         }
         #endregion


Try to get around timeout

Try to get around timeout

--- Commencement.Mvc/Controllers/EmailQueueController.cs
+++ Commencement.Mvc/Controllers/EmailQueueController.cs
@@ -63,7 +63,10 @@
                 throw new Exception("Id not supplied");
             }

-            var queue = _emailQueueRepository.Queryable.Where(a => a.Student.StudentId == id).ToArray();
+            var studentList = _studentRepository.Queryable.Where(a => a.StudentId == id).Select(s => s.Id).ToArray();
+
+
+            var queue = _emailQueueRepository.Queryable.Where(a => studentList.Contains(a.Student.Id)).ToArray();

             return View(queue);
         }


DataTransfer: EntryTunnel updated - bugfix at connect routine, minor refactor

--- CustomBlocks/DataTransfer/EntryTunnel/EntryTunnel.cs
+++ CustomBlocks/DataTransfer/EntryTunnel/EntryTunnel.cs
@@ -44,7 +44,7 @@
 		private int isDisposed = 0;
 		private int stateChangeWorkers = 0;

-		private class OfflineSwitchException : Exception { }
+		private class StateSwitchException : Exception { }

 		private EntryTunnel()
 		{
@@ -83,14 +83,28 @@
 				catch (Exception ex)
 				{
 					tEx = ex;
+					pendingState = TunnelState.Offline;
 				}
 				finally
 				{
-					evCtl.Raise(this, new TunnelStateEventArgs(pendingState, tEx), () => {
-						state = pendingState;
-						writeLock.Release();
-						readLock.Release();
-					});
+					try
+					{
+						evCtl.Raise(this, new TunnelStateEventArgs(pendingState, tEx), () =>
+						{
+							try
+							{
+								if (state != TunnelState.Init)
+									throw new StateSwitchException();
+								state = pendingState;
+							}
+							finally
+							{
+								writeLock.Release();
+								readLock.Release();
+							}
+						});
+					}
+					catch(StateSwitchException) {}
 					Interlocked.Decrement(ref stateChangeWorkers);
 				}
 			});
@@ -198,7 +212,7 @@
 						try
 						{
 							if (state == TunnelState.Offline)
-								throw new OfflineSwitchException();
+								throw new StateSwitchException();
 							try { downstream.Disconnect(); }
 							catch (Exception ex) { if (iEx == null) iEx = ex; }
 							state = TunnelState.Offline;
@@ -216,7 +230,7 @@
 						}
 					});
 				}
-				catch (OfflineSwitchException) {}
+				catch (StateSwitchException) {}
 				Interlocked.Decrement(ref stateChangeWorkers);
 			});
 		}


fix build

fix build

--- LiteNetLib/NetManager.cs
+++ LiteNetLib/NetManager.cs
@@ -78,7 +78,7 @@
     /// <summary>
     /// Main class for all network operations. Can be used as client and/or server.
     /// </summary>
-    public class NetManager : INetSocketListener, IConnectionRequestListener, IEnumerable<NetPeer>
+    public class NetManager : INetSocketListener, IEnumerable<NetPeer>
     {
         private class IPEndPointComparer : IEqualityComparer<IPEndPoint>
         {


Bugfix

Bugfix

--- Assets/FancyScrollView/Sources/Runtime/FancyScrollRect.cs
+++ Assets/FancyScrollView/Sources/Runtime/FancyScrollRect.cs
@@ -3,7 +3,7 @@

 namespace FancyScrollView
 {
-    [RequireComponent(typeof(Scroller)), ExecuteInEditMode]
+    [RequireComponent(typeof(Scroller))]
     public abstract class FancyScrollRect<TItemData, TContext>
         : FancyScrollView<TItemData, TContext> where TContext : class, IFancyScrollRectContext, new()
     {
@@ -25,6 +25,8 @@
         protected virtual void Start()
         {
             Scroller.Snap.Enable = false;
+            scrollOffset = cellInterval;
+
             Scroller.OnValueChanged(p =>
                 base.UpdatePosition(ScrollEnabled ? ToFancyScrollViewPosition(p) : 0f));
         }


Add positive tests covering strings in ExistsIn

--- ChameleonForms.Tests/Attributes/ExistsInAttributeTests.cs
+++ ChameleonForms.Tests/Attributes/ExistsInAttributeTests.cs
@@ -113,17 +113,38 @@
             Assert.That(result.ErrorMessage, Is.EqualTo(string.Format(expectedError, validationContext.DisplayName)));
         }

-        [Test]
-        public void Successfully_validate_non_ienumerable_property()
+        private readonly ModelBindingViewModel[] _validViewModels =
+        {
+            new ModelBindingViewModel{ RequiredString = "" },
+            new ModelBindingViewModel{ RequiredString = null },
+            new ModelBindingViewModel{ RequiredString = "1" }
+        };
+        [TestCaseSource("_validViewModels")]
+        public void Successfully_validate_string_property(ModelBindingViewModel vm)
         {
             const string valueProperty = "Id";
             const string nameProperty = "Name";
             const string listProperty = "List";
-            var vm = new ViewModelExample { ListId = 1 };
             var validationContext = new ValidationContext(vm, null, null);
             var attribute = new ExistsInAttribute(listProperty, valueProperty, nameProperty);

-            var result = attribute.GetValidationResult(vm.ListId, validationContext);
+            var result = attribute.GetValidationResult(vm.RequiredString, validationContext);
+
+            Assert.That(result, Is.Null, string.Format("Validation failed with message: {0}", attribute.ErrorMessage));
+        }
+
+        [TestCase(1)]
+        [TestCase(null)]
+        public void Successfully_validate_non_ienumerable_property(int? submittedValue)
+        {
+            const string valueProperty = "Id";
+            const string nameProperty = "Name";
+            const string listProperty = "List";
+            var vm = new ModelBindingViewModel { OptionalInt = submittedValue };
+            var validationContext = new ValidationContext(vm, null, null);
+            var attribute = new ExistsInAttribute(listProperty, valueProperty, nameProperty);
+
+            var result = attribute.GetValidationResult(vm.OptionalInt, validationContext);

             Assert.That(result, Is.Null, string.Format("Validation failed with message: {0}", attribute.ErrorMessage));
         }


Refactored ErrorViewModel

Refactored ErrorViewModel

--- CmsEngine.Application/Models/ViewModels/ErrorViewModel.cs
+++ CmsEngine.Application/Models/ViewModels/ErrorViewModel.cs
@@ -2,14 +2,19 @@
 {
     public class ErrorViewModel
     {
-        public string RequestId { get; set; }
+        public string Title { get; }
+        public string Message { get; }

-        public bool ShowRequestId
+        public ErrorViewModel(string message)
         {
-            get
-            {
-                return !string.IsNullOrEmpty(RequestId);
-            }
+            Title = "Error";
+            Message = message;
+        }
+
+        public ErrorViewModel(string pageTitle, string message)
+        {
+            Title = pageTitle;
+            Message = message;
         }
     }
 }


More fixes for the AllowMixedHeaderCharsets formatting option

--- MimeKit/Utils/Rfc2047.cs
+++ MimeKit/Utils/Rfc2047.cs
@@ -1380,18 +1380,18 @@
 				int maxEncoding = 0;

 				for (int i = 0; i < words.Count; i++) {
-					if (words[i].Encoding == maxEncoding)
+					if (words[i].Type != WordType.EncodedWord || words[i].Encoding == maxEncoding)
 						continue;

 					if (words[i].Encoding > maxEncoding) {
 						maxEncoding = words[i].Encoding;
 						for (int j = 0; j <= i; j++) {
-							if (words[j].Encoding == 0)
+							if (words[j].Type != WordType.EncodedWord)
 								continue;

 							words[j].Encoding = maxEncoding;
 						}
-					} else if (words[i].Encoding > 0) {
+					} else {
 						words[i].Encoding = maxEncoding;
 					}
 				}


Fix peverify complains class/valuetype mismatch on WinRT types

Fix #417

--- Confuser.Renamer/References/OverrideDirectiveReference.cs
+++ Confuser.Renamer/References/OverrideDirectiveReference.cs
@@ -50,6 +50,8 @@
 						service.AddReference(baseSlot.MethodDef, new MemberRefReference((MemberRef)target, baseSlot.MethodDef));
 				}
 			}
+
+			target.MethodSig = new Importer(method.Module, ImporterOptions.TryToUseTypeDefs).Import(method.MethodSig);
 			if (target is MemberRef)
 				AddImportReference(context, service, method.Module, baseSlot.MethodDef, (MemberRef)target);


Fix Monitor View Location UI

Fix Monitor View Location UI

--- DynThings.WebPortal/Views/Monitor/_MonitorLocation.cshtml
+++ DynThings.WebPortal/Views/Monitor/_MonitorLocation.cshtml
@@ -1,21 +1,17 @@
 @model DynThings.Data.Models.Location
-

 @foreach (var ePoint in Model.EndPoints)
 {
     <Text>
-
     <button id="btnEndPoint_@ePoint.GUID" class="btn btn-default" onclick="LoadEndPointParts('@ePoint.GUID')" style="height:120px;min-width:120px">
         @**@
-         @**@
-        @ePoint.Title
+        @**@
+        @ePoint.Title

         @ePoint.EndPointType.Title

         @ePoint.LastInput.Valu
-
     </button>
-
     </text>
 }

@@ -26,47 +22,30 @@

History

Commands

-
-

-

-

+

+

+

+

+

+

+

+

+

+

+

+

+
Menu 2

+
Some content in menu 2.

+

-

-

-

-

-

-

-
Menu 2

-
Some content in menu 2.

-
-@*@foreach (var ePoint in Model.EndPoints)
-{
-    <Text>
-
-    <button id="btnEndPoint_@ePoint.GUID" class="shortcut-button @ePoint.CssColor.Css   fg-white" onclick="LoadEndPointParts('@ePoint.GUID')" style="border:solid;border-bottom-width:thick;">
-
-        @ePoint.Title
-        @ePoint.EndPointType.Title
-
-    </button>
-
-    </text>
-}*@
-
-
-
-

-
+</script>


ToString_VerifyOutput fails in non dot separator cultures.

--- EvilDICOM.Core/EvilDICOM.Core.Tests/DecimalStringTests.cs
+++ EvilDICOM.Core/EvilDICOM.Core.Tests/DecimalStringTests.cs
@@ -3,6 +3,8 @@
 using EvilDICOM.Core.Element;
 using EvilDICOM.Core.Helpers;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System.Globalization;
+using System.Threading;

 namespace EvilDICOM.Core.Tests
 {
@@ -82,13 +84,53 @@
         }

         [TestMethod]
-        public void ToString_VerifyOutput()
+        public void ToString_VerifyOutput_CurrentCultureInsensitive_AreNotEqual()
         {
             const string expected = "(300A,0082) : BeamDoseSpecificationPoint (DecimalString) -> 1 | -3.5 | 2.5";
-            var actual = _decimalString.ToString();
-            Assert.AreEqual(expected, actual);
+            var currentThread = Thread.CurrentThread;
+            var currentCulture = currentThread.CurrentCulture;
+
+            currentThread.CurrentCulture = CreateNonDotSeparatorCulture();
+
+            try
+            {
+                var actual = _decimalString.ToString();
+                Assert.AreNotEqual(expected, actual);
+            }
+            finally
+            {
+                currentThread.CurrentCulture = currentCulture;
+            }
+        }
+
+        [TestMethod]
+        public void ToString_VerifyOutput_CurrentCultureSensitive_AreEqual()
+        {
+            const string expected = "(300A,0082) : BeamDoseSpecificationPoint (DecimalString) -> 1 | -3*5 | 2*5";
+            var currentThread = Thread.CurrentThread;
+            var currentCulture = currentThread.CurrentCulture;
+
+            currentThread.CurrentCulture = CreateNonDotSeparatorCulture();
+
+            try
+            {
+                var actual = _decimalString.ToString();
+                Assert.AreEqual(expected, actual);
+            }
+            finally
+            {
+                currentThread.CurrentCulture = currentCulture;
+            }
+        }
+
+        private static CultureInfo CreateNonDotSeparatorCulture()
+        {
+            var nonDotSeparatorCulture = (CultureInfo)CultureInfo.InvariantCulture.Clone();
+            nonDotSeparatorCulture.NumberFormat.NumberGroupSeparator = "@";
+            nonDotSeparatorCulture.NumberFormat.NumberDecimalSeparator = "*";
+            return nonDotSeparatorCulture;
         }

         #endregion
     }
-}+}


Add extension methods to read from and write to 3rd party storages

--- SolidworksAddinFramework/ModelDocExtensions.cs
+++ SolidworksAddinFramework/ModelDocExtensions.cs
@@ -5,6 +5,7 @@
 using System.Numerics;
 using System.Reactive.Disposables;
 using System.Reactive.Linq;
+using System.Runtime.InteropServices.ComTypes;
 using System.Threading.Tasks;
 using LanguageExt;
 using LanguageExt.Parsec;
@@ -435,7 +436,7 @@
                 },()=>false);
         }

-        public static Option<KeyValuePair<int,SwEq>> GetGlobal(this IModelDoc2 doc, string name)
+        public static Option<KeyValuePair<int, SwEq>> GetGlobal(this IModelDoc2 doc, string name)
         {
             return doc.GetGlobals().FirstOrDefault(g => g.Value.Id == name);
         }
@@ -546,6 +547,40 @@
         }

+        public static void WriteStorage(this IModelDoc2 doc, string selectionStorageId, string data)
+        {
+            using (var stream = doc.OpenStreamForWriting(selectionStorageId))
+            {
+                stream.Resource?.WriteAllText(data);
+            }
+        }
+
+        public static void ReadStorage(this IModelDoc2 doc, string storageId, Action<string> action)
+        {
+            using (var stream = doc.OpenStreamForReading(storageId))
+            {
+                var storage = stream.Resource;
+                var data = storage?.ReadAllText();
+                action(data);
+            }
+        }
+
+        public static ResourceDisposable<IStream> OpenStreamForWriting(this IModelDoc2 doc, string storageId)
+        {
+            return OpenStream(doc, storageId, isStoring: true);
+        }
+
+        public static ResourceDisposable<IStream> OpenStreamForReading(this IModelDoc2 doc, string storageId)
+        {
+            return OpenStream(doc, storageId, isStoring: false);
+        }
+
+        private static ResourceDisposable<IStream> OpenStream(IModelDoc2 doc, string storageId, bool isStoring)
+        {
+            var obj = doc.IGet3rdPartyStorage(storageId, IsStoring: isStoring);
+            var closeStream = Disposable.Create(() => doc.IRelease3rdPartyStorage(storageId));
+            return ResourceDisposable.Create((IStream) obj, closeStream);
+        }
     }

     public static class ParserExt


fix rebase error

fix rebase error

--- SolidworksAddinFramework/ModellerExtensions.cs
+++ SolidworksAddinFramework/ModellerExtensions.cs
@@ -114,6 +114,13 @@
             return curve;
         }

+        public static IBody2 CreateBodyFromCylTs(this IModeler modeler, double[] xyz, double[] axis, double radius, double length)
+        {
+            var array = xyz.Concat(axis).Concat(new[] { radius, length }).ToArray();
+            return (IBody2)modeler.CreateBodyFromCyl(array);
+        }
+
+
         public static IEnumerable<double[]> FilterOutShortLines(List<double[]> points, double tol)
         {
             double[] previous = null;


made message more triggering so ppl try again kek

--- SoraBot-v2/SoraBot-v2/Module/GamblingModule.cs
+++ SoraBot-v2/SoraBot-v2/Module/GamblingModule.cs
@@ -69,7 +69,7 @@
             else
             {
                 await this.ReplySoraEmbedResponse(Utility.YellowWarningEmbed, Utility.NoEmoji,
-                    $"You lost :(");
+                    $"You lost :( Better luck next time!");
             }
         }
     }


Added more log info properties to be ignored.

--- Source/Core/Extensions/LogBuilderExtensions.cs
+++ Source/Core/Extensions/LogBuilderExtensions.cs
@@ -22,7 +22,7 @@
                 if (errorBuilderAction != null)
                     errorBuilderAction(exBuilder);

-                exBuilder.AddObject(builder.LogEventInfo, name: "Log Info", excludedPropertyNames: new List<string> { "Exception" });
+                exBuilder.AddObject(builder.LogEventInfo, name: "Log Info", excludedPropertyNames: new List<string> { "Exception", "Message", "LoggerShortName", "SequenceID", "TimeStamp" });

                 exBuilder.Submit();
             }


Minor addition of method info

Minor addition of method info

--- Glav.CognitiveServices.FluentApi.Core/CommonExtensions.cs
+++ Glav.CognitiveServices.FluentApi.Core/CommonExtensions.cs
@@ -8,6 +8,12 @@
     /// </summary>
     public static class CommonExtensions
     {
+        /// <summary>
+        /// Evaluate the score or confidence level value using the scoring engine of the API being used.
+        /// </summary>
+        /// <param name="context">API Context</param>
+        /// <param name="scoreValue">The value to parse</param>
+        /// <returns></returns>
         public static ScoreLevelBoundsDefinition Score<T>(this BaseApiAnalysisContext<T> context, double scoreValue) where T : IApiCallResult
         {
             return context.ScoringEngine.EvaluateScore(scoreValue);


Add descriptions for WLAN_NOTIFICATION_ACM

--- Source/ManagedNativeWifi/Win32/NativeMethod.cs
+++ Source/ManagedNativeWifi/Win32/NativeMethod.cs
@@ -730,33 +730,174 @@
 			wlan_intf_opcode_ihv_end = 0x3fffffff
 		}

+		/// <summary>
+		/// WLAN_NOTIFICATION_DATA structure:
+		/// https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms706902(v=vs.85)
+		/// </summary>
 		public enum WLAN_NOTIFICATION_ACM : uint
 		{
 			wlan_notification_acm_start = 0,
+
+			/// <summary>
+			/// <para>Autoconfiguration is enabled.</para>
+			/// </summary>
 			wlan_notification_acm_autoconf_enabled,
+
+			/// <summary>
+			/// <para>Autoconfiguration is disabled.</para>
+			/// </summary>
 			wlan_notification_acm_autoconf_disabled,
+
+			/// <summary>
+			/// <para>Background scans are enabled.</para>
+			/// </summary>
 			wlan_notification_acm_background_scan_enabled,
+
+			/// <summary>
+			/// <para>Background scans are disabled.</para>
+			/// </summary>
 			wlan_notification_acm_background_scan_disabled,
+
+			/// <summary>
+			/// <para>The BSS type for an interface has changed.</para>
+			/// <para>The pData member points to a DOT11_BSS_TYPE enumeration value that identifies
+			/// the new basic service set (BSS) type.</para>
+			/// </summary>
 			wlan_notification_acm_bss_type_change,
+
+			/// <summary>
+			/// <para>The power setting for an interface has changed.</para>
+			/// <para>The pData member points to a WLAN_POWER_SETTING enumeration value that
+			/// identifies the new power setting of an interface.</para>
+			/// </summary>
 			wlan_notification_acm_power_setting_change,
+
+			/// <summary>
+			/// <para>A scan for networks has completed.</para>
+			/// </summary>
 			wlan_notification_acm_scan_complete,
+
+			/// <summary>
+			/// <para>A scan for connectable networks failed.</para>
+			/// <para>The pData member points to a WLAN_REASON_CODE data type value that identifies
+			/// the reason the WLAN operation failed.</para>
+			/// </summary>
 			wlan_notification_acm_scan_fail,
+
+			/// <summary>
+			/// <para>A connection has started to a network in range.</para>
+			/// <para>The pData member points to a WLAN_CONNECTION_NOTIFICATION_DATA structure that
+			/// identifies the network information for the connection attempt.</para>
+			/// </summary>
 			wlan_notification_acm_connection_start,
+
+			/// <summary>
+			/// <para>A connection has completed.</para>
+			/// <para>The pData member points to a WLAN_CONNECTION_NOTIFICATION_DATA structure that
+			/// identifies the network information for the connection attempt that completed.
+			/// The connection succeeded if the wlanReasonCode in WLAN_CONNECTION_NOTIFICATION_DATA
+			/// is WLAN_REASON_CODE_SUCCESS. Otherwise, the connection has failed.</para>
+			/// </summary>
 			wlan_notification_acm_connection_complete,
+
+			/// <summary>
+			/// <para>A connection attempt has failed.</para>
+			/// <para>A connection consists of one or more connection attempts. An application may
+			/// receive zero or more wlan_notification_acm_connection_attempt_fail notifications
+			/// between receiving the wlan_notification_acm_connection_start notification and
+			/// the wlan_notification_acm_connection_complete notification.</para>
+			/// <para>The pData member points to a WLAN_CONNECTION_NOTIFICATION_DATA structure that
+			/// identifies the network information for the connection attempt that failed.</para>
+			/// </summary>
 			wlan_notification_acm_connection_attempt_fail,
+
+			/// <summary>
+			/// <para>A change in the filter list has occurred, either through group policy or
+			/// a call to the WlanSetFilterList function.</para>
+			/// <para>An application can call the WlanGetFilterList function to retrieve the new
+			/// filter list.</para>
+			/// </summary>
 			wlan_notification_acm_filter_list_change,
+
+			/// <summary>
+			/// <para>A wireless LAN interface has been added to or enabled on the local computer.</para>
+			/// </summary>
 			wlan_notification_acm_interface_arrival,
+
+			/// <summary>
+			/// <para>A wireless LAN interface has been removed or disabled on the local computer.</para>
+			/// </summary>
 			wlan_notification_acm_interface_removal,
+
+			/// <summary>
+			/// <para>A change in a profile or the profile list has occurred, either through group
+			/// policy or by calls to Native Wifi functions.</para>
+			/// <para>An application can call the WlanGetProfileList and WlanGetProfile functions
+			/// to retrieve the updated profiles. The interface on which the profile list changes
+			/// is identified by the InterfaceGuid member.</para>
+			/// </summary>
 			wlan_notification_acm_profile_change,
+
+			/// <summary>
+			/// <para>A profile name has changed, either through group policy or by calls to Native
+			/// Wifi functions.</para>
+			/// <para>The pData member points to a buffer that contains two NULL-terminated WCHAR
+			/// strings, the old profile name followed by the new profile name.</para>
+			/// </summary>
 			wlan_notification_acm_profile_name_change,
+
+			/// <summary>
+			/// <para>All profiles were exhausted in an attempt to autoconnect.</para>
+			/// </summary>
 			wlan_notification_acm_profiles_exhausted,
+
+			/// <summary>
+			/// <para>The wireless service cannot find any connectable network after a scan.</para>
+			/// <para>The interface on which no connectable network is found is identified by
+			/// the InterfaceGuid member.</para>
+			/// </summary>
 			wlan_notification_acm_network_not_available,
+
+			/// <summary>
+			/// <para>The wireless service found a connectable network after a scan, the interface
+			/// was in the disconnected state, and there is no compatible auto-connect profile that
+			/// the wireless service can use to connect.</para>
+			/// <para>The interface on which connectable networks are found is identified by
+			/// the InterfaceGuid member.</para>
+			/// </summary>
 			wlan_notification_acm_network_available,
+
+			/// <summary>
+			/// <para>The wireless service is disconnecting from a connectable network.</para>
+			/// <para>The pData member points to a WLAN_CONNECTION_NOTIFICATION_DATA structure that
+			/// identifies the network information for the connection that is disconnecting.</para>
+			/// </summary>
 			wlan_notification_acm_disconnecting,
+
+			/// <summary>
+			/// <para>The wireless service has disconnected from a connectable network.</para>
+			/// <para>The pData member points to a WLAN_CONNECTION_NOTIFICATION_DATA structure that
+			/// identifies the network information for the connection that disconnected.</para>
+			/// </summary>
 			wlan_notification_acm_disconnected,
+
+			/// <summary>
+			/// <para>A state change has occurred for an adhoc network.</para>
+			/// <para>The pData member points to a WLAN_ADHOC_NETWORK_STATE enumeration value that
+			/// identifies the new adhoc network state.</para>
+			/// </summary>
 			wlan_notification_acm_adhoc_network_state_change,
+
 			wlan_notification_acm_profile_unblocked,
+
+			/// <summary>
+			/// <para>The screen power has changed.</para>
+			/// <para>The pData member points to a BOOL value that indicates the value of
+			/// the screen power change. When this value is TRUE, the screen changed to on.
+			/// When this value is FALSE, the screen changed to off.</para>
+			/// </summary>
 			wlan_notification_acm_screen_power_change,
+
 			wlan_notification_acm_profile_blocked,
 			wlan_notification_acm_scan_list_refresh,
 			wlan_notification_acm_end


Explicitly added an instruction that saves the calling method whenever a method call is rewritten

--- Deflector/Deflector/MethodCallInterceptionEmitter.cs
+++ Deflector/Deflector/MethodCallInterceptionEmitter.cs
@@ -380,6 +380,10 @@
             // Push the current method
             SaveMethodCallArguments(il, targetMethod);

+            // Save the calling method
+            il.PushMethod(callingMethod, module);
+            il.Emit(OpCodes.Stloc, _callingMethod);
+
             PushThisPointer(il, targetMethod);

             SaveCurrentMethod(il, targetMethod, module);


Add suberrorcode to exception (#113)

Add suberrorcode to exception (#113)

--- Mozu.Api/ApiException.cs
+++ Mozu.Api/ApiException.cs
@@ -64,6 +64,12 @@
             }
             catch (Exception) { }

+            try
+            {
+                SubErrorCode = (string)info.GetValue("subErrorCode", typeof(string));
+            }
+            catch (Exception) { }
+

             try
             {
@@ -95,6 +101,7 @@
         }
         public string ApplicationName { get; private set; }
         public string ErrorCode { get; private set; }
+        public string SubErrorCode { get; private set; }
         public IApiContext ApiContext { get; set; }
         public String CorrelationId { get; set; }
         public ExceptionDetail ExceptionDetail;


1.3 -> 1.5 for Beast coefficient.

1.3 -> 1.5 for Beast coefficient.

--- Laboration.DoggieDayCare/Models/DogBreed/BeastDogBreed.cs
+++ Laboration.DoggieDayCare/Models/DogBreed/BeastDogBreed.cs
@@ -15,7 +15,7 @@
         public override decimal GetCostOfCare(Booking booking)
         {
             var daySpanAsDecimal = Convert.ToDecimal((booking.CheckOut.ToUniversalTime() - booking.CheckIn.ToUniversalTime()).TotalDays);
-            var housingCost = daySpanAsDecimal * BaseCosts.PerDayOfCare * 1.3M;
+            var housingCost = daySpanAsDecimal * BaseCosts.PerDayOfCare * 1.5M;

             var foodCost = BaseCosts.PerKiloGramOfFood * (booking.CheckInFoodWeight - booking.CheckOutFoodWeight) * 1.5M;


Have correct # of sortable columns in Excel sheet

--- LiveSplit/LiveSplit.Core/Model/RunSavers/ExcelRunSaver.cs
+++ LiveSplit/LiveSplit.Core/Model/RunSavers/ExcelRunSaver.cs
@@ -128,7 +128,7 @@
                 ++rowIndex;
             }

-            sheet.AutoFilter = sheet[0, 0, rowIndex - 1, 1];
+            sheet.AutoFilter = sheet[0, 0, rowIndex - 1, 3];
         }

         private void FillSegmentHistorySheet(Sheet sheet, IRun run)


Changed subqueries to improve folder browsing in restore

--- Duplicati/Library/Main/Database/LocalListDatabase.cs
+++ Duplicati/Library/Main/Database/LocalListDatabase.cs
@@ -266,8 +266,8 @@
                         //Then we select the matching results
                         var filesets = string.Format(@"SELECT ""FilesetID"", ""Timestamp"" FROM ""{0}"" ORDER BY ""Timestamp"" DESC", m_tablename);
                         var cartesianPathFileset = string.Format(@"SELECT ""A"".""Path"", ""B"".""FilesetID"" FROM ""{0}"" A, (" + filesets + @") B ORDER BY ""A"".""Path"" ASC, ""B"".""Timestamp"" DESC", tbname, m_tablename);
-
-                        var filesWithSizes = @"SELECT ""Length"", ""FilesetEntry"".""FilesetID"", ""File"".""Path"" FROM ""Blockset"", ""FilesetEntry"", ""File"" WHERE ""File"".""BlocksetID"" = ""Blockset"".""ID"" AND ""FilesetEntry"".""FileID"" = ""File"".""ID"" ";
+
+                        var filesWithSizes = string.Format(@"SELECT ""Length"", ""FilesetEntry"".""FilesetID"", ""File"".""Path"" FROM ""Blockset"", ""FilesetEntry"", ""File"" WHERE ""File"".""BlocksetID"" = ""Blockset"".""ID"" AND ""FilesetEntry"".""FileID"" = ""File"".""ID"" AND FilesetEntry.""FilesetID"" IN (SELECT DISTINCT ""FilesetID"" FROM ""{0}"") ", m_tablename);
                         var query = @"SELECT ""C"".""Path"", ""D"".""Length"", ""C"".""FilesetID"" FROM (" + cartesianPathFileset + @") C LEFT OUTER JOIN (" + filesWithSizes + @") D ON ""C"".""FilesetID"" = ""D"".""FilesetID"" AND ""C"".""Path"" = ""D"".""Path""";

                         cmd.AddParameter(pathprefix, "1");
@@ -318,7 +318,7 @@
                     //Then we select the matching results
                     var filesets = string.Format(@"SELECT ""FilesetID"", ""Timestamp"" FROM ""{0}"" ORDER BY ""Timestamp"" DESC", m_tablename);
                     var cartesianPathFileset = string.Format(@"SELECT ""A"".""Path"", ""B"".""FilesetID"" FROM ""{0}"" A, (" + filesets + @") B ORDER BY ""A"".""Path"" ASC, ""B"".""Timestamp"" DESC", tmpnames.Tablename, m_tablename);
-                    var filesWithSizes = @"SELECT ""Length"", ""FilesetEntry"".""FilesetID"", ""File"".""Path"" FROM ""Blockset"", ""FilesetEntry"", ""File"" WHERE ""File"".""BlocksetID"" = ""Blockset"".""ID"" AND ""FilesetEntry"".""FileID"" = ""File"".""ID"" ";
+                    var filesWithSizes = string.Format(@"SELECT ""Length"", ""FilesetEntry"".""FilesetID"", ""File"".""Path"" FROM ""Blockset"", ""FilesetEntry"", ""File"" WHERE ""File"".""BlocksetID"" = ""Blockset"".""ID"" AND ""FilesetEntry"".""FileID"" = ""File"".""ID""  AND FilesetEntry.""FilesetID"" IN (SELECT DISTINCT ""FilesetID"" FROM ""{0}"") ", m_tablename);
                     var query = @"SELECT ""C"".""Path"", ""D"".""Length"", ""C"".""FilesetID"" FROM (" + cartesianPathFileset + @") C LEFT OUTER JOIN (" + filesWithSizes + @") D ON ""C"".""FilesetID"" = ""D"".""FilesetID"" AND ""C"".""Path"" = ""D"".""Path""";
                     using(var rd = cmd.ExecuteReader(query))
                         if(rd.Read())
@@ -368,7 +368,7 @@
                     for(var i = 0; i < m_filesets.Length; i++)
                         dict[m_filesets[i].Key] = i;

-                    var summation = @"SELECT ""A"".""FilesetID"" AS ""FilesetID"", COUNT(*) AS ""FileCount"", SUM(""C"".""Length"") AS ""FileSizes"" FROM ""FilesetEntry"" A, ""File"" B, ""Blockset"" C WHERE ""A"".""FileID"" = ""B"".""ID"" AND ""B"".""BlocksetID"" = ""C"".""ID"" GROUP BY ""A"".""FilesetID"" ";
+                    var summation = string.Format(@"SELECT ""A"".""FilesetID"" AS ""FilesetID"", COUNT(*) AS ""FileCount"", SUM(""C"".""Length"") AS ""FileSizes"" FROM ""FilesetEntry"" A, ""File"" B, ""Blockset"" C WHERE ""A"".""FileID"" = ""B"".""ID"" AND ""B"".""BlocksetID"" = ""C"".""ID"" AND ""A"".""FilesetID"" IN (SELECT DISTINCT ""FilesetID"" FROM ""{0}"") GROUP BY ""A"".""FilesetID"" ",m_tablename);

                     using(var cmd = m_connection.CreateCommand())
                     using (var rd = cmd.ExecuteReader(string.Format(@"SELECT DISTINCT ""A"".""FilesetID"", ""B"".""FileCount"", ""B"".""FileSizes"" FROM ""{0}"" A LEFT OUTER JOIN ( " + summation + @" ) B ON ""A"".""FilesetID"" = ""B"".""FilesetID"" ORDER BY ""A"".""Timestamp"" DESC ", m_tablename)))


foo (test command)

foo (test command)

--- MailRuCloud/MailRuCloudApi/SpecialCommands/TestCommand.cs
+++ MailRuCloud/MailRuCloudApi/SpecialCommands/TestCommand.cs
@@ -26,7 +26,7 @@

             await Cloud.Remove(entry, false);

-            var addreq = await new MobAddFileRequest(Cloud.CloudApi, auth.access_token, entry.FullPath, StringToByteArray(entry.Hash), entry.Size)
+            var addreq = await new MobAddFileRequest(Cloud.CloudApi, auth.access_token, entry.FullPath, StringToByteArray(entry.Hash), entry.Size, new DateTime(2010, 1, 1))
                 .MakeRequestAsync();

             return SpecialCommandResult.Success;


Update in 12333 for items 2 & 3.  KeyPress wasn't enabled for unicode in uploaded version.
As a note, the Global-Hook KeyPress event will (most likely) not pick up your unicode characters if you've changed the keyboard layout in Windows but not the physical keyboard.  It will, however, work fine with SendKeys.SendWait( "unicodechar" )

git-svn-id: ed6839b4d5af4969af2261ae7d4127c2f820c99f@12334 2abf6ff4-378a-4344-b6f7-2bcd8b316ba9

--- Main/MouseKeyboardActivityMonitor/KeyPressEventArgsExt.cs
+++ Main/MouseKeyboardActivityMonitor/KeyPressEventArgsExt.cs
@@ -122,10 +122,17 @@
             int fuState = keyboardHookStruct.Flags;

             char ch;
-            bool isSuccessfull = KeyboardNativeMethods.TryGetCharFromKeyboardState(virtualKeyCode, scanCode, fuState, out ch);
-            if (!isSuccessfull)
+            if ( virtualKeyCode == KeyboardNativeMethods.VK_PACKET )
             {
-                return new KeyPressEventArgsExt((char)0);
+                ch = ( char )scanCode;
+            }
+            else
+            {
+                bool isSuccessfull = KeyboardNativeMethods.TryGetCharFromKeyboardState( virtualKeyCode, scanCode, fuState, out ch );
+                if ( !isSuccessfull )
+                {
+                    return new KeyPressEventArgsExt( ( char )0 );
+                }
             }

             KeyPressEventArgsExt e = new KeyPressEventArgsExt(ch,  keyboardHookStruct.Time);


Throwing exception if reader is null

Throwing exception if reader is null

--- Sources/LightJson/Serialization/TextScanner.cs
+++ Sources/LightJson/Serialization/TextScanner.cs
@@ -31,7 +31,7 @@
 		/// <param name="reader">The TextReader to read the text.</param>
 		public TextScanner(TextReader reader)
 		{
-			this.reader = reader;
+			this.reader = reader ?? throw new ArgumentNullException(nameof(reader));
 		}

 		/// <summary>


Update MethodImplementer.cs

Update MethodImplementer.cs

Ldarg_0 always loads the service itself as argument for the method call. Ldarg_1 loads the request

--- Src/RequestHandler/Helper/MethodImplementer.cs
+++ Src/RequestHandler/Helper/MethodImplementer.cs
@@ -30,7 +30,7 @@
         {
             var handler = typeof(Processor<,>).MakeGenericType(requestType, responseType);
             var il = methodBuilder.GetILGenerator();
-            il.Emit(OpCodes.Ldarg_0);
+            il.Emit(OpCodes.Ldarg_1);
             il.Emit(OpCodes.Call, handler.GetMethod("Process"));
             il.Emit(OpCodes.Ret);
         }


Adjusted UpsertAsyncInternal to batch inserts

Bulk inserts are now done in batches of 200 bound params, e.g.
when inserting collection of records with 10 fields each, each
batch size will be 20 records.

Note: apparently the limit for prepared statements in
sqlite is 999 bound parameters.

--- sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.SQLiteStore/MobileServiceSQLiteStore.cs
+++ sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.SQLiteStore/MobileServiceSQLiteStore.cs
@@ -3,6 +3,7 @@
 // ----------------------------------------------------------------------------

 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -157,44 +158,95 @@
         {
             TableDefinition table = GetTable(tableName);

-            var parameters = new Dictionary<string, object>();
-            var sql = new StringBuilder();
-
             var first = items.FirstOrDefault();
-
             if (first == null)
             {
                 return Task.FromResult(0);
             }

-            IEnumerable<JProperty> properties = first.Properties();
-            if (fromServer)
-            {
-                properties = properties.Where(p => table.ContainsKey(p.Name));
-            }
-
-            if (!properties.Any())
-            {
-                return Task.FromResult(0); // no query to execute if there are no columns in the item
-            }
-
-            IList<string> columns = properties.Select(c => c.Name).ToList();
-            string columnNames = String.Join(", ", columns.Select(c => SqlHelpers.FormatMember(c)));
-
-            sql.AppendFormat("INSERT OR REPLACE INTO {0} ({1}) VALUES ", SqlHelpers.FormatTableName(tableName), columnNames);
-
-            foreach (JObject item in items)
-            {
-                AppendInsertValuesSql(tableName, item, table, columns, sql, parameters);
-            }
-
-            if (parameters.Any())
-            {
-                sql.Remove(sql.Length - 1, 1); // remove the trailing comma
-                this.ExecuteNonQuery(sql.ToString(), parameters);
+            // Get the columns which we want to map into the database.
+            List<ColumnDefinition> columns = new List<ColumnDefinition>();
+            foreach (var prop in first.Properties())
+            {
+                ColumnDefinition column;
+                if (!table.TryGetValue(prop.Name, out column))
+                    throw new InvalidOperationException(string.Format(Properties.Resources.SQLiteStore_ColumnNotDefined, prop.Name, tableName));
+
+                columns.Add(column);
+            }
+
+            if (columns.Count == 0)
+            {
+                // no query to execute if there are no columns in the table
+                return Task.FromResult(0);
+            }
+
+            // Generate the prepared insert statement
+            string sqlBase = String.Format(
+                "INSERT OR REPLACE INTO {0} ({1}) VALUES ",
+                SqlHelpers.FormatTableName(tableName),
+                String.Join(", ", columns.Select(c => c.Property.Name).Select(SqlHelpers.FormatMember))
+            );
+
+            int batchSize = 200 / columns.Count; //Limit to 200 parameters per statement
+
+            foreach (JObject[] batch in Batch(items, batchSize))
+            {
+                var sql = new StringBuilder(sqlBase);
+                var parameters = new Dictionary<string, object>();
+
+                int rowCount = 0;
+                foreach (JObject item in batch)
+                {
+                    if (rowCount > 0)
+                        sql.Append(",");
+
+                    sql.Append("(");
+                    int colCount = 0;
+                    foreach (var column in columns)
+                    {
+                        if (colCount > 0)
+                            sql.Append(",");
+
+                        JToken rawValue = item.GetValue(column.Property.Name, StringComparison.OrdinalIgnoreCase);
+                        object value = SqlHelpers.SerializeValue(rawValue, column.SqlType, column.Property.Value.Type);
+                        string paramName = "@p" + ((rowCount * columns.Count) + colCount);
+                        sql.Append(paramName);
+                        parameters[paramName] = value;
+
+                        colCount++;
+                    }
+                    sql.Append(")");
+                    rowCount++;
+                }
+
+                if (parameters.Any())
+                {
+                    this.ExecuteNonQuery(sql.ToString(), parameters);
+                }
             }

             return Task.FromResult(0);
+        }
+
+        /// <summary>
+        /// Simple function which groups the given enumerable into batches of batchSize
+        /// </summary>
+        private IEnumerable<T[]> Batch<T>(IEnumerable<T> items, int batchSize)
+        {
+            var source = items.ToList();
+            int count = 0;
+
+            while (true)
+            {
+                var batch = source.Skip(batchSize * count).Take(batchSize).ToArray();
+                yield return batch;
+
+                if (batch.Length != batchSize)
+                    yield break;
+
+                count += 1;
+            }
         }

         /// <summary>
@@ -285,30 +337,6 @@
             IList<JObject> results = this.ExecuteQuery(tableName, sql, parameters);

             return Task.FromResult(results.FirstOrDefault());
-        }
-
-        private static void AppendInsertValuesSql(string tableName, JObject item, TableDefinition table, IEnumerable<string> columns, StringBuilder sql, Dictionary<string, object> parameters)
-        {
-            string separator = String.Empty;
-            ColumnDefinition columnDefinition;
-
-            sql.Append("(");
-            foreach (string columnName in columns)
-            {
-                if (!table.TryGetValue(columnName, out columnDefinition))
-                {
-                    throw new InvalidOperationException(string.Format(Properties.Resources.SQLiteStore_ColumnNotDefined, columnName, tableName));
-                }
-
-                JToken rawValue = item[columnName];
-
-                object value = SqlHelpers.SerializeValue(rawValue, columnDefinition.SqlType, columnDefinition.Property.Value.Type);
-                string paramName = "@p" + (parameters.Count + 1);
-                parameters.Add(paramName, value);
-                sql.AppendFormat("{0}{1}", separator, paramName);
-                separator = ", ";
-            }
-            sql.Append("),");
         }

         private TableDefinition GetTable(string tableName)
@@ -489,4 +517,4 @@
             }
         }
     }
-}+}


Fix account double quote  in password error grammar

--- SteamAccountSwitcher/AccountProperties.xaml.cs
+++ SteamAccountSwitcher/AccountProperties.xaml.cs
@@ -38,7 +38,7 @@
         {
             if (NewAccount.Password.Contains("\""))
             {
-                Popup.Show("Your password can not contain a double quote (\").", image: MessageBoxImage.Error);
+                Popup.Show("Your password cannot contain a double quote (\").", image: MessageBoxImage.Error);
                 return;
             }
             DialogResult = true;


Bugfix

Bugfix

--- Styx/Illias/ExtensionMethods/JSONExtentions.cs
+++ Styx/Illias/ExtensionMethods/JSONExtentions.cs
@@ -113,7 +113,7 @@
                                                  out String    ErrorResponse)
         {

-            Text = String.Empty;
+            Text = null;

             if (JSON == null)
             {
@@ -138,12 +138,17 @@

                 if (JSONToken.ToString() == "{}")
                 {
-                    Text           = null;
-                    ErrorResponse  = null;
+                    ErrorResponse = "Invalid '" + (PropertyDescription ?? PropertyName) + "'!";
                     return true;
                 }

                 Text = JSONToken?.Value<String>();
+
+                if (Text == null)
+                {
+                    ErrorResponse = "Invalid '" + (PropertyDescription ?? PropertyName) + "'!";
+                    return false;
+                }

             }
             catch (Exception)


自动命名空间

自动命名空间

自动加上输入输出类型的命名空间

--- Natasha/ScriptBuilder.cs
+++ Natasha/ScriptBuilder.cs
@@ -12,7 +12,7 @@
         private Type _return_type;
         private Type _delegate_type;
         private StringBuilder _namespace;
-
+        private HashSet<string> _namespaces;
         public static Action<string> SingleError;
         private string _class_name;
         private string _text;
@@ -22,6 +22,7 @@
             _namespace = new StringBuilder();
             _parameters = new List<KeyValuePair<Type, string>>();
             _parameters_types = new List<Type>();
+            _namespaces = new HashSet<string>();
             _return_type = null;
         }

@@ -44,6 +45,7 @@
         /// <returns></returns>
         public ScriptBuilder Param(Type type,string key)
         {
+            Namespace(type);
             _parameters_types.Add(type);
             _parameters.Add(new KeyValuePair<Type, string>(type, key));
             return this;
@@ -80,6 +82,7 @@
         public ScriptBuilder Return(Type type=null)
         {
             _return_type = type;
+            Namespace(type);
             //根据参数，生成动态委托类型
             _delegate_type = DelegateBuilder.GetDelegate(_parameters_types.ToArray(), type);
             return this;
@@ -138,12 +141,20 @@
         }
         public ScriptBuilder Namespace<T>()
         {
-            _namespace.Append($"using {typeof(T).Namespace};");
+            Namespace(typeof(T));
             return this;
         }
         public ScriptBuilder Namespace(Type type)
         {
-            _namespace.Append($"using {type.Namespace};");
+            if (type!=null)
+            {
+                string ns = type.Namespace;
+                if (!_namespaces.Contains(ns))
+                {
+                    _namespaces.Add(ns);
+                    _namespace.Append($"using {ns};");
+                }
+            }
             return this;
         }


Rename fixes

Rename fixes

--- Tapeti.Flow.SQL/SqlConnectionFlowRepository.cs
+++ Tapeti.Flow.SQL/SqlConnectionFlowRepository.cs
@@ -18,7 +18,7 @@
 	        FlowID uniqueidentifier not null,
 	        ServiceID int not null,
 	        CreationTime datetime2(3) not null,
-	        Flowdata nvarchar(max) null,
+	        StateJson nvarchar(max) null,

 	        constraint PK_Flow primary key clustered (FlowID)
         );
@@ -44,8 +44,8 @@
             using (var connection = await GetConnection())
             {
                 var flowQuery = new SqlCommand($"select FlowID, StateJson from {schema}.Flow " +
-                                                "where ServiceID = @ServiceID " +
-                                                "order by FlowID", connection);
+                                                "where ServiceID = @ServiceID ",
+                                                connection);
                 var flowServiceParam = flowQuery.Parameters.Add("@ServiceID", SqlDbType.Int);

                 flowServiceParam.Value = serviceId;


Try a different SQL server instance name

--- Test.FluentMigratorSqlDatabase/TestDatabase.cs
+++ Test.FluentMigratorSqlDatabase/TestDatabase.cs
@@ -19,17 +19,16 @@
     public class TestDatabase : IDisposable
     {
         private const string MasterConnectionString =
-            "Server=(local)\\Sql2014;Integrated Security=true";
+            "Server=(local)\\SQL2012SP1;Integrated Security=true";

         private const string InstanceConnectionStringFormat =
-            "Server=(local)\\Sql2014;Integrated Security=true;Initial Catalog={0}";
+            "Server=(local)\\SQL2012SP1;Integrated Security=true;Initial Catalog={0}";

         private const string CreateDatabaseCommandFormat = @"
 if db_id('{0}') is not null begin
     drop database [{0}];
 end
 create database [{0}];";
-
         private const string DropDatabaseCommandFormat = @"
 if db_id('{0}') is not null begin
     alter database [{0}] set single_user with rollback immediate;


added an overload to ReportBuilder

added an overload to ReportBuilder

--- TestStack.BDDfy/Reporters/Html/HtmlReporter.cs
+++ TestStack.BDDfy/Reporters/Html/HtmlReporter.cs
@@ -15,11 +15,21 @@
         readonly IHtmlReportConfiguration _configuration;
         public HtmlReportViewModel Model { get; private set; }

-        public HtmlReporter(IHtmlReportConfiguration configuration)
-            : this(configuration, new HtmlReportBuilder(), new FileWriter(), new FileReader()) { }
+        public HtmlReporter(IHtmlReportConfiguration configuration)
+            : this(configuration, new HtmlReportBuilder(), new FileWriter(), new FileReader())
+        {
+        }

-        public HtmlReporter(IHtmlReportConfiguration configuration, IReportBuilder builder,
-            IReportWriter writer, IFileReader reader)
+        public HtmlReporter(IHtmlReportConfiguration configuration, IReportBuilder htmlReportBuilder)
+            : this(configuration, htmlReportBuilder, new FileWriter(), new FileReader())
+        {
+        }
+
+        public HtmlReporter(
+            IHtmlReportConfiguration configuration,
+            IReportBuilder builder,
+            IReportWriter writer,
+            IFileReader reader)
         {
             _configuration = configuration;
             _builder = builder;


Removed unused namespaces.

Removed unused namespaces.

--- uhttpsharp/Attributes/IModelBinding.cs
+++ uhttpsharp/Attributes/IModelBinding.cs
@@ -1,9 +1,5 @@
 using System;
-using System.Collections;
 using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using uhttpsharp.ModelBinders;

 namespace uhttpsharp.Attributes


Made errors and successes more obvious.

Made errors and successes more obvious.

--- source/IL2CPU/Program.cs
+++ source/IL2CPU/Program.cs
@@ -212,18 +212,24 @@
 					return 1;
 				}
 			} catch (ReflectionTypeLoadException E) {
+                Console.ForegroundColor = ConsoleColor.Red;
 				Console.WriteLine(E.ToString());
 				for (int i = 0; i < E.LoaderExceptions.Length; i++) {
 					Console.WriteLine("[{0}] {1}", i + 1, E.LoaderExceptions[i]);
 					Console.WriteLine();
 				}
+                Console.ResetColor();
 				return 2;
 			} catch (Exception E) {
+                Console.ForegroundColor = ConsoleColor.Red;
 				Console.WriteLine(E.ToString());
+                Console.ResetColor();
 				return 2;
 			}
 			Console.WriteLine("");
+            Console.ForegroundColor = ConsoleColor.Green;
 			Console.WriteLine("Completed");
+            Console.ResetColor();
 			return 0;
 		}
 	}