fix IsValueType in DynamicTypeCodeGenerator

--- Signum.Engine.Extensions/Dynamic/DynamicTypeLogic.cs
+++ Signum.Engine.Extensions/Dynamic/DynamicTypeLogic.cs
@@ -549,9 +549,9 @@

             string result = SimplifyType(property.Type);

-            var t = TryResolveType(property.Type);
+

-            if (property.IsNullable != Entities.Dynamic.IsNullable.No && t?.IsValueType == true)
+            if (property.IsNullable != Entities.Dynamic.IsNullable.No && IsValueType(property))
                 result = result + "?";

             if (property.IsLite)
@@ -561,6 +561,23 @@
                 result = "MList<" + result + ">";

             return result;
+        }
+
+        private bool IsValueType(DynamicProperty property)
+        {
+            var t = TryResolveType(property.Type);
+            if (t != null)
+                return t.IsValueType;
+
+            var tn = property.Type;
+            if (tn.EndsWith("Embedded") || tn.EndsWith("Entity") || tn.EndsWith("Mixin") || tn.EndsWith("Symbol"))
+            {
+                return false;
+            }
+            else
+            {
+                return true; // Assume Enum
+            }
         }

         private string SimplifyType(string type)
@@ -604,7 +621,7 @@

             var type = TypeLogic.TryGetType(typeName);
             if (type != null)
-                return type;
+                return EnumEntity.Extract(type) ?? type;

             return null;
         }


Improve Digits() for BigInteger

Improve Digits() for BigInteger

Use the more efficient implementation for BigInteger too.

--- src/ProjectEuler/Maths.cs
+++ src/ProjectEuler/Maths.cs
@@ -6,7 +6,6 @@
     using System;
     using System.Collections.Concurrent;
     using System.Collections.Generic;
-    using System.Globalization;
     using System.Linq;
     using System.Numerics;

@@ -73,20 +72,25 @@
         /// </returns>
         internal static IList<int> Digits(BigInteger value)
         {
+            if (value == BigInteger.Zero)
+            {
+                return new[] { 0 };
+            }
+
             if (value < BigInteger.Zero)
             {
                 value = BigInteger.Negate(value);
             }

-            string valueAsString = value.ToString(CultureInfo.InvariantCulture);
-            int length = valueAsString.Length;
-
-            var digits = new int[length];
-
-            for (int i = 0; i < length; i++)
-            {
-                digits[i] = valueAsString[i] - '0';
-            }
+            var digits = new List<int>();
+
+            while (value > 0)
+            {
+                digits.Add((int)(value % 10));
+                value /= 10;
+            }
+
+            digits.Reverse();

             return digits;
         }


* TwoSum.cs improved Quick. Current order of growth is MLogN where M - count of negative values

--- Source/Algorithms/RobertSedgewick/Analysis/TwoSum.cs
+++ Source/Algorithms/RobertSedgewick/Analysis/TwoSum.cs
@@ -10,6 +10,10 @@
             source.Sort();
             for (int i = 0; i < source.Count; i++)
             {
+                if (source[i] > 0)
+                {
+                    return result;
+                }
                 int searchValue = -source[i];
                 if (source.BinarySearch(searchValue) > i)
                 {


Fixed removal of components

Fixed removal of components

--- Trainer.Wpf.VStudio.Tools/ViewModels/ComponentsViewModel.cs
+++ Trainer.Wpf.VStudio.Tools/ViewModels/ComponentsViewModel.cs
@@ -116,7 +116,7 @@
                 if (null != item)
                 {
                     if(isRemoved)
-                        item.Component.Remove(component);
+                        item.Component.Remove(item.Component.First(x => x.Id.Equals(component.Id)));
                     else
                         item.Component.Add(component);
                     XmlHelper<Components>.Save(file, item);


Code cleanup.

Code cleanup.

--- Source/Magick.NET/Shared/Drawables/DrawableBezier.cs
+++ Source/Magick.NET/Shared/Drawables/DrawableBezier.cs
@@ -42,13 +42,7 @@
         /// <summary>
         /// Gets the coordinates.
         /// </summary>
-        public IEnumerable<PointD> Coordinates
-        {
-            get
-            {
-                return _coordinates.ToList();
-            }
-        }
+        public IEnumerable<PointD> Coordinates => _coordinates.ToList();

         /// <summary>
         /// Draws this instance with the drawing wand.


Update Klarna properties on both create and update to reflect changes made by the user

--- Source/TeaCommerce.PaymentProviders/Inline/Klarna.cs
+++ Source/TeaCommerce.PaymentProviders/Inline/Klarna.cs
@@ -1,4 +1,4 @@
-using Klarna.Checkout;
+using Klarna.Checkout;
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
@@ -196,6 +196,39 @@

           Dictionary<string, object> data = new Dictionary<string, object> { { "cart", new Dictionary<string, object> { { "items", cartItems } } } };
           string klarnaLocation = order.Properties[ "klarnaLocation" ];
+          string merchantTermsUri = settings["merchant.terms_uri"];
+
+          if (!merchantTermsUri.StartsWith("http"))
+          {
+            Uri baseUrl = new UriBuilder(HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port).Uri;
+            merchantTermsUri = new Uri(baseUrl, merchantTermsUri).AbsoluteUri;
+          }
+
+          //Merchant information
+          data["merchant"] = new Dictionary<string, object> {
+              {"id", settings[ "merchant.id" ]},
+              {"terms_uri", merchantTermsUri},
+              {"checkout_uri", request.UrlReferrer.ToString()},
+              {"confirmation_uri", order.Properties[ "teaCommerceContinueUrl" ]},
+              {"push_uri", order.Properties[ "teaCommerceCallbackUrl" ]}
+            };
+
+          data["merchant_reference"] = new Dictionary<string, object>() {
+              {"orderid1", order.CartNumber}
+            };
+
+          //Combined data
+          Currency currency = CurrencyService.Instance.Get(order.StoreId, order.CurrencyId);
+
+          //If the currency is not a valid iso4217 currency then throw an error
+          if (!Iso4217CurrencyCodes.ContainsKey(currency.IsoCode))
+          {
+            throw new Exception("You must specify an ISO 4217 currency code for the " + currency.Name + " currency");
+          }
+
+          data["purchase_country"] = CountryService.Instance.Get(order.StoreId, order.PaymentInformation.CountryId).RegionCode;
+          data["purchase_currency"] = currency.IsoCode;
+          data["locale"] = settings["locale"];

           //Check if the order has a Klarna location URI property - then we try and update the order
           if ( !string.IsNullOrEmpty( klarnaLocation ) ) {
@@ -213,37 +246,6 @@

           //If no Klarna order was found to update or the session expired - then create new Klarna order
           if ( klarnaOrder == null ) {
-            string merchantTermsUri = settings[ "merchant.terms_uri" ];
-            if ( !merchantTermsUri.StartsWith( "http" ) ) {
-              Uri baseUrl = new UriBuilder( HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port ).Uri;
-              merchantTermsUri = new Uri( baseUrl, merchantTermsUri ).AbsoluteUri;
-            }
-
-            //Merchant information
-            data[ "merchant" ] = new Dictionary<string, object> {
-              {"id", settings[ "merchant.id" ]},
-              {"terms_uri", merchantTermsUri},
-              {"checkout_uri", request.UrlReferrer.ToString()},
-              {"confirmation_uri", order.Properties[ "teaCommerceContinueUrl" ]},
-              {"push_uri", order.Properties[ "teaCommerceCallbackUrl" ]}
-            };
-
-            data[ "merchant_reference" ] = new Dictionary<string, object>() {
-              {"orderid1", order.CartNumber}
-            };
-
-            //Combined data
-            Currency currency = CurrencyService.Instance.Get( order.StoreId, order.CurrencyId );
-
-            //If the currency is not a valid iso4217 currency then throw an error
-            if ( !Iso4217CurrencyCodes.ContainsKey( currency.IsoCode ) ) {
-              throw new Exception( "You must specify an ISO 4217 currency code for the " + currency.Name + " currency" );
-            }
-
-            data[ "purchase_country" ] = CountryService.Instance.Get( order.StoreId, order.PaymentInformation.CountryId ).RegionCode;
-            data[ "purchase_currency" ] = currency.IsoCode;
-            data[ "locale" ] = settings[ "locale" ];
-
             klarnaOrder = new KlarnaOrder( connector ) {
               BaseUri = settings.ContainsKey( "testMode" ) && settings[ "testMode" ] == "1" ? new Uri( "https://checkout.testdrive.klarna.com/checkout/orders" ) : new Uri( "https://checkout.klarna.com/checkout/orders" ),
               ContentType = KlarnaApiRequestContentType


撰寫AddDataTest方法

撰寫AddDataTest方法

撰寫AddDataTest方法

--- UartOscilloscopeTests/CSharpFiles/WaveDataStructureTests.cs
+++ UartOscilloscopeTests/CSharpFiles/WaveDataStructureTests.cs
@@ -14,7 +14,10 @@
 		[TestMethod()]
 		public void AddDataTest()                                               //	AddDataTest方法
 		{                                                                       //	進入AddDataTest方法
-			Assert.Fail();
+			WaveDataStructure WaveDataStructureTest1;                           //	宣告WaveDataStructureTest1物件
+			int ArrayMax = 3;                                                   //	宣告ArrayMax變數，用於給定WaveDataStructureTest物件空間
+			WaveDataStructureTest1 = new WaveDataStructure(ArrayMax);			//	初始化測試物件
+
 		}                                                                       //	結束AddDataTest方法
 	}                                                                           //	結束WaveDataStructureTests類別
 }                                                                               //	結束命名空間


MetadataVisualizer should display Parent column of GenericParam table. (changeset 1378688)

--- Src/Test/PdbUtilities/Metadata/MetadataVisualizer.cs
+++ Src/Test/PdbUtilities/Metadata/MetadataVisualizer.cs
@@ -926,6 +926,7 @@
                 "Name",
                 "Seq#",
                 "Attributes",
+                "Parent",
                 "TypeConstraints"
             );

@@ -937,6 +938,7 @@
                     Literal(entry.Name),
                     entry.Index.ToString(),
                     EnumValue<int>(entry.Attributes),
+                    Token(entry.Parent),
                     TokenRange(entry.GetConstraints(), h => h)
                 );
             }


[System.Runtime.Caching] Added Mono config variables. Variables __MonoEmulateOneCPU and __MonoTimerPeriod are used by some tests.

--- System.Runtime.Caching/System/Caching/MemoryCache.cs
+++ System.Runtime.Caching/System/Caching/MemoryCache.cs
@@ -307,6 +307,20 @@

         private void Init(NameValueCollection config) {
             _storeCount = Environment.ProcessorCount;
+#if MONO
+            if (config != null) {
+                if (config ["__MonoEmulateOneCPU"] == "true")
+                    _storeCount = 1;
+                if (config ["__MonoTimerPeriod"] != null) {
+                    try {
+                        int parsed = (int)UInt32.Parse (config ["__MonoTimerPeriod"]);
+                        CacheExpires.EXPIRATIONS_INTERVAL = new TimeSpan (0, 0, parsed);
+                    } catch {
+                        //
+                    }
+                }
+            }
+#endif
             _storeMask = _storeCount - 1;
             _stores = new MemoryCacheStore[_storeCount];
             InitDisposableMembers(config);


Removed the InitializeServer function, which was unnecessary in our case

--- server/ConsoleApplication1/Program.cs
+++ server/ConsoleApplication1/Program.cs
@@ -23,41 +23,46 @@

 		static void Main (string[] args)
 		{
-			InitializeServer ();
-		}
-
-		private static void InitializeServer ()
-		{
-			// Start the KinectService process. This is required for any Kinect application to run.
-			var KinectService = System.Diagnostics.Process.Start (@"C:\Windows\System32\KinectService.exe");
-
-			// Initialize a server at the address specified
-			var server = new WebSocketServer ("ws://localhost:1620");
-
-			server.Start (socket => {
-				socket.OnOpen = () => {
-					Console.WriteLine ("Opening a new socket...");
-					allSockets.Add (socket);
-
-					// Initialize a new Kinect object
-					Kinect alpha = new Kinect ();
-					alpha.InitializeKinect ();
-				};
-				socket.OnClose = () => {
-					Console.WriteLine ("Closing all connections...");
-					allSockets.Remove (socket);
-				};
-			});
-
-			// Logic to allow for a soft quit of the server when "exit" is input at the CLI
-			var input = Console.ReadLine ();
-			if (input == "exit") {
-				KinectService.Kill;
-			} else {
-				while (input != "exit") {
-					input = Console.ReadLine ();
-				}
-			}
+            // Start the KinectService process. This is required for any Kinect application to run.
+            Process KinectService;
+            KinectService = Process.Start(@"C:\Windows\System32\KinectService.exe");
+
+            // Initialize a server at the address specified
+            var server = new WebSocketServer("ws://localhost:1620");
+
+            server.Start(socket =>
+            {
+                socket.OnOpen = () =>
+                {
+                    Console.WriteLine("Opening a new socket...");
+                    allSockets.Add(socket);
+
+                    // Initialize a new Kinect object
+                    Kinect alpha = new Kinect();
+                    alpha.InitializeKinect();
+                };
+                socket.OnClose = () =>
+                {
+                    Console.WriteLine("Closing all connections...");
+                    allSockets.Remove(socket);
+                };
+            });
+
+            // Logic to allow for a soft quit of the server when "exit" is input at the CLI
+            var input = Console.ReadLine();
+            if (input == "exit")
+            {
+                KinectService.CloseMainWindow();
+                KinectService.Close();
+                System.Environment.Exit(0);
+            }
+            else
+            {
+                while (input != "exit")
+                {
+                    input = Console.ReadLine();
+                }
+            }
 		}

 		public class Kinect


simplify how we get vpu count

simplify how we get vpu count

--- src/SizePhotos/Program.cs
+++ src/SizePhotos/Program.cs
@@ -141,17 +141,12 @@
         void ResizePhotos()
         {
             var files = GetPhotos();
-            var vpus = Environment.ProcessorCount - 1;
+            var vpus = Math.Max(Environment.ProcessorCount - 1, 1);

             _writer.PreProcess(_opts.CategoryInfo);

             MagickWandEnvironment.Genesis();

-            if(vpus < 1)
-            {
-                vpus = 1;
-            }
-
             // try to leave a couple threads available for the GC
             var opts = new ParallelOptions { MaxDegreeOfParallelism = vpus };


Fix CA1901: Parameter 'argumentsLong' should be IntPtr

--- src/Squirrel/ShellFile.cs
+++ src/Squirrel/ShellFile.cs
@@ -1047,7 +1047,7 @@
             int dwLanguageId,
             string lpBuffer,
             uint nSize,
-            int argumentsLong);
+            IntPtr argumentsLong);

         [DllImport("kernel32")]
         static extern int GetLastError();
@@ -1158,7 +1158,7 @@
                 string txtS = new string('\0', 256);
                 int len = FormatMessage(
                     FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
-                    IntPtr.Zero, err, 0, txtS, 256, 0);
+                    IntPtr.Zero, err, 0, txtS, 256, IntPtr.Zero);
                 Console.WriteLine("Len {0} text {1}", len, txtS);

                 // throw exception


fix a crasher on editors

fix a crasher on editors

svn path=/trunk/; revision=4411

--- src/Widgets/EditorPage.cs
+++ src/Widgets/EditorPage.cs
@@ -168,7 +168,7 @@
 				Apply (editor); // Instant apply
 		}

-		private void SetupEditor (Editor editor) {
+		private bool SetupEditor (Editor editor) {
 			EditorState state = editor.CreateState ();

 			EditorSelection selection = new EditorSelection ();
@@ -185,13 +185,17 @@
 				state.Selection = null;
 				state.PhotoImageView = null;
 			}
+			if (Page.Sidebar.Selection == null)
+				return false;
 			state.Items = Page.Sidebar.Selection.Items;

 			editor.Initialize (state);
+			return true;
 		}

 		private void Apply (Editor editor) {
-			SetupEditor (editor);
+			if (!SetupEditor (editor))
+				return;

 			if (!editor.CanBeApplied) {
 				string msg = Catalog.GetString ("No selection available");


Simplify offset computation logic in `RemoveLastCharacter`

--- osu.Framework/Text/TextBuilder.cs
+++ osu.Framework/Text/TextBuilder.cs
@@ -258,18 +258,15 @@
             {
                 var character = Characters[i];

-                // this is used only when useFontSizeAsHeight is false.
-                float glyphBaseLine = (Characters[i].Baseline - Characters[i].YOffset);
-
                 float glyphHeightOffset = 0;
                 float previousCharactersHeightOffset = 0;

-                if ((currentLineBase ?? 0f) > glyphBaseLine)
-                    glyphHeightOffset = (useFontSizeAsHeight) ? 0 : (currentLineBase ?? 0f) - glyphBaseLine;
-                else if ((currentLineBase ?? 0f) < glyphBaseLine)
-                    previousCharactersHeightOffset = (useFontSizeAsHeight) ? 0 : glyphBaseLine - (currentLineBase ?? 0f);
-
-                float characterBaseLine = (useFontSizeAsHeight ? character.Baseline : character.Baseline - character.YOffset);
+                if (character.Baseline > currentLineBase)
+                    previousCharactersHeightOffset = useFontSizeAsHeight ? 0 : character.Baseline - currentLineBase.Value;
+                else if (character.Baseline < currentLineBase)
+                    glyphHeightOffset = useFontSizeAsHeight ? 0 : currentLineBase.Value - character.Baseline;
+                else if (currentLineBase == null)
+                    glyphHeightOffset = useFontSizeAsHeight ? 0 : character.Baseline;

                 currentLineBase = currentLineBase == null ? character.Baseline : Math.Max(currentLineBase.Value, character.Baseline);
                 currentLineHeight = Math.Max(currentLineHeight + previousCharactersHeightOffset, getGlyphHeight(ref character) + glyphHeightOffset);


Add basic back button

Add basic back button

--- osu.Game/Overlays/MainSettings.cs
+++ osu.Game/Overlays/MainSettings.cs
@@ -5,14 +5,21 @@
 using osu.Framework.Allocation;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
+using osu.Framework.Input;
+using osu.Game.Graphics;
+using osu.Game.Graphics.Containers;
+using osu.Game.Graphics.Sprites;
 using osu.Game.Overlays.Settings;
 using osu.Game.Overlays.Settings.Sections;
+using osu.Game.Screens.Ranking;
+using OpenTK;

 namespace osu.Game.Overlays
 {
     public class MainSettings : SettingsOverlay
     {
         private readonly KeyBindingOverlay keyBindingOverlay;
+        private BackButton backButton;

         protected override IEnumerable<SettingsSection> CreateSections() => new SettingsSection[]
         {
@@ -49,11 +56,15 @@
                     Background.FadeTo(0.9f, 500, Easing.OutQuint);
                     SectionsContainer.FadeOut(100);
                     ContentContainer.MoveToX(hidden_width - ContentContainer.DrawWidth, 500, Easing.OutQuint);
+
+                    backButton.Delay(100).FadeIn(100);
                     break;
                 case Visibility.Hidden:
                     Background.FadeTo(0.6f, 500, Easing.OutQuint);
                     SectionsContainer.FadeIn(500, Easing.OutQuint);
                     ContentContainer.MoveToX(0, 500, Easing.OutQuint);
+
+                    backButton.FadeOut(100);
                     break;
             }
         }
@@ -68,6 +79,14 @@
         private void load()
         {
             AddInternal(keyBindingOverlay);
+            AddInternal(backButton = new BackButton
+            {
+                Alpha = 0,
+                Height = 150,
+                Anchor = Anchor.CentreLeft,
+                Origin = Anchor.CentreLeft,
+                Action = () => keyBindingOverlay.Hide()
+            });
         }

         protected override void UpdateAfterChildren()
@@ -75,6 +94,81 @@
             base.UpdateAfterChildren();

             keyBindingOverlay.Margin = new MarginPadding { Left = ContentContainer.Margin.Left + ContentContainer.DrawWidth + ContentContainer.X };
+
+            backButton.Margin = new MarginPadding { Left = ContentContainer.Margin.Left };
+            backButton.Width = ContentContainer.DrawWidth + ContentContainer.X;
+        }
+
+        private class BackButton : OsuClickableContainer
+        {
+            private FillFlowContainer flow;
+            private AspectContainer aspect;
+
+            [BackgroundDependencyLoader]
+            private void load()
+            {
+                Children = new Drawable[]
+                {
+                    aspect = new AspectContainer
+                    {
+                        Anchor = Anchor.Centre,
+                        Origin = Anchor.Centre,
+                        RelativeSizeAxes = Axes.Y,
+                        Children = new Drawable[]
+                        {
+                            flow = new FillFlowContainer
+                            {
+                                Anchor = Anchor.TopCentre,
+                                RelativePositionAxes = Axes.Y,
+                                Y = 0.4f,
+                                AutoSizeAxes = Axes.Both,
+                                Origin = Anchor.Centre,
+                                Direction = FillDirection.Horizontal,
+                                Children = new[]
+                                {
+                                    new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_left },
+                                    new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_left },
+                                    new SpriteIcon { Size = new Vector2(15), Shadow = true, Icon = FontAwesome.fa_chevron_left },
+                                }
+                            },
+                            new OsuSpriteText
+                            {
+                                Anchor = Anchor.TopCentre,
+                                RelativePositionAxes = Axes.Y,
+                                Y = 0.7f,
+                                TextSize = 12,
+                                Font = @"Exo2.0-Bold",
+                                Origin = Anchor.Centre,
+                                Text = @"back",
+                            },
+                        }
+                    }
+                };
+            }
+
+            protected override bool OnHover(InputState state)
+            {
+                flow.TransformSpacingTo(new Vector2(5), 500, Easing.OutQuint);
+                return base.OnHover(state);
+            }
+
+            protected override void OnHoverLost(InputState state)
+            {
+                flow.TransformSpacingTo(new Vector2(0), 500, Easing.OutQuint);
+                base.OnHoverLost(state);
+            }
+
+            protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
+            {
+                aspect.ScaleTo(0.75f, 2000, Easing.OutQuint);
+                return base.OnMouseDown(state, args);
+            }
+
+            protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
+            {
+                aspect.ScaleTo(1, 1000, Easing.OutElastic);
+                return base.OnMouseUp(state, args);
+            }
         }
     }
 }


Ensure skin `InstantiationInfo` is updated when saving

--- osu.Game/Skinning/SkinImporter.cs
+++ osu.Game/Skinning/SkinImporter.cs
@@ -232,6 +232,9 @@
         {
             skin.SkinInfo.PerformWrite(s =>
             {
+                // Update for safety
+                s.InstantiationInfo = skin.GetType().GetInvariantInstantiationInfo();
+
                 // Serialise out the SkinInfo itself.
                 string skinInfoJson = JsonConvert.SerializeObject(s, new JsonSerializerSettings { Formatting = Formatting.Indented });


fix domain vs email username logons

fix domain vs email username logons

- earlier email usernames got converted into domain logons

--- pGina/src/Service/Impl/Service.cs
+++ pGina/src/Service/Impl/Service.cs
@@ -287,6 +287,7 @@
                 PluginDriver sessionDriver = new PluginDriver();
                 bool LastUsernameEnable = Settings.Get.LastUsernameEnable;

+                string oriUsername = msg.Username; //to distinguish email from domain
                 msg = SplitDomainfromUsername(msg);
                 sessionDriver.UserInformation.Username = msg.Username;
                 sessionDriver.UserInformation.Password = (String.IsNullOrEmpty(msg.Password)) ? "" : msg.Password;
@@ -388,6 +389,15 @@
                         }
                     }
                 }
+
+                // for those who are logging in by using a mail address
+                if (oriUsername.Contains("@"))
+                {
+                    sessionDriver.UserInformation.Username = oriUsername;
+                    sessionDriver.UserInformation.Domain = Environment.MachineName;
+                    m_logger.DebugFormat("Reintegrate username from username:{0} domain:{1} to {2} and domain:{3}", msg.Username, msg.Domain, oriUsername, Environment.MachineName);
+                }
+                // mail mod end

                 BooleanResult result = new BooleanResult() { Success = true, Message = "" };


Fixed attribute persistence on product editor.

--- Views/EditorTemplates/Parts/ProductAttributes.cshtml
+++ Views/EditorTemplates/Parts/ProductAttributes.cshtml
@@ -4,13 +4,14 @@
 @model Nwazet.Commerce.ViewModels.ProductAttributesPartEditViewModel
 @{
     var currentAttributeIds = Model.Part.AttributeIds;
+    var index = 0;
 }
 <fieldset>
     <legend>@T("Attributes")</legend>
     @foreach(var attribute in Model.Attributes) {
         var attributeName = attribute.As<TitlePart>().Title;
         var idString = attribute.Id.ToString(CultureInfo.InvariantCulture);
-        <input type="checkbox" name="@Html.Name(idString)"@(currentAttributeIds.Contains(attribute.Id) ? " checked=\"checked\"" : "") id="@Html.Id(idString)" value="@attribute.Id"/>
+        <input type="checkbox" name="@(Html.Name("AttributeIds"))"@(currentAttributeIds.Contains(attribute.Id) ? " checked=\"checked\"" : "") id="@Html.Id(idString)" value="@attribute.Id"/>
         @attributeName
     }

@T("Please select the attributes that apply to this product. Customers will need to choose a value for each active attribute when adding the product to their shopping cart.")


throw for DateTimeOffset in mysql

throw for DateTimeOffset in mysql

--- ScriptBuilder/Saga/Writers/MySqlSagaScriptWriter.cs
+++ ScriptBuilder/Saga/Writers/MySqlSagaScriptWriter.cs
@@ -198,7 +198,7 @@
             case CorrelationPropertyType.DateTime:
                 return "datetime";
             case CorrelationPropertyType.DateTimeOffset:
-                return "datetimeoffset";
+                throw new Exception("DateTimeOffset is not supported by MySql.");
             case CorrelationPropertyType.String:
                 return "varchar(450)";
             case CorrelationPropertyType.Int:


Handling of entries with no compressed data adjusted.

--- src/Zip/ZipInputStream.cs
+++ src/Zip/ZipInputStream.cs
@@ -506,13 +506,19 @@
 				inputBuffer.CryptoTransform = null;
 #endif
 			}
-
-			if ( (method == (int)CompressionMethod.Deflated) && (inputBuffer.Available > 0) ) {
-				inputBuffer.SetInflaterInput(inf);
-			}
-
-			internalReader = new ReaderDelegate(BodyRead);
-			return BodyRead(destination, offset, count);
+
+			if ((csize > 0) || ((flags & (int)GeneralBitFlags.Descriptor) != 0)) {
+				if ((method == (int)CompressionMethod.Deflated) && (inputBuffer.Available > 0)) {
+					inputBuffer.SetInflaterInput(inf);
+				}
+
+				internalReader = new ReaderDelegate(BodyRead);
+				return BodyRead(destination, offset, count);
+			}
+			else {
+				internalReader = new ReaderDelegate(ReadingNotAvailable);
+				return 0;
+			}
 		}

 		/// <summary>


Bug Fix: Only add parameters to db driven menu items - if we have a value to populate

--- src/webforms/CodeTorch.Web/Controls/Menu.cs
+++ src/webforms/CodeTorch.Web/Controls/Menu.cs
@@ -394,7 +394,8 @@
                                 p.Value = Common.HostHeader;
                             }

-                            parameters.Add(p);
+                            if(!String.IsNullOrEmpty(p.Name))
+                                parameters.Add(p);
                         }

@@ -437,6 +438,7 @@
             bool containsCheckPermission = dt.Columns.Contains("CheckPermission");
             bool containsPermissionName = dt.Columns.Contains("PermissionName");
             bool containsCssClass = dt.Columns.Contains("CssClass");
+            bool containsLinkCssClass = dt.Columns.Contains("LinkCssClass");
             bool containsTarget = dt.Columns.Contains("Target");
             bool containsCode = dt.Columns.Contains("Code");

@@ -477,6 +479,11 @@
                 if (containsCssClass)
                 {
                     newItem.CssClass = row["CssClass"].ToString();
+                }
+
+                if (containsLinkCssClass)
+                {
+                    newItem.LinkCssClass = row["LinkCssClass"].ToString();
                 }

                 if (containsTarget)


Fix the resetPasswordToken conflict with URL format (a plus sign becomes white space and code didnt' works) because of lack of auto-escaping at WebClient.QueryString #965

--- web/App_Code/LcMessaging.cs
+++ web/App_Code/LcMessaging.cs
@@ -1024,7 +1024,10 @@
             if (data != null)
             foreach (var d in data)
             {
-                w.QueryString.Add(d.Key, (d.Value ?? "").ToString());
+                // IMPORTANT: Expectation about the QueryString and WebClient was that they perform the correct
+                // management of URL encoding for the given data, but it does nothing so needs to be manually done
+                // using Uri.EscapeDataString to avoid bugs (fixed a bug at #965)
+                w.QueryString.Add(d.Key, (Uri.EscapeDataString((d.Value ?? "").ToString())).ToString());
             }
             if (!w.QueryString.AllKeys.Contains<string>("RequestKey"))
                 w.QueryString["RequestKey"] = SecurityRequestKey;


JS UI Client - Update - Setting up plugin for remote work

--- source/Glimpse.Test/Views/Main/Index.cshtml
+++ source/Glimpse.Test/Views/Main/Index.cshtml
@@ -473,11 +473,12 @@
     .glimpse-panel table table thead tr th { border-left:1px solid #C6C6C6; border-right:1px solid #D9D9D9; padding:1px 4px 2px 4px; }
     .glimpse-panel table table thead tr th:first-child { border-left:0px; }
     .glimpse-panel table table thead tr th:last-child { border-right:0px; }
-    /*.glimpse-panel table table thead th { border-left:1px solid #9C9C9C; border-right:1px solid #9C9C9C; border-bottom:1px solid #9C9C9C; }*/
     .glimpse-panel tbody tr.even { background:#F4F4F4; }
     .glimpse-panel tbody tr.odd { background:#F9F9F9; }
     .glimpse-panel table table tbody th { font-weight:normal; font-style:italic; }
     .glimpse-panel table table thead th { font-weight:bold; font-style:normal; }
+    .glimpse-panel .glimpse-side-sub-panel { float:right; background-color:#F5F5F5; height:100%; width:300px; border-left:1px solid #ACA899; }
+    .glimpse-panel .glimpse-loading { color:#AAA; text-align:center; margin-top:20px; }
     .glimpse-panel-holder .glimpse-active { display:block; }
     .glimpse-resizer { height:4px; cursor:n-resize; width:100%; position:absolute; top:-1px; }
     .glimpse-preview-object { color:#006400; }
@@ -492,20 +493,20 @@
     .glimpse-expand { height:11px; width:11px; display: inline-block; float:left; margin:0px 3px; cursor:pointer; background-image:url(/Scripts/glimpse-sprite.png); background-repeat:no-repeat; background-position:-64px 0; }
     .glimpse-collapse { background-position:-64px -11px; }
     .glimpse-preview-show { display:none; font-weight:normal !important; }
-    .glimpse-panel tbody tr.quiet { color:#AAA; }
-    .glimpse-panel tbody tr.suppress { color:#AAA; text-decoration:line-through; }
-    .glimpse-panel tbody tr.selected { background-color:#FFFF99; color:#409B3B; }
-    .glimpse-panel tbody tr.info .icon, .glimpse-panel tbody tr.warn .icon, .glimpse-panel tbody tr.loading .icon, .glimpse-panel tbody tr.error .icon, .glimpse-panel tbody tr.fail .icon { width:14px; height:14px; background-image:url(/Scripts/glimpse-sprite.png); background-repeat:no-repeat; float:left; margin-right: 5px; }
-    .glimpse-panel tbody tr.info .icon { background-position: -22px -22px; }
-    .glimpse-panel tbody tr.warn .icon { background-position:-36px -22px; }
-    .glimpse-panel tbody tr.loading .icon { background-position:-78px -22px; }
-    .glimpse-panel tbody tr.error .icon { background-position:-50px -22px; }
-    .glimpse-panel tbody tr.fail .icon { background-position:-64px -22px; }
-    .glimpse-panel tbody tr.info { color:#067CE5; }
-    .glimpse-panel tbody tr.warn { color:#FE850C; }
-    .glimpse-panel tbody tr.error { color:#B40000; }
-    .glimpse-panel tbody tr.fail { color:#D00; font-weight:bold; }
-    .glimpse-panelitem-XHReqests tbody tr.loading .icon { float:right; }
+    .glimpse-panel .quiet { color:#AAA; }
+    .glimpse-panel .suppress { color:#AAA; text-decoration:line-through; }
+    .glimpse-panel .selected { background-color:#FFFF99; color:#409B3B; }
+    .glimpse-panel .info .icon, .glimpse-panel .warn .icon, .glimpse-panel .loading .icon, .glimpse-panel .error .icon, .glimpse-panel .fail .icon { width:14px; height:14px; background-image:url(/Scripts/glimpse-sprite.png); background-repeat:no-repeat; float:left; margin-right: 5px; }
+    .glimpse-panel .info .icon { background-position: -22px -22px; }
+    .glimpse-panel .warn .icon { background-position:-36px -22px; }
+    .glimpse-panel .loading .icon { background-position:-78px -22px; }
+    .glimpse-panel .error .icon { background-position:-50px -22px; }
+    .glimpse-panel .fail .icon { background-position:-64px -22px; }
+    .glimpse-panel .info { color:#067CE5; }
+    .glimpse-panel .warn { color:#FE850C; }
+    .glimpse-panel .error { color:#B40000; }
+    .glimpse-panel .fail { color:#D00; font-weight:bold; }
+    .glimpse-panelitem-XHReqests .loading .icon { float:right; }
 </style>


Log errors when importing mods

Log errors when importing mods

--- source/Plugins/SteamLibrary/SteamLibrary.cs
+++ source/Plugins/SteamLibrary/SteamLibrary.cs
@@ -138,7 +138,10 @@
                 try
                 {
                     var game = GetInstalledModFromFolder(folder, ModInfo.ModType.HL);
-                    games.Add(game);
+                    if (game != null)
+                    {
+                        games.Add(game);
+                    }
                 }
                 catch (Exception exc)
                 {
@@ -159,7 +162,10 @@
                 try
                 {
                     var game = GetInstalledModFromFolder(folder, ModInfo.ModType.HL2);
-                    games.Add(game);
+                    if (game != null)
+                    {
+                        games.Add(game);
+                    }
                 }
                 catch (Exception exc)
                 {
@@ -174,6 +180,10 @@
         internal Game GetInstalledModFromFolder(string path, ModInfo.ModType modType)
         {
             var modInfo = ModInfo.GetFromFolder(path, modType);
+            if (modInfo == null)
+            {
+                return null;
+            }

             var game = new Game()
             {


Fix 06.C#_OOP_Basics\02.ENCAPSULATION\EXERCISE\05. Pizza Calories\StartUp.cs


FIX: Relaxing network delta threshold setting was being parsed as an Int32 instead of a Double.

--- SharpNeatV2/src/SharpNeatDomains/ExperimentUtils.cs
+++ SharpNeatV2/src/SharpNeatDomains/ExperimentUtils.cs
@@ -51,7 +51,7 @@
                     int iters = XmlUtils.GetValueAsInt(xmlActivation, "Iters");
                     return NetworkActivationScheme.CreateCyclicFixedTimestepsScheme(iters);
                 case "CyclicRelax":
-                    double deltaThreshold = XmlUtils.GetValueAsInt(xmlActivation, "Threshold");
+                    double deltaThreshold = XmlUtils.GetValueAsDouble(xmlActivation, "Threshold");
                     int maxIters = XmlUtils.GetValueAsInt(xmlActivation, "MaxIters");
                     return NetworkActivationScheme.CreateCyclicRelaxingActivationScheme(deltaThreshold, maxIters);
             }


Made it easier to differentiate between working with a metafield on an object or a metafield on a shop.

--- ShopifySharp/Services/MetaField/MetaFieldService.cs
+++ ShopifySharp/Services/MetaField/MetaFieldService.cs
@@ -19,23 +19,9 @@
         /// <param name="shopAccessToken">An API access token for the shop.</param>
         public MetaFieldService(string myShopifyUrl, string shopAccessToken) : base(myShopifyUrl, shopAccessToken) { }

-        /// <summary>
-        /// Gets a count of the metafields for the given entity type and filter options. Leave both resourceType and resourceId null for shop metafields.
-        /// </summary>
-        /// <param name="resourceType">The type of shopify resource to obtain metafields for. This could be variants, products, orders, customers, custom_collections.</param>
-        /// <param name="resourceId">The Id for the resource type.</param>
-        /// <param name="filter">The <see cref="MetaFieldFilter"/> used to filter results</param>
-        /// <returns>The count of all metafields for the given entity and filter options.</returns>
-        public virtual async Task<int> CountAsync(long? resourceId, string resourceType = null, MetaFieldFilter filter = null)
+        private async Task<int> _CountAsync(string path, MetaFieldFilter filter = null)
         {
-            string reqPath = "metafields/count.json";
-
-            if (! string.IsNullOrEmpty(resourceType) && resourceId.HasValue)
-            {
-                reqPath = $"{resourceType}/{resourceId.Value}/metafields/count.json";
-            }
-
-            var req = PrepareRequest(reqPath);
+            var req = PrepareRequest(path);

             if (filter != null)
             {
@@ -46,37 +32,62 @@
         }

         /// <summary>
-        /// Gets a list of the metafields for a specified resource. Leave both resourceType and resourceId null for shop metafields.
+        /// Gets a count of the metafields on the shop itself.
+        /// </summary>
+        /// <param name="filter">Options to filter the results.</param>
+        public virtual async Task<int> CountAsync(MetaFieldFilter filter = null)
+        {
+            return await _CountAsync("metafields/count.json", filter);
+        }
+
+        /// <summary>
+        /// Gets a count of the metafields for the given entity type and filter options.
         /// </summary>
         /// <param name="resourceType">The type of shopify resource to obtain metafields for. This could be variants, products, orders, customers, custom_collections.</param>
         /// <param name="resourceId">The Id for the resource type.</param>
-        /// <param name="options">The <see cref="MetaFieldFilter"/> used to filter results</param>
-        /// <returns></returns>
-        public virtual async Task<IEnumerable<MetaField>> ListAsync(long? resourceId, string resourceType = null, MetaFieldFilter options = null)
+        /// <param name="filter">Options to filter the results.</param>
+        public virtual async Task<int> CountAsync(long resourceId, string resourceType, MetaFieldFilter filter = null)
         {
-            string reqPath = "metafields.json";
+            return await _CountAsync($"{resourceType}/{resourceId}/metafields/count.json", filter);
+        }

-            if (!string.IsNullOrEmpty(resourceType) && resourceId.HasValue)
+        private async Task<IEnumerable<MetaField>> _ListAsync(string path, MetaFieldFilter filter = null)
+        {
+            var req = PrepareRequest(path);
+
+            if (filter != null)
             {
-                reqPath = $"{resourceType}/{resourceId}/metafields.json";
-            }
-
-            var req = PrepareRequest(reqPath);
-
-            if (options != null)
-            {
-                req.Url.QueryParams.AddRange(options.ToParameters());
+                req.Url.QueryParams.AddRange(filter.ToParameters());
             }

             return await ExecuteRequestAsync<List<MetaField>>(req, HttpMethod.Get, rootElement: "metafields");
         }

         /// <summary>
-        /// Retrieves the <see cref="MetaField"/> with the given id.
+        /// Gets a list of the metafields for the shop itself.
+        /// </summary>
+        /// <param name="filter">Options to filter the results.</param>
+        public virtual async Task<IEnumerable<MetaField>> ListAsync(MetaFieldFilter filter = null)
+        {
+            return await _ListAsync("metafields.json", filter);
+        }
+
+        /// <summary>
+        /// Gets a list of the metafields for the given entity type and filter options.
+        /// </summary>
+        /// <param name="resourceType">The type of shopify resource to obtain metafields for. This could be variants, products, orders, customers, custom_collections.</param>
+        /// <param name="resourceId">The Id for the resource type.</param>
+        /// <param name="filter">Options to filter the results.</param>
+        public virtual async Task<IEnumerable<MetaField>> ListAsync(long resourceId, string resourceType, MetaFieldFilter filter = null)
+        {
+            return await _ListAsync( $"{resourceType}/{resourceId}/metafields.json", filter);
+        }
+
+        /// <summary>
+        /// Retrieves the metafield with the given id.
         /// </summary>
         /// <param name="metafieldId">The id of the metafield to retrieve.</param>
         /// <param name="fields">A comma-separated list of fields to return.</param>
-        /// <returns>The <see cref="MetaField"/>.</returns>
         public virtual async Task<MetaField> GetAsync(long metafieldId, string fields = null)
         {
             var req = PrepareRequest($"metafields/{metafieldId}.json");
@@ -90,10 +101,9 @@
         }

         /// <summary>
-        /// Creates a new <see cref="MetaField"/> on the shop itself.
+        /// Creates a new metafield on the shop itself.
         /// </summary>
-        /// <param name="metafield">A new <see cref="MetaField"/>. Id should be set to null.</param>
-        /// <returns>The new <see cref="MetaField"/>.</returns>
+        /// <param name="metafield">A new metafield. Id should be set to null.</param>
         public virtual async Task<MetaField> CreateAsync(MetaField metafield)
         {
             var req = PrepareRequest("metafields.json");
@@ -106,13 +116,12 @@
         }

         /// <summary>
-        /// Creates a new <see cref="MetaField"/> associated with the provided resource type and resource id.
+        /// Creates a new metafield on the given entity.
         /// </summary>
-        /// <param name="metafield">A new <see cref="MetaField"/>. Id should be set to null.</param>
+        /// <param name="metafield">A new metafield. Id should be set to null.</param>
         /// <param name="resourceId">The Id of the resource the metafield will be associated with. This can be variants, products, orders, customers, custom_collections, etc.</param>
         /// <param name="resourceType">The resource type the metaifeld will be associated with. This can be variants, products, orders, customers, custom_collections, etc.</param>
-        /// <returns>The new <see cref="MetaField"/>.</returns>
-        public virtual async Task<MetaField> CreateAsync(MetaField metafield, long resourceId, string resourceType = null)
+        public virtual async Task<MetaField> CreateAsync(MetaField metafield, long resourceId, string resourceType)
         {
             var req = PrepareRequest( $"{resourceType}/{resourceId}/metafields.json");
             var content = new JsonContent(new
@@ -124,10 +133,9 @@
         }

         /// <summary>
-        /// Updates the given <see cref="MetaField"/>. Id must not be null.
+        /// Updates the given metafield. Id must not be null.
         /// </summary>
-        /// <param name="metafield">The <see cref="MetaField"/> to update.</param>
-        /// <returns>The updated <see cref="MetaField"/>.</returns>
+        /// <param name="metafield">The metafield to update.</param>
         public virtual async Task<MetaField> UpdateAsync(MetaField metafield)
         {
             var req = PrepareRequest($"metafields/{metafield.Id.Value}.json");


Closes #438.  Het werd toch niet gecachet :-) maar gewoon verkeerd opgehaald.

git-svn-id: 0ffdc289f568b1e7493e560395a00d06174c8a92@1124 99b415e2-69d1-4072-8d93-0ed3a15484ab

--- Solution/Chiro.Gap.Workers/GroepsWerkjaarManager.cs
+++ Solution/Chiro.Gap.Workers/GroepsWerkjaarManager.cs
@@ -218,6 +218,7 @@

 			if ((extras & GroepsWerkJaarExtras.LidFuncties) != 0)
 			{
+				paths.Add(gwj => gwj.Lid.First().Functie);
 				paths.Add(gwj => gwj.AfdelingsJaar.First().Kind.First().Functie);
 				paths.Add(gwj => gwj.AfdelingsJaar.First().Leiding.First().Functie);
 			}


Add support for AuralAwarenessRange, used for friendly aggro (#3903)

--- Source/ACE.Server/WorldObjects/Monster_Awareness.cs
+++ Source/ACE.Server/WorldObjects/Monster_Awareness.cs
@@ -410,6 +410,23 @@
             }
         }

+        private float? _auralAwarenessRangeSq;
+
+        public float AuralAwarenessRangeSq
+        {
+            get
+            {
+                if (_auralAwarenessRangeSq == null)
+                {
+                    var auralAwarenessRange = (float)((AuralAwarenessRange ?? VisualAwarenessRange ?? VisualAwarenessRange_Default) * PropertyManager.GetDouble("mob_awareness_range").Item);
+
+                    _auralAwarenessRangeSq = auralAwarenessRange * auralAwarenessRange;
+                }
+
+                return _auralAwarenessRangeSq.Value;
+            }
+        }
+
         /// <summary>
         /// A monster can only alert friendly mobs to the presence of each attack target
         /// once every AlertThreshold
@@ -448,7 +465,7 @@
                 {
                     //var distSq = Location.SquaredDistanceTo(nearbyCreature.Location);
                     var distSq = PhysicsObj.get_distance_sq_to_object(nearbyCreature.PhysicsObj, true);
-                    if (distSq > nearbyCreature.VisualAwarenessRangeSq)
+                    if (distSq > nearbyCreature.AuralAwarenessRangeSq)
                         continue;

                     // scenario: spawn a faction mob, and then spawn a non-faction mob next to it, of the same CreatureType


Modified interface to the openHistorian 2.0 to better handle object disposal.

--- Source/Libraries/openHistorian.XDALink/Historian.cs
+++ Source/Libraries/openHistorian.XDALink/Historian.cs
@@ -61,7 +61,7 @@
         private HistorianClient m_client;
         private ClientDatabaseBase<HistorianKey, HistorianValue> m_database;
         private Lazy<HistorianInputQueue> m_queue;
-        private List<WeakReference<TreeStream<HistorianKey, HistorianValue>>> m_treeStreams;
+        private List<TreeStream<HistorianKey, HistorianValue>> m_treeStreams;

         private bool m_disposed;

@@ -88,7 +88,7 @@

             m_database = m_client.GetDatabase<HistorianKey, HistorianValue>(database);
             m_queue = new Lazy<HistorianInputQueue>(() => new HistorianInputQueue(() => m_database));
-            m_treeStreams = new List<WeakReference<TreeStream<HistorianKey, HistorianValue>>>();
+            m_treeStreams = new List<TreeStream<HistorianKey, HistorianValue>>();
         }

         #endregion
@@ -129,17 +129,12 @@

         public void Dispose()
         {
-            TreeStream<HistorianKey, HistorianValue> stream;
-
             if (!m_disposed)
             {
                 try
                 {
-                    foreach (WeakReference<TreeStream<HistorianKey, HistorianValue>> reference in m_treeStreams)
-                    {
-                        if (reference.TryGetTarget(out stream))
-                            stream.Dispose();
-                    }
+                    foreach (TreeStream<HistorianKey, HistorianValue> stream in m_treeStreams)
+                        stream.Dispose();

                     if (m_queue.IsValueCreated)
                     {
@@ -170,7 +165,7 @@
             // Start stream reader for the provided time window and selected points
             using (TreeStream<HistorianKey, HistorianValue> stream = m_database.Read(SortedTreeEngineReaderOptions.Default, timeFilter, pointFilter))
             {
-                m_treeStreams.Add(new WeakReference<TreeStream<HistorianKey, HistorianValue>>(stream));
+                m_treeStreams.Add(stream);

                 while (stream.Read(key, value))
                 {


Adding ignores, removing RhinoMocksHacks

--- Source/Mocks/Machine.Mocks.Specs/RhinoMocksHacks.cs
+++ Source/Mocks/Machine.Mocks.Specs/RhinoMocksHacks.cs
@@ -6,19 +6,5 @@
 {
   public static class RhinoMocksHacks
   {
-    public static void AssertWasNotCalled<T>(this T mock, Action<T> action)
-    {
-      try
-      {
-        mock.AssertWasCalled(action);
-      }
-      catch (ExpectationViolationException)
-      {
-        return;
-      }
-
-      throw new ExpectationViolationException("Expectd that something " +
-        " would not be called, but is was");
-    }
   }
 }


added snake growing longer when fruit consumed

--- src/namespaceModel/classFruit.cs
+++ src/namespaceModel/classFruit.cs
@@ -157,6 +157,7 @@
 		{
 			if (Eaten != null)
 			{
+                eater.Length = eater.Length + 1;
 				Eaten(this, new EatenEventArgs(eater));
 			}
 		}


PDF encoding for numerics fixed

PDF encoding for numerics fixed

git-svn-id: 98f681d7a2907ee2a41df434552134740bcc8829@74513 81fbe566-5dc4-48c1-bdea-7421811ca204

--- Source/lib/pdf417/encoder/PDF417HighLevelEncoder.cs
+++ Source/lib/pdf417/encoder/PDF417HighLevelEncoder.cs
@@ -494,7 +494,7 @@
          {
             tmp.Length = 0;
             int len = Math.Min(44, count - idx);
-            String part = '1' + msg.Substring(startpos + idx, startpos + idx + len);
+            String part = '1' + msg.Substring(startpos + idx, len);
             BigInteger bigint = BigInteger.Parse(part);
             do
             {
@@ -520,7 +520,7 @@
          {
             tmp.Length = 0;
             int len = Math.Min(44, count - idx);
-            String part = '1' + msg.Substring(startpos + idx, startpos + idx + len);
+            String part = '1' + msg.Substring(startpos + idx, len);
             BigInteger bigint = BigInteger.Parse(part);
             do
             {


Implement TestEmailAddresses method

Implement TestEmailAddresses method

--- StressMeasurementSystem.Tests/Models/ContactTest.cs
+++ StressMeasurementSystem.Tests/Models/ContactTest.cs
@@ -118,6 +118,16 @@
             Assert.AreSame(pnMobile.T, PhoneInfo.Type.Mobile);
         }

+        [Test]
+        public void TestEmailAddresses()
+        {
+            Assert.Equals(_contact.EmailAddresses.Count, 1);
+
+            var eaWork = _contact.EmailAddresses[0];
+            Assert.AreEqual(eaWork.Address, "jsmith@smith.com");
+            Assert.AreSame(eaWork.T, EmailInfo.Type.Work);
+        }
+
         #endregion


SemaphoreSlimTest file tweak...

SemaphoreSlimTest file tweak...

I only need Threaot.Core in NET40

The thing is, SemaphoreSlimExtensions only exists in NET40, should I put SemaphoreSlimExtensions in System.Threading? I do not want to, because it won't exist in all targets.

Should I make it exist in all targets and just delegate (like TaskEx)? Perhaps, however, I do not need to do it because this is not the case of being unable to extend a class (like Task) given that I can use extension methods.

It is not really a problem to keep Threaot.Core, the code compiles just fine. The reason why I put it in conditional compilation is not because there is something wrong with the library, but because a tool might remove it considering it not used and break the code.

--- TestRunner/System/Threading/SemaphoreSlimTestsEx.cs
+++ TestRunner/System/Threading/SemaphoreSlimTestsEx.cs
@@ -5,7 +5,12 @@
 using System.Threading;
 using System.Threading.Tasks;
 using Theraot.Collections.ThreadSafe;
+
+#if NET40
+
 using Theraot.Core;
+
+#endif

 namespace TestRunner.System.Threading
 {


test cancelling queue

test cancelling queue

--- test/Samples/App.cs
+++ test/Samples/App.cs
@@ -1,121 +1,133 @@
-using System;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using Plugin.TextToSpeech;
-using Plugin.TextToSpeech.Abstractions;
-
-using Xamarin.Forms;
-
-namespace Samples
-{
-    public class App : Application
-    {
-        CancellationTokenSource cancelSrc;
-        const string MSG = "This is a test of the emergency broadcast system.  Had this had been an actual emergency, I'm sure something else important would have happened";
-
-		CrossLocale? lang = null;
-
-        public App()
-        {
-            // The root page of your application
-            var btn = new Button {Text = "Say Hello" };
-            var queueBtn = new Button { Text = "Test Queue" };
-            var lbl = new Label { TextColor = Color.Red };
-
-            queueBtn.Command = new Command(async () =>
-            {
-                queueBtn.IsEnabled = false;
-                try
-                {
-
-                    await Task.WhenAll(
-                        CrossTextToSpeech.Current.Speak("Queue 1", lang),
-                        CrossTextToSpeech.Current.Speak("Queue 2", lang),
-                        CrossTextToSpeech.Current.Speak("Queue 3", lang),
-                        CrossTextToSpeech.Current.Speak("Queue 4", lang),
-                        CrossTextToSpeech.Current.Speak("Queue 5", lang)
-                    );
-                }
-                catch (Exception ex)
-                {
-                    lbl.Text = ex.ToString();
-                }
-                finally
-                {
-                    queueBtn.IsEnabled = true;
-                }
-            });
-            btn.Command = new Command(async () =>
-            {
-                lbl.Text = string.Empty;
-                btn.Text = "Cancel Speech";
-                try
-                {
-                    if (cancelSrc == null)
-                    {
-                        cancelSrc = new CancellationTokenSource();
-                        await CrossTextToSpeech.Current.Speak(MSG, crossLocale: lang, cancelToken: cancelSrc.Token);
-                        cancelSrc = null;
-                    }
-                    else
-                    {
-                        cancelSrc.Cancel();
-                        cancelSrc = null;
-                    }
-                }
-                catch (OperationCanceledException)
-                {
-                    lbl.Text = "You cancelled it";
-                }
-                catch (Exception ex)
-                {
-                    lbl.Text = ex.ToString();
-                }
-                finally
-                {
-                    btn.Text = "Say Hello";
-                    cancelSrc = null;
-                }
-            });
-
-
-
-			var language = new Label
-			{
-				Text = "Default language"
-			};
-
-			var pickLanguage = new Button
-			{
-				Text = "Pick Language",
-				Command = new Command(async () =>
-				{
-					var items = await CrossTextToSpeech.Current.GetInstalledLanguages();
-					var result = await MainPage.DisplayActionSheet("Pick", "OK", null, items.Select(i => i.DisplayName).ToArray());
-					lang = items.FirstOrDefault(i => i.DisplayName == result);
-					language.Text = (result == "OK" || string.IsNullOrEmpty(result)) ? "Default" : result;
-				})
-			};
-
-
-            var content = new ContentPage
-            {
-                Title = "Samples",
-                Content = new StackLayout
-                {
-                    VerticalOptions = LayoutOptions.Center,
-                    Children = {
-                        btn,
-                        queueBtn,
-                        lbl,
-						language,
-						pickLanguage
-                    }
-                }
-            };
-
-            MainPage = new NavigationPage(content);
-        }
-    }
-}
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Plugin.TextToSpeech;
+using Plugin.TextToSpeech.Abstractions;
+
+using Xamarin.Forms;
+
+namespace Samples
+{
+    public class App : Application
+    {
+        CancellationTokenSource cancelSrc;
+        const string MSG = "This is a test of the emergency broadcast system.  Had this had been an actual emergency, I'm sure something else important would have happened";
+
+		CrossLocale? lang = null;
+
+        public App()
+        {
+            // The root page of your application
+            var btn = new Button {Text = "Say Hello" };
+            var queueBtn = new Button { Text = "Test Queue" };
+            var lbl = new Label { TextColor = Color.Red };
+
+            queueBtn.Command = new Command(async () =>
+            {
+	            lbl.Text = "";
+	            try
+	            {
+		            if (cancelSrc == null)
+		            {
+			            queueBtn.Text = "Cancel Test Queue";
+			            cancelSrc = new CancellationTokenSource();
+			            await Task.WhenAll(
+				            CrossTextToSpeech.Current.Speak("Queue 1", lang, cancelToken: cancelSrc.Token),
+				            CrossTextToSpeech.Current.Speak("Queue 2", lang, cancelToken: cancelSrc.Token),
+				            CrossTextToSpeech.Current.Speak("Queue 3", lang, cancelToken: cancelSrc.Token),
+				            CrossTextToSpeech.Current.Speak("Queue 4", lang, cancelToken: cancelSrc.Token),
+				            CrossTextToSpeech.Current.Speak("Queue 5", lang, cancelToken: cancelSrc.Token)
+			            );
+		            }
+		            else
+		            {
+			            cancelSrc.Cancel();
+		            }
+	            }
+	            catch (OperationCanceledException)
+	            {
+		            lbl.Text = "You cancelled it";
+	            }
+	            catch (Exception ex)
+	            {
+		            lbl.Text = ex.ToString();
+	            }
+	            finally
+	            {
+		            queueBtn.Text = "Test Queue";
+		            cancelSrc = null;
+	            }
+            });
+            btn.Command = new Command(async () =>
+            {
+                lbl.Text = string.Empty;
+                btn.Text = "Cancel Speech";
+                try
+                {
+                    if (cancelSrc == null)
+                    {
+                        cancelSrc = new CancellationTokenSource();
+                        await CrossTextToSpeech.Current.Speak(MSG, lang, cancelToken: cancelSrc.Token);
+                        cancelSrc = null;
+                    }
+                    else
+                    {
+                        cancelSrc.Cancel();
+                    }
+                }
+                catch (OperationCanceledException)
+                {
+                    lbl.Text = "You cancelled it";
+                }
+                catch (Exception ex)
+                {
+                    lbl.Text = ex.ToString();
+                }
+                finally
+                {
+                    btn.Text = "Say Hello";
+                    cancelSrc = null;
+                }
+            });
+
+
+
+			var language = new Label
+			{
+				Text = "Default language"
+			};
+
+			var pickLanguage = new Button
+			{
+				Text = "Pick Language",
+				Command = new Command(async () =>
+				{
+					var items = await CrossTextToSpeech.Current.GetInstalledLanguages();
+					var result = await MainPage.DisplayActionSheet("Pick", "OK", null, items.Select(i => i.DisplayName).ToArray());
+					lang = items.FirstOrDefault(i => i.DisplayName == result);
+					language.Text = (result == "OK" || string.IsNullOrEmpty(result)) ? "Default" : result;
+				})
+			};
+
+
+            var content = new ContentPage
+            {
+                Title = "Samples",
+                Content = new StackLayout
+                {
+                    VerticalOptions = LayoutOptions.Center,
+                    Children = {
+                        btn,
+                        queueBtn,
+                        lbl,
+						language,
+						pickLanguage
+                    }
+                }
+            };
+
+            MainPage = new NavigationPage(content);
+        }
+    }
+}


Ensure home page JS is rendered when on air

--- src/live.asp.net/Views/Home/Index.cshtml
+++ src/live.asp.net/Views/Home/Index.cshtml
@@ -104,10 +104,10 @@
     <environment names="Development">
         <script src="~/lib/jquery/dist/jquery.js"></script>
         <script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
-        <script src="~/js/common.js" inline="true"></script>
-        @if (Model.NextShowScheduled)
+        <script src="~/js/common.js"></script>
+        @if (Model.NextShowScheduled || Model.IsOnAir)
         {
-        <script src="~/js/home.js" inline="true"></script>
+        <script src="~/js/home.js"></script>
         }
     </environment>
     <environment names="Staging,Production">
@@ -122,7 +122,7 @@
         <cache>
             <script src="~/js/common.min.js" inline="true"></script>
         </cache>
-        @if (Model.NextShowScheduled)
+        @if (Model.NextShowScheduled || Model.IsOnAir)
         {
         <cache>
             <script src="~/js/home.min.js" inline="true"></script>


Remove references to non-existent classes from comments

--- src/tests/Program.cs
+++ src/tests/Program.cs
@@ -58,27 +58,6 @@
         //
         //    -wait             Wait for a keypress before exiting.
         //
-        // Examples:
-        //
-        //  Sending output to the console works on desktop Windows and Windows CE.
-        //
-        //      new ConsoleUI().Execute( args );
-        //
-        //  Debug output works on all platforms.
-        //
-        //      new DebugUI().Execute( args );
-        //
-        //  Sending output to a file works on all platforms, but care must be taken
-        //  to write to an accessible location on some platforms.
-        //
-        //      string myDocs = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
-        //      string path = System.IO.Path.Combine( myDocs, "TestResult.txt" );
-        //      System.IO.TextWriter writer = new System.IO.StreamWriter(output);
-        //      new TextUI( writer ).Execute( args );
-        //      writer.Close();
-        //
-        //  NOTE: Sending output to TCP doesn't work yet
-        //
         static void Main(string[] args)
         {
             new TextUI().Execute(args);


Added unit test

Added unit test

--- test/Overflow.Test/OperationContextTests.cs
+++ test/Overflow.Test/OperationContextTests.cs
@@ -221,6 +221,18 @@
         }

         [Theory, AutoMoqData]
+        public void Providing_inputs_sets_input_properties_on_base_operation(IOperation op, object input)
+        {
+            var sut = OperationContext.Create(op);
+            sut.AddData(input);
+            var inputOperation = new TestInputOperationConcrete();
+
+            sut.ProvideInputs(inputOperation);
+
+            Assert.Equal(input, inputOperation.Input);
+        }
+
+        [Theory, AutoMoqData]
         public void Providing_inputs_to_a_decorated_operation_sets_input_properties(IOperation op, object input)
         {
             var sut = OperationContext.Create(op);
@@ -301,6 +313,15 @@
             op.Execute();

             Assert.Same(output, outputOperation.Output);
+        }
+
+
+        private class TestInputOperationConcrete : TestInputOperationBase { }
+
+        private abstract class TestInputOperationBase : Operation
+        {
+            [Input]
+            public object Input { get; set; }
         }

         private class TestInputOperation : Operation


Make CCPrimitiveBatch public again.  This was hidden for the PCL implementation but is no longer necessary to keep it internal.

--- src/platform/CCPrimitiveBatch.cs
+++ src/platform/CCPrimitiveBatch.cs
@@ -1,10 +1,11 @@
 using System;
+using System.Runtime.CompilerServices;
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Graphics;

 namespace CocosSharp
 {
-	internal class CCPrimitiveBatch : IDisposable
+	public class CCPrimitiveBatch : IDisposable
     {
 		const int DefaultBufferSize = 500;


Added flag to indicate development branch

--- bin/projects/dbatools/dbatools/dbaSystem/DebugHost.cs
+++ bin/projects/dbatools/dbatools/dbaSystem/DebugHost.cs
@@ -74,6 +74,11 @@
         /// Enables the developer mode. In this additional information and logs are written, in order to make it easier to troubleshoot issues.
         /// </summary>
         public static bool DeveloperMode = false;
+
+        /// <summary>
+        /// Returns whether the module is currently in a development branch. Some warnings will only be shown in development branch, but hidden in master / public releases
+        /// </summary>
+        public static bool DevelopmentBranch = true;
         #endregion Defines

         #region Queues


Update ReadingLargeExcelFiles.cs

Update ReadingLargeExcelFiles.cs

--- Examples/CSharp/Articles/OptimizingMemoryUsage/ReadingLargeExcelFiles.cs
+++ Examples/CSharp/Articles/OptimizingMemoryUsage/ReadingLargeExcelFiles.cs
@@ -8,7 +8,7 @@
     {
         public static void Main()
         {
-            //ExEnd:1
+            //ExStart:1
             // The path to the documents directory.
             string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
             //Specify the LoadOptions


Fixed PC symbol regex

Fixed PC symbol regex

--- 6502.Net/Asm6502Controller.cs
+++ 6502.Net/Asm6502Controller.cs
@@ -82,7 +82,7 @@
             evaluator_ = new ExpressionEvaluator();
             evaluator_.SymbolLookups.Add(@"(?>_?[a-zA-Z][a-zA-Z0-9_\.]*)(?!\()", GetLabelValue);
             evaluator_.SymbolLookups.Add(@"^\++$|^-+$|\(\++\)|\(-+\)", ConvertAnonymous);
-            evaluator_.SymbolLookups.Add(@"(?<=[^a-zA-Z0-9_\.\)]|^)\*(?=[^a-zA-Z0-9_\.\(]|$)", (str, ix, obj) => Output.GetPC().ToString());
+            evaluator_.SymbolLookups.Add(@"(?<![a-zA-Z0-9_\.)])\*(?![a-zA-Z0-9_\.(])", (str, ix, obj) => Output.GetPC().ToString());
             evaluator_.AllowAlternateBinString = true;

             Output.Reset();


Added reference to MFWSVaultExtensionAuthenticationOperations.

--- Libraries/MFaaP.MFWSClient/MFWSVaultExtensionAuthenticationOperations.cs
+++ Libraries/MFaaP.MFWSClient/MFWSVaultExtensionAuthenticationOperations.cs
@@ -10,6 +10,7 @@
 	/// <summary>
 	/// The 'VaultExtensionAuthenticationOperations' class represents the available extension authentication operations.
 	/// </summary>
+	/// <remarks>ref: https://www.m-files.com/api/documentation/latest/index.html#MFilesAPI~VaultExtensionAuthenticationOperations.html </remarks>
 	public class MFWSVaultExtensionAuthenticationOperations
 		: MFWSVaultOperationsBase
 	{


Fix for MP3 duration calculation

Fix for MP3 duration calculation

--- ATL/AudioData/IO/MPEGaudio.cs
+++ ATL/AudioData/IO/MPEGaudio.cs
@@ -606,8 +606,8 @@
 					return vbrData.Frames * getCoefficient(HeaderFrame) * 8.0 / getSampleRate(HeaderFrame);
 				else
 				{
-                    long MPEGSize = sizeInfo.FileSize - sizeInfo.ID3v2Size - sizeInfo.ID3v1Size - sizeInfo.APESize;
-                    return (MPEGSize - HeaderFrame.Position) / getBitRate(HeaderFrame) / 1000.0 * 8;
+                    long MPEGSize = sizeInfo.FileSize - sizeInfo.TotalTagSize;
+                    return (MPEGSize/* - HeaderFrame.Position*/) / getBitRate(HeaderFrame) / 1000.0 * 8;
 				}
 			else
 				return 0;


Registrar: Fix IsKnownNativeLibrary to work correctly.

--- AgateLib/Drivers/Registrar.cs
+++ AgateLib/Drivers/Registrar.cs
@@ -46,7 +46,7 @@

         private static IWinForms mWinForms;

-        private static const string[] KnownNativeLibraries = new string[]
+        private static readonly string[] KnownNativeLibraries = new string[]
         {
             "SDL.dll",
         };
@@ -62,7 +62,7 @@
         public static void Initialize()
         {
             if (mIsInitialized)
-                sreturn;
+                return;

             NullSoundImpl.Register();
             NullInputImpl.Register();
@@ -158,12 +158,15 @@
             mIsInitialized = true;
         }

-        private static bool IsKnownNativeLibrary(string file)
-        {
+        private static bool IsKnownNativeLibrary(string path)
+        {
+            string filename = System.IO.Path.GetFileName(path).ToLowerInvariant();
+
             for (int i = 0; i < KnownNativeLibraries.Length; i++)
-                if (KnownNativeLibraries[i].ToLowerInvariant() == file.ToLowerInvariant())
+            {
+                if (KnownNativeLibraries[i].ToLowerInvariant() == filename)
                     return true;
-
+            }
             return false;
         }


ci target added

ci target added

--- Android/GoogleGson/build.cake
+++ Android/GoogleGson/build.cake
@@ -1,5 +1,5 @@

-var TARGET = Argument ("t", Argument ("target", "Default"));
+var TARGET = Argument ("t", Argument ("target", "ci"));

 var JAR_VERSION = "2.8.6";
 var NUGET_VERSION = JAR_VERSION;
@@ -57,6 +57,9 @@
 	});
 });

+Task ("ci")
+	.IsDependentOn("samples");
+
 Task ("clean")
 	.Does (() =>
 {


Clean up test helper

Clean up test helper

--- AngleSharp.Io.Tests/Helper.cs
+++ AngleSharp.Io.Tests/Helper.cs
@@ -1,9 +1,9 @@
-namespace AngleSharp.Core.Tests
+namespace AngleSharp.Io.Tests
 {
-    using NUnit.Framework;
     using System;
     using System.IO;
     using System.Net.NetworkInformation;
+    using NUnit.Framework;

     /// <summary>
     /// Small (but quite useable) code to enable / disable some
@@ -39,7 +39,7 @@
             if (!NetworkInterface.GetIsNetworkAvailable())
                 return false;

-            foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
+            foreach (var ni in NetworkInterface.GetAllNetworkInterfaces())
             {
                 // discard because of standard reasons
                 if ((ni.OperationalStatus != OperationalStatus.Up) ||
@@ -84,4 +84,4 @@
             return stream;
         }
     }
-}
+}


(QLIE): fixed older archives decryption.

--- ArcFormats/Qlie/Encryption.cs
+++ ArcFormats/Qlie/Encryption.cs
@@ -47,6 +47,11 @@
         /// Hash generated from the key data contained within archive index.
         /// </summary>
         public uint ArcKey { get; protected set; }
+
+        /// <summary>
+        /// Key used to decrypt names, usually same as ArcKey.
+        /// </summary>
+        public int NameKey { get; protected set; }

         public static IEncryption Create (ArcView file, Version version, byte[] arc_key)
         {
@@ -71,7 +76,8 @@
     {
         public EncryptionV2 ()
         {
-            ArcKey = 0xC4;
+            NameKey = 0xC4;
+            ArcKey = 0;
         }

         public override uint CalculateHash (byte[] data, int length)
@@ -81,7 +87,7 @@

         public override string DecryptName (byte[] name, int name_length)
         {
-            int key = name_length + ((int)ArcKey ^ 0x3E);
+            int key = name_length + (NameKey ^ 0x3E);
             for (int k = 0; k < name_length; ++k)
                 name[k] ^= (byte)(((k + 1) ^ key) + k + 1);

@@ -94,7 +100,7 @@
                 throw new ArgumentOutOfRangeException ("offset");
             if (length > data.Length || offset > data.Length - length)
                 throw new ArgumentOutOfRangeException ("length");
-            uint arc_key = 0; // ArcKey?
+            uint arc_key = ArcKey;

             ulong hash = 0xA73C5F9DA73C5F9Dul;
             ulong xor = ((uint)length + arc_key) ^ 0xFEC9753Eu;
@@ -128,6 +134,7 @@
             GameKeyData = game_key;
             var key_data = file.View.ReadBytes (file.MaxOffset-0x41C, 0x100);
             ArcKey = CalculateHash (key_data, key_data.Length) & 0x0FFFFFFFu;
+            NameKey = (int)ArcKey;
         }

         public override uint CalculateHash (byte[] data, int length)
@@ -234,6 +241,7 @@
         {
             var key_data = file.View.ReadBytes (file.MaxOffset-0x41C, 0x100);
             ArcKey = CalculateHash (key_data, key_data.Length) & 0x0FFFFFFFu;
+            NameKey = (int)ArcKey;
         }

         public override uint CalculateHash (byte[] data, int length)
@@ -263,7 +271,7 @@
         {
             int char_count = name_length / 2;
             int hash = (char_count * char_count) ^ char_count;
-            hash ^= (int)(0x3E13 ^ (ArcKey >> 16) ^ ArcKey);
+            hash ^= 0x3E13 ^ (NameKey >> 16) ^ NameKey;
             hash &= 0xFFFF;
             int key = hash;
             for (int i = 0; i < char_count; ++i)


(ODN): another image filename + recognize WAV entries.

--- ArcFormats/Valkyria/ArcODN.cs
+++ ArcFormats/Valkyria/ArcODN.cs
@@ -67,6 +67,7 @@
         public OdnOpener ()
         {
             Settings = new[] { AudioSampleRate };
+            Extensions = new[] { "odn", "dat" };
         }

         FixedSetSetting AudioSampleRate = new FixedSetSetting (Properties.Settings.Default) {
@@ -77,32 +78,17 @@

         public override ArcFile TryOpen (ArcView file)
         {
-            if (!file.Name.HasExtension (".odn"))
+            if (!file.Name.HasAnyOfExtensions ("odn", "dat"))
                 return null;
             var reader = new OdnIndexReader (file);
             var dir = reader.ReadIndex();
             if (null == dir)
                 return null;
-            /*
-            var sys_ini = VFS.CombinePath (VFS.GetDirectoryName (file.Name), "system.ini");
-            if (VFS.FileExists (sys_ini))
-            {
-                try
-                {
-                    using (var ini = new IniReader (sys_ini))
-                    {
-                        var scheme = ini.ReadScheme();
-                        return new OdnArchive (file, this, dir, scheme);
-                    }
-                }
-                catch { }
-            }
-            */
             return new ArcFile (file, this, dir);
         }

         internal static readonly Regex Image24NameRe = new Regex ("^(?:back|phii)");
-        internal static readonly Regex Image32NameRe = new Regex ("^(?:data|codn|cccc)");
+        internal static readonly Regex Image32NameRe = new Regex ("^(?:data|codn|cccc|fund)");
         internal static readonly Regex ScriptNameRe  = new Regex ("^(?:scrp|menu|sysm)");
         internal static readonly Regex AudioNameRe   = new Regex ("^hime");

@@ -185,6 +171,7 @@
             new Size (1024, 768),
             new Size (800, 600),
             new Size (640, 480),
+            new Size (400, 600),
             new Size (400, 200),
         };

@@ -369,6 +356,8 @@
                     IResource res = null;
                     if (0x5E6A6A42 == signature)
                         res = OggAudio.Instance;
+                    else if (AudioFormat.Wav.Signature == signature)
+                        res = AudioFormat.Wav;
                     else
                         res = AutoEntry.DetectFileType (signature);
                     if (res != null)


Updated code comments

Updated code comments

--- tests/EFCoreTools.Tests/Tests/IndexTests.cs
+++ tests/EFCoreTools.Tests/Tests/IndexTests.cs
@@ -13,16 +13,12 @@
         [TestMethod]
         public void CreateUniqueIndexTest()
         {
-            /***************
-                ASSIGN
-            ****************/
+            /**** ASSIGN ****/

             // Create a TestDbContext object using SQLite db.
             var context = TestDbContext.New("index_convention_tests");

-            /***************
-                ACT
-            ****************/
+            /**** ACT ****/

             // Grab the Person Entity from the Model.
             var personEntity = context.Model.FindEntityType(typeof(Person));
@@ -34,9 +30,7 @@
             var zipCodeIndex = personEntity.GetIndexes().FirstOrDefault(x => x.SqlServer().Name.ToLower() == "ix_person_zipcode");
             var fullNameIndex = personEntity.GetIndexes().FirstOrDefault(x => x.SqlServer().Name.ToLower() == "ix_person_lastname_firstname_middlename");

-            /***************
-                ASSERT
-            ****************/
+            /**** ASSERT ****/

             // Verify that the Person Entity exists in the Model.
             Assert.IsNotNull(personEntity);


Create constructor for PartsTableAdapter class

--- Project/WorkshopManager/WorkshopManager/SqlDatabase/PartsTableAdapter.cs
+++ Project/WorkshopManager/WorkshopManager/SqlDatabase/PartsTableAdapter.cs
@@ -10,6 +10,12 @@

     class PartsTableAdapter
     {
+        public Get Get;
+
+        public PartsTableAdapter()
+        {
+            Get = new Get();
+        }
     }
 }


Small improvement to the InterceptorExtensions in the Code Samples project. An exception will now be thrown when a non-interface type is encountered, instead of skipping over it.

--- SimpleServiceLocator/SimpleInjector.CodeSamples/InterceptorExtensions.cs
+++ SimpleServiceLocator/SimpleInjector.CodeSamples/InterceptorExtensions.cs
@@ -156,16 +156,30 @@
             internal Func<Type, bool> Predicate { get; set; }

             [DebuggerStepThrough]
-            public void OnExpressionBuilt(object sender, ExpressionBuiltEventArgs e)
+            public void OnExpressionBuilt(object sender,
+                ExpressionBuiltEventArgs e)
+            {
+                if (this.Predicate(e.RegisteredServiceType))
+                {
+                    ThrowIfServiceTypeIsNotAnInterface(e);
+
+                    e.Expression = this.BuildProxyExpression(e);
+                }
+            }
+
+            [DebuggerStepThrough]
+            private static void ThrowIfServiceTypeIsNotAnInterface(
+                ExpressionBuiltEventArgs e)
             {
                 // NOTE: We can only handle interfaces, because
-                // System.Runtime.Remoting.Proxies.RealProxy only supports interfaces.
-                bool interceptType = e.RegisteredServiceType.IsInterface &&
-                    this.Predicate(e.RegisteredServiceType);
-
-                if (interceptType)
-                {
-                    e.Expression = this.BuildProxyExpression(e);
+                // System.Runtime.Remoting.Proxies.RealProxy
+                // only supports interfaces.
+                if (!e.RegisteredServiceType.IsInterface)
+                {
+                    throw new NotSupportedException(
+                        "Can't intercept type " +
+                        e.RegisteredServiceType.Name +
+                        " because it is not an interface.");
                 }
             }


Change BillboardTextModel to be subclass of MaterialGeometryModel3D instead of MeshGeometryModel3D

--- Source/HelixToolkit.Wpf.SharpDX/Model/Elements3D/BillboardTextModel3D.cs
+++ Source/HelixToolkit.Wpf.SharpDX/Model/Elements3D/BillboardTextModel3D.cs
@@ -8,8 +8,32 @@

 namespace HelixToolkit.Wpf.SharpDX
 {
-    public class BillboardTextModel3D : MeshGeometryModel3D
+    public class BillboardTextModel3D : MaterialGeometryModel3D
     {
+        public static readonly DependencyProperty ReuseVertexArrayBufferProperty = DependencyProperty.Register("ReuseVertexArrayBuffer", typeof(bool), typeof(BillboardTextModel3D),
+           new PropertyMetadata(false, (s, e) =>
+           {
+               if (!(bool)e.NewValue)
+               {
+                   (s as BillboardTextModel3D).vertexArrayBuffer = null;
+               }
+           }));
+
+        /// <summary>
+        /// Reuse previous vertext array buffer during CreateBuffer. Reduce excessive memory allocation during rapid geometry model changes.
+        /// Example: Repeatly updates textures, or geometries with close number of vertices.
+        /// </summary>
+        public bool ReuseVertexArrayBuffer
+        {
+            set
+            {
+                SetValue(ReuseVertexArrayBufferProperty, value);
+            }
+            get
+            {
+                return (bool)GetValue(ReuseVertexArrayBufferProperty);
+            }
+        }
         #region Private Class Data Members

         private EffectVectorVariable vViewport;


draft

draft

--- Tests.Unit.Presentation.Web/Models/V2/ItSystemUsageResponseMapperTest.cs
+++ Tests.Unit.Presentation.Web/Models/V2/ItSystemUsageResponseMapperTest.cs
@@ -144,6 +144,22 @@
             Assert.Equal(expectedRemovals, actualRemovals);
         }

+        [Fact]
+        public void MapSystemUsageDTO_Maps_OrganizationalUsage_Properties_Section()
+        {
+            //TODO:
+            ////Arrange
+            //var itSystemUsage = new ItSystemUsage();
+            //AssignBasicProperties(itSystemUsage);
+            //itSystemUsage.ResponsibleUsage = new ItSystemUsageOrgUnitUsage(){}
+
+            ////Act
+            //var dto = _sut.MapSystemUsageDTO(itSystemUsage);
+
+            ////Assert
+
+        }
+
         private void AssignKle(ItSystemUsage itSystemUsage)
         {
             itSystemUsage.TaskRefs = Many<Guid>().Select(x => new TaskRef() { TaskKey = A<string>(), Uuid = A<Guid>() }).ToList();


Solved post request related issue

Solved post request related issue

--- Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
+++ Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
@@ -19,8 +19,8 @@
         /// <returns>Question list</returns>
         public List<SingleMultipleAnswerQuestion> GetAllQuestions()
         {
-            var questions = _dbContext.SingleMultipleAnswerQuestion.ToList();
-            return questions;
+            var question = _dbContext.SingleMultipleAnswerQuestion.ToList();
+            return question;
         }
         /// <summary>
         /// Add single multiple answer question into SingleMultipleAnswerQuestion model


Added transaction scope to update code snippet question function

--- Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
+++ Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
@@ -114,32 +114,36 @@
             updatedQuestion.UpdatedByUserId = userId;
             updatedCodeSnippetQuestion.Question = updatedQuestion;

-            _dbContext.Question.Update(updatedQuestion);
-            await _dbContext.SaveChangesAsync();
-
-            _dbContext.CodeSnippetQuestion.Update(updatedCodeSnippetQuestion);
-            await _dbContext.SaveChangesAsync();
+            using (var transaction = _dbContext.Database.BeginTransaction())
+            {
+                _dbContext.Question.Update(updatedQuestion);
+                await _dbContext.SaveChangesAsync();

-            //Handling many to many relationship entity
-            //Remove all the mapping between CodeSnippetQuestion and CodingLanguage
-            var mappingToRemove = await _dbContext.QuestionLanguageMapping.Where(x => x.QuestionId == updatedQuestion.CodeSnippetQuestion.Id).ToListAsync();
-            _dbContext.QuestionLanguageMapping.RemoveRange(mappingToRemove);
+                _dbContext.CodeSnippetQuestion.Update(updatedCodeSnippetQuestion);
+                await _dbContext.SaveChangesAsync();

-            var questionLanguageMapping = new List<QuestionLanguageMapping>();
-            var languageList = await _dbContext.CodingLanguage.ToListAsync();
+                //Handling many to many relationship entity
+                //Remove all the mapping between CodeSnippetQuestion and CodingLanguage
+                var codingLanguageToRemove = await _dbContext.QuestionLanguageMapping.Where(x => x.QuestionId == updatedQuestion.CodeSnippetQuestion.Id).ToListAsync();
+                _dbContext.QuestionLanguageMapping.RemoveRange(codingLanguageToRemove);

-            //Map language to codeSnippetQuestion
-            foreach (var language in questionAC.CodeSnippetQuestion.LanguageList)
-            {
-                questionLanguageMapping.Add(new QuestionLanguageMapping
+                var questionLanguageMapping = new List<QuestionLanguageMapping>();
+                var languageList = await _dbContext.CodingLanguage.ToListAsync();
+
+                //Map language to codeSnippetQuestion
+                foreach (var language in questionAC.CodeSnippetQuestion.LanguageList)
                 {
-                    QuestionId = updatedQuestion.CodeSnippetQuestion.Id,
-                    LanguageId = languageList.First(x => x.Language.ToLower().Equals(language.ToLower())).Id
-                });
+                    questionLanguageMapping.Add(new QuestionLanguageMapping
+                    {
+                        QuestionId = updatedQuestion.CodeSnippetQuestion.Id,
+                        LanguageId = languageList.First(x => x.Language.ToLower().Equals(language.ToLower())).Id
+                    });
+                }
+
+                updatedQuestion.CodeSnippetQuestion.QuestionLanguangeMapping = questionLanguageMapping;
+                await _dbContext.SaveChangesAsync();
+                transaction.Commit();
             }
-
-            updatedQuestion.CodeSnippetQuestion.QuestionLanguangeMapping = questionLanguageMapping;
-            await _dbContext.SaveChangesAsync();
         }

         public async Task UpdateSingleMultipleAnswerQuestionAsync(int questionId, QuestionAC questionAC, string userId)


Solve build related issue

Solve build related issue

--- Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
+++ Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
@@ -53,6 +53,7 @@
         /// Add single multiple answer question into SingleMultipleAnswerQuestion model
         /// </summary>
         /// <param name="singleMultipleAnswerQuestion"></param>
+        /// <param name="singleMultipleAnswerQuestionOption"></param>
         public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption)
         {
             _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion);


use ! instead of check

use ! instead of check

--- WalletWasabi.Fluent/Behaviors/FocusFirstTextBoxInItemsControlBehavior.cs
+++ WalletWasabi.Fluent/Behaviors/FocusFirstTextBoxInItemsControlBehavior.cs
@@ -11,20 +11,14 @@
 		{
 			base.OnAttached();

-			if (AssociatedObject is { } ao)
-			{
-				ao.LayoutUpdated += OnLayoutUpdated;
-			}
+			AssociatedObject!.LayoutUpdated += OnLayoutUpdated;
 		}

 		protected override void OnDetaching()
 		{
 			base.OnDetaching();

-			if (AssociatedObject is { } ao)
-			{
-				ao.LayoutUpdated -= OnLayoutUpdated;
-			}
+			AssociatedObject!.LayoutUpdated -= OnLayoutUpdated;
 		}

 		private void OnLayoutUpdated(object? sender, EventArgs e)


reconstructor allows a parent task

reconstructor allows a parent task

--- AsanaNet/Objects/AsanaTask.cs
+++ AsanaNet/Objects/AsanaTask.cs
@@ -80,18 +80,22 @@
             return Create(typeof(AsanaTask), ID) as AsanaTask;
         }

-        public AsanaTask(AsanaWorkspace workspace)
+        public AsanaTask(AsanaWorkspace workspace, AsanaTask parentTask = null)
         {
             Workspace = workspace;
-        }
-
-        public AsanaTask(AsanaWorkspace workspace, Int64 id)
+            if (parentTask != null)
+                Parent = parentTask;
+        }
+
+        public AsanaTask(AsanaWorkspace workspace, Int64 id, AsanaTask parentTask = null)
         {
             ID = id;
             Workspace = workspace;
+            if (parentTask != null)
+                Parent = parentTask;
+
             // cache current state
             SetAsReferenceObject();
-            //SavingCallback(Parsing.Serialize(this, false, true));
         }

         public Task AddProject(AsanaProject proj, Asana host)


Build fix

Build fix

--- tests/tarantool.client.tests/Performance.cs
+++ tests/tarantool.client.tests/Performance.cs
@@ -50,11 +50,11 @@
     {
         private const uint OperationsCount = 1000;

-        private readonly Client.Index _index;
+        private readonly Client.IIndex _index;

         private readonly uint _id;

-        public TestClient(Client.Index index, uint threadId)
+        public TestClient(Client.IIndex index, uint threadId)
         {
             _index = index;
             _id = threadId;


Add unit tests for countWords method

Add unit tests for countWords method

--- UnitTestUsefullFunctions/UnitTestFunctionsString.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsString.cs
@@ -5292,6 +5292,69 @@
       var result = StringFunc.CountWords(source);
       Assert.AreEqual(result, expected);
     }
+
+    [TestMethod]
+    public void TestMethod_CountWords_french_words()
+    {
+      const string source = "il fut dommage qu'il ne pu venir";
+      var expected = 7;
+      var result = StringFunc.CountWords(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_CountWords_french_quote_of_mine()
+    {
+      const string source = "La connaissance est certitude et la certitude ne se confirme pas";
+      var expected = 11;
+      var result = StringFunc.CountWords(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_CountWords_English_quote()
+    {
+      const string source = "It's immposible said pride. It's risky said experience. It's pointless said reason. Give it a try whispered the heart";
+      var expected = 19;
+      var result = StringFunc.CountWords(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_CountWords_English_quote_antoine_de_saint_exupery()
+    {
+      const string source = "When you give yourself, you receive more than you give";
+      var expected = 10;
+      var result = StringFunc.CountWords(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_CountWords_English_quote_Linus_tordvals()
+    {
+      const string source = "If Microsoft ever does applications for Linux, it means I've won";
+      var expected = 11;
+      var result = StringFunc.CountWords(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_CountWords_English_quote_Mark_Twain()
+    {
+      const string source = "Age is an issue of mind over matter. If you don't mind, it doesn't matter";
+      var expected = 15;
+      var result = StringFunc.CountWords(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_CountWords_English_quote_Issac_Newton()
+    {
+      const string source = "We build too many walls and not enough bridges";
+      var expected = 9;
+      var result = StringFunc.CountWords(source);
+      Assert.AreEqual(result, expected);
+    }
     #endregion CountWords
     #region Helper methods


RCNETSDK-2 development work on Headers.cs

--- ringcentral/http/Headers.cs
+++ ringcentral/http/Headers.cs
@@ -7,5 +7,83 @@
 {
     class Headers
     {
+        private const string HeaderSeperator = ":";
+        private const string ContentType = "content-type";
+        private const string Authorization = "authorization";
+        private const string Accept = "accept";
+        private const string UrlEncodedContentType = "application/x-www-form-urlencoded";
+        private const string JsonContentType = "application/json";
+        private const string MultipartContentType = "multipart/mixed";
+
+        private readonly Dictionary<String, String> _headers;
+
+        public Headers()
+        {
+            _headers = new Dictionary<String, String>();
+        }
+
+        public Boolean HasHeader(String name)
+        {
+            return _headers.ContainsKey(name);
+        }
+
+        public String GetHeader(String name)
+        {
+            return _headers.ContainsKey(name) ? _headers[name] : null;
+        }
+
+        public void SetHeader(String name, String value)
+        {
+            _headers.Add(name, value);
+        }
+
+        public void SetHeaders(Dictionary<String, String> headers)
+        {
+            foreach (var k in headers.Keys)
+            {
+                SetHeader(k, headers[k]);
+            }
+        }
+
+        public Dictionary<String, String> GetHeaders()
+        {
+            return _headers;
+        }
+
+        public String[] GetHeadersArray()
+        {
+            return _headers.Keys.Select(k => k.ToLower() + HeaderSeperator + _headers[k]).ToArray();
+        }
+
+        public String GetContentType()
+        {
+            return GetHeader(ContentType);
+        }
+
+        public void SetContentType(String contentType)
+        {
+            SetHeader(ContentType, contentType);
+        }
+
+        public Boolean IsContentType(String contentType)
+        {
+            return GetContentType().Equals(contentType);
+        }
+
+        public Boolean IsJson()
+        {
+            return IsContentType(JsonContentType);
+        }
+
+        public Boolean IsMultiPart()
+        {
+            return IsContentType(MultipartContentType);
+        }
+
+        public Boolean IsUrlEncoded()
+        {
+            return IsContentType(UrlEncodedContentType);
+        }
+
     }
 }


Add Unit tests for IsRepeatedChar method

--- UnitTestUsefullFunctions/UnitTestFunctionsString.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsString.cs
@@ -1695,5 +1695,42 @@
       bool result = StringFunc.IsSpaces(source);
       Assert.AreEqual(result, expected);
     }
+
+    // **********************IsRepeatedChar****************
+    [TestMethod]
+    public void TestMethod_IsRepeatedChar_true()
+    {
+      string source = "aaaaaaa";
+      bool expected = true;
+      bool result = StringFunc.IsRepeatedChar(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsRepeatedChars_empty_string()
+    {
+      string source = "";
+      bool expected = true;
+      bool result = StringFunc.IsRepeatedChar(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsRepeatedChar_false()
+    {
+      string source = "qwerty";
+      bool expected = false;
+      bool result = StringFunc.IsRepeatedChar(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsRepeatedChar_false_on_a_sentence()
+    {
+      string source = "Once upon a time in a galaxy far far away";
+      bool expected = false;
+      bool result = StringFunc.IsRepeatedChar(source);
+      Assert.AreEqual(result, expected);
+    }
   }
 }