drobnepoprawki

drobnepoprawki

--- Application.LogicLayer/Logic/UsNavyFatIndex/UsNavyFatIndex.cs
+++ Application.LogicLayer/Logic/UsNavyFatIndex/UsNavyFatIndex.cs
@@ -20,14 +20,14 @@

             if (person.Sex == Sex.Male)
             {
-                dataNavy.PersonIndex = (float) ((float) (86.010*Math.Log10((double) person.DataForCalculatedNIndex.abdomen-
-                          person.DataForCalculatedNIndex.neck)-70.041 *Math.Log10(person.Heigh))+36.76);
+                dataNavy.PersonIndex = (float) ((float) (86.010*Math.Log10((double) person.DataForCalculatedNIndex.abdomen / 100 * 39.3700787 -
+                          person.DataForCalculatedNIndex.neck / 100 * 39.3700787) -70.041 *Math.Log10(person.Heigh / 100 * 39.3700787))+36.76);
             }
             else if (person.Sex == Sex.Female)
             {
-                dataNavy.PersonIndex = (float)((float)(163.205 * Math.Log10((double)person.DataForCalculatedNIndex.abdomen +
-                    person.DataForCalculatedNIndex.hip-
-                     person.DataForCalculatedNIndex.neck) - 97.684 * Math.Log10(person.Heigh)) -78.387);
+                dataNavy.PersonIndex = (float)((float)(163.205 * Math.Log10((double)person.DataForCalculatedNIndex.abdomen / 100 * 39.3700787 +
+                    person.DataForCalculatedNIndex.hip / 100 * 39.3700787 -
+                     person.DataForCalculatedNIndex.neck / 100 * 39.3700787) - 97.684 * Math.Log10(person.Heigh/100* 39.3700787)) -78.387);
             }


Modified .And() to use the .NET .Concat() method instead of yields

--- src/ListExtensions.cs
+++ src/ListExtensions.cs
@@ -91,10 +91,7 @@
         /// </summary>
         public static IEnumerable<T> And<T>(this IEnumerable<T> source, IEnumerable<T> other)
         {
-            foreach (T t in source)
-                yield return t;
-            foreach (T t in other)
-                yield return t;
+            return source.Concat(other);
         }

         /// <summary>


Enabling startup error logging

Enabling startup error logging

--- src/MabWeb/Program.cs
+++ src/MabWeb/Program.cs
@@ -15,6 +15,8 @@
                 .UseKestrel()
                 .UseContentRoot(Directory.GetCurrentDirectory())
                 .UseIISIntegration()
+                .UseSetting("detailedErrors", "true")
+                .CaptureStartupErrors(true)
                 .UseStartup<Startup>()
                 .Build();


Move-KnownFolder: determine unique path in pipeline mode, implement single folder mode

--- BlaSoft.PowerShell.KnownFolders/RedirectKnownFolderCommand.cs
+++ BlaSoft.PowerShell.KnownFolders/RedirectKnownFolderCommand.cs
@@ -1,4 +1,5 @@
 using System;
+using System.IO;
 using System.Management.Automation;
 using System.Reflection;
 using System.Runtime.InteropServices;
@@ -6,7 +7,7 @@

 namespace BlaSoft.PowerShell.KnownFolders
 {
-    [Cmdlet(VerbsCommon.Move, "KnownFolder", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High)]
+    [Cmdlet(VerbsCommon.Move, "KnownFolder", DefaultParameterSetName = "SingleFolder", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High)]
     [OutputType(typeof(KnownFolder))]
     public sealed class RedirectKnownFolderCommand : PSCmdlet
     {
@@ -16,12 +17,16 @@

         private bool noToAll;

-        [Parameter(ParameterSetName = "KnownFolder", Mandatory = true, ValueFromPipeline = true)]
-        [ValidateNotNull]
+        [Parameter(ParameterSetName = "SingleFolder", Mandatory = true, Position = 0)]
+        public KnownFolder SingleFolder { get; set; }
+
+        [Parameter(ParameterSetName = "SingleFolder", Mandatory = true, Position = 1)]
+        public string NewPath { get; set; }
+
+        [Parameter(ParameterSetName = "MultipleFolders", Mandatory = true, ValueFromPipeline = true)]
         public KnownFolder Folder { get; set; }

-        [Parameter(ParameterSetName = "KnownFolder", Mandatory = true, Position = 0)]
-        [ValidateNotNullOrEmpty]
+        [Parameter(ParameterSetName = "MultipleFolders", Mandatory = true, Position = 0)]
         public string Destination { get; set; }

         [Parameter]
@@ -40,14 +45,46 @@

         protected override void ProcessRecord()
         {
-            if (!this.Folder.CanRedirect)
+            switch (this.ParameterSetName)
             {
-                throw new InvalidOperationException("Folder cannot be redirected.");
+                case "SingleFolder":
+                    this.RedirectOneFolder(this.SingleFolder, this.NewPath);
+                    break;
+                case "MultipleFolders":
+                    var newPath = DetermineNewPath(this.Folder, this.Destination);
+                    this.RedirectOneFolder(this.Folder, newPath);
+                    break;
+                default:
+                    throw new ArgumentException("Unsupported parameter set name: " + this.ParameterSetName);
+            }
+        }
+
+        private string DetermineNewPath(KnownFolder knownFolder, string destinationPath)
+        {
+            var existingPath = knownFolder.Path;
+            if (string.IsNullOrEmpty(existingPath))
+            {
+                throw new InvalidOperationException(string.Format("Unable to determine new path of folder '{0}': existing path is empty.", knownFolder.Name));
             }

-            string currentPath = this.Folder.Path;
-            var newPath = this.Destination;
-            if (!this.ShouldProcess(this.Folder.Name, string.Format("Redirect from {0} to {1}", currentPath, newPath)))
+            var existingDirectoryName = Path.GetFileName(existingPath);
+            if (string.IsNullOrEmpty(existingDirectoryName))
+            {
+                throw new InvalidOperationException(string.Format("Unable to determine new path of folder '{0}': cannot determine existing directory name.", knownFolder.Name));
+            }
+
+            return Path.Combine(destinationPath, existingDirectoryName);
+        }
+
+        private void RedirectOneFolder(KnownFolder folder, string newPath)
+        {
+            if (!folder.CanRedirect)
+            {
+                throw new InvalidOperationException(string.Format("Folder '{0}' cannot be redirected.", folder.Name));
+            }
+
+            string currentPath = folder.Path;
+            if (!this.ShouldProcess(folder.Name, string.Format("Redirect from {0} to {1}", currentPath, newPath)))
             {
                 return;
             }
@@ -57,7 +94,7 @@
                 return;
             }

-            var id = new KNOWNFOLDERID(this.Folder.FolderId);
+            var id = new KNOWNFOLDERID(folder.FolderId);
             KF_REDIRECT_FLAGS flags = KF_REDIRECT_FLAGS.KF_REDIRECT_NONE;
             if (this.CheckOnly)
             {
@@ -95,7 +132,7 @@

             if (this.PassThru)
             {
-                this.WriteObject(this.Folder);
+                this.WriteObject(folder);
             }
         }
     }


fix var codedColor = new UnmanagedArray<Pixel>(rect.Width * rect.Height)

--- CSharpGL/OpenGLObjects/ColorCodedPicking/ColorCodedPicking.cs
+++ CSharpGL/OpenGLObjects/ColorCodedPicking/ColorCodedPicking.cs
@@ -165,7 +165,7 @@
             if (rect.Width <= 0 || rect.Height <= 0) { return result; }

             // get coded color.
-            using (var codedColor = new UnmanagedArray<Pixel>(4 * rect.Width * rect.Height))
+            using (var codedColor = new UnmanagedArray<Pixel>(rect.Width * rect.Height))
             {
                 GL.ReadPixels(rect.X, canvasHeight - rect.Y - 1, rect.Width, rect.Height,
                     GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, codedColor.Header);


Updated Request.Form so it checks for content-type of application/x-www-form-urlencoded

--- src/Nancy/IRequest.cs
+++ src/Nancy/IRequest.cs
@@ -3,6 +3,7 @@
     using System;
     using System.Collections.Generic;
     using System.IO;
+    using System.Linq;
     using System.Web;

     using Nancy.Routing;
@@ -50,7 +51,7 @@
                 throw new ArgumentNullException("body", "The value of the body parameter cannot be null.");

             this.Body = body;
-            this.Headers = headers;
+            this.Headers = new Dictionary<string, IEnumerable<string>>(headers, StringComparer.OrdinalIgnoreCase);
             this.Method = method;
             this.Uri = uri;
         }
@@ -64,17 +65,25 @@

         private dynamic GetFormData()
         {
-            var position = this.Body.Position;
-            var reader = new StreamReader(this.Body);
-            var coll = HttpUtility.ParseQueryString(reader.ReadToEnd());
-            this.Body.Position = position;
+            var ret = new RouteParameters();

-            var ret = new RouteParameters();
-            foreach (var key in coll.AllKeys)
+            if (this.Headers.Keys.Any(x => x.Equals("content-type", StringComparison.OrdinalIgnoreCase)))
             {
-                ret[key] = coll[key];
+                var contentType = this.Headers["content-type"].First();
+                if (contentType.Equals("application/x-www-form-urlencoded", StringComparison.OrdinalIgnoreCase))
+                {
+                    var position = this.Body.Position;
+                    var reader = new StreamReader(this.Body);
+                    var coll = HttpUtility.ParseQueryString(reader.ReadToEnd());
+                    this.Body.Position = position;
+
+                    foreach (var key in coll.AllKeys)
+                    {
+                        ret[key] = coll[key];
+                    }
+                }
             }
-
+
             return ret;
         }


Use NodaTime to convert recurrence exception date to utc.

--- CalDavSynchronizer/Implementation/Events/EventEntityMapper.cs
+++ CalDavSynchronizer/Implementation/Events/EventEntityMapper.cs
@@ -29,7 +29,9 @@
 using GenSync.Logging;
 using log4net;
 using Microsoft.Office.Interop.Outlook;
+using NodaTime;
 using Exception = Microsoft.Office.Interop.Outlook.Exception;
+using Period = DDay.iCal.Period;
 using RecurrencePattern = DDay.iCal.RecurrencePattern;

 namespace CalDavSynchronizer.Implementation.Events
@@ -663,7 +665,10 @@
                   }
                   else
                   {
-                    var originalDateUtc = TimeZoneInfo.ConvertTimeToUtc (sourceException.OriginalDate, TimeZoneInfo.Local);
+                    DateTimeZone tz = DateTimeZoneProviders.Bcl.GetSystemDefault();
+                    LocalDateTime localExDateTime = LocalDateTime.FromDateTime (sourceException.OriginalDate);
+                    ZonedDateTime zonedExDateTime = tz.AtLeniently (localExDateTime);
+                    var originalDateUtc = zonedExDateTime.ToDateTimeUtc();
                     targetException.RecurrenceID = new iCalDateTime (originalDateUtc) { IsUniversalTime = true };
                   }
                 }


Updated Response so that it can be cast from Action<Stream>

--- src/Nancy/Response.cs
+++ src/Nancy/Response.cs
@@ -41,6 +41,10 @@
             return new Response { Contents = GetStringContents(contents) };
         }

+        public static implicit operator Response(Action<Stream> streamFactory) {
+            return new Response { Contents = streamFactory };
+        }
+
         protected static Action<Stream> GetStringContents(string contents)
         {
             return stream =>


Fix action method navigtion

Fix action method navigtion

--- ClubChallengeBeta/Views/SingleChallenges/_ClaimVictory.cshtml
+++ ClubChallengeBeta/Views/SingleChallenges/_ClaimVictory.cshtml
@@ -11,7 +11,7 @@
         <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Team Challenge

-    @using (Html.BeginForm("ClaimSinglesVictory", "UsersClub", FormMethod.Post, new { @id = "multi" }))
+    @using (Html.BeginForm("ClaimVictory", "SingleChallenges", FormMethod.Post, new { @id = "multi" }))
     {


Make 'providerkey' querystring parameter lowercase to fix #120.

--- Code/Nancy.SimpleAuthentication/SimpleAuthenticationModule.cs
+++ Code/Nancy.SimpleAuthentication/SimpleAuthenticationModule.cs
@@ -122,7 +122,7 @@

         private dynamic AuthenticateCallback()
         {
-            var providerKey = (string) Request.Query.providerKey;
+            var providerKey = (string) Request.Query.providerkey;
             if (string.IsNullOrEmpty(providerKey))
             {
                 throw new ArgumentException(


indentation management started

indentation management started

--- APproject/FSCodeGenerator/FSCodeGen.cs
+++ APproject/FSCodeGenerator/FSCodeGen.cs
@@ -16,9 +16,12 @@
     public class FSCodeGen
     {
         private StreamWriter fileWriter;
+        private int indentationLevel; //it stores the number of \t needed to get the perfect indentation ;)

         public FSCodeGen(string outputFileName)
         {
+            indentationLevel = 0;
+
             if (outputFileName == string.Empty)
             {
                 Console.WriteLine("Invalid File Name");


Refactor ModMaplist a bit

Refactor ModMaplist a bit


Added property Picture to Animal

Added property Picture to Animal

--- AnimalHope/AnimalHope.Models/Animal.cs
+++ AnimalHope/AnimalHope.Models/Animal.cs
@@ -29,5 +29,7 @@
         public virtual ApplicationUser User { get; set; }

         public virtual ICollection<Description> Descriptions { get; set; }
+
+        public string Picture { get; set; }
     }
 }


Update AssemblyInfo.cs

Update AssemblyInfo.cs

--- AppTracking/Properties/AssemblyInfo.cs
+++ AppTracking/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@
 [assembly: AssemblyTitle("AppTracking")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyCompany("StillDesign")]
 [assembly: AssemblyProduct("AppTracking")]
 [assembly: AssemblyCopyright("Copyright © StillDesign 2014")]
 [assembly: AssemblyTrademark("")]


new additions for 2.3

new additions for 2.3

--- Application/Properties/AssemblyInfo.cs
+++ Application/Properties/AssemblyInfo.cs
@@ -33,4 +33,4 @@
 //      Build Number
 //      Revision
 //
-[assembly: AssemblyVersion("2.2.*")]
+[assembly: AssemblyVersion("2.2.0.0")]


Changed visibility on one of Maybe<T>'s constructors...

--- Application/iSynaptic.Commons/Maybe.cs
+++ Application/iSynaptic.Commons/Maybe.cs
@@ -32,7 +32,7 @@
             _Computation = () => new MaybeResult { Exception = exception };
         }

-        internal Maybe(Func<MaybeResult> computation) : this()
+        private Maybe(Func<MaybeResult> computation) : this()
         {
             _Computation = computation;
         }


(WARC): another IDecryptExtra implementation.

--- ArcFormats/ShiinaRio/WarcEncryption.cs
+++ ArcFormats/ShiinaRio/WarcEncryption.cs
@@ -1181,4 +1181,41 @@
             data[index + 0x104] ^= count_FF;
         }
     }
+
+    [Serializable]
+    public class UshimitsuCrypt : IDecryptExtra
+    {
+        protected readonly uint m_key;
+
+        public UshimitsuCrypt (uint key)
+        {
+            m_key = key;
+        }
+
+        public void Decrypt (byte[] data, int index, uint length, uint flags)
+        {
+            if ((flags & 0x204) == 0x204)
+                DoCrypt (data, index, length);
+        }
+
+        public void Encrypt (byte[] data, int index, uint length, uint flags)
+        {
+            if ((flags & 0x104) == 0x104)
+                DoCrypt (data, index, length);
+        }
+
+        unsafe void DoCrypt (byte[] data, int index, uint length)
+        {
+            if (length < 0x100)
+                return;
+            fixed (byte* data8 = &data[index])
+            {
+                uint* data32 = (uint*)data8;
+                for (int i = 0; i < 0x40; ++i)
+                {
+                    data32[i] ^= m_key;
+                }
+            }
+        }
+    }
 }


ExampleGUI app update

ExampleGUI app update

--- Assets/Adjust/ExampleGUI/ExampleGUI.cs
+++ Assets/Adjust/ExampleGUI/ExampleGUI.cs
@@ -1,40 +1,45 @@
 using System;
+using System.Text;
 using System.Collections;
 using System.Runtime.InteropServices;

 using UnityEngine;
+using UnityEngine.UI;
+
 using com.adjust.sdk;

-public class ExampleGUI : MonoBehaviour
-{
+public class ExampleGUI : MonoBehaviour {
+
     private int nr_buttons = 8;

     private static bool isEnabled;
     private bool showPopUp = false;

-    private string txtSetEnabled = "Disable SDK";
     private string txtManualLaunch = "Manual Launch";
     private string txtSetOfflineMode = "Turn Offline Mode ON";
+    private string txtSetEnabled = "Disable SDK";

     void OnGUI ()
     {
-        if (showPopUp)
-        {
-            GUI.Window(0, new Rect ((Screen.width / 2) - 150, (Screen.height / 2) - 65, 300, 130), showGUI, "Is SDK enabled?");
-        }
-
-        if (GUI.Button (new Rect (0, Screen.height * 0 / nr_buttons, Screen.width, Screen.height / nr_buttons), txtManualLaunch))
-        {
-            if (!string.Equals (txtManualLaunch, "SDK Launched", StringComparison.OrdinalIgnoreCase))
-            {
+        if (showPopUp) {
+            GUI.Window(0, new Rect((Screen.width / 2) - 150, (Screen.height / 2) - 65, 300, 130), showGUI, "Is SDK enabled?");
+        }
+
+        if (GUI.Button (new Rect (0, Screen.height * 0 / nr_buttons, Screen.width, Screen.height / nr_buttons), txtManualLaunch)) {
+            if (!string.Equals(txtManualLaunch, "SDK Launched", StringComparison.OrdinalIgnoreCase)) {
                 AdjustConfig adjustConfig = new AdjustConfig ("{YourAppToken}", AdjustEnvironment.Sandbox);
                 adjustConfig.setLogLevel (AdjustLogLevel.Verbose);
+                adjustConfig.setLogDelegate (msg => Debug.Log (msg));
+                adjustConfig.setSendInBackground (true);
+                adjustConfig.setLaunchDeferredDeeplink (true);
+
                 adjustConfig.setEventSuccessDelegate (EventSuccessCallback);
-				adjustConfig.setEventFailureDelegate (EventFailureCallback);
-				adjustConfig.setSessionSuccessDelegate (SessionSuccessCallback);
-				adjustConfig.setSessionFailureDelegate (SessionFailureCallback);
-				adjustConfig.setAttributionChangedDelegate (AttributionChangedCallback);
-
+                adjustConfig.setEventFailureDelegate (EventFailureCallback);
+                adjustConfig.setSessionSuccessDelegate (SessionSuccessCallback);
+                adjustConfig.setSessionFailureDelegate (SessionFailureCallback);
+                adjustConfig.setDeferredDeeplinkDelegate (DeferredDeeplinkCallback);
+                adjustConfig.setAttributionChangedDelegate (AttributionChangedCallback);
+
                 Adjust.start (adjustConfig);
                 isEnabled = true;

@@ -42,90 +47,84 @@
             }
         }

-        if (GUI.Button (new Rect (0, Screen.height * 1 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Simple Event"))
-        {
-            AdjustEvent adjustEvent = new AdjustEvent ("{YourEventToken}");
-            Adjust.trackEvent (adjustEvent);
-        }
-
-        if (GUI.Button (new Rect (0, Screen.height * 2 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Revenue Event"))
-        {
+        if (GUI.Button (new Rect (0, Screen.height * 1 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Simple Event")) {
+            AdjustEvent adjustEvent = new AdjustEvent ("{YourEventToken}");
+            Adjust.trackEvent (adjustEvent);
+        }
+
+        if (GUI.Button (new Rect (0, Screen.height * 2 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Revenue Event")) {
             AdjustEvent adjustEvent = new AdjustEvent ("{YourEventToken}");
             adjustEvent.setRevenue (0.25, "EUR");
-
-            Adjust.trackEvent (adjustEvent);
-        }
-
-        if (GUI.Button (new Rect (0, Screen.height * 3 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Callback Event"))
-        {
-            AdjustEvent adjustEvent = new AdjustEvent ("{YourEventToken}");
-
+
+            Adjust.trackEvent (adjustEvent);
+        }
+
+        if (GUI.Button (new Rect (0, Screen.height * 3 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Callback Event")) {
+            AdjustEvent adjustEvent = new AdjustEvent ("{YourEventToken}");
+
             adjustEvent.addCallbackParameter ("key", "value");
             adjustEvent.addCallbackParameter ("foo", "bar");
-
-            Adjust.trackEvent (adjustEvent);
-        }
-
-        if (GUI.Button (new Rect (0, Screen.height * 4 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Partner Event"))
-        {
-            AdjustEvent adjustEvent = new AdjustEvent ("{YourEventToken}");
-
+
+            Adjust.trackEvent (adjustEvent);
+        }
+
+        if (GUI.Button (new Rect (0, Screen.height * 4 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Track Partner Event")) {
+            AdjustEvent adjustEvent = new AdjustEvent ("{YourEventToken}");
+
             adjustEvent.addPartnerParameter ("key", "value");
             adjustEvent.addPartnerParameter ("foo", "bar");
-
-            Adjust.trackEvent (adjustEvent);
-        }
-
-        if (GUI.Button (new Rect (0, Screen.height * 5 / nr_buttons, Screen.width, Screen.height / nr_buttons), txtSetOfflineMode))
-        {
-            if (string.Equals (txtSetOfflineMode, "Turn Offline Mode ON", StringComparison.OrdinalIgnoreCase))
-            {
-                Adjust.setOfflineMode (true);
+
+            Adjust.trackEvent (adjustEvent);
+        }
+
+        if (GUI.Button (new Rect (0, Screen.height * 5 / nr_buttons, Screen.width, Screen.height / nr_buttons), txtSetOfflineMode)) {
+            if (string.Equals(txtSetOfflineMode, "Turn Offline Mode ON", StringComparison.OrdinalIgnoreCase)) {
+                Adjust.setOfflineMode(true);
+
                 txtSetOfflineMode = "Turn Offline Mode OFF";
-            }
-            else
-            {
-                Adjust.setOfflineMode (false);
+            } else {
+                Adjust.setOfflineMode(false);
+
                 txtSetOfflineMode = "Turn Offline Mode ON";
             }
         }

-        if (GUI.Button (new Rect (0, Screen.height * 6 / nr_buttons, Screen.width, Screen.height / nr_buttons), txtSetEnabled))
-        {
-            if (string.Equals (txtSetEnabled, "Disable SDK", StringComparison.OrdinalIgnoreCase))
-            {
-                Adjust.setEnabled (false);
+        if (GUI.Button (new Rect (0, Screen.height * 6 / nr_buttons, Screen.width, Screen.height / nr_buttons), txtSetEnabled)) {
+            if (string.Equals(txtSetEnabled, "Disable SDK", StringComparison.OrdinalIgnoreCase)) {
+                Adjust.setEnabled(false);
+
                 txtSetEnabled = "Enable SDK";
-            }
-            else
-            {
-                Adjust.setEnabled (true);
+            } else {
+                Adjust.setEnabled(true);
+
                 txtSetEnabled = "Disable SDK";
             }
         }

-        if (GUI.Button (new Rect (0, Screen.height * 7 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Is SDK Enabled?"))
-        {
-            isEnabled = Adjust.isEnabled ();
+        if (GUI.Button (new Rect (0, Screen.height * 7 / nr_buttons, Screen.width, Screen.height / nr_buttons), "Is SDK Enabled?")) {
+            isEnabled = Adjust.isEnabled();
+
             showPopUp = true;
         }
     }

-    void showGUI (int windowID)
-    {
-        if (isEnabled)
-        {
-            GUI.Label (new Rect (65, 40, 200, 30), "Adjust SDK is ENABLED!");
-        }
-        else
-        {
-            GUI.Label (new Rect (65, 40, 200, 30), "Adjust SDK is DISABLED!");
+    void showGUI(int windowID)
+    {
+
+        if (isEnabled) {
+            GUI.Label(new Rect(65, 40, 200, 30), "Adjust SDK is ENABLED!");
+        } else {
+            GUI.Label(new Rect(65, 40, 200, 30), "Adjust SDK is DISABLED!");
         }

-        if (GUI.Button (new Rect (90, 75, 120, 40), "OK"))
-        {
+        if (GUI.Button(new Rect(90, 75, 120, 40), "OK")) {
             showPopUp = false;
         }
+    }
+
+    public void handleGooglePlayId (String adId)
+    {
+        Debug.Log ("Google Play Ad ID = " + adId);
     }

     public void AttributionChangedCallback (AdjustAttribution attributionData)
@@ -281,4 +280,18 @@
             Debug.Log ("JsonResponse: " + sessionFailureData.GetJsonResponse ());
         }
     }
+
+    private void DeferredDeeplinkCallback (string deeplinkURL)
+    {
+        Debug.Log ("Deferred deeplink reported!");
+
+        if (deeplinkURL != null)
+        {
+            Debug.Log ("Deeplink URL: " + deeplinkURL);
+        }
+        else
+        {
+            Debug.Log ("Deeplink URL is null!");
+        }
+    }
 }


fix(Caching): get specific ControllerManager for left/right controller

--- Assets/VRTK/SDK/SteamVR/SDK_SteamVR.cs
+++ Assets/VRTK/SDK/SteamVR/SDK_SteamVR.cs
@@ -470,7 +470,14 @@
         {
             if (cachedControllerManager == null)
             {
-                cachedControllerManager = FindObjectOfType<SteamVR_ControllerManager>();
+                SteamVR_ControllerManager[] controllerManagers = FindObjectsOfType<SteamVR_ControllerManager>();
+                foreach (SteamVR_ControllerManager cm in controllerManagers)
+                {
+                    if (cm.left && cm.right)
+                    {
+                        cachedControllerManager = cm;
+                    }
+                }
             }
             return cachedControllerManager;
         }


Made Platformer.mValuesJumpedWith public, renamed as ValuesJumpedWith.

--- FRBDK/Glue/PlatformerPlugin/Generators/EntityCodeGenerator.cs
+++ FRBDK/Glue/PlatformerPlugin/Generators/EntityCodeGenerator.cs
@@ -78,12 +78,6 @@
             codeBlock.Line("/// </summary>");
             codeBlock.Line("double mTimeJumpPushed = double.NegativeInfinity;");

-            codeBlock.Line("/// <summary>");
-            codeBlock.Line("/// The MovementValues which were active when the user last jumped.");
-            codeBlock.Line("/// These are used to determine the upward velocity to apply while");
-            codeBlock.Line("/// the user holds the jump button.");
-            codeBlock.Line("/// </summary>");
-            codeBlock.Line("DataTypes.PlatformerValues mValuesJumpedWith;");

             codeBlock.Line("/// <summary>");
             codeBlock.Line("/// See property for information.");
@@ -114,6 +108,14 @@

             codeBlock.Line("#region Platformer Properties");
+
+
+            codeBlock.Line("/// <summary>");
+            codeBlock.Line("/// The MovementValues which were active when the user last jumped.");
+            codeBlock.Line("/// These are used to determine the upward velocity to apply while");
+            codeBlock.Line("/// the user holds the jump button.");
+            codeBlock.Line("/// </summary>");
+            codeBlock.Line("public DataTypes.PlatformerValues ValuesJumpedWith { get; set; }");

             codeBlock.Line("public bool WasOnGroundLastFrame{ get; private set; }");

@@ -270,25 +272,25 @@

             BeforeGroundMovementSet += (newValue) =>
             {
-                if(mGroundMovement != null && mGroundMovement == mValuesJumpedWith)
-                {
-                    mValuesJumpedWith = newValue;
+                if(mGroundMovement != null && mGroundMovement == ValuesJumpedWith)
+                {
+                    ValuesJumpedWith = newValue;
                 }
             };

             BeforeAirMovementSet += (newValue) =>
             {
-                if(mAirMovement != null && mAirMovement == mValuesJumpedWith)
-                {
-                    mValuesJumpedWith = newValue;
+                if(mAirMovement != null && mAirMovement == ValuesJumpedWith)
+                {
+                    ValuesJumpedWith = newValue;
                 }
             };

             BeforeAfterDoubleJumpSet += (newValue) =>
             {
-                if(mAfterDoubleJump != null && mAfterDoubleJump == mValuesJumpedWith)
-                {
-                    mValuesJumpedWith = newValue;
+                if(mAfterDoubleJump != null && mAfterDoubleJump == ValuesJumpedWith)
+                {
+                    ValuesJumpedWith = newValue;
                 }
             };

@@ -569,7 +571,7 @@

                 mTimeJumpPushed = CurrentTime;
                 this.YVelocity = CurrentMovement.JumpVelocity;
-                mValuesJumpedWith = CurrentMovement;
+                ValuesJumpedWith = CurrentMovement;

                 mCanContinueToApplyJumpToHold = true;

@@ -606,20 +608,20 @@
             double secondsSincePush = CurrentTime - mTimeJumpPushed;

             // This needs to be done before checking if the user can continue to apply jump to hold
-            if (mValuesJumpedWith != null && mValuesJumpedWith.JumpApplyByButtonHold &&
+            if (ValuesJumpedWith != null && ValuesJumpedWith.JumpApplyByButtonHold &&
 				(!JumpInput.IsDown || mHitHead)
                 )
             {
                 mCanContinueToApplyJumpToHold = false;
             }

-            if (mValuesJumpedWith != null &&
+            if (ValuesJumpedWith != null &&
                 mCanContinueToApplyJumpToHold &&
-                secondsSincePush < mValuesJumpedWith.JumpApplyLength &&
-				(mValuesJumpedWith.JumpApplyByButtonHold == true && JumpInput.IsDown)
+                secondsSincePush < ValuesJumpedWith.JumpApplyLength &&
+				(ValuesJumpedWith.JumpApplyByButtonHold == true && JumpInput.IsDown)
                 )
             {
-                this.YVelocity = mValuesJumpedWith.JumpVelocity;
+                this.YVelocity = ValuesJumpedWith.JumpVelocity;
             }
             else
             {


Fix the algorithm for decoding the remaining length to allow a length greater than 2,097,151 bytes. See: https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/errata01/os/mqtt-v3.1.1-errata01-os.html#_Toc442180732

--- Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketReader.cs
+++ Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketReader.cs
@@ -86,7 +86,7 @@

         private static async Task<int> ReadBodyLengthFromSourceAsync(Stream stream, CancellationToken cancellationToken)
         {
-            // Alorithm taken from http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html.
+            // Alorithm taken from https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/errata01/os/mqtt-v3.1.1-errata01-os-complete.html.
             var multiplier = 1;
             var value = 0;
             byte encodedByte;
@@ -110,11 +110,11 @@
                 readBytes.Add(encodedByte);

                 value += (byte)(encodedByte & 127) * multiplier;
-                multiplier *= 128;
                 if (multiplier > 128 * 128 * 128)
                 {
                     throw new MqttProtocolViolationException($"Remaining length is invalid (Data={string.Join(",", readBytes)}).");
                 }
+                multiplier *= 128;
             } while ((encodedByte & 128) != 0);

             return value;


Refactoring in eine zweite Methode

Refactoring in eine zweite Methode

--- ILK-Protokoll/Areas/Session/Controllers/FinalizeController.cs
+++ ILK-Protokoll/Areas/Session/Controllers/FinalizeController.cs
@@ -84,6 +84,32 @@
 				return HTTPStatus(HttpStatusCode.InternalServerError, e.Message);
 			}

+			var result = ProcessTopics(session, report);
+			if (result != null)
+				return result;
+
+			db.ActiveSessions.Remove(session);
+			Session.Remove("SessionID");
+
+			try
+			{
+				db.SaveChanges();
+			}
+			catch (DbEntityValidationException e)
+			{
+				var message = "Fehler beim Schreiben der Topics
" + ErrorMessageFromException(e);
+				return HTTPStatus(HttpStatusCode.InternalServerError, message);
+			}
+			catch (DataException ex)
+			{
+				return HTTPStatus(HttpStatusCode.InternalServerError, ex.Message);
+			}
+
+			return PartialView("_ReportSuccess", report.ID);
+		}
+
+		protected ActionResult ProcessTopics(ActiveSession session, SessionReport report)
+		{
 			List<Topic> topics = db.Topics
 				.Include(t => t.SessionType)
 				.Include(t => t.Lock)
@@ -99,10 +125,10 @@
 			}
 			catch (Exception ex)
 			{
-				return HTTPStatus(HttpStatusCode.InternalServerError, "Fehler beim mailen: " + ex.Message);
+				return HTTPStatus(HttpStatusCode.InternalServerError, "Fehler beim Versenden der E-Mails: " + ex.Message);
 			}

-			foreach (Topic t in topics)
+			foreach (var t in topics)
 			{
 				switch (t.Lock.Action)
 				{
@@ -118,7 +144,7 @@
 							Type = DecisionType.Resolution
 						};
 						db.Assignments.RemoveRange(db.Assignments.Where(a => a.TopicID == t.ID && !a.IsActive));
-							// Inaktive Aufgaben löschen
+						// Inaktive Aufgaben löschen
 						foreach (var duty in t.Assignments.Where(a => a.Type == AssignmentType.Duty && a.IsActive))
 							mailer.SendNewAssignment(duty);
 						break;
@@ -141,24 +167,8 @@
 				if (t.Lock != null) // Wenn gelöscht wird, ist t.Lock hier bereits null
 					db.TopicLocks.Remove(t.Lock);
 			}
-			db.ActiveSessions.Remove(session);
-			Session.Remove("SessionID");

-			try
-			{
-				db.SaveChanges();
-			}
-			catch (DbEntityValidationException e)
-			{
-				var message = "Fehler beim Schreiben der Topics
" + ErrorMessageFromException(e);
-				return HTTPStatus(HttpStatusCode.InternalServerError, message);
-			}
-			catch (DataException ex)
-			{
-				return HTTPStatus(HttpStatusCode.InternalServerError, ex.Message);
-			}
-
-			return PartialView("_ReportSuccess", report.ID);
+			return null;
 		}

 		public ActionResult ShowReport()


Changed CopyAttributes default value to true.

--- ILMerge.MSBuild.Task/ILMerge.MSBuild.Task/AdvancedSettings.cs
+++ ILMerge.MSBuild.Task/ILMerge.MSBuild.Task/AdvancedSettings.cs
@@ -56,7 +56,7 @@
         public bool Closed { get; set; } = false;

         [DataMember]
-        public bool CopyAttributes { get; set; } = false;
+        public bool CopyAttributes { get; set; } = true;

         [DataMember]
         public bool DebugInfo { get; set; } = true;


Cache the token

Cache the token

--- Instaflight/Instaflight.Service/OAuthAuthenticationHandler.cs
+++ Instaflight/Instaflight.Service/OAuthAuthenticationHandler.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Net.Http;
 using System.Net.Http.Headers;
@@ -15,7 +16,8 @@
         private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
         private readonly IInstaflightAuthApi _client;
         private DateTime _expiresAt;
-        private string _token;
+        private static volatile string _token;
+        private static object _syncRoot = new Object();

         public OauthAuthenticationHandler(IInstaflightAuthApi client)
         {
@@ -27,7 +29,7 @@
             var auth = request.Headers.Authorization;
             if (auth.Scheme == "Bearer")
             {
-                _token = await GetToken(cancellationToken);
+                await GetToken(cancellationToken);
                 request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _token);
                 Logger.Debug($"Injecting oauth token ({_token}, expire: {_expiresAt}) into request {request.RequestUri}");

@@ -35,22 +37,28 @@
             return await base.SendAsync(request, cancellationToken);
         }

-        private async Task<string> GetToken(CancellationToken cancellationToken)
+        private async Task GetToken(CancellationToken cancellationToken)
         {
-            if (!string.IsNullOrEmpty(_token) && _expiresAt <= DateTime.UtcNow) return _token;
+            if (string.IsNullOrEmpty(_token) || _expiresAt <= DateTime.UtcNow)
+            {
+                var sw = new Stopwatch();
+                sw.Start();
+                var token = await _client.GetTokenAsync(new Dictionary<string, object>()
+                {
+                    { "grant_type", "client_credentials"}
+                });
+                sw.Stop();
+                Logger.Debug($"Got Bearer Token in {sw.ElapsedMilliseconds} ms: {token.AccessToken}, expires in {token.ExpiresIn}");

-            //"grant_type=client_credentials"
-            var token = await _client.GetTokenAsync(new Dictionary<string, object>()
-            {
-                { "grant_type", "client_credentials"}
-            });
-            Logger.Debug($"Got Bearer Token: {token.AccessToken}, expires in {token.ExpiresIn}");
-            //if (token.IsError)
-            //    throw new HttpRequestException($"Cannot get token: {token.Error}");
-            _token = token.AccessToken;
-            _expiresAt = DateTime.UtcNow.AddSeconds(token.ExpiresIn);
-
-            return _token;
+                lock (_syncRoot)
+                {
+                    if (string.IsNullOrEmpty(_token) || _expiresAt <= DateTime.UtcNow)
+                    {
+                        _token = token.AccessToken;
+                        _expiresAt = DateTime.UtcNow.AddSeconds(token.ExpiresIn);
+                    }
+                }
+            }
         }
     }
 }


Fix typos in comment

Fix typos in comment

--- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs
+++ osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs
@@ -150,8 +150,8 @@
             rightArea.Padding = new MarginPadding { Left = leftArea.DrawWidth };
             hitTargetOffsetContent.Padding = new MarginPadding { Left = HitTarget.DrawWidth / 2 };

-            // When rewinding, make sure to remove any auxilliary hit notes that were
-            // spawned and played during a drumroll.
+            // When rewinding, make sure to remove any auxiliary hit notes that were
+            // spawned and played during a drum roll.
             if (Time.Elapsed < 0)
             {
                 foreach (var o in drumRollHitContainer.Objects)


Cleanup TaikoPlayfield a bit

Cleanup TaikoPlayfield a bit

--- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs
+++ osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs
@@ -219,27 +219,25 @@

         public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement)
         {
-            bool wasHit = judgement.Result > HitResult.Miss;
-            bool secondHit = judgement is TaikoStrongHitJudgement;
-            var taikoObject = (TaikoHitObject)judgedObject.HitObject;
-
             if (judgementContainer.FirstOrDefault(j => j.JudgedObject == judgedObject) == null)
             {
                 judgementContainer.Add(new DrawableTaikoJudgement(judgedObject, judgement)
                 {
-                    Anchor = wasHit ? Anchor.TopLeft : Anchor.CentreLeft,
-                    Origin = wasHit ? Anchor.BottomCentre : Anchor.Centre,
+                    Anchor = judgement.IsHit ? Anchor.TopLeft : Anchor.CentreLeft,
+                    Origin = judgement.IsHit ? Anchor.BottomCentre : Anchor.Centre,
                     RelativePositionAxes = Axes.X,
-                    X = wasHit ? judgedObject.Position.X : 0,
+                    X = judgement.IsHit ? judgedObject.Position.X : 0,
                 });
             }

-            if (!wasHit)
+            if (!judgement.IsHit)
                 return;

             bool isRim = judgedObject.HitObject is RimHit;

-            if (!secondHit)
+            if (judgement is TaikoStrongHitJudgement)
+                hitExplosionContainer.Children.FirstOrDefault(e => e.JudgedObject == judgedObject)?.VisualiseSecondHit();
+            else
             {
                 if (judgedObject.X >= -0.05f && judgedObject is DrawableHit)
                 {
@@ -249,11 +247,9 @@

                 hitExplosionContainer.Add(new HitExplosion(judgedObject, isRim));

-                if (taikoObject.Kiai)
+                if (judgedObject.HitObject.Kiai)
                     kiaiExplosionContainer.Add(new KiaiHitExplosion(judgedObject, isRim));
             }
-            else
-                hitExplosionContainer.Children.FirstOrDefault(e => e.JudgedObject == judgedObject)?.VisualiseSecondHit();
         }
     }
 }


Use foreach

Use foreach

--- osu.Game/Screens/Edit/BindableBeatDivisor.cs
+++ osu.Game/Screens/Edit/BindableBeatDivisor.cs
@@ -91,10 +91,8 @@
         {
             int beat = index % beatDivisor;

-            for (int i = 0; i < BindableBeatDivisor.VALID_DIVISORS.Length; i++)
+            foreach (var divisor in BindableBeatDivisor.VALID_DIVISORS)
             {
-                int divisor = BindableBeatDivisor.VALID_DIVISORS[i];
-
                 if ((beat * divisor) % beatDivisor == 0)
                     return divisor;
             }


General improvements.

General improvements.

--- Eutherion/Tests/JsonTokenizerTests.cs
+++ Eutherion/Tests/JsonTokenizerTests.cs
@@ -121,7 +121,7 @@
         public void WhiteSpace(string ws)
         {
             // Exactly one whitespace token.
-            AssertTokens(ws, x => Assert.IsType<JsonWhitespace>(x));
+            AssertTokens(ws, ExpectToken<JsonWhitespace>(ws.Length));
         }

         [Theory]
@@ -187,7 +187,6 @@
                 Assert.NotNull(symbol);
                 var valueSymbol = Assert.IsType<JsonValue>(symbol);
                 Assert.Equal(json.Length, symbol.Length);
-                Assert.Equal(json, json.Substring(0, symbol.Length));
                 Assert.Equal(json, valueSymbol.Value);
             });
         }
@@ -295,7 +294,7 @@

             // Here Assert.Collection is used so if such a test fails,
             // it gives the index of the third token that was tested.
-            Assert.Collection<(string, Type)>(
+            Assert.Collection(
                 JsonTestSymbols(),
                 Enumerable.Repeat<Action<(string, Type)>>(x0 =>
                 {


changed to memory pooling when allocating temporary buffers for calculating distances

--- BrightWire.CUDA.Source/CudaProvider.cs
+++ BrightWire.CUDA.Source/CudaProvider.cs
@@ -19,6 +19,7 @@
     {
         const int BLOCK_DIM = 16;
         const int BLOCK_DIM2 = BLOCK_DIM * BLOCK_DIM;
+	    const int PTR_SIZE = 8;

         class KernelExecution
         {
@@ -425,10 +426,10 @@
                         _Use(_findMinAndMax, size, k => k.Run(BLOCK_DIM2, ptr.DevicePointer, size, minBlock.DevicePointer, maxBlock.DevicePointer));
                         if (ptr != a)
                             ptr.Free();
-                        var minTest = new float[bufferSize];
-                        var maxText = new float[bufferSize];
-                        minBlock.CopyToHost(minTest);
-                        maxBlock.CopyToHost(maxText);
+                        //var minTest = new float[bufferSize];
+                        //var maxText = new float[bufferSize];
+                        //minBlock.CopyToHost(minTest);
+                        //maxBlock.CopyToHost(maxText);
                         size = bufferSize * 2;
                         ptr = Allocate(size);
                         ptr.DeviceVariable.CopyToDevice(minBlock.DeviceVariable, 0, 0, bufferSize * sizeof(float));
@@ -586,14 +587,14 @@
         internal IDeviceMemoryPtr MultiEuclideanDistance(IDeviceMemoryPtr vector, CUdeviceptr[] compareTo, int size)
         {
             IDeviceMemoryPtr ret = null;
-            var buffer = _cuda.AllocateMemory(8 * compareTo.Length);
+            var buffer = Allocate(PTR_SIZE * compareTo.Length);
             try {
-                _cuda.CopyToDevice(buffer, compareTo);
+                _cuda.CopyToDevice(buffer.DevicePointer, compareTo);
                 ret = Allocate(size * compareTo.Length);
-                _Use(_multiEuclidean, size, compareTo.Length, k => k.Run(0, vector.DevicePointer, buffer, ret.DevicePointer, size, compareTo.Length));
+                _Use(_multiEuclidean, size, compareTo.Length, k => k.Run(0, vector.DevicePointer, buffer.DevicePointer, ret.DevicePointer, size, compareTo.Length));
             }
             finally {
-                _cuda.FreeMemory(buffer);
+	            buffer.Free();
             }
             return ret;
         }
@@ -601,14 +602,14 @@
         internal IDeviceMemoryPtr MultiManhattanDistance(IDeviceMemoryPtr vector, CUdeviceptr[] compareTo, int size)
         {
             IDeviceMemoryPtr ret = null;
-            var buffer = _cuda.AllocateMemory(8 * compareTo.Length);
+            var buffer = Allocate(PTR_SIZE * compareTo.Length);
             try {
-                _cuda.CopyToDevice(buffer, compareTo);
+                _cuda.CopyToDevice(buffer.DevicePointer, compareTo);
                 ret = Allocate(size * compareTo.Length);
-                _Use(_multiManhattan, size, compareTo.Length, k => k.Run(0, vector.DevicePointer, buffer, ret.DevicePointer, size, compareTo.Length));
+                _Use(_multiManhattan, size, compareTo.Length, k => k.Run(0, vector.DevicePointer, buffer.DevicePointer, ret.DevicePointer, size, compareTo.Length));
             }
             finally {
-                _cuda.FreeMemory(buffer);
+	            buffer.Free();
             }
             return ret;
         }


Replace creation of multiple HttpClient instances by static one

--- src/IronSharp.Core/RestClient.cs
+++ src/IronSharp.Core/RestClient.cs
@@ -12,6 +12,8 @@
 {
     public class RestClient
     {
+        private static HttpClient client=new HttpClient();
+
         /// <summary>
         /// Generates the Uri for the specified request.
         /// </summary>
@@ -57,10 +59,7 @@
                 Content = request.Content
             });

-            using (var client = new HttpClient())
-            {
-                return client.SendAsync(httpRequest);
-            }
+            return client.SendAsync(httpRequest);
         }

         public static RestResponse<T> Get<T>(IronClientConfig config, string endPoint, NameValueCollection query = null) where T : class
@@ -122,47 +121,44 @@

             ILog logger = LogManager.GetLogger<RestClient>();

-            using (var client = new HttpClient())
-            {
-                if (logger.IsDebugEnabled)
+            if (logger.IsDebugEnabled)
+            {
+                using (var sw = new StringWriter())
                 {
-                    using (var sw = new StringWriter())
+                    sw.WriteLine("{0} {1}", request.Method, request.RequestUri);
+                    if (request.Content != null)
                     {
-                        sw.WriteLine("{0} {1}", request.Method, request.RequestUri);
-                        if (request.Content != null)
-                        {
-                            sw.WriteLine(request.Content.ReadAsStringAsync().Result);
-                        }
-                        logger.Debug(sw.ToString());
+                        sw.WriteLine(request.Content.ReadAsStringAsync().Result);
                     }
+                    logger.Debug(sw.ToString());
                 }
-
-                HttpResponseMessage response = client.SendAsync(request).Result;
-
-                if (logger.IsDebugEnabled)
+            }
+
+            HttpResponseMessage response = client.SendAsync(request).Result;
+
+            if (logger.IsDebugEnabled)
+            {
+                if (response.Content != null)
                 {
-                    if (response.Content != null)
-                    {
-                        logger.Debug(response.Content.ReadAsStringAsync().Result);
-                    }
+                    logger.Debug(response.Content.ReadAsStringAsync().Result);
                 }
-
-                if (response.IsSuccessStatusCode)
-                {
-                    return response;
-                }
-
-                if (HttpClientOptions.EnableRetry && IsRetriableStatusCode(response))
-                {
-                    attempt++;
-
-                    ExponentialBackoff.Sleep(sharpConfig.BackoffFactor, attempt);
-
-                    return AttemptRequest(sharpConfig, request, attempt);
-                }
-
+            }
+
+            if (response.IsSuccessStatusCode)
+            {
                 return response;
             }
+
+            if (HttpClientOptions.EnableRetry && IsRetriableStatusCode(response))
+            {
+                attempt++;
+
+                ExponentialBackoff.Sleep(sharpConfig.BackoffFactor, attempt);
+
+                return AttemptRequest(sharpConfig, request, attempt);
+            }
+
+            return response;
         }

         private static HttpRequestMessage BuildRequest(IronClientConfig config, IRestClientRequest request)


the message popup when experiment is finished will now display the total value of the data

--- src/Kerbalism/Science/Science.cs
+++ src/Kerbalism/Science/Science.cs
@@ -83,7 +83,7 @@
 				file.buff += transmitted;

 				bool credit = file.size <= double.Epsilon;
-				var totalValue = Value(exp_filename) * file.science_cap;
+				var currentValue = Value(exp_filename) * file.science_cap;
 				var value = Value(exp_filename, file.buff) * file.science_cap;
 				if (!credit && file.buff > min_buffer_size) credit = value > buffer_science_value;

@@ -97,8 +97,9 @@
 					file.buff = 0.0;

 					// this was the last useful bit, there is no more value in the experiment
-					if (totalValue >= 0.1 && totalValue - value < 0.1)
+					if (currentValue >= 0.1 && currentValue - value < 0.1)
 					{
+						var totalValue = TotalValue(exp_filename);
 						Message.Post(
 							Lib.BuildString(Lib.HumanReadableScience(totalValue), " ", Experiment(exp_filename).FullName(exp_filename), " completed"),
 						  Lib.TextVariant(
@@ -202,6 +203,22 @@
 			return credits;
 		}

+		// return total value of some data about a subject, in science credits
+		public static float TotalValue(string subject_id)
+		{
+			var exp = Science.Experiment(subject_id);
+			var size = exp.max_amount;
+
+			// get science subject
+			// - if null, we are in sandbox mode
+			var subject = ResearchAndDevelopment.GetSubjectByID(subject_id);
+			if (subject == null) return 0.0f;
+
+			var credits = ResearchAndDevelopment.GetReferenceDataValue((float)size, subject);
+			credits *= HighLogic.CurrentGame.Parameters.Career.ScienceGainMultiplier;
+
+			return credits;
+		}

 		// return module acting as container of an experiment
 		public static IScienceDataContainer Container(Part p, string experiment_id)


Fixes: 27008 - Removes cmsDataType record when a data type is deleted

[TFS Changeset #66066]

--- umbraco/cms/businesslogic/datatype/DataType.cs
+++ umbraco/cms/businesslogic/datatype/DataType.cs
@@ -31,10 +31,19 @@
 			setupDataTypeDefinition();
 		}

+        public override void delete()
+        {
+            //delete the cmsDataType role, then the umbracoNode
+            SqlHelper.ExecuteNonQuery("delete from cmsDataType where nodeId=@nodeId", SqlHelper.CreateParameter("@nodeId", this.Id));
+            base.delete();
+
+            cache.Cache.ClearCacheItem(string.Format("UmbracoDataTypeDefinition{0}", Id));
+        }
+
+        [Obsolete("Use the standard delete() method instead")]
         public void Delete()
         {
             delete();
-            cache.Cache.ClearCacheItem(string.Format("UmbracoDataTypeDefinition{0}", Id));
         }

 	    /// <summary>


Fix build for "Simplify MongoConnectionDouble functions" commit

--- src/LfMerge.Tests/TestDoubles.cs
+++ src/LfMerge.Tests/TestDoubles.cs
@@ -157,12 +157,12 @@
 			_storedLfOptionLists[id] = mockData;
 		}

-		public IEnumerable<LfLexEntry> GetLfLexEntries(ILfProject project)
+		public IEnumerable<LfLexEntry> GetLfLexEntries()
 		{
 			return _storedLfLexEntries.Values;
 		}

-		public IEnumerable<LfOptionList> GetLfOptionLists(ILfProject project)
+		public IEnumerable<LfOptionList> GetLfOptionLists()
 		{
 			return _storedLfOptionLists.Values;
 		}


Removed GC calls for Travis CI

Removed GC calls for Travis CI

--- src/MeasureMap/ProfileSession.cs
+++ src/MeasureMap/ProfileSession.cs
@@ -87,15 +87,15 @@
             var profile = new ProfileResult();
             var stopwatch = new Stopwatch();

-            var process = Process.GetCurrentProcess();
+            //var process = Process.GetCurrentProcess();
             //process.ProcessorAffinity = new IntPtr(2); // Uses the second Core or Processor for the Test
-            process.PriorityClass = ProcessPriorityClass.High; // Prevents "Normal" processes from interrupting Threads
+            //process.PriorityClass = ProcessPriorityClass.High; // Prevents "Normal" processes from interrupting Threads
             Thread.CurrentThread.Priority = ThreadPriority.Highest; // Prevents "Normal" Threads from interrupting this thread

             // clean up
-            GC.Collect();
-            GC.WaitForPendingFinalizers();
-            GC.Collect();
+            //GC.Collect();
+            //GC.WaitForPendingFinalizers();
+            //GC.Collect();

             Trace.WriteLine(string.Format("Running Task for {0} iterations for Perfomance Analysis Benchmark", _iterations));
             for (int i = 0; i < _iterations; i++)


Add Coarse Dirt Handling (#352)

Add Coarse Dirt Handling (#352)

Includes handling for tiling coarse dirt to regular dirt using a hoe
No handling for avoiding grass spread, since grass spread is not written.

--- src/MiNET/MiNET/Items/ItemHoe.cs
+++ src/MiNET/MiNET/Items/ItemHoe.cs
@@ -19,7 +19,7 @@
 		public override void PlaceBlock(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoords)
 		{
 			Block block = world.GetBlock(blockCoordinates);
-			if (block is Grass || block is Dirt || block is GrassPath)
+			if (block is Grass || (block is Dirt && block.Metadata != 1) || block is GrassPath)
 			{
 				Farmland farmland = new Farmland
 				{
@@ -35,6 +35,15 @@

 				world.SetBlock(farmland);
 			}
+			else if (block is Dirt && block.Metadata == 1)
+			{
+				Dirt dirt = new Dirt
+				{
+					Coordinates = blockCoordinates
+				};
+
+				world.SetBlock(dirt);
+			}
 		}
 	}
 }


fixed broken unit test related to Fillup Add

--- MileageStats.Web.Tests/Controllers/FillupControllerFixture.cs
+++ MileageStats.Web.Tests/Controllers/FillupControllerFixture.cs
@@ -170,7 +170,7 @@

             var result = controller.Add(defaultVehicleId);

-            Assert.IsType(typeof(ViewResult), result);
+            Assert.IsType(typeof(ContentTypeAwareResult), result);
         }

         [Fact]


Update FibonacciNumbers.cs

Update FibonacciNumbers.cs

--- Fibonacci_Numbers/FibonacciNumbers.cs
+++ Fibonacci_Numbers/FibonacciNumbers.cs
@@ -30,7 +30,7 @@
 			{
 				Console.Write($" {fib}");
 			}
-			Console.Write(" }");
+			Console.Write(" }\n");


Update FibonacciNumbers.cs

Update FibonacciNumbers.cs

--- Fibonacci_Numbers/FibonacciNumbers.cs
+++ Fibonacci_Numbers/FibonacciNumbers.cs
@@ -27,9 +27,7 @@

 			Console.Write("Result - {");
 			foreach (int fib in fullList)
-			{
 				Console.Write($" {fib}");
-			}
 			Console.Write(" }\n");


Added Load() overload with Exception out parameter.

--- FileTypes/TabsterDocumentProcessor.cs
+++ FileTypes/TabsterDocumentProcessor.cs
@@ -21,6 +21,12 @@

         public T Load(string fileName)
         {
+            Exception error;
+            return Load(fileName, out error);
+        }
+
+        public T Load(string fileName, out Exception error)
+        {
             Error = null;

             var doc = new T();
@@ -34,11 +40,13 @@
                     doc.Update();
                 }

+                error = null;
                 return doc;
             }

             catch (Exception ex)
             {
+                error = ex;
                 Error = ex;
                 return null;
             }


Improve text placement.

Improve text placement.

--- common/Subtitles/FontGenerator.cs
+++ common/Subtitles/FontGenerator.cs
@@ -15,15 +15,23 @@
         public string Path => path;
         public bool IsEmpty => path == null;

+        private int baseWidth;
+        public int BaseWidth => baseWidth;
+
+        private int baseHeight;
+        public int BaseHeight => baseHeight;
+
         private int width;
         public int Width => width;

         private int height;
         public int Height => height;

-        public FontText(string path, int width, int height)
+        public FontText(string path, int baseWidth, int baseHeight, int width, int height)
         {
             this.path = path;
+            this.baseWidth = baseWidth;
+            this.baseHeight = baseHeight;
             this.width = width;
             this.height = height;
         }
@@ -33,12 +41,13 @@
     {
         public string FontPath;
         public int FontSize = 76;
-        public bool Outlined = false;
+        public bool Outlined;
         public int ShadowThickness = 8;
         public int HorizontalPadding = 0;
         public int VerticalPadding = 0;
         public Color TextColor = Color.FromArgb(255, 255, 255, 255);
         public Color ShadowColor = Color.FromArgb(100, 0, 0, 0);
+        public bool Debug;
     }

     public class FontGenerator
@@ -76,7 +85,7 @@
             var fontPath = Path.Combine(projectDirectory, description.FontPath);
             if (!File.Exists(fontPath)) fontPath = description.FontPath;

-            int width, height;
+            int baseWidth, baseHeight, width, height;
             using (Graphics graphics = Graphics.FromHwnd(IntPtr.Zero))
             using (StringFormat stringFormat = new StringFormat(StringFormat.GenericTypographic))
             using (var textBrush = new SolidBrush(description.TextColor))
@@ -96,14 +105,16 @@
                     var shadowExpandFactor = 1.4f;

                     var measuredSize = graphics.MeasureString(text, font, 0, stringFormat);
-                    width = (int)(measuredSize.Width + 1 + description.HorizontalPadding * 2 + description.ShadowThickness * shadowExpandFactor * 2);
-                    height = (int)(measuredSize.Height + 1 + description.VerticalPadding * 2 + description.ShadowThickness * shadowExpandFactor * 2);
+                    baseWidth = (int)measuredSize.Width + 1 + description.HorizontalPadding * 2;
+                    baseHeight = (int)measuredSize.Height + 1 + description.VerticalPadding * 2;
+                    width = (int)(baseWidth + description.ShadowThickness * shadowExpandFactor * 2);
+                    height = (int)(baseHeight + description.ShadowThickness * shadowExpandFactor * 2);

                     if (text.Length == 1 && char.IsWhiteSpace(text[0]))
-                        return new FontText(null, width, height);
+                        return new FontText(null, baseWidth, baseHeight, width, height);

-                    float offsetX = width / 2;
-                    float offsetY = description.VerticalPadding + description.ShadowThickness * shadowExpandFactor;
+                    var offsetX = width / 2;
+                    var offsetY = description.VerticalPadding + description.ShadowThickness * shadowExpandFactor;

                     using (Bitmap bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb))
                     {
@@ -112,6 +123,12 @@
                             textGraphics.TextRenderingHint = graphics.TextRenderingHint;
                             textGraphics.SmoothingMode = SmoothingMode.HighQuality;
                             textGraphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
+
+                            if (description.Debug)
+                            {
+                                var r = new Random();
+                                textGraphics.Clear(Color.FromArgb(r.Next(100, 255), r.Next(100, 255), r.Next(100, 255)));
+                            }

                             for (var i = 1; i <= description.ShadowThickness; i++)
                             {
@@ -140,7 +157,7 @@
                     }
                 }
             }
-            return new FontText(Path.Combine(directory, filename), width, height);
+            return new FontText(Path.Combine(directory, filename), baseWidth, baseHeight, width, height);
         }

         private static void withRetries(Action action, int timeout = 2000)


Fixes for MR-115. The cast to ActiveRecordBase fails when using ActiveRecordBase<T> derived objects.

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

--- MonoRail/Castle.MonoRail.ActiveRecordScaffold/RemoveAction.cs
+++ MonoRail/Castle.MonoRail.ActiveRecordScaffold/RemoveAction.cs
@@ -50,7 +50,7 @@

 				controller.PropertyBag["instance"] = instance;

-				(instance as ActiveRecordBase).Delete();
+				ActiveRecordMediator.Delete(instance);
 			}
 			catch(Exception ex)
 			{


MR-425 : Additions to RequestAdapter in order to support the Contrib Rest project.

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

--- MonoRail/Castle.MonoRail.Framework/Adapters/RequestAdapter.cs
+++ MonoRail/Castle.MonoRail.Framework/Adapters/RequestAdapter.cs
@@ -12,11 +12,14 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.

+using Castle.MonoRail.Framework;
+
 namespace Castle.MonoRail.Framework.Adapters
 {
 	using System;
 	using System.Collections;
 	using System.Collections.Specialized;
+	using System.IO;
 	using System.Web;
 	using Castle.Components.Binder;

@@ -27,9 +30,26 @@
 	{
 		private TreeBuilder treeBuilder = new TreeBuilder();
 		private HttpRequest request;
-		private CompositeNode paramsNode, formNode, queryStringNode;
 		private FileDictionaryAdapter files;

+		/// <summary>
+		/// Lazy initialized property with a hierarchical
+		/// representation of the flat data on <see cref="Controller.Params"/>
+		/// </summary>
+		protected CompositeNode paramsCompositeNode;
+
+		/// <summary>
+		/// Lazy initialized property with a hierarchical
+		/// representation of the flat data on <see cref="IRequest.Form"/>
+		/// </summary>
+		protected CompositeNode formCompositeNode;
+
+		/// <summary>
+		/// Lazy initialized property with a hierarchical
+		/// representation of the flat data on <see cref="IRequest.QueryString"/>
+		/// </summary>
+		protected CompositeNode queryStringCompositeNode;
+
 		/// <summary>
 		/// Initializes a new instance of the <see cref="RequestAdapter"/> class.
 		/// </summary>
@@ -87,6 +107,25 @@
 			get { return request.Url.IsLoopback; }
 		}

+		/// <summary>
+		/// Gets the contents of the incoming HTTP entity body.
+		/// </summary>
+		/// <value></value>
+		public Stream InputStream
+		{
+			get { return request.InputStream; }
+		}
+
+		/// <summary>
+		/// Gets or sets the MIME content type of the incoming request.
+		/// </summary>
+		/// <value></value>
+		public string ContentType
+		{
+			get { return request.ContentType; }
+			set { request.ContentType = value; }
+		}
+
 		/// <summary>
 		/// Gets the request type (GET, POST, etc)
 		/// </summary>
@@ -251,17 +290,17 @@
 		/// Lazy initialized property with a hierarchical
 		/// representation of the flat data on <see cref="Controller.Params"/>
 		/// </summary>
-		public CompositeNode ParamsNode
-		{
-			get
-			{
-				if (paramsNode == null)
-				{
-					paramsNode = treeBuilder.BuildSourceNode(Params);
-					treeBuilder.PopulateTree(paramsNode, request.Files);
-				}
-
-				return paramsNode;
+		public virtual CompositeNode ParamsNode
+		{
+			get
+			{
+				if (paramsCompositeNode == null)
+				{
+					paramsCompositeNode = treeBuilder.BuildSourceNode(Params);
+					treeBuilder.PopulateTree(paramsCompositeNode, request.Files);
+				}
+
+				return paramsCompositeNode;
 			}
 		}

@@ -269,17 +308,17 @@
 		/// Lazy initialized property with a hierarchical
 		/// representation of the flat data on <see cref="IRequest.Form"/>
 		/// </summary>
-		public CompositeNode FormNode
-		{
-			get
-			{
-				if (formNode == null)
-				{
-					formNode = treeBuilder.BuildSourceNode(Form);
-					treeBuilder.PopulateTree(formNode, request.Files);
-				}
-
-				return formNode;
+		public virtual CompositeNode FormNode
+		{
+			get
+			{
+				if (formCompositeNode == null)
+				{
+					formCompositeNode = treeBuilder.BuildSourceNode(Form);
+					treeBuilder.PopulateTree(formCompositeNode, request.Files);
+				}
+
+				return formCompositeNode;
 			}
 		}

@@ -287,17 +326,17 @@
 		/// Lazy initialized property with a hierarchical
 		/// representation of the flat data on <see cref="IRequest.QueryString"/>
 		/// </summary>
-		public CompositeNode QueryStringNode
-		{
-			get
-			{
-				if (queryStringNode == null)
-				{
-					queryStringNode = treeBuilder.BuildSourceNode(QueryString);
-					treeBuilder.PopulateTree(queryStringNode, request.Files);
-				}
-
-				return queryStringNode;
+		public virtual CompositeNode QueryStringNode
+		{
+			get
+			{
+				if (queryStringCompositeNode == null)
+				{
+					queryStringCompositeNode = treeBuilder.BuildSourceNode(QueryString);
+					treeBuilder.PopulateTree(queryStringCompositeNode, request.Files);
+				}
+
+				return queryStringCompositeNode;
 			}
 		}


Added size changed and collection changed handling

--- MonocleGiraffe/MonocleGiraffe/Controls/ColumnGridView.xaml.cs
+++ MonocleGiraffe/MonocleGiraffe/Controls/ColumnGridView.xaml.cs
@@ -51,14 +51,11 @@
         private void Render(bool isDown)
         {
             var currentWindow = GetRealizationWindow();
-            SortedSet<LayoutInfo> itemsToRealize;
             if (isDown)
-                itemsToRealize = items.GetViewBetween(new LayoutInfo { Top = oldWindow.Bottom }, new LayoutInfo { Top = currentWindow.Bottom });
+                RealizeWindow(oldWindow.Bottom, currentWindow.Bottom);
             else
-                itemsToRealize = items.GetViewBetween(new LayoutInfo { Top = currentWindow.Top }, new LayoutInfo { Top = oldWindow.Top });
-            oldWindow = currentWindow;
-            foreach (var item in itemsToRealize)
-                RealizeOneItem(item);
+                RealizeWindow(currentWindow.Top, oldWindow.Top);
+            oldWindow = currentWindow;
         }

         private void ItemsSource_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
@@ -71,11 +68,21 @@
         }

         double previousWidth = -1;
-        private async void LayoutRoot_SizeChanged(object sender, SizeChangedEventArgs e)
+        private void LayoutRoot_SizeChanged(object sender, SizeChangedEventArgs e)
         {
             if (previousWidth != -1 && e.NewSize.Width != previousWidth)
-                await RefreshView();
+                RedrawView();
             previousWidth = e.NewSize.Width;
+        }
+
+        private void RedrawView()
+        {
+            ResetLayout();
+            MainPanel.Children.Clear();
+            var availableSize = new Size(Window.Current.Bounds.Width, double.PositiveInfinity);
+            MainPanel.Height = MeasurePanel(availableSize).Height;
+            var window = GetRealizationWindow();
+            RealizeWindow(window.Top, window.Bottom);
         }

         public IncrementalCollection<GalleryItem> ItemsSource
@@ -92,7 +99,7 @@
         {
             var view = o as ColumnGridView;
             view.SubscribeToCollectionChanged();
-            await view.RefreshView();
+            await view.ReloadEverything();
         }

         private void SubscribeToCollectionChanged()
@@ -102,21 +109,33 @@

         private void RealizeWindow(double top, double bottom)
         {
+            if (top >= bottom)
+                return;
             var itemsToRealize = items.GetViewBetween(new LayoutInfo { Top = top }, new LayoutInfo { Top = bottom});
             foreach (var item in itemsToRealize)
                 RealizeOneItem(item);
         }

-        private async Task RefreshView()
-        {
+        private async Task ReloadEverything()
+        {
+            ResetLayout();
+            if (ItemsSource.Count == 0)
+                await ItemsSource.LoadMoreItemsAsync(60);
             var window = GetRealizationWindow();
-            MainPanel.Children.Clear();
-            if (items.Count == 0)
-                await ItemsSource.LoadMoreItemsAsync(60);
-            //MeasurePanel(new Size(LayoutRoot.Width, double.PositiveInfinity));
             RealizeWindow(window.Top, window.Bottom);
-        }
-
+            oldWindow = window;
+        }
+
+        private void ResetLayout()
+        {
+            items = new SortedSet<LayoutInfo>(new LayoutInfoComparer());
+            currentX = 0;
+            isFirstRow = true;
+            finalWidth = 0;
+            finalHeight = 0;
+            columnHeights = new List<double>();
+            count = 0;
+        }
         private SortedSet<LayoutInfo> items = new SortedSet<LayoutInfo>(new LayoutInfoComparer());
         double currentX = 0;
         bool isFirstRow = true;
@@ -188,15 +207,7 @@
         }

         private Size MeasurePanel(Size availableSize)
-        {
-            items = new SortedSet<LayoutInfo>(new LayoutInfoComparer());
-            finalWidth = 0;
-            finalHeight = 0;
-            element = new GalleryThumbnailTemplate();
-            currentX = 0;
-            columnHeights = new List<double>();
-            count = 0;
-            isFirstRow = true;
+        {
             foreach (var g in ItemsSource)
             {
                 MeasureOneItem(g, availableSize);
@@ -209,8 +220,8 @@

         private void RealizeOneItem(LayoutInfo i)
         {
-            if (i.IsRendered)
-                return;
+            //if (i.IsRendered)
+            //    return;
             var container = containerCache.Get();
             if (container == null)
                 container = new GalleryThumbnailTemplate();


Update for CLS Compliance

Update for CLS Compliance

svn path=/trunk/bitsharp/; revision=75001

--- src/MonoTorrent.Common/PeerID.cs
+++ src/MonoTorrent.Common/PeerID.cs
@@ -55,7 +55,6 @@
         ElectricSheep,
         KTorrent,
         Lphant,
-        libtorrent,
         LibTorrent,
         MLDonkey,
         MooPolice,
@@ -169,11 +168,8 @@
                         this.client = Common.Client.Lphant;
                         break;

+					case ("lt"):
                     case ("LT"):
-                        this.client = Common.Client.libtorrent;
-                        break;
-
-                    case ("lt"):
                         this.client = Common.Client.LibTorrent;
                         break;


NH-3399

--- src/NHibernate/NHibernateUtil.cs
+++ src/NHibernate/NHibernateUtil.cs
@@ -77,195 +77,195 @@
 		///
 		/// NHibernate Ansi String type
 		///
-		public static readonly NullableType AnsiString = new AnsiStringType();
+		public static readonly AnsiStringType AnsiString = new AnsiStringType();

 		///
 		/// NHibernate binary type
 		///
-		public static readonly NullableType Binary = new BinaryType();
+		public static readonly BinaryType Binary = new BinaryType();

 		///
 		/// NHibernate binary blob type
 		///
-		public static readonly NullableType BinaryBlob = new BinaryBlobType();
+		public static readonly BinaryBlobType BinaryBlob = new BinaryBlobType();

 		///
 		/// NHibernate boolean type
 		///
-		public static readonly NullableType Boolean = new BooleanType();
+		public static readonly BooleanType Boolean = new BooleanType();

 		///
 		/// NHibernate byte type
 		///
-		public static readonly NullableType Byte = new ByteType();
+		public static readonly ByteType Byte = new ByteType();

 		///
 		/// NHibernate character type
 		///
-		public static readonly NullableType Character = new CharType();
+		public static readonly CharType Character = new CharType();

 		///
 		/// NHibernate Culture Info type
 		///
-		public static readonly NullableType CultureInfo = new CultureInfoType();
+		public static readonly CultureInfoType CultureInfo = new CultureInfoType();

 		///
 		/// NHibernate date type
 		///
-		public static readonly NullableType DateTime = new DateTimeType();
+		public static readonly DateTimeType DateTime = new DateTimeType();

 		///
 		/// NHibernate date type
 		///
-		public static readonly NullableType DateTime2 = new DateTime2Type();
+		public static readonly DateTime2Type DateTime2 = new DateTime2Type();

 		///
 		/// NHibernate local date type
 		///
-		public static readonly NullableType LocalDateTime = new LocalDateTimeType();
+		public static readonly LocalDateTimeType LocalDateTime = new LocalDateTimeType();

 		///
 		/// NHibernate utc date type
 		///
-		public static readonly NullableType UtcDateTime = new UtcDateTimeType();
+		public static readonly UtcDateTimeType UtcDateTime = new UtcDateTimeType();

 		///
 		/// NHibernate date type
 		///
-		public static readonly NullableType DateTimeOffset = new DateTimeOffsetType();
+		public static readonly DateTimeOffsetType DateTimeOffset = new DateTimeOffsetType();

 		///
 		/// NHibernate date type
 		///
-		public static readonly NullableType Date = new DateType();
+		public static readonly DateType Date = new DateType();

 		///
 		/// NHibernate decimal type
 		///
-		public static readonly NullableType Decimal = new DecimalType();
+		public static readonly DecimalType Decimal = new DecimalType();

 		///
 		/// NHibernate double type
 		///
-		public static readonly NullableType Double = new DoubleType();
+		public static readonly DoubleType Double = new DoubleType();

 		///
 		/// NHibernate Currency type (System.Decimal - DbType.Currency)
 		///
-		public static readonly NullableType Currency = new CurrencyType();
+		public static readonly CurrencyType Currency = new CurrencyType();

 		///
 		/// NHibernate Guid type.
 		///
-		public static readonly NullableType Guid = new GuidType();
+		public static readonly GuidType Guid = new GuidType();

 		///
 		/// NHibernate System.Int16 (short in C#) type
 		///
-		public static readonly NullableType Int16 = new Int16Type();
+		public static readonly Int16Type Int16 = new Int16Type();

 		///
 		/// NHibernate System.Int32 (int in C#) type
 		///
-		public static readonly NullableType Int32 = new Int32Type();
+		public static readonly Int32Type Int32 = new Int32Type();

 		///
 		/// NHibernate System.Int64 (long in C#) type
 		///
-		public static readonly NullableType Int64 = new Int64Type();
+		public static readonly Int64Type Int64 = new Int64Type();

 		///
 		/// NHibernate System.SByte type
 		///
-		public static readonly NullableType SByte = new SByteType();
+		public static readonly SByteType SByte = new SByteType();

 		///
 		/// NHibernate System.UInt16 (ushort in C#) type
 		///
-		public static readonly NullableType UInt16 = new UInt16Type();
+		public static readonly UInt16Type UInt16 = new UInt16Type();

 		///
 		/// NHibernate System.UInt32 (uint in C#) type
 		///
-		public static readonly NullableType UInt32 = new UInt32Type();
+		public static readonly UInt32Type UInt32 = new UInt32Type();

 		///
 		/// NHibernate System.UInt64 (ulong in C#) type
 		///
-		public static readonly NullableType UInt64 = new UInt64Type();
+		public static readonly UInt64Type UInt64 = new UInt64Type();

 		///
 		/// NHibernate System.Single (float in C#) Type
 		///
-		public static readonly NullableType Single = new SingleType();
+		public static readonly SingleType Single = new SingleType();

 		///
 		/// NHibernate String type
 		///
-		public static readonly NullableType String = new StringType();
+		public static readonly StringType String = new StringType();

 		///
 		/// NHibernate string clob type
 		///
-		public static readonly NullableType StringClob = new StringClobType();
+		public static readonly StringClobType StringClob = new StringClobType();

 		///
 		/// NHibernate Time type
 		///
-		public static readonly NullableType Time = new TimeType();
+		public static readonly TimeType Time = new TimeType();

 		///
 		/// NHibernate Ticks type
 		///
-		public static readonly NullableType Ticks = new TicksType();
+		public static readonly TicksType Ticks = new TicksType();

 		///
 		/// NHibernate Ticks type
 		///
-		public static readonly NullableType TimeAsTimeSpan = new TimeAsTimeSpanType();
+		public static readonly TimeAsTimeSpanType TimeAsTimeSpan = new TimeAsTimeSpanType();

 		///
 		/// NHibernate Ticks type
 		///
-		public static readonly NullableType TimeSpan = new TimeSpanType();
+		public static readonly TimeSpanType TimeSpan = new TimeSpanType();

 		///
 		/// NHibernate Timestamp type
 		///
-		public static readonly NullableType Timestamp = new TimestampType();
-
-		public static readonly NullableType DbTimestamp = new DbTimestampType();
+		public static readonly TimestampType Timestamp = new TimestampType();
+
+		public static readonly DbTimestampType DbTimestamp = new DbTimestampType();

 		///
 		/// NHibernate TrueFalse type
 		///
-		public static readonly NullableType TrueFalse = new TrueFalseType();
+		public static readonly TrueFalseType TrueFalse = new TrueFalseType();

 		///
 		/// NHibernate YesNo type
 		///
-		public static readonly NullableType YesNo = new YesNoType();
+		public static readonly YesNoType YesNo = new YesNoType();

 		///
 		/// NHibernate class type
 		///
-		public static readonly NullableType Class = new TypeType();
+		public static readonly TypeType Class = new TypeType();

 		///
 		/// NHibernate class meta type for association of kind any.
 		///
 		/// <seealso cref="AnyType"/>
-		public static readonly IType ClassMetaType = new ClassMetaType();
+		public static readonly ClassMetaType ClassMetaType = new ClassMetaType();

 		///
 		/// NHibernate serializable type
 		///
-		public static readonly NullableType Serializable = new SerializableType();
+		public static readonly SerializableType Serializable = new SerializableType();

 		///
 		/// NHibernate System.Object type
 		///
-		public static readonly IType Object = new AnyType();
+		public static readonly AnyType Object = new AnyType();

 		//		///
@@ -276,15 +276,15 @@
 		//		/// NHibernate clob type
 		//		///
 		//		public static readonly NullableType Clob = new ClobType();
-
-
-		public static readonly NullableType AnsiChar = new AnsiCharType();
-
-		public static readonly NullableType XmlDoc = new XmlDocType();
-
-	public static readonly NullableType XDoc = new XDocType();
-
-		public static readonly NullableType Uri = new UriType();
+
+
+		public static readonly AnsiCharType AnsiChar = new AnsiCharType();
+
+		public static readonly XmlDocType XmlDoc = new XmlDocType();
+
+		public static readonly XDocType XDoc = new XDocType();
+
+		public static readonly UriType Uri = new UriType();

 		///
 		/// A NHibernate persistent enum type


Fix incorrect file path

Fix incorrect file path

--- src/NVika/BuildServers/GitHub.cs
+++ src/NVika/BuildServers/GitHub.cs
@@ -40,10 +40,7 @@

             if (issue.FilePath != null)
             {
-                var file = issue.Project != null
-                    ? issue.FilePath.Replace(issue.Project + @"\", string.Empty)
-                    : issue.FilePath;
-
+                var file = issue.FilePath.Replace('\\', '/');
                 outputString.Append($"file={file},");
             }


password-auth comment for RHEL

password-auth comment for RHEL

--- src/Npam.Example.User/Program.cs
+++ src/Npam.Example.User/Program.cs
@@ -5,6 +5,7 @@
 {
     public class Program
     {
+	//const string PamServiceName = "password-auth"; //For RHEL based Linux
         const string PamServiceName = "passwd";

         public static void Main(string[] args)


Implement RunOverrideTargetResponse

Implement RunOverrideTargetResponse

--- OmniSharp/AutoComplete/Overrides/RunOverrideTargetResponse.cs
+++ OmniSharp/AutoComplete/Overrides/RunOverrideTargetResponse.cs
@@ -1,6 +1,22 @@
 using System;
 using OmniSharp.Common;
+using OmniSharp.Rename;

 namespace OmniSharp.AutoComplete.Overrides {
-    public class RunOverrideTargetResponse {}
+    public class RunOverrideTargetResponse : ModifiedFileResponse {
+        public RunOverrideTargetResponse() {}
+        public RunOverrideTargetResponse
+            ( string fileName
+            , string buffer
+            , int    line
+            , int    column)
+            : base(fileName: fileName, buffer: buffer) {
+            this.Line = line;
+            this.Column = column;
+        }
+
+        public int Line {get; set;}
+        public int Column {get; set;}
+
+    }
 }


Deal with incoming land objects properly so they don't just stack up

--- OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -1303,18 +1303,31 @@

         public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data)
         {
-            for (int i = 0; i < data.Count; i++)
-            {
-                IncomingLandObjectFromStorage(data[i]);
+            lock (m_landList)
+            {
+                //Remove all the land objects in the sim and then process our new data
+                foreach (int n in m_landList.Keys)
+                {
+                    m_scene.EventManager.TriggerLandObjectRemoved(m_landList[n].LandData.GlobalID);
+                }
+                m_landIDList.Initialize();
+                m_landList.Clear();
+
+                for (int i = 0; i < data.Count; i++)
+                {
+                    IncomingLandObjectFromStorage(data[i]);
+                }
             }
         }

         public void IncomingLandObjectFromStorage(LandData data)
         {
+
             ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene);
             new_land.LandData = data.Copy();
             new_land.SetLandBitmapFromByteArray();
             AddLandObject(new_land);
+            new_land.SendLandUpdateToAvatarsOverMe();
         }

         public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)


updated testing username

updated testing username

--- Parser/Src/Parser.Auth.Remote/Providers/RemoteUserProvider.cs
+++ Parser/Src/Parser.Auth.Remote/Providers/RemoteUserProvider.cs
@@ -4,7 +4,7 @@
 {
     public class RemoteUserProvider : IRemoteUserProvider
     {
-        private const string FixedUsernameForTesting = "some@user.com";
+        private const string FixedUsernameForTesting = "myuser@user.com";

         private IRemoteUser loggedInRemoteUser;


Issue 84: warning CS0219: The variable `size' is assigned but its value is never used

--- src/ProtoGen/MessageGenerator.cs
+++ src/ProtoGen/MessageGenerator.cs
@@ -360,7 +360,7 @@
             writer.WriteLine("public override void WriteTo(pb::ICodedOutputStream output) {");
             writer.Indent();
             // Make sure we've computed the serialized length, so that packed fields are generated correctly.
-            writer.WriteLine("int size = SerializedSize;");
+            writer.WriteLine("CalcSerializedSize();");
             writer.WriteLine("string[] field_names = _{0}FieldNames;", NameHelpers.UnderscoresToCamelCase(ClassName));
             if (Descriptor.Proto.ExtensionRangeList.Count > 0)
             {
@@ -412,6 +412,17 @@
             writer.Indent();
             writer.WriteLine("int size = memoizedSerializedSize;");
             writer.WriteLine("if (size != -1) return size;");
+            writer.WriteLine("return CalcSerializedSize();");
+            writer.Outdent();
+            writer.WriteLine("}");
+            writer.Outdent();
+            writer.WriteLine("}");
+            writer.WriteLine();
+
+            writer.WriteLine("private int CalcSerializedSize() {");
+            writer.Indent();
+            writer.WriteLine("int size = memoizedSerializedSize;");
+            writer.WriteLine("if (size != -1) return size;");
             writer.WriteLine();
             writer.WriteLine("size = 0;");
             foreach (FieldDescriptor field in Descriptor.Fields)
@@ -438,9 +449,6 @@
             writer.WriteLine("return size;");
             writer.Outdent();
             writer.WriteLine("}");
-            writer.Outdent();
-            writer.WriteLine("}");
-            writer.WriteLine();
         }

         private void GenerateSerializeOneField(TextGenerator writer, FieldDescriptor fieldDescriptor)


- Implemented GLSLHelper methods

- Implemented GLSLHelper methods

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

--- Projects/Axiom/Source/RenderSystems/OpenGL/GLSL/GLSLHelper.cs
+++ Projects/Axiom/Source/RenderSystems/OpenGL/GLSL/GLSLHelper.cs
@@ -35,6 +35,10 @@

 using System;

+using Tao.OpenGl;
+using System.Text;
+using Axiom.Core;
+
 #endregion Namespace Declarations

 namespace Axiom.RenderSystems.OpenGL.GLSL
@@ -63,19 +67,61 @@
 		/// <param name="forceInfoLog"></param>
 		public static void CheckForGLSLError( string error, int handle, bool forceInfoLog, bool forceException )
 		{
-			// TODO: Implement
+			int glErr;
+			bool errorsFound = false;
+			String msg = error;
+
+			// get all the GL errors
+			glErr = Gl.glGetError();
+			while ( glErr != Gl.GL_NO_ERROR )
+			{
+				msg += "\n" + Glu.gluErrorString( glErr );
+				glErr = Gl.glGetError();
+				errorsFound = true;
+			}
+
+
+			// if errors were found then put them in the Log and raise and exception
+			if ( errorsFound || forceInfoLog )
+			{
+				// if shader or program object then get the log message and send to the log manager
+				msg += LogObjectInfo( msg, handle );
+
+				if ( forceException )
+				{
+					throw new Exception( msg );
+				}
+			}
 		}

 		/// <summary>
-		///		If there is a message in GL info log then post it in the Ogre Log
+		///		If there is a message in GL info log then post it in the Axiom Log
 		/// </summary>
 		/// <param name="message">The info log message string is appended to this string.</param>
 		/// <param name="handle">The GL object handle that is used to retrieve the info log</param>
 		/// <returns></returns>
 		public static string LogObjectInfo( string message, int handle )
 		{
-			// TODO: Implement
-			return string.Empty;
+			StringBuilder logMessage = new StringBuilder( message );
+
+			if ( handle > 0 )
+			{
+				int infologLength = 0;
+
+				Gl.glGetObjectParameterivARB( handle, Gl.GL_OBJECT_INFO_LOG_LENGTH_ARB, out infologLength );
+
+				if ( infologLength > 0 )
+				{
+					int charsWritten = 0;
+
+					Gl.glGetInfoLogARB( handle, infologLength, out charsWritten, logMessage );
+					logMessage.Append("\n");
+					LogManager.Instance.Write( logMessage.ToString() );
+				}
+			}
+
+			return logMessage.ToString();
+
 		}
 	}
 }


RC - PERF(ApplyToConceptScheme)

RC - PERF(ApplyToConceptScheme)

--- RDFSharp.Semantics/Extensions/SKOS/Validator/SKOSValidator.cs
+++ RDFSharp.Semantics/Extensions/SKOS/Validator/SKOSValidator.cs
@@ -58,26 +58,33 @@
             {
                 OWLSemanticsEvents.RaiseSemanticsInfo($"SKOS Validator is going to be applied on skos:ConceptScheme '{conceptScheme.URI}'");

-                //Standard Rules
+                //Initialize validator registry
+                Dictionary<string, OWLValidatorReport> validatorRegistry = new Dictionary<string, OWLValidatorReport>();
+                foreach (SKOSEnums.SKOSValidatorStandardRules standardRule in StandardRules)
+                    validatorRegistry.Add(standardRule.ToString(), null);
+
+                //Execute standard rules
                 Parallel.ForEach(StandardRules,
                     standardRule =>
                     {
                         OWLSemanticsEvents.RaiseSemanticsInfo($"Launching standard SKOS validator rule '{standardRule}'");

-                        OWLValidatorReport standardRuleReport = new OWLValidatorReport();
                         switch (standardRule)
                         {
                             case SKOSEnums.SKOSValidatorStandardRules.TopConcept:
-                                standardRuleReport.MergeEvidences(SKOSTopConceptRule.ExecuteRule(conceptScheme));
+                                validatorRegistry[SKOSEnums.SKOSValidatorStandardRules.TopConcept.ToString()] = SKOSTopConceptRule.ExecuteRule(conceptScheme);
                                 break;
                             case SKOSEnums.SKOSValidatorStandardRules.LiteralForm:
-                                standardRuleReport.MergeEvidences(SKOSXLLiteralFormRule.ExecuteRule(conceptScheme));
+                                validatorRegistry[SKOSEnums.SKOSValidatorStandardRules.LiteralForm.ToString()] = SKOSXLLiteralFormRule.ExecuteRule(conceptScheme);
                                 break;
                         }
-                        validatorReport.MergeEvidences(standardRuleReport);

-                        OWLSemanticsEvents.RaiseSemanticsInfo($"Completed standard SKOS validator rule '{standardRule}': found {standardRuleReport.EvidencesCount} evidences");
+                        OWLSemanticsEvents.RaiseSemanticsInfo($"Completed standard SKOS validator rule '{standardRule}': found {validatorRegistry[standardRule.ToString()].EvidencesCount} evidences");
                     });
+
+                //Process validator registry
+                foreach (OWLValidatorReport validatorRegistryReport in validatorRegistry.Values)
+                    validatorReport.MergeEvidences(validatorRegistryReport);

                 OWLSemanticsEvents.RaiseSemanticsInfo($"SKOS Validator has been applied on skos:ConceptScheme '{conceptScheme.URI}': found {validatorReport.EvidencesCount} evidences");
             }


Fixed ModelHeader

Fixed ModelHeader

--- src/Rs317.Library/ModelHeader.cs
+++ src/Rs317.Library/ModelHeader.cs
@@ -1,7 +1,7 @@

 sealed class ModelHeader
 {
-	public byte modelData[];
+	public byte[] modelData;

 	public int vertexCount;
 	public int triangleCount;


Add values in enum 'LexerError'

Add values in enum 'LexerError'

--- lury-lexer/LexerError.cs
+++ lury-lexer/LexerError.cs
@@ -38,6 +38,9 @@
         InvalidIndentFirstLine = 0x100001,
         InvalidCharacter = 0x100002,
         InvalidIndent = 0x100003,
+        UnexpectedCharacterAfterBackslash = 0x100004,
+        UnclosedBlockComment = 0x100005,
+        UnclosedStringLiteral = 0x100006,
     }

     public enum LexerWarning


DelaySpan.SetDelayActionメソッドを削除

DelaySpan.SetDelayActionメソッドを削除

--- src/Sitrine/Animate/DelaySpan.cs
+++ src/Sitrine/Animate/DelaySpan.cs
@@ -96,24 +96,6 @@
         }

         /// <summary>
-        /// 指定されたストーリーボードにウェイトイベントを指定します。
-        /// </summary>
-        /// <param name="story"></param>
-        public void SetDelayAction(Storyboard story)
-        {
-            if (story == null)
-                throw new ArgumentNullException("story");
-
-            var process = story.Process;
-
-            if (this.delaySeconds != 0.0)
-                process.Wait(this.delaySeconds);
-
-            if (this.delayFrames != 0)
-                process.WaitFrame(this.delayFrames);
-        }
-
-        /// <summary>
         /// このインスタンスの値がゼロに等しいかの真偽値を返します。
         /// </summary>
         /// <returns>ゼロの場合は true、それ以外の場合は false。</returns>


Fix #63

Fix #63

--- src/Spatial/Euclidean/Point2D.cs
+++ src/Spatial/Euclidean/Point2D.cs
@@ -338,6 +338,7 @@
         /// return new Point3D(X, Y, 0);
         /// </summary>
         /// <returns>A <see cref="Point3D"/> with x and y from this instance and z = 0</returns>
+        [Obsolete("Use projections instead, Obsolete on 2017-12-10")]
         [Pure]
         public Point3D ToPoint3D()
         {
@@ -349,6 +350,7 @@
         /// </summary>
         /// <param name="cs">A coordinate system</param>
         /// <returns>A new 3D point</returns>
+        [Obsolete("Use projections instead, Obsolete on 2017-12-10")]
         [Pure]
         public Point3D TransformBy(CoordinateSystem cs)
         {


Fixed test

Fixed test

--- SDK/UnitTests/ApiTests.cs
+++ SDK/UnitTests/ApiTests.cs
@@ -238,10 +238,16 @@
         public void T15BadRequestTest()
         {
             var problems = (RoutingProblemDataSet)testObjects["problems"];
-
-            //##BEGIN EXAMPLE oauth##
-            var result = api.Navigate<ResponseData>(problems.GetLink("create"));
-            //##END EXAMPLE##
+            try
+            {
+                //##BEGIN EXAMPLE oauth##
+                var result = api.Navigate<ResponseData>(problems.GetLink("create"));
+                //##END EXAMPLE##
+            }
+            catch (System.IO.IOException e)
+            {
+                Assert.IsTrue(e.Message.Contains("400 Bad Request"));
+            }
         }
     }
 }


Agruments -> Arguments (#16273)

Agruments -> Arguments (#16273)

--- src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs
+++ src/mscorlib/shared/System/Globalization/DateTimeFormatInfo.cs
@@ -1463,7 +1463,7 @@
         //
         //  Actions: Retrieve the month names used in a leap year.
         //      If this culture does not have different month names in a leap year, the normal month name is returned.
-        //  Agruments: None. (can use abbreviated later if needed)
+        //  Arguments: None. (can use abbreviated later if needed)
         //
         internal String[] internalGetLeapYearMonthNames(/*bool abbreviated*/)
         {


fix tabs

fix tabs

--- FluentFTP/Client/FtpClient_Listing.cs
+++ FluentFTP/Client/FtpClient_Listing.cs
@@ -1051,7 +1051,7 @@

 #endregion

-#region Get Name Listing
+		#region Get Name Listing

 		/// <summary>
 		/// Returns a file/directory listing using the NLST command.


Update existing documentation for person ids.

--- Source/Lib/TraktApiSharp/Objects/Get/People/TraktPersonIds.cs
+++ Source/Lib/TraktApiSharp/Objects/Get/People/TraktPersonIds.cs
@@ -1,57 +1,40 @@
 namespace TraktApiSharp.Objects.Get.People
 {
     using Newtonsoft.Json;
-    using System.Globalization;

-    ///
-    /// A collection of ids for various web services for a Trakt person.
-    ///
+    /// A collection of ids for various web services, including the Trakt id, for a Trakt person.
     public class TraktPersonIds
     {
-        ///
-        /// The Trakt numeric id for the person.
-        ///
+        /// Gets or sets the Trakt numeric id.
         [JsonProperty(PropertyName = "trakt")]
         public int Trakt { get; set; }

-        ///
-        /// The Trakt slug for the person.
-        ///
+        /// Gets or sets the Trakt slug.
         [JsonProperty(PropertyName = "slug")]
         public string Slug { get; set; }

-        ///
-        /// The id for the person from imdb.com
-        ///
+        /// Gets or sets the id from imdb.com
         [JsonProperty(PropertyName = "imdb")]
         public string Imdb { get; set; }

-        ///
-        /// The numeric id for the person from themoviedb.org
-        ///
+        /// Gets or sets the numeric id from themoviedb.org
         [JsonProperty(PropertyName = "tmdb")]
         public int? Tmdb { get; set; }

-        ///
-        /// The numeric id for the person from tvrage.com
-        ///
+        /// Gets or sets the numeric id from tvrage.com
         [JsonProperty(PropertyName = "tvrage")]
         public int? TvRage { get; set; }

-        ///
-        /// Tests, if at least one id has been set.
-        ///
+        /// Returns, whether any id has been set.
         [JsonIgnore]
         public bool HasAnyId => Trakt > 0 || !string.IsNullOrEmpty(Slug) || !string.IsNullOrEmpty(Imdb) || Tmdb > 0 || TvRage > 0;

-        ///
-        /// Get the most reliable id from those that have been set for the person.
-        ///
-        /// <returns>The id as a string.</returns>
+        /// Gets the most reliable id from those that have been set.
+        /// <returns>The id as a string or an empty string, if no id is set.</returns>
         public string GetBestId()
         {
             if (Trakt > 0)
-                return Trakt.ToString(CultureInfo.InvariantCulture);
+                return Trakt.ToString();

             if (!string.IsNullOrEmpty(Slug))
                 return Slug;
@@ -59,6 +42,12 @@
             if (!string.IsNullOrEmpty(Imdb))
                 return Imdb;

+            if (Tmdb.HasValue && Tmdb.Value > 0)
+                return Tmdb.Value.ToString();
+
+            if (TvRage.HasValue && TvRage.Value > 0)
+                return TvRage.Value.ToString();
+
             return string.Empty;
         }
     }


FIx call method for array expression.

FIx call method for array expression.

--- Freesia/Internal/ExpressionBuilder.cs
+++ Freesia/Internal/ExpressionBuilder.cs
@@ -30,14 +30,14 @@
                 if (current == null) return new object[0];
                 if (current.Token.Type != TokenType.ArrayDelimiter)
                 {
-                    items.Add(current.Token);
+                    items.Add(CompileOne(current));
                     return items.ToArray();
                 }
                 while (current != null)
                 {
                     if (current.Token.Type == TokenType.ArrayDelimiter)
                     {
-                        items.Add(current.Left.Token);
+                        items.Add(CompileOne(current.Left));
                         current = current.Right;
                         continue;
                     }
@@ -405,7 +405,7 @@
         {
             if (lhs.Token.Type != TokenType.PropertyAccess)
                 throw new ParseException("Invoke method requires property access.", lhs.Token.Position);
-            var rootExpr = MakeExpression(CompileOne(lhs.Left));
+            var rootExpr = MakeExpression(CastIfNeeded(CompileOne(lhs.Left)));
             var ie = rootExpr.Type.GetUnderlyingEnumerableType();
             if (ie == null)
                 throw new ParseException("Method only apply to IE<T>.", lhs.Token.Position);
@@ -518,6 +518,14 @@
                 : MakeExpression(CompileOne(x))).ToArray();
         }

+        private Expression MakeNewArrayExpression(object[] nodes)
+        {
+            var exprs = nodes.Select(MakeExpression).ToArray();
+            var types = exprs.Select(x => x.Type).Distinct().ToArray();
+            var type = types.Length == 1 ? types[0] : typeof (object);
+            return Expression.NewArrayInit(type, exprs);
+        }
+
         private bool MayNullable(object o, bool checkRecursive = true)
         {
             if (o is MemberExpression)
@@ -696,5 +704,12 @@
             return propInfo.PropertyType;
         }

+        private object CastIfNeeded(object o)
+        {
+            if (o.GetType() != typeof(object[])) return o;
+            // public static IEnumerable<TResult> Cast<TResult>(this IEnumerable source);
+            var objects = (object[])o;
+            return MakeNewArrayExpression(objects);
+        }
     }
 }


ioc configuration to prevent obscured errors in unit tests

--- Serenity.Core/Core/IoC.cs
+++ Serenity.Core/Core/IoC.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using System.Web.UI.WebControls.WebParts;
 using Munq;
+using System.Configuration;

 namespace Serenity
 {
@@ -16,7 +17,9 @@

         static IoC()
         {
-            container = new IocContainer();
+            // to prevent test errors when unit tests registers classes, without starting a ioc context
+            if (ConfigurationManager.AppSettings["IoCManualStartContext"] != "1")
+                container = new IocContainer();
         }

         public static TType Resolve<TType>() where TType : class