Added a fix to hopefully fix the MPNowPlaying

--- MusicPlayer.Apple/Playback/NativeTrackHandler.cs
+++ MusicPlayer.Apple/Playback/NativeTrackHandler.cs
@@ -31,9 +31,10 @@

 		MPNowPlayingInfo nowPlayingInfo;
 		MPMediaItemArtwork artwork;
-
+		Song currentSong;
 		public void UpdateSong (Song song)
 		{
+			currentSong = song;
 			if (song == null)
 				return;
 			try {
@@ -70,13 +71,21 @@
 		{
 			try {

-				if (nowPlayingInfo == null)
+				if (currentSong == null)
 					return;
 				if (Math.Abs(position.CurrentTime - lastTime) < 1)
 					return;
+
+				nowPlayingInfo = new MPNowPlayingInfo
+				{
+					Title = currentSong?.Name ?? "",
+					Artist = currentSong?.Artist ?? "",
+					AlbumTitle = currentSong?.Album ?? "",
+					Genre = currentSong?.Genre ?? "",
+					Artwork = artwork ?? CreateDefaultArtwork(),
+				};
+
 				lastTime = position.CurrentTime;
-				if (artwork != null && (int) lastTime%10 == 0)
-					nowPlayingInfo.Artwork = artwork;
 				nowPlayingInfo.ElapsedPlaybackTime = position.CurrentTime;
 				nowPlayingInfo.PlaybackDuration = position.Duration;
 				App.RunOnMainThread(() => MPNowPlayingInfoCenter.DefaultCenter.NowPlaying = nowPlayingInfo);


Fixed bug, _assemblyDict must be static

Fixed bug, _assemblyDict must be static

--- CopaceticSoftware.CodeGenerator.StarterKit/Infrastructure/VisualStudioSolution/MicrosoftBuildProjectAssemblyReferenceResolver.cs
+++ CopaceticSoftware.CodeGenerator.StarterKit/Infrastructure/VisualStudioSolution/MicrosoftBuildProjectAssemblyReferenceResolver.cs
@@ -36,14 +36,9 @@
     //Should be singleton
     public class MicrosoftBuildProjectAssemblyReferenceResolver : IMicrosoftBuildProjectAssemblyReferenceResolver
     {
-        private readonly ConcurrentDictionary<string, IUnresolvedAssembly> _assemblyDict;

-        public MicrosoftBuildProjectAssemblyReferenceResolver()
-        {
-            _assemblyDict =
+        private static readonly ConcurrentDictionary<string, IUnresolvedAssembly> _assemblyDict =
                 new ConcurrentDictionary<string, IUnresolvedAssembly>(Platform.FileNameComparer);
-        }
-

         public IEnumerable<IAssemblyReference> ResolveReferences(Project project, string projectFileName)
         {


Replaces <truncated> with <<truncated>> to be aligned with the <<tab>> syntax.

--- NFluent.35/Extensions/ExtensionsCommonHelpers.cs
+++ NFluent.35/Extensions/ExtensionsCommonHelpers.cs
@@ -92,7 +92,7 @@
         {
             if (result.Length > 197)
             {
-                result = result.Substring(0, 150) + "...<truncated>..."
+                result = result.Substring(0, 150) + "...<<truncated>>..."
                          + result.Substring(result.Length - 40);
             }


Added tests for SecuritySettings

Added tests for SecuritySettings

--- OpenIIoT.Core.Tests/Security/SecuritySettings.cs
+++ OpenIIoT.Core.Tests/Security/SecuritySettings.cs
@@ -48,9 +48,71 @@
                                                                                ▀████▀
                                                                                ▀▀                            */

+using System;
+using Xunit;
+
 namespace OpenIIoT.Core.Tests.Security
 {
-    class SecuritySettings
+    /// <summary>
+    ///     Unit tests for the <see cref="Core.Security.SecuritySettings"/> class.
+    /// </summary>
+    public class SecuritySettings
     {
+        #region Public Methods
+
+        /// <summary>
+        ///     Tests the <see cref="Core.Security.SecuritySettings.DefaultUser"/> property.
+        /// </summary>
+        [Fact]
+        public void DefaultUser()
+        {
+            string test = Core.Security.SecuritySettings.DefaultUser;
+
+            Assert.NotEqual(default(string), test);
+        }
+
+        /// <summary>
+        ///     Tests the <see cref="Core.Security.SecuritySettings.DefaultUserPasswordHash"/> property.
+        /// </summary>
+        [Fact]
+        public void DefaultUserPasswordHash()
+        {
+            string test = Core.Security.SecuritySettings.DefaultUserPasswordHash;
+
+            Assert.NotEqual(default(string), test);
+        }
+
+        /// <summary>
+        ///     Tests the <see cref="Core.Security.SecuritySettings.SessionLength"/> property.
+        /// </summary>
+        [Fact]
+        public void SessionLength()
+        {
+            int test = Core.Security.SecuritySettings.SessionLength;
+
+            Assert.NotEqual(default(int), test);
+        }
+
+        /// <summary>
+        ///     Tests the <see cref="Core.Security.SecuritySettings.SessionPurgeInterval"/> property.
+        /// </summary>
+        [Fact]
+        public void SessionPurgeInterval()
+        {
+            int test = Core.Security.SecuritySettings.SessionPurgeInterval;
+
+            Assert.NotEqual(default(int), test);
+        }
+
+        /// <summary>
+        ///     Tests the <see cref="Core.Security.SecuritySettings.SlidingSessions"/> property.
+        /// </summary>
+        [Fact]
+        public void SlidingSessions()
+        {
+            bool test = Core.Security.SecuritySettings.SlidingSessions;
+        }
+
+        #endregion Public Methods
     }
-}
+}


Guarding the new call to SetHeight in MakeRoot, so that ODE doesn't complain when it's 0.

--- OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -845,7 +845,7 @@
             AbsolutePosition = pos;

             AddToPhysicalScene(isFlying);
-            if (m_appearance != null)
+            if ((m_appearance != null) && (m_appearance.AvatarHeight > 0))
                 SetHeight(m_appearance.AvatarHeight);

             // Don't send an animation pack here, since on a region crossing this will sometimes cause a flying


llUnsit position fix 4063 (updated 11-20-2010)

--- OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -445,8 +445,33 @@
                 PhysicsActor actor = m_physicsActor;
                 if (actor != null)
                     m_pos = actor.Position;
-
-                return m_parentPosition + m_pos;
+                else                                                                        // OS Mantis #4063
+                {                                                                           // OS Mantis #4063
+                    // OpenSim Mantis #4063. Obtain the correct position of a seated avatar. In addition
+                    // to providing the correct position while the avatar is seated, this value will also
+                    // be used as the location to unsit to.
+                    //
+                    // If m_parentID is not 0, assume we are a seated avatar and we should return the
+                    // position based on the sittarget offset and rotation of the prim we are seated on.
+                    //
+                    // Generally, m_pos will contain the position of the avator in the sim unless the avatar
+                    // is on a sit target. While on a sit target, m_pos will contain the desired offset
+                    // without the parent rotation applied.
+                    if (m_parentID != 0)                                                    // OS Mantis #4063
+                    {
+                        SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID);      // OS Mantis #4063
+                        if (part != null)                                                   // OS Mantis #4063
+                        {                                                                   // OS Mantis #4064
+                            return m_parentPosition + (m_pos * part.GetWorldRotation());    // OS Mantis #4063
+                        }
+                        else                                                                // OS Mantis #4064
+                        {                                                                   // OS Mantis #4063
+                            return m_parentPosition + m_pos;                                // OS Mantis #4064
+                        }                                                                   // OS Mantis #4063
+                    }                                                                       // OS Mantis #4063
+                }                                                                           // OS Mantis #4063
+
+                return m_pos;                                                               // OS Mantis #4063
             }
             set
             {


use Vector3.normalize in place of util.GetNormalize

--- OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -530,11 +530,8 @@
             get
             {
                 Vector3 a = new Vector3(CameraAtAxis.X, CameraAtAxis.Y, 0);
-
-                if (a == Vector3.Zero)
-                    return a;
-
-                return Util.GetNormalizedVector(a);
+                a.Normalize();
+                return a;
             }
         }
         #endregion
@@ -1796,7 +1793,7 @@
                 {
                     look = Velocity;
                     look.Z = 0;
-                    look = Util.GetNormalizedVector(look);
+                    look.Normalize();
                     if ((Math.Abs(look.X) < 0.01) && (Math.Abs(look.Y) < 0.01) )
                         look = new Vector3(0.99f, 0.042f, 0);
                 }


Small CC fix

Small CC fix

--- OpenUtau.Plugin.Builtin/ENDeltaVer1Phonemizer.cs
+++ OpenUtau.Plugin.Builtin/ENDeltaVer1Phonemizer.cs
@@ -306,7 +306,9 @@
                             // like [C1C2][C3 ...]
                         } else if (!cc.First().Contains(cc[i + 1]) || !cc.First().Contains(cc[i + 2])) {
                             // like [C1][C2 ...]
-                            //TryAddPhoneme(phonemes, ending.tone, cc[i], $"{cc[i]} -");
+                            if (burstConsonants.Contains(cc[i])) {
+                                TryAddPhoneme(phonemes, ending.tone, cc[i], $"{cc[i]} -");
+                            }
                             TryAddPhoneme(phonemes, ending.tone, cc[i + 1], $"{cc[i + 1]} -");
                             TryAddPhoneme(phonemes, ending.tone, $"{cc[i + 2]} -", cc[i + 2]);
                             i++;
@@ -340,9 +342,6 @@
                                 phonemes.Remove(cc[0]);
                             }
                             TryAddPhoneme(phonemes, ending.tone, $"{cc[i + 1]} -", cc[i + 1]);
-                            if (!burstConsonants.Contains(cc[i])) {
-                                phonemes.Remove(cc[i]);
-                            }
                             i++;
                         }
                     }


added Rel

added Rel

--- Dragon/Source/BooleanExpr.cs
+++ Dragon/Source/BooleanExpr.cs
@@ -121,4 +121,27 @@
             return this.Op.ToString() + " " + RhsExpr.ToString();
         }
     }
+
+
+    public class Rel : Logical
+    {
+        public Rel(Token tok, Expr lhs, Expr rhs)
+            : base(tok, lhs, rhs)
+        { }
+
+        public Dragon.Type check(Dragon.Type lft, Dragon.Type rht)
+        {
+            if (lft is Array || rht is Array) return null;
+            else if (lft == rht) return Dragon.Type.Bool;
+            else return null;
+        }
+
+        public override void Jumping(int t, int f)
+        {
+            Expr lft = this.LhsExpr.Reduce();
+            Expr rht = this.RhsExpr.Reduce();
+            string test = lft.ToString() + " " + this.Op.ToString() + " " + rht.ToString();
+            this.EmitJumps(test, t, f);
+        }
+    }
 }


Add OriginalFilePath parameter to PalasoImage

--- PalasoUIWindowsForms/ImageToolbox/PalasoImage.cs
+++ PalasoUIWindowsForms/ImageToolbox/PalasoImage.cs
@@ -139,6 +139,14 @@
 			};
 			i.Metadata = Metadata.FromFile(path);
 			return i;
+		}
+
+		/// <summary>
+		/// will be set if this was created using FromFile
+		/// </summary>
+		public string OriginalFilePath
+		{
+			get { return _pathForSavingMetadataChanges; }
 		}

 		/*


Added Remarks field to UserAccount model.

--- PocketHub.Server.Lib/UserAccounts/UserAccount.cs
+++ PocketHub.Server.Lib/UserAccounts/UserAccount.cs
@@ -10,6 +10,7 @@
         public string        ShortName      { get; set; }
         public bool          IsBlocked      { get; set; }
         public string        SaltedKeyHash  { get; set; }
+        public string        Remarks        { get; set; }
         public List<string>  Roles          { get; set; }
     }
 }


Make sure we save queries where appropriate even if they return cached results (http://meta.stackoverflow.com/q/107076)

--- App/StackExchange.DataExplorer/Helpers/QueryRunner.cs
+++ App/StackExchange.DataExplorer/Helpers/QueryRunner.cs
@@ -191,16 +191,24 @@
             return json;
         }

-        public static string GetCachedResults(ParsedQuery query, Site site)
-        {
-            CachedResult row = Current.DB.CachedResults
-                .Where(result => result.QueryHash == query.ExecutionHash && result.SiteId == site.Id)
-                .FirstOrDefault();
-            string results = null;
-            if (row != null)
-            {
-                results = row.Results;
-            }
+        public static QueryResults GetCachedResults(ParsedQuery query, Site site)
+        {
+            CachedResult cache = Current.DB.Query<Models.CachedResult>(
+                "SELECT * FROM CachedResults WHERE QueryHash = @hash AND SiteId = @siteId",
+                new
+                {
+                    hash = query.ExecutionHash,
+                    siteId = site.Id
+                }
+            ).FirstOrDefault();
+
+            QueryResults results = null;
+
+            if (cache != null && cache.Results != null)
+            {
+                results = QueryResults.FromJson(cache.Results);
+            }
+
             return results;
         }

@@ -503,23 +511,26 @@
         public static string GetJson(ParsedQuery parsedQuery, Site site, User user, bool IncludeExecutionPlan)
         {
             DBContext db = Current.DB;
-            UpdateSavedQuery(user, parsedQuery);
-
-            var cachedJson = GetCachedResults(parsedQuery, site);
-            if (cachedJson != null)
+
+            var cache = GetCachedResults(parsedQuery, site);
+
+            VerifyQueryState(parsedQuery, cache, user);
+
+            if (cache != null)
             {
                 if (!IncludeExecutionPlan)
                 {
-                    return cachedJson;
+                    return cache.ToJson();
                 }
                 else
                 {
                     var plan = GetCachedPlan(parsedQuery, site);
+
                     if (plan != null)
                     {
-                        var queryResults = QueryResults.FromJson(cachedJson);
-                        queryResults.ExecutionPlan = plan.Plan;
-                        return queryResults.ToJson();
+                        cache.ExecutionPlan = plan.Plan;
+
+                        return cache.ToJson();
                     }
                 }
             }
@@ -527,10 +538,12 @@
             QueryResults results = ExecuteNonCached(parsedQuery, site, user, IncludeExecutionPlan);

             string json = results.ToJson();
-            if (cachedJson == null)
+
+            if (cache == null)
             {
                 AddResultToCache(json, parsedQuery, site, db, IncludeExecutionPlan);
             }
+
             if (IncludeExecutionPlan)
             {
                 db.CachedPlans.InsertOnSubmit(new CachedPlan()
@@ -546,6 +559,97 @@

             // well there is an annoying XSS condition here
             return json.Replace("/", "\\/");
+        }
+
+        /// <summary>
+        /// Verifies that the cached set of results are correct for this particular query,
+        /// addressing the case where many queries may produce the same execution SQL, but may
+        /// have differing parameter names.
+        /// </summary>
+        /// <param name="parsedQuery">The current query that produces the results in the
+        /// cache</param>
+        /// <param name="cache">The cached results for a query semantically equivalent to the
+        /// provided one</param>
+        /// <param name="user"></param>
+        private static void VerifyQueryState(ParsedQuery parsedQuery, QueryResults cache, User user)
+        {
+            Query query = Current.DB.Query<Query>(
+                "SELECT * FROM Queries WHERE QueryHash = @hash",
+                new
+                {
+                    hash = parsedQuery.Hash
+                }
+            ).FirstOrDefault();
+
+            // Check if the parsed query is actually responsible for this cache
+            if (cache != null)
+            {
+                int id;
+
+                // If the query doesn't exist, now is the only time it'll get created since it
+                // corresponds to a pre-existing cache result (but isn't actually what generated
+                // the result set)
+                if (query == null)
+                {
+                    id = (int)Current.DB.Query<decimal>(@"
+                        INSERT INTO Queries(
+                            CreatorId, CreatorIP, FirstRun, Name,
+                            Description, QueryBody, QueryHash, Views
+                        ) VALUES(
+                            @CreatorId, @CreatorIP, @FirstRun, @Name,
+                            @Description, @QueryBody, @QueryHash, @Views
+                        )
+
+                        SELECT SCOPE_IDENTITY()",
+                        new
+                        {
+                            CreatorId = user.IsAnonymous ? (int?)null : user.Id,
+                            CreatorIP = user.IPAddress,
+                            FirstRun = DateTime.UtcNow,
+                            Name = parsedQuery.Name,
+                            Description = parsedQuery.Description,
+                            QueryBody = parsedQuery.RawSql,
+                            QueryHash = parsedQuery.Hash,
+                            Views = 0
+                        }
+                    ).First();
+                }
+                else
+                {
+                    id = query.Id;
+                }
+
+                // Update the cache's query ID to lie to the client that these results came from
+                // this specific query
+                if (id != cache.QueryId)
+                {
+                    cache.QueryId = id;
+                }
+            }
+
+            // Update the important bits of the query if we didn't just insert it, provided that
+            // the user isn't anonymous.
+            if (query != null && !user.IsAnonymous)
+            {
+                // Save ourselves the trouble of updating if nothing's changed
+                if (query.Name != parsedQuery.Name || query.Description != parsedQuery.Description || query.QueryBody != query.QueryBody)
+                {
+                    Current.DB.Execute(@"
+                        UPDATE Queries SET
+                            Name = @name,
+                            Description = @description,
+                            QueryBody = @sql
+                        WHERE QueryHash = @hash",
+                        new
+                        {
+                            name = parsedQuery.Name,
+                            description = parsedQuery.Description,
+                            sql = parsedQuery.RawSql,
+                            hash = parsedQuery.Hash
+                        }
+                    );
+                }
+            }
         }

         /// <summary>
@@ -571,29 +675,6 @@
                 CreationDate = DateTime.UtcNow
             };
             db.CachedResults.InsertOnSubmit(cache);
-        }
-
-        /// <summary>
-        /// Updates a saved query if it exists and the user is not anonymous.
-        /// </summary>
-        private static void UpdateSavedQuery(User user, ParsedQuery parsedQuery)
-        {
-            DBContext db = Current.DB;
-
-            // update the query if its not anon
-            if (!user.IsAnonymous)
-            {
-                Query query = db.Queries
-                    .Where(q => q.QueryHash == parsedQuery.Hash)
-                    .FirstOrDefault();
-                if (query != null)
-                {
-                    query.Description = parsedQuery.Description;
-                    query.Name = parsedQuery.Name;
-                    query.QueryBody = parsedQuery.RawSql;
-                    db.SubmitChanges();
-                }
-            }
         }

         private static void ProcessMagicColumns(QueryResults results, SqlConnection cnn)


#13474 #13479 Additional info for on-demand request

--- SnapMD.VirtualCare.ApiModels/OnDemandIntakeRequest.cs
+++ SnapMD.VirtualCare.ApiModels/OnDemandIntakeRequest.cs
@@ -70,5 +70,10 @@
         /// PatientQueueId
         /// </summary>
         public Guid? PatientQueueId { get; set; }
+
+        /// <summary>
+        /// Service type. May be null, so default type would be chosen
+        /// </summary>
+        public int? ServiceTypeId { get; set; }
     }
 }


bugfix in TcpSocketClient

bugfix in TcpSocketClient

--- Sockets/Sockets.Implementation.NET/TcpSocketClient.cs
+++ Sockets/Sockets.Implementation.NET/TcpSocketClient.cs
@@ -85,6 +85,9 @@
             else
                 canceller.Dispose();

+            if (okOrCancelled.IsFaulted)
+                throw okOrCancelled.Exception.InnerException;
+
             InitializeWriteStream();

             if (secure)


Added shared material color change

Added shared material color change

--- Assets/Rhythmify_Scripts/rhythmObject/ChangeColors.cs
+++ Assets/Rhythmify_Scripts/rhythmObject/ChangeColors.cs
@@ -13,6 +13,7 @@
         public ColorTransition[] colorTransitions;
         public int[] indices;
         public int offset;
+        public bool shared;

         override protected void rhythmUpdate(int beat) {
             int size = colorTransitions.Length;
@@ -36,7 +37,12 @@
                 StartCoroutine(changeSmooth(t.startColor, t.endColor, secondsPerBeat));
             }
             else {
-                renderer.material.color = t.endColor;
+                if (shared) {
+                    renderer.sharedMaterial.color = t.endColor;
+                }
+                else {
+                    renderer.material.color = t.endColor;
+                }
             }
         }

@@ -44,7 +50,12 @@
             float startTime = Time.time;
             while (Time.time <= startTime + duration) {
                 float lerpPercent = Mathf.Clamp01((Time.time - startTime) / duration);
-                renderer.material.color = Color.Lerp(startColor, endColor, lerpPercent);
+                if (shared) {
+                    renderer.sharedMaterial.color = Color.Lerp(startColor, endColor, lerpPercent);
+                }
+                else {
+                    renderer.material.color = Color.Lerp(startColor, endColor, lerpPercent);
+                }
                 yield return null;
             }
         }


Remove extra blank lines

Remove extra blank lines

--- Assets/Scenes/Starport/Scripts/PersonnelController.cs
+++ Assets/Scenes/Starport/Scripts/PersonnelController.cs
@@ -442,7 +442,6 @@
 			gameObjectIsVisible[ (int) GameObjects.BioValuesText ] = true;
 		}

-
 		// if the previous button is currently selected and we are going to disable it, select the exit button
 		if ( !buttonIsInteractable[ (int) Buttons.PreviousButton ] )
 		{
@@ -451,7 +450,6 @@
 				m_exitButton.Select();
 			}
 		}
-

 		// if the next button is currently selected and we are going to disable it, select the exit button
 		if ( !buttonIsInteractable[ (int) Buttons.NextButton ] )


[NavigationService] Fixed according to latest changes for release v2.

--- Source/GSoft.Dynamite/Navigation/NavigationService.cs
+++ Source/GSoft.Dynamite/Navigation/NavigationService.cs
@@ -131,7 +131,7 @@
         private IEnumerable<NavigationNode> GetNavigationNodeItems(NavigationManagedProperties properties, SPContentTypeId filteredContentTypeId, string term)
         {
             // Use 'all menu items' result source for search query
-            var searchResultSource = this.searchHelper.GetResultSourceByName(properties.ResultSourceName, SPContext.Current.Site, SearchObjectLevel.Ssa);
+            var searchResultSource = this.searchHelper.GetResultSourceByName(SPContext.Current.Site, properties.ResultSourceName, SearchObjectLevel.Ssa);

             // Check if find result source
             if (searchResultSource == null)


Make reference counted pool more thread safe.

--- Source/HelixToolkit.SharpDX.Shared/Utilities/Pools.cs
+++ Source/HelixToolkit.SharpDX.Shared/Utilities/Pools.cs
@@ -68,17 +68,23 @@
                 {
                     if (!pool_.TryGetValue(key, out objOut))
                     {
-                        objOut = pool_.GetOrAdd(key, (k) => OnCreate(ref k, ref argument));
-                        if (objOut == null)
+                        lock (pool_)
                         {
-                            pool_.TryRemove(key, out objOut);
-                            return false;
+                            if (!pool_.TryGetValue(key, out objOut))
+                            {
+                                objOut = pool_.GetOrAdd(key, (k) => OnCreate(ref k, ref argument));
+                                if (objOut == null)
+                                {
+                                    pool_.TryRemove(key, out objOut);
+                                    return false;
+                                }
+                                objOut.AddBackToPool = Item_AddBackToPool;
+                                objOut.Disposing += (s, e) =>
+                                {
+                                    pool_.TryRemove(key, out var val);
+                                };
+                            }
                         }
-                        objOut.AddBackToPool = Item_AddBackToPool;
-                        objOut.Disposing += (s, e) =>
-                        {
-                            pool_.TryRemove(key, out var val);
-                        };
                     }
                     if (objOut == null)
                     {


In EmailWriter, modified call to ThreadPool.RegisterWaitForSingleObject so that the callback can unregister the registered wait handle.

git-tfs-id: [https://tfs.codeplex.com/tfs/TFS07]$/openXDA/Main;C96937

--- Source/Libraries/FaultData/DataWriters/EmailWriter.cs
+++ Source/Libraries/FaultData/DataWriters/EmailWriter.cs
@@ -36,6 +36,7 @@
 using FaultData.Database.FaultLocationDataTableAdapters;
 using FaultData.Database.MeterDataTableAdapters;
 using FaultData.DataSets;
+using GSF;
 using GSF.Collections;
 using log4net;
 using Series = System.Windows.Forms.DataVisualization.Charting.Series;
@@ -230,20 +231,26 @@

             ProcessQueue.Add(() =>
             {
+                EventArgs<RegisteredWaitHandle> args;
                 ManualResetEvent waitHandle;
                 WaitOrTimerCallback callback;

+                args = new EventArgs<RegisteredWaitHandle>(null);
                 waitHandle = new ManualResetEvent(false);

                 callback = (state, timedOut) =>
                 {
+                    DequeueEventID(eventID);
+
+                    if ((object)args.Argument != null)
+                        args.Argument.Unregister(null);
+
                     waitHandle.Dispose();
-                    DequeueEventID(eventID);
                 };

                 QueuedEventIDs.Add(eventID);

-                ThreadPool.RegisterWaitForSingleObject(waitHandle, callback, null, s_waitPeriod, true);
+                args.Argument = ThreadPool.RegisterWaitForSingleObject(waitHandle, callback, null, s_waitPeriod, true);
             });
         }


Fix NullReferenceExceptions in OIDCSecurityProvider.Authenticate()

--- Source/Libraries/GSF.Security/OIDCSecurityProvider.cs
+++ Source/Libraries/GSF.Security/OIDCSecurityProvider.cs
@@ -272,7 +272,7 @@

             try
             {
-                RequestToken(UserData.Username);
+                RequestToken(base.UserData.Username);

                 if (UserData.Roles.Count == 0)
                 {
@@ -516,7 +516,7 @@
                 return;

             // Already have token for this user, do not re-initialize user data
-            if (UserData.Token is not null)
+            if (UserData?.Token is not null)
                 return;

             m_clientRequestUri = "";


Properties collapsed by VisibleBy no longer affect the shared label column width

--- Source/PropertyTools.Wpf/PropertyGrid/PropertyGrid.cs
+++ Source/PropertyTools.Wpf/PropertyGrid/PropertyGrid.cs
@@ -1563,6 +1563,11 @@
                 propertyPanel.SetBinding(
                     VisibilityProperty,
                     new Binding(pi.IsVisibleDescriptor.Name) { Converter = BoolToVisibilityConverter });
+
+                if (this.LabelWidthSharing != LabelWidthSharing.NotShared)
+                {
+                    propertyPanel.IsVisibleChanged += (s, e) => ((Grid)s).ColumnDefinitions[0].SharedSizeGroup = ((bool)e.NewValue) ? "labelColumn" : null;
+                }
             }

             if (this.EnableLabelWidthResizing && pi.HeaderPlacement == HeaderPlacement.Left)
@@ -1576,6 +1581,7 @@
                             Focusable = false
                         });
             }
+

             panel.Children.Add(propertyPanel);
         }


fixing some grammatic errors

fixing some grammatic errors

--- Source/Toolkit/SharpDX.Toolkit.Graphics/Buffer.Raw.cs
+++ Source/Toolkit/SharpDX.Toolkit.Graphics/Buffer.Raw.cs
@@ -33,7 +33,7 @@
         public static class Raw
         {
             /// <summary>
-            /// Creates a new Raw buffer <see cref="ResourceUsage.Default" /> uasge.
+            /// Creates a new Raw buffer <see cref="ResourceUsage.Default" /> usage.
             /// </summary>
             /// <param name="device">The <see cref="GraphicsDevice"/>.</param>
             /// <param name="size">The size in bytes.</param>
@@ -46,7 +46,7 @@
             }

             /// <summary>
-            /// Creates a new Raw buffer <see cref="ResourceUsage.Default"/> uasge.
+            /// Creates a new Raw buffer <see cref="ResourceUsage.Default"/> usage.
             /// </summary>
             /// <typeparam name="T">Type of the Raw buffer to get the sizeof from</typeparam>
             /// <param name="device">The <see cref="GraphicsDevice"/>.</param>
@@ -59,7 +59,7 @@
             }

             /// <summary>
-            /// Creates a new Raw buffer <see cref="ResourceUsage.Default"/> uasge.
+            /// Creates a new Raw buffer <see cref="ResourceUsage.Default"/> usage.
             /// </summary>
             /// <typeparam name="T">Type of the Raw buffer to get the sizeof from</typeparam>
             /// <param name="device">The <see cref="GraphicsDevice"/>.</param>
@@ -73,7 +73,7 @@
             }

             /// <summary>
-            /// Creates a new Raw buffer <see cref="ResourceUsage.Default"/> uasge.
+            /// Creates a new Raw buffer <see cref="ResourceUsage.Default"/> usage.
             /// </summary>
             /// <typeparam name="T">Type of the Raw buffer to get the sizeof from</typeparam>
             /// <param name="device">The <see cref="GraphicsDevice"/>.</param>
@@ -87,7 +87,7 @@
             }

             /// <summary>
-            /// Creates a new Raw buffer <see cref="ResourceUsage.Default"/> uasge.
+            /// Creates a new Raw buffer <see cref="ResourceUsage.Default"/> usage.
             /// </summary>
             /// <param name="device">The <see cref="GraphicsDevice"/>.</param>
             /// <param name="value">The value to initialize the Raw buffer.</param>
@@ -100,4 +100,4 @@
             }
         }
     }
-}+}


Enable SqlFunctions handling in projection

--- BlueBoxSharp.Data/Expressions/ProjectionExpression.cs
+++ BlueBoxSharp.Data/Expressions/ProjectionExpression.cs
@@ -202,11 +202,16 @@

         private IEnumerable<ProjectionItem> FindProjection(MethodCallExpression expression, MemberInfo member)
         {
-            if (expression.Object != null && expression.Object.NodeType != ExpressionType.Constant)
-                yield return new ProjectionItem(expression.Object, member, "Extent" + this._index++);
-
-            foreach (Expression expr in expression.Arguments)
-                yield return new ProjectionItem(expr, member, "Extent" + this._index++);
+            if (expression.Method.DeclaringType == typeof(SqlFunctions))
+                yield return new ProjectionItem(expression, member, "Extent" + this._index++);
+            else
+            {
+                if (expression.Object != null && expression.Object.NodeType != ExpressionType.Constant)
+                    yield return new ProjectionItem(expression.Object, member, "Extent" + this._index++);
+
+                foreach (Expression expr in expression.Arguments)
+                    yield return new ProjectionItem(expr, member, "Extent" + this._index++);
+            }
         }

         private IEnumerable<ProjectionItem> FindProjection(ExistsExpression expression, MemberInfo member)


Make camera detection retry if no cameras are found

--- BulletTime.Client/ViewModels/CameraClientViewModel.cs
+++ BulletTime.Client/ViewModels/CameraClientViewModel.cs
@@ -1,5 +1,11 @@
-using System;
+using BulletTime.Controllers;
+using BulletTime.Models;
+using BulletTime.RemoteControl;
+using BulletTime.UI;
+using System;
 using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
 using System.Threading.Tasks;
 using System.Windows.Input;
 using Windows.Devices.Enumeration;
@@ -9,10 +15,6 @@
 using Windows.UI.Xaml;
 using Windows.UI.Xaml.Data;
 using Windows.UI.Xaml.Media;
-using BulletTime.Controllers;
-using BulletTime.Models;
-using BulletTime.RemoteControl;
-using BulletTime.UI;

 namespace BulletTime.ViewModels
 {
@@ -69,8 +71,35 @@

         public async void Initialize()
         {
-            Cameras.Source = await CameraController.GetCameras();
+            await DetectCameras();
             await _remote.Initialize();
+        }
+
+        private async Task DetectCameras()
+        {
+            Debug.WriteLine("Detecting Cameras");
+            if (!Dispatcher.HasThreadAccess)
+            {
+                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => { await DetectCameras(); });
+                return;
+            }
+
+            if (this.SelectedCamera.Value == null)
+            {
+                var cameras = await CameraController.GetCameras();
+
+                if (!cameras.Any())
+                {
+                    var t = Task.Run(async () =>
+                    {
+                        await Task.Delay(TimeSpan.FromSeconds(2));
+                        await DetectCameras();
+
+                    });
+                };
+
+                Cameras.Source = cameras;
+            }
         }

         private async void SelectedCameraChanged(IProperty obj)


Better tests logging

Better tests logging

--- tests/RecoveryTest.cs
+++ tests/RecoveryTest.cs
@@ -399,6 +399,7 @@
             // generate messages with 100ms interval in 10 threads
             //
             var sentMsgs = new List<Message>();
+            _log.Info("Start sending");
             var senders = Enumerable.Range(1, 1).
                 Select(thread => Observable.
                     Interval(TimeSpan.FromMilliseconds(10)).
@@ -428,15 +429,22 @@
                 ToArray();

             // wait for around 10K messages (10K/(10*10) = 100sec) and close producer
+            _log.Info("Waiting for producer to produce enough...");
             Thread.Sleep(100*1000);
+            _log.Info("Closing senders intervals");
             senders.ForEach(s => s.Dispose());
+            _log.Info("Closing producer");
             producer.Close().Wait();

             // wait for 3 sec for listener to catch up
+            _log.Info("Waiting for additional 3sec");
             Thread.Sleep(3*1000);

+            _log.Info("Disposing consumer");
             consumerSubscription.Dispose();
+            _log.Info("Closing consumer");
             await consumer.CloseAsync(TimeSpan.FromSeconds(4));
+            _log.Info("Done with networking");

             // compare sent and received messages
             // TODO: for some reason preformance is not what I'd expect it to be and only 6K is generated.


Sync kerbal lamp state

Sync kerbal lamp state

--- Client/Systems/VesselProtoSys/ProtoToKerbalRefresh.cs
+++ Client/Systems/VesselProtoSys/ProtoToKerbalRefresh.cs
@@ -100,7 +100,8 @@
                         var lampValStr = moduleSnapshot.moduleValues.GetValue("lampOn");
                         if (bool.TryParse(lampValStr, out var lampVal) && currentEva.lampOn != lampVal)
                         {
-                            currentEva.ToggleLamp();
+                            currentEva.lampOn = lampVal;
+                            currentEva.headLamp.SetActive(lampVal);
                         }
                     }


Updates to bayazit

Updates to bayazit

--- SourceFiles/Common/Decomposition/BayazitDecomposer.cs
+++ SourceFiles/Common/Decomposition/BayazitDecomposer.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Diagnostics;
 using FarseerPhysics.Common.PolygonManipulation;
 using Microsoft.Xna.Framework;

@@ -8,6 +9,12 @@

     /// <summary>
     /// Convex decomposition algorithm created by Mark Bayazit (http://mnbayazit.com/)
+    ///
+    /// Properties:
+    /// - Tries to decompose using polygons instead of triangles.
+    /// - Tends to produce optimal results with low processing time.
+    /// - Running time is O(nr), n = number of vertices, r = reflex vertices.
+    ///
     /// For more information about this algorithm, see http://mnbayazit.com/406/bayazit
     /// </summary>
     public static class BayazitDecomposer
@@ -35,12 +42,11 @@
         /// <summary>
         /// Decompose the polygon into several smaller non-concave polygon.
         /// If the polygon is already convex, it will return the original polygon, unless it is over Settings.MaxPolygonVertices.
-        /// Precondition: Counter Clockwise polygon
         /// </summary>
         public static List<Vertices> ConvexPartition(Vertices vertices)
         {
-            //We force it to CCW as it is a precondition in this algorithm.
-            vertices.ForceCounterClockWise();
+            //We check for counter clockwise vertices, as it is a precondition in this algorithm.
+            Debug.Assert(vertices.IsCounterClockWise(), "The polygon is not counter clockwise. This is needed for Bayazit to work correctly.");

             List<Vertices> list = new List<Vertices>();
             Vector2 lowerInt = new Vector2();
@@ -59,8 +65,7 @@
                         // if line intersects with an edge
                         float d;
                         Vector2 p;
-                        if (Left(At(i - 1, vertices), At(i, vertices), At(j, vertices)) &&
-                            RightOn(At(i - 1, vertices), At(i, vertices), At(j - 1, vertices)))
+                        if (Left(At(i - 1, vertices), At(i, vertices), At(j, vertices)) && RightOn(At(i - 1, vertices), At(i, vertices), At(j - 1, vertices)))
                         {
                             // find the point of intersection
                             p = LineTools.LineIntersect(At(i - 1, vertices), At(i, vertices), At(j, vertices), At(j - 1, vertices));
@@ -196,16 +201,15 @@
             {
                 if ((k + 1) % vertices.Count == i || k == i || (k + 1) % vertices.Count == j || k == j)
                     continue; // ignore incident edges
-
+
                 Vector2 intersectionPoint;
-
+
                 if (LineTools.LineIntersect(At(i, vertices), At(j, vertices), At(k, vertices), At(k + 1, vertices), out intersectionPoint))
                     return false;
             }
             return true;
         }

-        // precondition: ccw
         private static bool Reflex(int i, Vertices vertices)
         {
             return Right(i, vertices);


windows-31j encoding maped to CP 932 - Japanese (Shift-JIS)

--- SpssLib/FileParser/Records/CharacterEncodingRecord.cs
+++ SpssLib/FileParser/Records/CharacterEncodingRecord.cs
@@ -86,6 +86,12 @@
                 if (info != null)
                     return info.GetEncoding();
             }
+
+            if (strEncoding.Equals("windows-31j", StringComparison.InvariantCultureIgnoreCase))
+            {
+                // 932 - Japanese (Shift-JIS)
+                return Encoding.GetEncoding(932);
+            }

             throw new SpssFileFormatException("Encoding not recognized: " + strEncoding);
         }


Simplified ordering code using LINQ expression.

--- SquishIt.Framework/Directories/DirectoryEnumerator.cs
+++ SquishIt.Framework/Directories/DirectoryEnumerator.cs
@@ -21,11 +21,11 @@

         public IEnumerable<string> GetFiles(string path)
         {
-        	var files = directory.GetFiles(path, "*.js")
-				.Where(file => !file.EndsWith("-vsdoc.js", StringComparison.OrdinalIgnoreCase))
-				.ToArray();
+            var files = directory.GetFiles(path, "*.js")
+                .Where(file => !file.EndsWith("-vsdoc.js", StringComparison.OrdinalIgnoreCase))
+                .ToArray();

-			var ordering = GetOrdering(path);
+            var ordering = GetOrdering(path);
             if (ordering.Count <= 0)
             {
                 return files;
@@ -42,48 +42,43 @@
         private static IEnumerable<string> OrderFiles(IEnumerable<string> ordering,
             IEnumerable<string> files)
         {
-            var result = new List<string>();
-            foreach (string order in ordering)
-            {
-                foreach (string file in files)
-                {
-                    string fileName = Path.GetFileName(file);
-                    if (!String.IsNullOrEmpty(fileName) &&
-                        fileName.Equals(order, StringComparison.OrdinalIgnoreCase))
-                    {
-                        result.Add(file);
-                    }
-                }
-            }
-            return result;
+            var orderedFiles =
+                from order in ordering
+                from file in files
+                let fileName = Path.GetFileName(file)
+                where !String.IsNullOrEmpty(fileName)
+                    && fileName.Equals(order, StringComparison.OrdinalIgnoreCase)
+                select file;
+
+            return orderedFiles;
         }

         private static List<string> GetOrdering(string path)
         {
-			var orderingFile = Path.Combine(path, "ordering.txt");
-			if (!File.Exists(orderingFile))
+            var orderingFile = Path.Combine(path, "ordering.txt");
+            if (!File.Exists(orderingFile))
             {
-            	return new List<string>();
+                return new List<string>();
             }

-			return ReadOrderingFile(orderingFile);
+            return ReadOrderingFile(orderingFile);
         }

-		private static List<string> ReadOrderingFile(string orderingFile)
-		{
-			var ordering = new List<string>();
-			using (var sr = new StreamReader(orderingFile))
-			{
-				for (string entry = sr.ReadLine(); entry != null; entry = sr.ReadLine())
-				{
-					entry = entry.Trim();
-					if (!String.IsNullOrEmpty(entry))
-					{
-						ordering.Add(entry);
-					}
-				}
-			}
-			return ordering;
-		}
-	}
+        private static List<string> ReadOrderingFile(string orderingFile)
+        {
+            var ordering = new List<string>();
+            using (var sr = new StreamReader(orderingFile))
+            {
+                for (string entry = sr.ReadLine(); entry != null; entry = sr.ReadLine())
+                {
+                    entry = entry.Trim();
+                    if (!String.IsNullOrEmpty(entry))
+                    {
+                        ordering.Add(entry);
+                    }
+                }
+            }
+            return ordering;
+        }
+    }
 }


allow matches on the abstract attribute blueprint to be overridden

--- Construktion/Blueprints/AbstractAttributeBlueprint.cs
+++ Construktion/Blueprints/AbstractAttributeBlueprint.cs
@@ -10,13 +10,13 @@
             return (T) context.PropertyContext.GetAttributes(typeof(T)).First();
         }

-        public bool Matches(ConstruktionContext context)
+        public virtual bool Matches(ConstruktionContext context)
         {
             return context.PropertyContext.GetAttributes(typeof(T))
-                        .ToList()
-                        .Any();
+                .ToList()
+                .Any();
         }

         public abstract object Construct(ConstruktionContext context, ConstruktionPipeline pipeline);
     }
-}+}


WIP Test Milestone 1.2

WIP Test Milestone 1.2

--- RDFSharp.Test/Model/Serializers/RDFTurtleTest.cs
+++ RDFSharp.Test/Model/Serializers/RDFTurtleTest.cs
@@ -4612,6 +4612,230 @@
             Assert.IsTrue(graph.Single().Object.Equals(new RDFTypedLiteral("-2.02E5", RDFModelEnums.RDFDatatypes.XSD_DOUBLE)));
         }

+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPOTriplesHavingSameSubject()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> <http://pred1/> <http://obj1/>;{Environment.NewLine}<http://pred2/> <http://obj2/>.");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), new RDFResource("http://pred1/"), new RDFResource("http://obj1/"))));
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), new RDFResource("http://pred2/"), new RDFResource("http://obj2/"))));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPOTriplesHavingSameSubjectAndUsingRegisteredNamespaceInSubject()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}rdf:Alt <http://pred1/> <http://obj1/>;{Environment.NewLine}<http://pred2/> <http://obj2/>.");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(RDFVocabulary.RDF.ALT, new RDFResource("http://pred1/"), new RDFResource("http://obj1/"))));
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(RDFVocabulary.RDF.ALT, new RDFResource("http://pred2/"), new RDFResource("http://obj2/"))));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPOTriplesHavingSameSubjectAndUsingRegisteredNamespaceInPredicate()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> rdf:Alt <http://obj1/>;{Environment.NewLine}rdf:Bag <http://obj2/>.");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.ALT, new RDFResource("http://obj1/"))));
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.BAG, new RDFResource("http://obj2/"))));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPOTriplesHavingSameSubjectAndUsingFirstTypeInPredicate()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> a <http://obj1/>;{Environment.NewLine}rdf:Bag <http://obj2/>.");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.TYPE, new RDFResource("http://obj1/"))));
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.BAG, new RDFResource("http://obj2/"))));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPOTriplesHavingSameSubjectAndUsingLastTypeInPredicate()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> rdf:Alt <http://obj1/>;{Environment.NewLine}a <http://obj2/>.");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.ALT, new RDFResource("http://obj1/"))));
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.TYPE, new RDFResource("http://obj2/"))));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPOTriplesHavingSameSubjectAndUsingRegisteredNamespaceInObject()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> <http://pred1/> rdf:Alt;{Environment.NewLine}<http://pred2/> rdf:Bag.");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), new RDFResource("http://pred1/"), RDFVocabulary.RDF.ALT)));
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), new RDFResource("http://pred2/"), RDFVocabulary.RDF.BAG)));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPBTriplesHavingSameSubject()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> <http://pred1/> _:12345;{Environment.NewLine}<http://pred2/> _:54321.");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), new RDFResource("http://pred1/"), new RDFResource("bnode:12345"))));
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), new RDFResource("http://pred2/"), new RDFResource("bnode:54321"))));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPBTriplesHavingSameSubjectAndUsingRegisteredNamespaceInSubject()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}rdf:Alt <http://pred1/> _:12345;{Environment.NewLine}<http://pred2/> _:54321.");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(RDFVocabulary.RDF.ALT, new RDFResource("http://pred1/"), new RDFResource("bnode:12345"))));
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(RDFVocabulary.RDF.ALT, new RDFResource("http://pred2/"), new RDFResource("bnode:54321"))));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPBTriplesHavingSameSubjectAndUsingRegisteredNamespaceInPredicate()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> rdf:Alt _:12345;{Environment.NewLine}rdf:Bag _:54321.");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.ALT, new RDFResource("bnode:12345"))));
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.BAG, new RDFResource("bnode:54321"))));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPBTriplesHavingSameSubjectAndUsingFirstTypeInPredicate()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> a _:12345;{Environment.NewLine}rdf:Bag _:54321.");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.TYPE, new RDFResource("bnode:12345"))));
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.BAG, new RDFResource("bnode:54321"))));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPBTriplesHavingSameSubjectAndUsingLastTypeInPredicate()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> rdf:Alt _:12345;{Environment.NewLine}a _:54321.");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.ALT, new RDFResource("bnode:12345"))));
+            Assert.IsTrue(graph.ContainsTriple(new RDFTriple(new RDFResource("http://subj/"), RDFVocabulary.RDF.TYPE, new RDFResource("bnode:54321"))));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPBAnonymousTriplesHavingSameSubject()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> <http://pred1/> [];{Environment.NewLine}<http://pred2/> [].");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.Any(t => t.Subject.Equals(new RDFResource("http://subj/")) && t.Predicate.Equals(new RDFResource("http://pred1/")) && t.Object is RDFResource objRes && objRes.IsBlank));
+            Assert.IsTrue(graph.Any(t => t.Subject.Equals(new RDFResource("http://subj/")) && t.Predicate.Equals(new RDFResource("http://pred2/")) && t.Object is RDFResource objRes && objRes.IsBlank));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPBAnonymousTriplesHavingSameSubjectAndUsingRegisteredNamespaceInSubject()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}rdf:Alt <http://pred1/> [];{Environment.NewLine}<http://pred2/> [].");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.Any(t => t.Subject.Equals(RDFVocabulary.RDF.ALT) && t.Predicate.Equals(new RDFResource("http://pred1/")) && t.Object is RDFResource objRes && objRes.IsBlank));
+            Assert.IsTrue(graph.Any(t => t.Subject.Equals(RDFVocabulary.RDF.ALT) && t.Predicate.Equals(new RDFResource("http://pred2/")) && t.Object is RDFResource objRes && objRes.IsBlank));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPBAnonymousTriplesHavingSameSubjectAndUsingRegisteredNamespaceInPredicate()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> rdf:Alt [];{Environment.NewLine}rdf:Bag [].");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.Any(t => t.Subject.Equals(new RDFResource("http://subj/")) && t.Predicate.Equals(RDFVocabulary.RDF.ALT) && t.Object is RDFResource objRes && objRes.IsBlank));
+            Assert.IsTrue(graph.Any(t => t.Subject.Equals(new RDFResource("http://subj/")) && t.Predicate.Equals(RDFVocabulary.RDF.BAG) && t.Object is RDFResource objRes && objRes.IsBlank));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPBAnonymousTriplesHavingSameSubjectAndUsingFirstTypeInPredicate()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> a [];{Environment.NewLine}rdf:Bag [].");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.Any(t => t.Subject.Equals(new RDFResource("http://subj/")) && t.Predicate.Equals(RDFVocabulary.RDF.TYPE) && t.Object is RDFResource objRes && objRes.IsBlank));
+            Assert.IsTrue(graph.Any(t => t.Subject.Equals(new RDFResource("http://subj/")) && t.Predicate.Equals(RDFVocabulary.RDF.BAG) && t.Object is RDFResource objRes && objRes.IsBlank));
+        }
+
+        [TestMethod]
+        public void ShouldDeserializeGraphWithSPBAnonymousTriplesHavingSameSubjectAndUsingLastTypeInPredicate()
+        {
+            MemoryStream stream = new MemoryStream();
+            using (StreamWriter writer = new StreamWriter(stream))
+                writer.WriteLine($"@prefix rdf: <{RDFVocabulary.RDF.BASE_URI}>.{Environment.NewLine}@base <{RDFNamespaceRegister.DefaultNamespace}>.{Environment.NewLine}<http://subj/> rdf:Alt [];{Environment.NewLine}a [].");
+            RDFGraph graph = RDFTurtle.Deserialize(new MemoryStream(stream.ToArray()), null);
+
+            Assert.IsNotNull(graph);
+            Assert.IsTrue(graph.TriplesCount == 2);
+            Assert.IsTrue(graph.Any(t => t.Subject.Equals(new RDFResource("http://subj/")) && t.Predicate.Equals(RDFVocabulary.RDF.ALT) && t.Object is RDFResource objRes && objRes.IsBlank));
+            Assert.IsTrue(graph.Any(t => t.Subject.Equals(new RDFResource("http://subj/")) && t.Predicate.Equals(RDFVocabulary.RDF.TYPE) && t.Object is RDFResource objRes && objRes.IsBlank));
+        }
+
         [TestCleanup]
         public void Cleanup()
         {


Fix to handle null blob access policy

Fix to handle null blob access policy

--- microsoft-azure-api/SharedAccessSignatureHelper.cs
+++ microsoft-azure-api/SharedAccessSignatureHelper.cs
@@ -46,25 +46,38 @@
             string resourceName,
             CloudBlobClient client)
         {
-            CommonUtils.AssertNotNull("policy", policy);
             CommonUtils.AssertNotNullOrEmpty("resourceName", resourceName);
             CommonUtils.AssertNotNull("client", client);

-            ////StringToSign = signedpermissions + "\n"
-            ////               signedstart + "\n"
-            ////               signedexpiry + "\n"
-            ////               canonicalizedresource + "\n"
-            ////               signedidentifier
-            ////HMAC-SHA256(URL.Decode(UTF8.Encode(StringToSign)))
-
-            string stringToSign = string.Format(
-                "{0}\n{1}\n{2}\n{3}\n{4}",
-                SharedAccessPolicy.PermissionsToString(policy.Permissions),
-                GetDateTimeOrEmpty(policy.SharedAccessStartTime),
-                GetDateTimeOrEmpty(policy.SharedAccessExpiryTime),
-                resourceName,
-                groupPolicyIdentifier);
-
+            string stringToSign = null;
+            if (policy != null)
+            {
+                ////StringToSign = signedpermissions + "\n"
+                ////               signedstart + "\n"
+                ////               signedexpiry + "\n"
+                ////               canonicalizedresource + "\n"
+                ////               signedidentifier
+                ////HMAC-SHA256(URL.Decode(UTF8.Encode(StringToSign)))
+
+                stringToSign = string.Format(
+                    "{0}\n{1}\n{2}\n{3}\n{4}",
+                    SharedAccessPolicy.PermissionsToString(policy.Permissions),
+                    GetDateTimeOrEmpty(policy.SharedAccessStartTime),
+                    GetDateTimeOrEmpty(policy.SharedAccessExpiryTime),
+                    resourceName,
+                    groupPolicyIdentifier);
+            }
+            else
+            {
+                stringToSign = string.Format(
+                    "{0}\n{1}\n{2}\n{3}\n{4}",
+                    string.Empty,
+                    string.Empty,
+                    string.Empty,
+                    resourceName,
+                    groupPolicyIdentifier);
+            }
+
             string signature = client.Credentials.ComputeHmac(stringToSign);

             return signature;
@@ -84,23 +97,26 @@
             string resourceType,
             string signature)
         {
-            CommonUtils.AssertNotNull("policy", policy);
             CommonUtils.AssertNotNullOrEmpty("resourceType", resourceType);
             CommonUtils.AssertNotNull("signature", signature);

             UriQueryBuilder builder = new UriQueryBuilder();

             // FUTURE blob for blob and container for container
-            string permissions = SharedAccessPolicy.PermissionsToString(policy.Permissions);
-            if (String.IsNullOrEmpty(permissions))
-            {
-                permissions = null;
-            }
-
-            AddEscapedIfNotNull(builder, Constants.QueryConstants.SignedStart, GetDateTimeOrNull(policy.SharedAccessStartTime));
-            AddEscapedIfNotNull(builder, Constants.QueryConstants.SignedExpiry, GetDateTimeOrNull(policy.SharedAccessExpiryTime));
+            if (policy != null)
+            {
+                string permissions = SharedAccessPolicy.PermissionsToString(policy.Permissions);
+                if (String.IsNullOrEmpty(permissions))
+                {
+                    permissions = null;
+                }
+
+                AddEscapedIfNotNull(builder, Constants.QueryConstants.SignedStart, GetDateTimeOrNull(policy.SharedAccessStartTime));
+                AddEscapedIfNotNull(builder, Constants.QueryConstants.SignedExpiry, GetDateTimeOrNull(policy.SharedAccessExpiryTime));
+                AddEscapedIfNotNull(builder, Constants.QueryConstants.SignedPermissions, permissions);
+            }
+
             builder.Add(Constants.QueryConstants.SignedResource, resourceType);
-            AddEscapedIfNotNull(builder, Constants.QueryConstants.SignedPermissions, permissions);
             AddEscapedIfNotNull(builder, Constants.QueryConstants.SignedIdentifier, groupPolicyIdentifier);
             AddEscapedIfNotNull(builder, Constants.QueryConstants.Signature, signature);


Update ICosmosTableRepository.cs

Update ICosmosTableRepository.cs

--- TIKSN.Core/Data/CosmosTable/ICosmosTableRepository.cs
+++ TIKSN.Core/Data/CosmosTable/ICosmosTableRepository.cs
@@ -1,6 +1,6 @@
-using Microsoft.Azure.Cosmos.Table;
-using System.Threading;
+using System.Threading;
 using System.Threading.Tasks;
+using Microsoft.Azure.Cosmos.Table;

 namespace TIKSN.Data.CosmosTable
 {
@@ -18,4 +18,4 @@

         Task ReplaceAsync(T entity, CancellationToken cancellationToken);
     }
-}+}


Only halt preview when camera is open

Only halt preview when camera is open

--- Rb.Forms.Barcode.Droid/BarcodeScannerRenderer.cs
+++ Rb.Forms.Barcode.Droid/BarcodeScannerRenderer.cs
@@ -199,7 +199,7 @@
                 await Task.Run(() => scannerService.StartPreview(previewFrameCallback));
             }

-            if (visibility == ViewStates.Gone && !BarcodeScannerRenderer.KeepCamera) {
+            if (visibility == ViewStates.Gone && !BarcodeScannerRenderer.KeepCamera && scannerCamera.CameraOpen) {
                 scannerService.HaltPreview();
             }


TO_CHAR

--- TableDependency.OracleClient/OracleTableDependency.cs
+++ TableDependency.OracleClient/OracleTableDependency.cs
@@ -608,22 +608,9 @@
                 $"DBMS_LOB.WRITE(lob_loc, amount_to_write, 1, message_buffer);" + Environment.NewLine;
         }

-        //private string PrepareEnqueueScriptForVarchar(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
-        //{
-        //    var variable = "TO_CHAR(v_" + column.Name.Replace(" ", "_").Replace(QUOTES, string.Empty) + ")";
-
-        //    return
-        //        $"SELECT UTL_RAW.CAST_TO_RAW({variable}) INTO message_buffer FROM DUAL;" + Environment.NewLine +
-        //        $"amount_to_write:= UTL_RAW.LENGTH(message_buffer);" + Environment.NewLine +
-        //        $"message_content:= TYPE_{dataBaseObjectsNamingConvention} ({messageType}, EMPTY_BLOB(), amount_to_write);" + Environment.NewLine +
-        //        $"DBMS_AQ.ENQUEUE(queue_name => 'QUE_{dataBaseObjectsNamingConvention}', enqueue_options => enqueue_options, message_properties => message_properties, payload => message_content, msgid => message_handle);" + Environment.NewLine +
-        //        $"SELECT t.user_data.message INTO lob_loc FROM QT_{dataBaseObjectsNamingConvention} t WHERE t.msgid = message_handle;" + Environment.NewLine +
-        //        $"DBMS_LOB.WRITE(lob_loc, LENGTH({variable}), 1, message_buffer);" + Environment.NewLine;
-        //}
-
         private string PrepareEnqueueScriptForVarchar(ColumnInfo column, string messageType, string dataBaseObjectsNamingConvention)
         {
-            var variable = "v_" + column.Name.Replace(" ", "_").Replace(QUOTES, string.Empty);
+            var variable = "TO_CHAR(v_" + column.Name.Replace(" ", "_").Replace(QUOTES, string.Empty) + ")";

             return
                 $"message_content:= TYPE_{dataBaseObjectsNamingConvention}({messageType}, EMPTY_BLOB(), LENGTH({variable}));" + Environment.NewLine +


Output the additional attribute first.

Output the additional attribute first.

--- ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs
+++ ReClass.NET/CodeGenerator/CSharpCodeGenerator.cs
@@ -174,11 +174,12 @@
 				var (type, attribute) = GetTypeDefinition(node);
 				if (type != null)
 				{
+					if (attribute != null)
+					{
+						writer.WriteLine(attribute);
+					}
+
 					writer.WriteLine($"[FieldOffset(0x{node.Offset:X})]");
-					if (attribute != null)
-					{
-						writer.WriteLine(attribute);
-					}
 					writer.Write($"public readonly {type} {node.Name};");
 					if (!string.IsNullOrEmpty(node.Comment))
 					{


cleanup

cleanup

--- ReachingTypeAnalysis/Tests/CallGraphGenerator.cs
+++ ReachingTypeAnalysis/Tests/CallGraphGenerator.cs
@@ -213,211 +213,211 @@
         private static StatementSyntax GetQueryCall(string methodName, int ordinal)
         {
             var s1 = SyntaxFactory.LocalDeclarationStatement(
-                                            SyntaxFactory.VariableDeclaration(
-                                                SyntaxFactory.IdentifierName(
-                                                    @"var"))
-                                            .WithVariables(
-                                                SyntaxFactory.SingletonSeparatedList<VariableDeclaratorSyntax>(
-                                                    SyntaxFactory.VariableDeclarator(
-                                                        SyntaxFactory.Identifier(
-                                                            @"sw"))
-                                                    .WithInitializer(
-                                                        SyntaxFactory.EqualsValueClause(
-                                                            SyntaxFactory.InvocationExpression(
-                                                                SyntaxFactory.MemberAccessExpression(
-                                                                    SyntaxKind.SimpleMemberAccessExpression,
-                                                                    SyntaxFactory.IdentifierName(
-                                                                        @"Stopwatch"),
-                                                                    SyntaxFactory.IdentifierName(
-                                                                        @"StartNew"))
-                                                                .WithOperatorToken(
-                                                                    SyntaxFactory.Token(
-                                                                        SyntaxKind.DotToken)))
-                                                            .WithArgumentList(
-                                                                SyntaxFactory.ArgumentList()
-                                                                .WithOpenParenToken(
-                                                                    SyntaxFactory.Token(
-                                                                        SyntaxKind.OpenParenToken))
-                                                                .WithCloseParenToken(
-                                                                    SyntaxFactory.Token(
-                                                                        SyntaxKind.CloseParenToken))))
-                                                        .WithEqualsToken(
-                                                            SyntaxFactory.Token(
-                                                                SyntaxKind.EqualsToken))))))
-                                        .WithSemicolonToken(
-                                            SyntaxFactory.Token(
-                                                SyntaxKind.SemicolonToken));
+                    SyntaxFactory.VariableDeclaration(
+                        SyntaxFactory.IdentifierName(
+                            @"var"))
+                    .WithVariables(
+                        SyntaxFactory.SingletonSeparatedList<VariableDeclaratorSyntax>(
+                            SyntaxFactory.VariableDeclarator(
+                                SyntaxFactory.Identifier(
+                                    @"sw"))
+                            .WithInitializer(
+                                SyntaxFactory.EqualsValueClause(
+                                    SyntaxFactory.InvocationExpression(
+                                        SyntaxFactory.MemberAccessExpression(
+                                            SyntaxKind.SimpleMemberAccessExpression,
+                                            SyntaxFactory.IdentifierName(
+                                                @"Stopwatch"),
+                                            SyntaxFactory.IdentifierName(
+                                                @"StartNew"))
+                                        .WithOperatorToken(
+                                            SyntaxFactory.Token(
+                                                SyntaxKind.DotToken)))
+                                    .WithArgumentList(
+                                        SyntaxFactory.ArgumentList()
+                                        .WithOpenParenToken(
+                                            SyntaxFactory.Token(
+                                                SyntaxKind.OpenParenToken))
+                                        .WithCloseParenToken(
+                                            SyntaxFactory.Token(
+                                                SyntaxKind.CloseParenToken))))
+                                .WithEqualsToken(
+                                    SyntaxFactory.Token(
+                                        SyntaxKind.EqualsToken))))))
+                .WithSemicolonToken(
+                    SyntaxFactory.Token(
+                        SyntaxKind.SemicolonToken));

             var s2 = SyntaxFactory.LocalDeclarationStatement(
                     SyntaxFactory.VariableDeclaration(
-                                                SyntaxFactory.IdentifierName(
-                                                    @"var"))
-                                            .WithVariables(
-                                                SyntaxFactory.SingletonSeparatedList<VariableDeclaratorSyntax>
-                                                (
-                                                    SyntaxFactory.VariableDeclarator(
-                                                        SyntaxFactory.Identifier(
-                                                            @"_"))
-                                                    .WithInitializer(
-                                                        SyntaxFactory.EqualsValueClause(
-                                SyntaxFactory.MemberAccessExpression(
-                                SyntaxKind.SimpleMemberAccessExpression,
-                                SyntaxFactory.InvocationExpression(
-                                    SyntaxFactory.MemberAccessExpression(
-                                        SyntaxKind.SimpleMemberAccessExpression,
+                        SyntaxFactory.IdentifierName(
+                            @"var"))
+                    .WithVariables(
+                        SyntaxFactory.SingletonSeparatedList<VariableDeclaratorSyntax>
+                        (
+                            SyntaxFactory.VariableDeclarator(
+                                SyntaxFactory.Identifier(
+                                    @"_"))
+                            .WithInitializer(
+                                SyntaxFactory.EqualsValueClause(
+                SyntaxFactory.MemberAccessExpression(
+                SyntaxKind.SimpleMemberAccessExpression,
+                SyntaxFactory.InvocationExpression(
+                    SyntaxFactory.MemberAccessExpression(
+                        SyntaxKind.SimpleMemberAccessExpression,
+                        SyntaxFactory.IdentifierName(
+                            SyntaxFactory.Identifier(
+                                SyntaxFactory.TriviaList(
+                                    SyntaxFactory.Whitespace(
+                                        @"    ")),
+                                @"CallGraphQueryInterface",
+                                SyntaxFactory.TriviaList())),
+                        SyntaxFactory.IdentifierName(
+                            @"GetCalleesAsync"))
+                    .WithOperatorToken(
+                        SyntaxFactory.Token(
+                            SyntaxKind.DotToken)))
+                .WithArgumentList(
+                    SyntaxFactory.ArgumentList(
+                        SyntaxFactory.SeparatedList<ArgumentSyntax>(
+                            new SyntaxNodeOrToken[]
+                            {
+                                SyntaxFactory.Argument(
+                                    SyntaxFactory.IdentifierName(@"analysisStrategy")
+                                    ),
+                                SyntaxFactory.Token(
+                                    SyntaxFactory.TriviaList(),
+                                    SyntaxKind.CommaToken,
+                                    SyntaxFactory.TriviaList(
+                                        SyntaxFactory.Space)),
+                                SyntaxFactory.Argument(
+                                    SyntaxFactory.ObjectCreationExpression(
                                         SyntaxFactory.IdentifierName(
-                                            SyntaxFactory.Identifier(
-                                                SyntaxFactory.TriviaList(
-                                                    SyntaxFactory.Whitespace(
-                                                        @"    ")),
-                                                @"CallGraphQueryInterface",
-                                                SyntaxFactory.TriviaList())),
-                                        SyntaxFactory.IdentifierName(
-                                            @"GetCalleesAsync"))
-                                    .WithOperatorToken(
+                                            @"MethodDescriptor"))
+                                    .WithNewKeyword(
                                         SyntaxFactory.Token(
-                                            SyntaxKind.DotToken)))
-                                .WithArgumentList(
-                                    SyntaxFactory.ArgumentList(
-                                        SyntaxFactory.SeparatedList<ArgumentSyntax>(
-                                            new SyntaxNodeOrToken[]
-                                            {
-                                                SyntaxFactory.Argument(
-                                                    SyntaxFactory.IdentifierName(@"analysisStrategy")
-                                                    ),
-                                                SyntaxFactory.Token(
-                                                    SyntaxFactory.TriviaList(),
-                                                    SyntaxKind.CommaToken,
-                                                    SyntaxFactory.TriviaList(
-                                                        SyntaxFactory.Space)),
-                                                SyntaxFactory.Argument(
-                                                    SyntaxFactory.ObjectCreationExpression(
-                                                        SyntaxFactory.IdentifierName(
-                                                            @"MethodDescriptor"))
-                                                    .WithNewKeyword(
-                                                        SyntaxFactory.Token(
-                                                            SyntaxFactory.TriviaList(
-                                                                SyntaxFactory.Whitespace(
-                                                                    @"        ")),
-                                                            SyntaxKind.NewKeyword,
-                                                            SyntaxFactory.TriviaList(
-                                                                SyntaxFactory.Space)))
-                                                    .WithArgumentList(
-                                                        SyntaxFactory.ArgumentList(
-                                                            SyntaxFactory.SeparatedList<ArgumentSyntax>(
-                                                                new SyntaxNodeOrToken[]{
-                                                                    SyntaxFactory.Argument(
-                                                                        SyntaxFactory.LiteralExpression(
-                                                                            SyntaxKind.StringLiteralExpression,
-                                                                            SyntaxFactory.Literal(
-                                                                                SyntaxFactory.TriviaList(),
-                                                                                @"""C""",
-                                                                                @"""C""",
-                                                                                SyntaxFactory.TriviaList()))),
-                                                                    SyntaxFactory.Token(
-                                                                        SyntaxFactory.TriviaList(),
-                                                                        SyntaxKind.CommaToken,
-                                                                        SyntaxFactory.TriviaList(
-                                                                            SyntaxFactory.Space)),
-                                                                    SyntaxFactory.Argument(
-                                                                        SyntaxFactory.LiteralExpression(
-                                                                            SyntaxKind.StringLiteralExpression,
-                                                                            SyntaxFactory.Literal(
-                                                                                SyntaxFactory.TriviaList(),
-                                                                                "\"" + methodName + "\"",
-                                                                                "\"" + methodName +"\"" ,
-                                                                                SyntaxFactory.TriviaList()))
-                                                                         )}))
-                                                        .WithOpenParenToken(
-                                                            SyntaxFactory.Token(
-                                                                SyntaxKind.OpenParenToken))
-                                                        .WithCloseParenToken(
-                                                            SyntaxFactory.Token(
-                                                                SyntaxKind.CloseParenToken)))),
-                                                SyntaxFactory.Token(
-                                                    SyntaxFactory.TriviaList(),
-                                                    SyntaxKind.CommaToken,
-                                                    SyntaxFactory.TriviaList(
-                                                        SyntaxFactory.Space)),
-                                                SyntaxFactory.Argument(
-                                                    SyntaxFactory.LiteralExpression(
-                                                                            SyntaxKind.NumericLiteralExpression,
-                                                                            SyntaxFactory.Literal(
-                                                                                SyntaxFactory.TriviaList(),
-                                                                                ordinal.ToString(),
-                                                                                ordinal,
-                                                                                SyntaxFactory.TriviaList()))),
-                                                SyntaxFactory.Token(
-                                                    SyntaxFactory.TriviaList(),
-                                                    SyntaxKind.CommaToken,
-                                                    SyntaxFactory.TriviaList(
-                                                        SyntaxFactory.Space)),
-                                                SyntaxFactory.Argument(
-                                                    SyntaxFactory.LiteralExpression(
-                                                        SyntaxKind.StringLiteralExpression,
-                                                        SyntaxFactory.Literal(
-                                                            SyntaxFactory.TriviaList(),
-                                                            @"""MyProject""",
-                                                            @"""MyProject""",
-                                                            SyntaxFactory.TriviaList())))
-                                            }))
-                                    .WithOpenParenToken(
-                                        SyntaxFactory.Token(
+                                            SyntaxFactory.TriviaList(
+                                                SyntaxFactory.Whitespace(
+                                                    @"        ")),
+                                            SyntaxKind.NewKeyword,
+                                            SyntaxFactory.TriviaList(
+                                                SyntaxFactory.Space)))
+                                    .WithArgumentList(
+                                        SyntaxFactory.ArgumentList(
+                                            SyntaxFactory.SeparatedList<ArgumentSyntax>(
+                                                new SyntaxNodeOrToken[]{
+                                                    SyntaxFactory.Argument(
+                                                        SyntaxFactory.LiteralExpression(
+                                                            SyntaxKind.StringLiteralExpression,
+                                                            SyntaxFactory.Literal(
+                                                                SyntaxFactory.TriviaList(),
+                                                                @"""C""",
+                                                                @"""C""",
+                                                                SyntaxFactory.TriviaList()))),
+                                                    SyntaxFactory.Token(
+                                                        SyntaxFactory.TriviaList(),
+                                                        SyntaxKind.CommaToken,
+                                                        SyntaxFactory.TriviaList(
+                                                            SyntaxFactory.Space)),
+                                                    SyntaxFactory.Argument(
+                                                        SyntaxFactory.LiteralExpression(
+                                                            SyntaxKind.StringLiteralExpression,
+                                                            SyntaxFactory.Literal(
+                                                                SyntaxFactory.TriviaList(),
+                                                                "\"" + methodName + "\"",
+                                                                "\"" + methodName +"\"" ,
+                                                                SyntaxFactory.TriviaList()))
+                                                            )}))
+                                        .WithOpenParenToken(
+                                            SyntaxFactory.Token(
+                                                SyntaxKind.OpenParenToken))
+                                        .WithCloseParenToken(
+                                            SyntaxFactory.Token(
+                                                SyntaxKind.CloseParenToken)))),
+                                SyntaxFactory.Token(
+                                    SyntaxFactory.TriviaList(),
+                                    SyntaxKind.CommaToken,
+                                    SyntaxFactory.TriviaList(
+                                        SyntaxFactory.Space)),
+                                SyntaxFactory.Argument(
+                                    SyntaxFactory.LiteralExpression(
+                                                            SyntaxKind.NumericLiteralExpression,
+                                                            SyntaxFactory.Literal(
+                                                                SyntaxFactory.TriviaList(),
+                                                                ordinal.ToString(),
+                                                                ordinal,
+                                                                SyntaxFactory.TriviaList()))),
+                                SyntaxFactory.Token(
+                                    SyntaxFactory.TriviaList(),
+                                    SyntaxKind.CommaToken,
+                                    SyntaxFactory.TriviaList(
+                                        SyntaxFactory.Space)),
+                                SyntaxFactory.Argument(
+                                    SyntaxFactory.LiteralExpression(
+                                        SyntaxKind.StringLiteralExpression,
+                                        SyntaxFactory.Literal(
                                             SyntaxFactory.TriviaList(),
-                                            SyntaxKind.OpenParenToken,
-                                            SyntaxFactory.TriviaList(
-                                                SyntaxFactory.LineFeed)))
-                                    .WithCloseParenToken(
-                                        SyntaxFactory.Token(
-                                            SyntaxKind.CloseParenToken))),
-                                    SyntaxFactory.IdentifierName(
-                                        @"Result"))
-                                    .WithOperatorToken(
-                                        SyntaxFactory.Token(
-                                            SyntaxKind.DotToken)))
-                                    ))))
-                                    .WithSemicolonToken(
-                                            SyntaxFactory.Token(
-                                                SyntaxKind.SemicolonToken));
-
+                                            @"""MyProject""",
+                                            @"""MyProject""",
+                                            SyntaxFactory.TriviaList())))
+                            }))
+            .WithOpenParenToken(
+                SyntaxFactory.Token(
+                    SyntaxFactory.TriviaList(),
+                    SyntaxKind.OpenParenToken,
+                    SyntaxFactory.TriviaList(
+                        SyntaxFactory.LineFeed)))
+            .WithCloseParenToken(
+                SyntaxFactory.Token(
+                    SyntaxKind.CloseParenToken))),
+            SyntaxFactory.IdentifierName(
+                @"Result"))
+            .WithOperatorToken(
+                SyntaxFactory.Token(
+                    SyntaxKind.DotToken)))
+            ))))
+            .WithSemicolonToken(
+                    SyntaxFactory.Token(
+                        SyntaxKind.SemicolonToken));

             var s3 = // stop the stopwatch
-                                        SyntaxFactory.ExpressionStatement(
-                                            SyntaxFactory.InvocationExpression(
-                                                SyntaxFactory.MemberAccessExpression(
-                                                    SyntaxKind.SimpleMemberAccessExpression,
-                                                    SyntaxFactory.IdentifierName(
-                                                        @"sw"),
-                                                    SyntaxFactory.IdentifierName(
-                                                        @"Stop"))
-                                                .WithOperatorToken(
-                                                    SyntaxFactory.Token(
-                                                        SyntaxKind.DotToken)))
-                                            .WithArgumentList(
-                                                SyntaxFactory.ArgumentList()
-                                                .WithOpenParenToken(
-                                                    SyntaxFactory.Token(
-                                                        SyntaxKind.OpenParenToken))
-                                                .WithCloseParenToken(
-                                                    SyntaxFactory.Token(
-                                                        SyntaxKind.CloseParenToken))))
-                                        .WithSemicolonToken(
-                                            SyntaxFactory.Token(
-                                                SyntaxKind.SemicolonToken));
-            var s4 =
-                                        SyntaxFactory.YieldStatement(
-                                            SyntaxKind.YieldReturnStatement,
-                                            SyntaxFactory.IdentifierName(
-                                                @"sw"))
-                                        .WithYieldKeyword(
-                                            SyntaxFactory.Token(
-                                                SyntaxKind.YieldKeyword))
-                                        .WithReturnOrBreakKeyword(
-                                            SyntaxFactory.Token(
-                                                SyntaxKind.ReturnKeyword))
-                                        .WithSemicolonToken(
-                                            SyntaxFactory.Token(
-                                                SyntaxKind.SemicolonToken));
+                SyntaxFactory.ExpressionStatement(
+                    SyntaxFactory.InvocationExpression(
+                        SyntaxFactory.MemberAccessExpression(
+                            SyntaxKind.SimpleMemberAccessExpression,
+                            SyntaxFactory.IdentifierName(
+                                @"sw"),
+                            SyntaxFactory.IdentifierName(
+                                @"Stop"))
+                        .WithOperatorToken(
+                            SyntaxFactory.Token(
+                                SyntaxKind.DotToken)))
+                    .WithArgumentList(
+                        SyntaxFactory.ArgumentList()
+                        .WithOpenParenToken(
+                            SyntaxFactory.Token(
+                                SyntaxKind.OpenParenToken))
+                        .WithCloseParenToken(
+                            SyntaxFactory.Token(
+                                SyntaxKind.CloseParenToken))))
+                .WithSemicolonToken(
+                    SyntaxFactory.Token(
+                        SyntaxKind.SemicolonToken));
+
+            var s4 = // yield return the stopwatch
+                SyntaxFactory.YieldStatement(
+                    SyntaxKind.YieldReturnStatement,
+                    SyntaxFactory.IdentifierName(
+                        @"sw"))
+                .WithYieldKeyword(
+                    SyntaxFactory.Token(
+                        SyntaxKind.YieldKeyword))
+                .WithReturnOrBreakKeyword(
+                    SyntaxFactory.Token(
+                        SyntaxKind.ReturnKeyword))
+                .WithSemicolonToken(
+                    SyntaxFactory.Token(
+                        SyntaxKind.SemicolonToken));

             return
                 SyntaxFactory.Block(
@@ -429,7 +429,7 @@
                             s3,
                             s4
                         }
-                        ));
+                    ));
         }

         private static MethodDeclarationSyntax GetMain(IEnumerable<string> methods)