Delete SceneLoadMenuGenerator.cs

Delete SceneLoadMenuGenerator.cs

--- Assets/Plugins/SceneLoadMenu/SceneLoadMenuGenerator.cs
+++ Assets/Plugins/SceneLoadMenu/SceneLoadMenuGenerator.cs
@@ -1,215 +0,0 @@
-using UnityEngine;
-using UnityEditor;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Collections.Generic;
-
-namespace charcolle.Utility {
-    public class SceneLoadMenuGenerator: MonoBehaviour {
-
-        //===========================================
-        // Varies
-        //===========================================
-
-        private const string SCENELOADMENU_FILENAME    = "SceneLoadMenu.cs";
-        private const string SEARCH_TIHS_SCRIPT        = "SceneLoadMenuGenerator";
-        private const string SEARCH_SCENE_FILTER      = "t:Scene";
-
-        private const string PATTERN_SCENENAME_INVALID = @"^[!-/:-@¥[-`{-~]+$";
-
-        private const string TEMPLATE_CLASS = @"
-using UnityEditor;
-using UnityEditor.SceneManagement;
-namespace charcolle.Utility {
-        public static class SceneLoadMenu {
-
-        #METHODS#
-
-        }
-}
-";
-        private const string TEMPLATE_LOAD = @"
-        [MenuItem( #SCENEMENU#, false, #PRIORITY# )]
-        static void Open_#SCENENAME#() {
-            if ( EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo() ) {
-                EditorSceneManager.OpenScene( #SCENEPATH#, OpenSceneMode.Single );
-            }
-        }
-
-";
-        private const string TEMPLATE_ADD = @"
-        [MenuItem( #SCENEMENU#, false, #PRIORITY# )]
-        static void Open_#SCENENAME#() {
-            if ( EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo() ) {
-                EditorSceneManager.OpenScene( #SCENEPATH#, OpenSceneMode.Additive );
-            }
-        }
-
-";
-        private const string MENU_NORMAL = "\"Scenes/Load Scene/Scene/#SCENENAME#\"";
-        private const string MENU_BUILD = "\"Scenes/Load Scene/Build/#SCENENAME#\"";
-        private const string MENU_TEST = "\"Scenes/Load Scene/Test/#SCENENAME#\"";
-        private const string MENU_ADD  = "\"Scenes/Add Scene/#SCENENAME#\"";
-
-        private const string PRIORITY_LOAD   = "23";
-        private const string PRIORITY_ADD    = "12";
-        private const string PRIORITY_BUILD  = "34";
-
-        private const string REPLACE_METHOD    = "#METHODS#";
-        private const string REPLACE_MENU      = "#SCENEMENU#";
-        private const string REPLACE_NAME      = "#SCENENAME#";
-        private const string REPLACE_PATH      = "#SCENEPATH#";
-        private const string REPLACE_PRIORITY  = "#PRIORITY#";
-
-        //===========================================
-        // Generate Scenes Menu
-        //===========================================
-
-        [MenuItem( "Scenes/Generate SceneMenu", false, 1 )]
-        static void GenerateScenLoadMenu() {
-
-            generateScenLoadProcess();
-
-        }
-
-        private static void generateScenLoadProcess() {
-            // load scenes from project and cache at list
-            var sceneList = getScenesFromProject();
-            if ( sceneList == null || sceneList.Count == 0 ) {
-                Debug.LogWarning( "no scenes is found." );
-                return;
-            }
-
-            // create methods( load/scenes, add, test, build  )
-            var methods = generateMethods( sceneList );
-
-            // save files
-            if ( !string.IsNullOrEmpty( methods ) )
-                saveSceneLoadMenuScript( methods );
-        }
-        //===========================================
-        // Process
-        //===========================================
-
-        /// <summary>
-        /// Load scenes from project and return scene class list
-        /// </summary>
-        /// <returns></returns>
-        private static List<Scene> getScenesFromProject() {
-            var sceneList = new List<Scene>();
-
-            // search scenes
-            var guids = AssetDatabase.FindAssets( SEARCH_SCENE_FILTER );
-            var sceneNum = guids.Length;
-            if ( sceneNum == 0 ) return null;
-
-            // check sceneName
-            for ( int i = 0; i < sceneNum; i++ ) {
-                var path = AssetDatabase.GUIDToAssetPath( guids[i] );
-                var sceneFileName = Path.GetFileNameWithoutExtension( path );
-                if ( !Regex.IsMatch( sceneFileName, PATTERN_SCENENAME_INVALID ) ) {
-                    // avoid including space in method
-                    var sceneName = sceneFileName.Replace( " ", "_" );
-                    // check scene name duplicate
-                    var duplicates = sceneList.Count( s => s.sceneName == sceneName );
-                    if ( duplicates > 0 ) sceneName += "_" + duplicates.ToString();
-
-                    // add list
-                    sceneList.Add( new Scene( path, sceneName ) );
-                } else {
-                    Debug.LogError( "This Scene contains inValid character. " + sceneFileName );
-                    continue;
-                }
-            }
-
-            return sceneList;
-        }
-
-        /// <summary>
-        /// Generate scene load method string from list and return method string
-        /// </summary>
-        private static string generateMethods( List<Scene> sceneList ) {
-            StringBuilder m_methods = new StringBuilder( sceneList.Count );
-
-            for ( int i = 0; i < sceneList.Count; i++ ) {
-                m_methods.Append( generateMethod( sceneList[i], TEMPLATE_ADD, MENU_ADD, PRIORITY_ADD, "_Add" ) );
-                m_methods.Append( generateMethod( sceneList[i], TEMPLATE_LOAD, MENU_NORMAL, PRIORITY_LOAD ) );
-                if ( sceneList[i].isTest )
-                    m_methods.Append( generateMethod( sceneList[i], TEMPLATE_LOAD, MENU_TEST, PRIORITY_LOAD, "_Test" ) );
-                if ( sceneList[i].inBuild )
-                    m_methods.Append( generateMethod( sceneList[i], TEMPLATE_LOAD, MENU_BUILD, PRIORITY_BUILD, "_InBuild" ) );
-            }
-
-            return m_methods.ToString();
-        }
-        /// <summary>
-        /// generate a method from scene class
-        /// </summary>
-        /// <param name="scene"></param>
-        /// <param name="methodTemplate"></param>
-        /// <param name="menu"></param>
-        /// <param name="priority"></param>
-        /// <returns></returns>
-        private static string generateMethod( Scene scene, string methodTemplate, string menu, string priority, string type = "" ) {
-            var m_method = methodTemplate;
-            var m_loadMenu = menu.Replace( REPLACE_NAME, scene.sceneName );
-
-            m_method = m_method.Replace( REPLACE_MENU, m_loadMenu );
-            m_method = m_method.Replace( REPLACE_NAME, scene.sceneName + type );
-            m_method = m_method.Replace( REPLACE_PATH, "\"" + scene.path + "\"" );
-            m_method = m_method.Replace( REPLACE_PRIORITY, priority );
-
-            return m_method;
-        }
-
-        /// <summary>
-        /// save SceneLoadMenu.cs
-        /// </summary>
-        private static void saveSceneLoadMenuScript( string methods ) {
-            if ( string.IsNullOrEmpty( methods ) ) {
-                Debug.LogWarning("Error occured when generating SceneLoadMenu.cs");
-                return;
-            }
-            // find save path
-            var guids = AssetDatabase.FindAssets( SEARCH_TIHS_SCRIPT );
-            var saveDir = Path.GetDirectoryName( AssetDatabase.GUIDToAssetPath( guids[0] ) );
-            var savePath = Path.Combine( saveDir, SCENELOADMENU_FILENAME );
-
-            // generate class
-            var saveClass = TEMPLATE_CLASS.Replace( REPLACE_METHOD, methods );
-
-            if ( File.Exists( savePath ) )
-                Debug.Log( "Menu will be overwritten." );
-
-            // save file
-            using ( StreamWriter sw = new StreamWriter( savePath ) ) {
-                sw.Write( saveClass );
-                sw.Close();
-            }
-
-            AssetDatabase.Refresh();
-
-            Debug.Log( "Menu is created." );
-        }
-
-        //===========================================
-        // Class
-        //===========================================
-
-        class Scene {
-            public string path;
-            public string sceneName;
-            public bool inBuild;
-            public bool isTest;
-
-            public Scene( string _path, string _scenename ) {
-                path        = _path;
-                sceneName   = _scenename;
-                inBuild = EditorBuildSettings.scenes.Any( b => b.path == path );
-                isTest = sceneName.ToLower().Contains( "test" ) || sceneName.ToLower().Contains( "debug" );
-            }
-        }
-    }
-}


remove warmup logic from the init call

remove warmup logic from the init call

--- AzureFunctions/Controllers/AzureFunctionsController.cs
+++ AzureFunctions/Controllers/AzureFunctionsController.cs
@@ -133,15 +133,7 @@
                 {
                     sitesResponse = await client.PutAsJsonAsync(ArmUriTemplates.PutSiteAppSettings.Bind(new { subscriptionId = subscription.subscriptionId, resourceGroupName = resourceGroup.name, siteName = site.name }), new { properties = appSettings.properties });
                     await sitesResponse.EnsureSuccessStatusCodeWithFullError();
-
-                }
-
-                //warm up the main site
-                HostingEnvironment.QueueBackgroundWorkItem(async _ => {
-                    await Task.Delay(500);
-                    await client.GetAsync(scmUrl.Replace(".scm.", "."));
-                    await client.GetAsync($"{scmUrl.Replace(".scm.", ".")}/api/");
-                });
+                }

                 // return it's scm name
                 return Request.CreateResponse(HttpStatusCode.OK, new { scm_url = scmUrl });


Extract Icon Bugfixes #FIX: No longer crashing the game when failing to extract a window icon from the game's executable.

--- Backend/DefaultOpenTK/Backend/Graphics/NativeWindow.cs
+++ Backend/DefaultOpenTK/Backend/Graphics/NativeWindow.cs
@@ -99,14 +99,30 @@
 				this.internalWindow.Context.SwapInterval);

 			// Retrieve icon from executable file and set it as window icon
-			Assembly entryAssembly = Assembly.GetEntryAssembly();
-			if (entryAssembly != null)
-			{
-				string executablePath = Path.GetFullPath(entryAssembly.Location);
-				if (File.Exists(executablePath))
+			string executablePath = null;
+			try
+			{
+				Assembly entryAssembly = Assembly.GetEntryAssembly();
+				if (entryAssembly != null)
 				{
-					this.internalWindow.Icon = Icon.ExtractAssociatedIcon(executablePath);
+					executablePath = Path.GetFullPath(entryAssembly.Location);
+					if (File.Exists(executablePath))
+					{
+						this.internalWindow.Icon = Icon.ExtractAssociatedIcon(executablePath);
+					}
 				}
+			}
+			// As described in issue 301 (https://github.com/AdamsLair/duality/issues/301), the
+			// icon extraction can fail with an exception under certain circumstances. Don't fail
+			// just because of an icon. Log the error and continue.
+			catch (Exception e)
+			{
+				Log.Core.WriteError(
+					"There was an exception while trying to extract the " +
+					"window icon from the game's main executable '{0}'. This is " +
+					"uncritical, but still an error: {1}",
+					executablePath,
+					Log.Exception(e));
 			}

 			if (options.ScreenMode == ScreenMode.FullWindow)


#60 fix: thumb label is hidden when thumb is hidden

--- Xamarin.RangeSlider.iOS/RangeSliderControl.cs
+++ Xamarin.RangeSlider.iOS/RangeSliderControl.cs
@@ -811,12 +811,12 @@
             _lowerHandleLabel.Text = ValueToString(LowerValue, Thumb.Lower);
             _lowerHandleLabel.Font = UIFont.SystemFontOfSize(_textSize);
             _lowerHandleLabel.Frame = HandleLabelRect(_lowerHandleLabel, _lowerHandle.Frame);
-            _lowerHandleLabel.Hidden = !ShowTextAboveThumbs;
+            _lowerHandleLabel.Hidden = !ShowTextAboveThumbs || _lowerHandleHidden;

             _upperHandleLabel.Text = ValueToString(UpperValue, Thumb.Upper);
             _upperHandleLabel.Font = UIFont.SystemFontOfSize(_textSize);
             _upperHandleLabel.Frame = HandleLabelRect(_upperHandleLabel, _upperHandle.Frame);
-            _upperHandleLabel.Hidden = !ShowTextAboveThumbs;
+            _upperHandleLabel.Hidden = !ShowTextAboveThumbs || _upperHandleHidden;
         }

         public override bool BeginTracking(UITouch uitouch, UIEvent uievent)


updated version number

updated version number

--- BuildingCoder/BuildingCoder/Properties/AssemblyInfo.cs
+++ BuildingCoder/BuildingCoder/Properties/AssemblyInfo.cs
@@ -147,7 +147,7 @@
 // 2016-07-05 2017.0.127.6 implemented BoundingBoxXYZ ExpandToContain extension methods and GetModelExtents
 // 2016-07-07 2017.0.127.7 implemented and tested ExportToImage3
 // 2016-08-02 2017.0.127.8 implemented and tested GetBoundingBox for room boundary IList of IList of BoundarySegment
-// 2016-08-15 2017.0.127.9 implemented SetSectionBox
+// 2016-08-15 2017.0.127.8 implemented SetSectionBox
 //
-[assembly: AssemblyVersion( "2017.0.127.9" )]
-[assembly: AssemblyFileVersion( "2017.0.127.9" )]
+[assembly: AssemblyVersion( "2017.0.127.8" )]
+[assembly: AssemblyFileVersion( "2017.0.127.8" )]


fix MappingContext performance

fix MappingContext performance

--- Signum.Web/Mappings/MappingContext.cs
+++ Signum.Web/Mappings/MappingContext.cs
@@ -538,27 +538,52 @@
             this.ControlID = controlID + TypeContext.Separator;

             Debug.Assert(csl == null || ControlID.StartsWith(csl.ControlID));
-            int startParent = csl == null ? 0 : csl.startIndex;
-            int endParent = csl == null ? sortedList.Count : csl.endIndex;
+
             this.global = csl == null ? (SortedList<string, V>)sortedList : csl.global;

-            for (int i = startParent; i < endParent; i++)
-            {
-                if (global.Keys[i].StartsWith(ControlID))
-                {
-                    this.startIndex = i;
-                    break;
-                }
-            }
-
-            for (int i = endParent - 1; i >= startParent; i--)
-            {
-                if (global.Keys[i].StartsWith(ControlID))
-                {
-                    this.endIndex = i + 1;
-                    break;
-                }
-            }
+            var parentStart = csl == null ? 0 : csl.startIndex;
+            var parentEnd = csl == null ? sortedList.Count : csl.endIndex;
+
+            startIndex = this.BinarySearch(parentStart, parentEnd);
+
+            endIndex = BinarySearchStartsWith(startIndex, parentEnd);
+        }
+
+        int BinarySearch(int start, int end)
+        {
+            while (start <= end)
+            {
+                int mid = (start + end) / 2;
+
+                var num = global.Keys[mid].CompareTo(ControlID);
+
+                if (num > 0)
+                    end = mid - 1;
+                else if (num < 0)
+                    start = mid + 1;
+                else
+                    return mid;
+            }
+
+            return start;
+        }
+
+        int BinarySearchStartsWith(int start, int end)
+        {
+            if (!global.Keys[start].StartsWith(ControlID))
+                return start;
+
+            while (start < end)
+            {
+                int mid = (start + end) / 2;
+
+                if (global.Keys[mid].StartsWith(ControlID))
+                    start = mid + 1;
+                else
+                    end = mid;
+            }
+
+            return start;
         }

         public void Add(string key, V value)


Ignoring failing test (that didn't work correctly for a very long time)

--- test/Tester/RequestContextTest.cs
+++ test/Tester/RequestContextTest.cs
@@ -3,8 +3,6 @@
 using Orleans.Runtime;
 using UnitTests.GrainInterfaces;
 using UnitTests.Tester;
-using System;
-using Tester;

 namespace UnitTests.General
 {
@@ -22,20 +20,16 @@
             Assert.True((int)infoFromGrain == 10);
         }

-        [Fact, TestCategory("RequestContext"), TestCategory("Functional")]
+        [Fact(Skip = "Was failing before (just masked as a Pass), needs fixing or removing"), TestCategory("RequestContext"), TestCategory("Functional")]
         public async Task RequestContextCalleeToCallerFlow()
         {
-            await Xunit.Assert.ThrowsAsync(typeof(Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException), async () =>
-            {
-                var grain = GrainFactory.GetGrain<ISimplePersistentGrain>(random.Next());
-                // This method in the grain does RequestContext.Set
-                await grain.SetRequestContext(15);
-                // Read the info set in the grain
-                var infoFromGrain = RequestContext.Get("GrainInfo");
-                Assert.NotNull(infoFromGrain);
-                Assert.True((int)infoFromGrain == 15);
-            });
+            var grain = GrainFactory.GetGrain<ISimplePersistentGrain>(random.Next());
+            // This method in the grain does RequestContext.Set
+            await grain.SetRequestContext(15);
+            // Read the info set in the grain
+            var infoFromGrain = RequestContext.Get("GrainInfo");
+            Assert.NotNull(infoFromGrain);
+            Assert.True((int)infoFromGrain == 15);
         }
-
     }
-}
+}


Happy New Year!

Happy New Year!

I'm a slowpoke, I know.

--- SimpleMaid/Properties/AssemblyInfo.cs
+++ SimpleMaid/Properties/AssemblyInfo.cs
@@ -13,7 +13,7 @@
 #endif
 [assembly: AssemblyCompany("Svetomech")]
 [assembly: AssemblyProduct("SimpleMaid")]
-[assembly: AssemblyCopyright("Copyright © Svetomech TheRainwildsKeeper 2015")]
+[assembly: AssemblyCopyright("Copyright © Svetomech TheRainwildsKeeper 2016")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


git-svn-id: 75210f800c74dac7ab89a5be233e5d30c702c3e4@343 a0bf3537-8e53-448f-ae4a-0b965e85af5e

--- Sinobyl/Sinobyl.Engine/ChessSearch.cs
+++ Sinobyl/Sinobyl.Engine/ChessSearch.cs
@@ -604,7 +604,7 @@
 			//check for draw
 			if (board.IsDrawByRepetition() || board.IsDrawBy50MoveRule())
 			{
-                return eval.DrawScore;
+                return board.WhosTurn == ChessPlayer.White ? eval.DrawScore : -eval.DrawScore;
 			}

 			if (depth <= 0)


BitMaskCheckedListBox

BitMaskCheckedListBox

--- Source/Forms/BitMaskCheckedListBox.cs
+++ Source/Forms/BitMaskCheckedListBox.cs
@@ -22,7 +22,11 @@
     public BitMaskCheckedListBox()
     {
       this.CheckOnClick = true;
-      // this.ItemCheck += (sender, e) => { this.ValueChanged?.Invoke(sender, EventArgs.Empty); this.LongValueChanged?.Invoke(sender, EventArgs.Empty); };
+      /*this.ItemCheck += (sender, e) =>
+      {
+        this.ValueChanged?.Invoke(sender, EventArgs.Empty);
+        this.LongValueChanged?.Invoke(sender, EventArgs.Empty);
+      };*/
       this.SelectedValueChanged += (sender, e) =>
       {
         this.ValueChanged?.Invoke(sender, EventArgs.Empty);


Calculating Value of BitMaskCheckedListBox has been corrected

--- Source/Forms/BitMaskCheckedListBox.cs
+++ Source/Forms/BitMaskCheckedListBox.cs
@@ -23,12 +23,10 @@
     public BitMaskCheckedListBox()
     {
       this.CheckOnClick = true;
-      this.ItemCheck += (sender, e) =>
-      {
-        this.ValueChanged?.Invoke(sender, EventArgs.Empty);
-      };
+      /*this.ItemCheck += (sender, e) => { this.ValueChanged?.Invoke(sender, EventArgs.Empty); };*/
+      this.SelectedValueChanged += (sender, e) => { this.ValueChanged?.Invoke(sender, EventArgs.Empty); };
     }
-
+
     [BrowsableAttribute(false)]
     public event EventHandler ValueChanged;

@@ -38,9 +36,9 @@
     {
       get
       {
-        int result = 0;
+        long result = 0;
         for (int i = 0; i < this.Items.Count; i++)
-          if (this.GetItemChecked(i)) result |= 1 << i;
+          if (this.GetItemChecked(i)) result |= (long)1 << i;
         return result;
       }
       set
@@ -48,7 +46,7 @@
         this.BeginUpdate();
         for (int i = 0; i < this.Items.Count; i++)
         {
-          int j = 1 << i;
+          long j = (long)1 << i;
           bool nch = (value & j) == j;
           bool och = this.GetItemChecked(i);
           if (nch != och) this.SetItemChecked(i, nch);


ISSUE-392 - change file SRC to not internal

--- Source/Glass.Mapper.Sc/Fields/File.cs
+++ Source/Glass.Mapper.Sc/Fields/File.cs
@@ -12,7 +12,7 @@
         /// Gets the SRC.
         /// </summary>
         /// <value>The SRC.</value>
-        public string Src { get; internal set; }
+        public string Src { get;  set; }
         /// <summary>
         /// Gets or sets the id.
         /// </summary>


Fixed Activor.CreateInstance issue

Fixed Activor.CreateInstance issue

--- SquidReports.DataCollector/Program.cs
+++ SquidReports.DataCollector/Program.cs
@@ -39,7 +39,15 @@
                 if (!connection.Query("SELECT * FROM [SQR].[DATA_MODEL] WHERE ModelName = @ModelName AND AssemblyName = @AssemblyName", new { ModelName = type.Name, AssemblyName = type.Assembly.GetName().Name }).Any())
                 {
                     // It's not there yet, register in in the [SQR].[DATA_MODEL] table
-                    connection.Execute("INSERT INTO [SQR].[DATA_MODEL] (ModelName, AssemblyName) VALUES (@ModelName, @AssemblyName)", new { ModelName = type.Name, AssemblyName = type.Assembly.GetName().Name });
+                    connection.Execute("INSERT INTO [SQR].[DATA_MODEL] (ModelName, ModelNameFull, AssemblyName, AssemblyNameFull, NameSpace) VALUES (@ModelName, @ModelNameFull, @AssemblyName, @AssemblyNameFull, @NameSpace)",
+                                                                        new
+                                                                        {
+                                                                            ModelName = type.Name,
+                                                                            ModelNameFull = String.Format("{0}.{1}", type.Namespace, type.Name),
+                                                                            AssemblyName = type.Assembly.GetName().Name,
+                                                                            AssemblyNameFull = type.Assembly.FullName,
+                                                                            type.Namespace
+                                                                        });
                 }
             }
         }
@@ -111,8 +119,13 @@
                             // Therefore, it has become invalid. Let's delete it from the HashTable
                             connection.Execute("DELETE FROM [SQR].[DATA_HASH] WHERE ModelID = @ModelID AND KeyHash = @KeyHash", new { ModelID = ID, KeyHash = tableKey });

-                            // Also, delete the date in the actual persistent table
-                            connection.Execute(Helpers.Sql.DeleteBuilder(collector.GetType(), tableID));
+                            // Next up, we need to delete from the actual persistent table, so we need to find out what Model this is
+                            // For that, we use the ModelID and the [SQR].[DATA_MODEL] table
+                            dynamic modelInfo = connection.Query("SELECT * FROM [SQR].[DATA_MODEL] WHERE ID = @ModelID", new { ModelID = ID }).Single();
+                            // Spawn an instance of the model type
+                            object modelObject = Activator.CreateInstance((string)modelInfo.AssemblyName, (string)modelInfo.ModelNameFull).Unwrap();
+                            // Delete based on the Model Type
+                            connection.Execute(Helpers.Sql.DeleteBuilder(modelObject.GetType(), tableID));
                         }
                     }


Load file and process struct directly on file

--- Src/WHampson.BFT/TemplateProcessor.cs
+++ Src/WHampson.BFT/TemplateProcessor.cs
@@ -23,6 +23,7 @@

 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Runtime.InteropServices;
 using System.Text;
@@ -37,194 +38,229 @@
 {
     internal class TemplateProcessor
     {
+        private const string RootElementName = "bft";
+
         //private const string VariableRegex = "\\$\\{(.+)\\}";

-        // Things to remember
-        //  * Ensure that custom types have a fixed size
+        private delegate int ProcessAction(IntPtr pData, XElement intElem, int off);

         private XDocument doc;
-        private SyntaxParser syntaxParser;
-        private Dictionary<string, CustomTypeInfo> customTypeMap;
+        private Dictionary<BuiltinType, ProcessAction> builtinTypeParseActionMap;
+        private Dictionary<Directive, ProcessAction> directiveParseActionMap;
+        private Dictionary<string, CustomTypeInfo> customTypes;
+        private int fileLen;

         public TemplateProcessor(XDocument doc)
         {
             this.doc = doc;
-            syntaxParser = new SyntaxParser(doc);
-            customTypeMap = new Dictionary<string, CustomTypeInfo>();
-        }
-
-        public void Preprocess()
-        {
-            syntaxParser.ParseTemplateStructure();
-            customTypeMap = syntaxParser.CustomTypeMap;
-            //Console.WriteLine(SizeOf(tree.Root));
+            customTypes = new Dictionary<string, CustomTypeInfo>();
+            builtinTypeParseActionMap = new Dictionary<BuiltinType, ProcessAction>();
+            directiveParseActionMap = new Dictionary<Directive, ProcessAction>();
+
+            BuildActionMaps();
+        }
+
+        public T Process<T>(string filePath)
+        {
+            // Validate root element
+            if (doc.Root.Name != RootElementName)
+            {
+                string fmt = "Template must have a root element named '{0}'.";
+                string msg = XmlUtils.BuildXmlErrorMsg(doc.Root, fmt, RootElementName);
+                throw new TemplateException(msg);
+            }
+
+            IEnumerable<XElement> elems = doc.Root.Elements();
+            if (elems.Count() == 0)
+            {
+                throw new TemplateException("Empty binary file template.");
+            }
+
+            // Load binary file
+            byte[] data = LoadFile(filePath);
+            fileLen = data.Length;
+
+            // Pin file data to unmanaged memory
+            IntPtr pData = Marshal.AllocHGlobal(data.Length);
+            Marshal.Copy(data, 0, pData, data.Length);
+
+            // Clear current list of custom types (if any)
+            customTypes.Clear();
+
+            // Process the template with respect to the file data
+            T outObj;
+            int bytesProcessed = ProcessStructure<T>(pData, doc.Root, out outObj);
+            Console.WriteLine("Processed {0} bytes.", bytesProcessed);
+
+            // Free pinned file data
+            // (This will change in the future depending on how we want to manipulate the file data)
+            Marshal.FreeHGlobal(pData);
+
+            return outObj;
+        }
+
+        private int ProcessStructure<T>(IntPtr pData, XElement structureElem, out T outObj)
+        {
+            return ProcessStructure<T>(pData, structureElem, false, out outObj);
+        }
+
+        private int ProcessStructure<T>(IntPtr pData, XElement structureElem, bool ignoreAttributes, out T outObj)
+        {
+            Type objType = typeof(T);
+            string dataTypeIdentifier = structureElem.Name.LocalName;
+
+            // Ensure no text data is present
+            if (!string.IsNullOrWhiteSpace(structureElem.Value))
+            {
+                string fmt = "Unexpected textual data.";
+                throw new TemplateException(XmlUtils.BuildXmlErrorMsg(structureElem, fmt));
+            }
+
+            // Check whether this is user-defined type or a plain-old struct
+            CustomTypeInfo typeInfo;
+            bool isCustomType = customTypes.TryGetValue(dataTypeIdentifier, out typeInfo);
+
+            // Get member elements
+            IEnumerable<XElement> children = (isCustomType)
+                ? typeInfo.Members
+                : structureElem.Elements();
+
+            // Ensure struct has at least one member field
+            if (children.Count() == 0)
+            {
+                string fmt = "Empty structs are not allowed.";
+                throw new TemplateException(XmlUtils.BuildXmlErrorMsg(structureElem, fmt));
+            }
+
+            // Extract modifiers
+            Dictionary<Modifier, string> modifierMap = (!ignoreAttributes)
+                ? BuildModifierMap(structureElem, Modifier.Comment, Modifier.Count, Modifier.Name)
+                : new Dictionary<Modifier, string>();
+
+            // Process members
             int offset = 0;
-            PrintNode(doc.Root, 0, ref offset);
-        }
-
-        public void PrintNode(XElement e, int depth, ref int offset)
-        {
-            string identifier = e.Name.LocalName;
-            if (identifier == Keyword.TypedefIdentifier)
-            {
-                return;
-            }
-
-            IEnumerable<XElement> children = e.Elements();
-
-            CustomTypeInfo customType;
-            BuiltinType kw;
-            bool isCustomType = customTypeMap.TryGetValue(identifier, out customType);
-            if (isCustomType)
-            {
-                children = new List<XElement>(customType.Members);
-                identifier = customType.Kind.ToString().ToLower();
-                kw = customType.Kind;
-            }
-            else if (identifier == "bft")
-            {
-                kw = BuiltinType.Struct;
-            }
-            else if (identifier == AlignIdentifier)
-            {
-                XAttribute countAttr = e.Attribute(CountIdentifier);
-                XAttribute kindAttr = e.Attribute(KindIdentifier);
-
-                BuiltinType kind;
-                if (kindAttr == null || !BuiltinTypeIdentifierMap.TryGetValue(kindAttr.Value, out kind))
-                {
-                    kind = BuiltinType.Int8;
-                }
-
-                int count = 1;
-                int.TryParse(countAttr.Value, out count);
-
-                Type t = TypeMap[kind];
-                offset += count * (Marshal.SizeOf(t));
-
-                return;
-            }
-            else
-            {
-                kw = BuiltinTypeIdentifierMap[identifier];
-            }
-
-            Console.WriteLine("{0:X4}: {1}{2}", offset, new string(' ', 2 * depth), identifier);
-
-            if (kw != BuiltinType.Struct)
-            {
-                Type t = TypeMap[kw];
-                offset += Marshal.SizeOf(t);
-            }
-
-            foreach (XElement child in children)
-            {
-                PrintNode(child, depth + 1, ref offset);
-            }
-        }
-
-        //private void PrintNode(ISyntaxTreeNode n, int offset)
-        //{
-        //    Console.Write("{0:D4}: ", offset);
-        //    Console.WriteLine(n);
-        //    foreach (ISyntaxTreeNode child in n.Children)
-        //    {
-        //        PrintNode(child, offset);
-        //        offset += SizeOf(child);
-        //    }
-        //}
-
-        //private int SizeOf(ISyntaxTreeNode n)
-        //{
-        //    int size = 0;
-        //    if (n is DataTypeTreeNode)
-        //    {
-        //        DataTypeTreeNode dn = (DataTypeTreeNode) n;
-        //        if (dn.Type == BuiltinType.Struct)
-        //        {
-        //            foreach  (ISyntaxTreeNode memb in dn.Children)
-        //            {
-        //                size += SizeOf(memb);
-        //            }
-        //        }
-        //        else
-        //        {
-        //            size = Marshal.SizeOf(TypeMap[dn.Type]);
-        //        }
-        //        string countStr;
-        //        n.Modifiers.TryGetValue(Modifier.Count, out countStr);
-        //        int count;
-        //        bool result = int.TryParse(countStr, out count);
-        //        if (!result)
-        //        {
-        //            count = 1;
-        //        }
-
-        //        size *= count;
-        //    }
-        //    else if (n is DirectiveTreeNode)
-        //    {
-        //        string countStr;
-        //        n.Modifiers.TryGetValue(Modifier.Count, out countStr);
-        //        int count;
-        //        bool result = int.TryParse(countStr, out count);
-        //        if (!result)
-        //        {
-        //            count = 1;
-        //        }
-
-        //        string kindStr;
-        //        if (!n.Modifiers.TryGetValue(Modifier.Kind, out kindStr))
-        //        {
-        //            kindStr = Int8Identifier;
-        //        }
-
-        //        // TODO: handle typedef'd types
-        //        BuiltinType type;
-        //        if (!BuiltinTypeIdentifierMap.TryGetValue(kindStr, out type))
-        //        {
-        //            throw new TemplateException(string.Format("Unknown type '{0}'", kindStr));
-        //        }
-
-        //        int typeSize = size = Marshal.SizeOf(TypeMap[type]);
-        //        size = count * typeSize;
-        //    }
-
-        //    return size;
-        //}
-
-        //private int SizeOf(XElement data)
-        //{
-        //    BuiltinType kind;
-        //    IEnumerable<XElement> members = data.Descendants();
-
-        //    string typeName = data.Name.LocalName;
-
-        //    bool found = BuiltinTypeIdentifierMap.TryGetValue(typeName, out kind);
-        //    if (!found)
-        //    {
-        //        CustomTypeInfo info;
-        //        customTypeMap.TryGetValue(typeName, out info);
-        //        kind = info.Kind;
-        //        members = info.Members;
-        //    }
-
-        //    int siz = 0;
-        //    if (kind == BuiltinType.Struct)
-        //    {
-        //        foreach (XElement memb in members)
-        //        {
-        //            siz += SizeOf(memb);
-        //        }
-        //    }
-        //    else
-        //    {
-        //        Type t = TypeMap[kind];
-        //        siz = Marshal.SizeOf(t);
-        //    }
-
-        //    return siz;
-        //}
+            bool hasDataFields = false;
+            foreach (XElement memberElem in children)
+            {
+                string mDataTypeIdentifier = memberElem.Name.LocalName;
+                bool doLookupDirective = false;
+
+                // Look up member type
+                BuiltinType type;
+                bool validType = LookupType(mDataTypeIdentifier, out type);
+                if (validType)
+                {
+                    hasDataFields = true;
+                }
+                else
+                {
+                    doLookupDirective = true;
+                }
+
+                // Look up directive if not a valid data type
+                Directive dir = Directive.Align;    // dummy value
+                if (doLookupDirective && !DirectiveIdentifierMap.TryGetValue(mDataTypeIdentifier, out dir))
+                {
+                    string fmt = "Unknown type or directive '{0}'.";
+                    throw new TemplateException(XmlUtils.BuildXmlErrorMsg(memberElem, fmt, mDataTypeIdentifier));
+                }
+
+                if (dir == Directive.Align)
+                {
+                    hasDataFields = true;
+                }
+
+                // Parse type or directive
+                ProcessAction parse = (validType)
+                    ? builtinTypeParseActionMap[type]
+                    : directiveParseActionMap[dir];
+
+                offset += parse(pData, memberElem, offset);
+            }
+
+            outObj = Activator.CreateInstance<T>();
+
+            return offset;
+        }
+
+        private int ProcessInt32Element(IntPtr pData, XElement intElem, int off, out int val)
+        {
+            if (off + 4 > fileLen)
+            {
+                throw new IndexOutOfRangeException("File length exceeded.");
+            }
+
+            IntPtr pVal = pData + off;
+            unsafe
+            {
+                val = *(Int32*)pVal;
+                Console.WriteLine("0x{0:X8}", val);
+            }
+
+            return 4;
+        }
+
+        private Dictionary<Modifier, string> BuildModifierMap(XElement e, params Modifier[] validAttrs)
+        {
+            Dictionary<Modifier, string> modifierMap = new Dictionary<Modifier, string>();
+            IEnumerable<XAttribute> attrs = e.Attributes();
+
+            foreach (XAttribute attr in attrs)
+            {
+                string mId = attr.Name.LocalName;
+                Modifier m;
+
+                // Get modifier
+                if (!ModifierIdentifierMap.TryGetValue(mId, out m))
+                {
+                    string fmt = "Unknown modifier '{0}'.";
+                    throw new TemplateException(XmlUtils.BuildXmlErrorMsg(attr, fmt, mId));
+                }
+
+                // Check if modifier is valid for current type
+                if (!validAttrs.Contains(m))
+                {
+                    string fmt = "Invalid modifier '{0}'.";
+                    throw new TemplateException(XmlUtils.BuildXmlErrorMsg(attr, fmt, mId));
+                }
+
+                // Validate modifier
+                if (string.IsNullOrWhiteSpace(attr.Value))
+                {
+                    string fmt = "Value for modifier '{0}' cannot be empty.";
+                    throw new TemplateException(XmlUtils.BuildXmlErrorMsg(attr, fmt, mId));
+                }
+
+                modifierMap[m] = attr.Value;
+            }
+
+            return modifierMap;
+        }
+
+        private int SizeOf(XElement structure)
+        {
+            return SizeOf(structure, true);
+        }
+
+        private int SizeOf(XElement structure, bool dereferenceVariables)
+        {
+            return 0;
+        }
+
+        private bool LookupType(string identifier, out BuiltinType type)
+        {
+            // Look up in custom type list
+            CustomTypeInfo info;
+            bool found = customTypes.TryGetValue(identifier, out info);
+            if (found)
+            {
+                type = info.Kind;
+                return true;
+            }
+
+            // Look up in builtin type list
+            return BuiltinTypeIdentifierMap.TryGetValue(identifier, out type);
+        }

         internal static Dictionary<BuiltinType, Type> TypeMap = new Dictionary<BuiltinType, Type>()
         {
@@ -233,5 +269,46 @@
             { BuiltinType.Int32, typeof(Int32) }
         };

+        private byte[] LoadFile(string filePath)
+        {
+            const int OneGibiByte = 1 << 30;
+
+            FileInfo fInfo = new FileInfo(filePath);
+            if (fInfo.Length > OneGibiByte)
+            {
+                throw new IOException("File size must be less than 1 GiB.");
+            }
+
+            int len = (int) fInfo.Length;
+            byte[] data = new byte[len];
+
+            using (FileStream fs = new FileStream(filePath, FileMode.Open))
+            {
+                fs.Read(data, 0, len);
+            }
+
+            return data;
+        }
+
+        private void BuildActionMaps()
+        {
+            // Builtin types
+            //builtinTypeParseActionMap[BuiltinType.Double] = ParseFloatElement;
+            //builtinTypeParseActionMap[BuiltinType.Float] = ParseFloatElement;
+            //builtinTypeParseActionMap[BuiltinType.Int8] = ParseIntegerElement;
+            //builtinTypeParseActionMap[BuiltinType.Int16] = ParseIntegerElement;
+            builtinTypeParseActionMap[BuiltinType.Int32] = ProcessIntegerElement;
+            //builtinTypeParseActionMap[BuiltinType.Int64] = ParseIntegerElement;
+            //builtinTypeParseActionMap[BuiltinType.Struct] = ParseStructElement;
+            //builtinTypeParseActionMap[BuiltinType.UInt8] = ParseIntegerElement;
+            //builtinTypeParseActionMap[BuiltinType.UInt16] = ParseIntegerElement;
+            //builtinTypeParseActionMap[BuiltinType.UInt32] = ParseIntegerElement;
+            //builtinTypeParseActionMap[BuiltinType.UInt64] = ParseIntegerElement;
+
+            // Directives
+            //directiveParseActionMap[Directive.Align] = ParseAlignElement;
+            //directiveParseActionMap[Directive.Echo] = ParseEchoElement;
+            //directiveParseActionMap[Directive.Typedef] = ParseTypedefElement;
+        }
     }
 }


Added a way to show/hide the element metadata and/or description.

--- Structurizr.Core/View/ElementStyle.cs
+++ Structurizr.Core/View/ElementStyle.cs
@@ -87,6 +87,18 @@
             }
         }

+        /// <summary>
+        /// A flag to indicate whether the element metadata should be shown or not.
+        /// </summary>
+        [DataMember(Name = "metadata", EmitDefaultValue = false)]
+        public bool? Metadata { get; set; }
+
+        /// <summary>
+        /// A flag to indicate whether the element description should be shown or not.
+        /// </summary>
+        [DataMember(Name = "description", EmitDefaultValue = false)]
+        public bool? Description { get; set; }
+
         internal ElementStyle()
         {
         }
@@ -97,4 +109,4 @@
         }

     }
-}
+}


remove arush id

remove arush id

--- TCC.Core/ClassSpecific/LancerAbnormalityTracker.cs
+++ TCC.Core/ClassSpecific/LancerAbnormalityTracker.cs
@@ -6,7 +6,7 @@
 {
     public class LancerAbnormalityTracker : ClassAbnormalityTracker
     {
-        private static readonly uint[] ARushIDs = { 200700, 200701, 200731, 200732 };
+        private static readonly uint[] ARushIDs = { 200700, 200701, 200731 };
         private static readonly uint[] GShoutIDs = { 200200, 200201, 200202 };
         private static readonly uint LineHeldId = 201701;


Catch InvalidOperationException when setting SplashScreen status.

--- Tabster/LocalUtilities/SingleInstanceController.cs
+++ Tabster/LocalUtilities/SingleInstanceController.cs
@@ -1,5 +1,6 @@
 #region

+using System;
 using System.Collections.ObjectModel;
 using System.IO;
 using System.Threading;
@@ -101,14 +102,32 @@
             _isLibraryOpen = true;
         }

+        #region Splash Screen
+
+        private void SetSplashStatus(string status)
+        {
+            var splash = ((SplashScreen) SplashScreen);
+
+            try
+            {
+                splash.SetStatus(status);
+            }
+
+            catch (InvalidOperationException)
+            {
+                //sometimes happens "randomly"
+            }
+        }
+
+        #endregion
+
         private void PerformStartupEvents()
         {
             var splashStatuses = new[] {"Initializing plugins...", "Loading library...", "Checking for updates..."};
+
             var sleepDuration = MIN_SPLASH_TIME/splashStatuses.Length/2;

-            var splash = ((SplashScreen) SplashScreen);
-
-            splash.SetStatus("Initializing plugins...");
+            SetSplashStatus(splashStatuses[0]);

 #if DEBUG
             Thread.Sleep(sleepDuration);
@@ -116,7 +135,7 @@

             Program.pluginController.LoadPlugins();

-            splash.SetStatus("Loading library...");
+            SetSplashStatus(splashStatuses[1]);

             Program.tablatureLibrary.Load();

@@ -126,7 +145,7 @@

             if (Settings.Default.StartupUpdate)
             {
-                splash.SetStatus("Checking for updates...");
+                SetSplashStatus(splashStatuses[2]);

 #if DEBUG
                 Thread.Sleep(sleepDuration);


Added the in-memory dbcontext for the AIService unit test class

--- Tests/UnitTests/ApplicationIdentityServiceTests.cs
+++ Tests/UnitTests/ApplicationIdentityServiceTests.cs
@@ -1,15 +1,14 @@
 namespace UnitTests
 {
     using Microsoft.AspNetCore.Http;
+    using Microsoft.EntityFrameworkCore;
     using Microsoft.Extensions.Caching.Memory;
     using Microsoft.Extensions.Configuration;
     using Moq;
     using System;
     using System.Collections.Generic;
     using System.IO;
-    using System.Reflection;
     using System.Security.Claims;
-    using System.Text;
     using TeamStore.DataAccess;
     using TeamStore.Interfaces;
     using TeamStore.Models;
@@ -33,13 +32,18 @@
             _httpContextAccessor = new HttpContextAccessor();
             _httpContextAccessor.HttpContext = _testHttpContext;

-            _dbContext = new ApplicationDbContext(new Microsoft.EntityFrameworkCore.DbContextOptions<ApplicationDbContext>());
+            var dbContextOptionsBuilder = new DbContextOptionsBuilder<ApplicationDbContext>();
+            dbContextOptionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
+            _dbContext = new ApplicationDbContext(dbContextOptionsBuilder.Options);

             _applicationIdentityService = new ApplicationIdentityService(_dbContext, _httpContextAccessor);

             SetApplicationUser();
         }

+        /// <summary>
+        /// Reads testsettings.json and builds out the configuration
+        /// </summary>
         private void BuildTestConfiguration()
         {
             var builder = new ConfigurationBuilder()
@@ -49,6 +53,9 @@
             _configuration = builder.Build();
         }

+        /// <summary>
+        /// Fakes an ApplicationUser in the HttpContext of the current request
+        /// </summary>
         private void SetApplicationUser()
         {
             var newApplicationUser = new ApplicationUser();
@@ -60,6 +67,9 @@
             _testHttpContext.Items[ApplicationIdentityService.CURRENTUSERKEY] = newApplicationUser;
         }

+        /// <summary>
+        /// Ensures we have a valid Http Context Accessor as this service depends on HttpContext
+        /// </summary>
         [Fact]
         public void GetCurrentUser_ShouldReturnArgumentNullException()
         {
@@ -69,6 +79,9 @@
             });
         }

+        /// <summary>
+        /// Validates that a null item in the items collection returns null and doesn't throw
+        /// </summary>
         [Fact]
         public async void GetCurrentUser_UnauthenticatedIdentityShouldReturnNull()
         {
@@ -84,6 +97,9 @@
             Assert.Null(nullUser);
         }

+        /// <summary>
+        /// Checks that a null parameter returns null and doesn't throw
+        /// </summary>
         [Fact]
         public async void GetCurrentUser_NullIdentityShouldReturnNull()
         {
@@ -98,6 +114,9 @@
             Assert.Null(nullUser);
         }

+        /// <summary>
+        /// Fakes an ApplicationUser, which is then retrieved by GetCurrentUser
+        /// </summary>
         [Fact]
         public async void GetCurrentUser_ShouldReturnUser()
         {
@@ -124,6 +143,10 @@
             Assert.Equal(newApplicationUser.Upn, returnedUser.Upn);
         }

+        /// <summary>
+        /// Mocks a ClaimsIdentity, then tests the conversion to ApplicationUser.
+        /// Asserts all parameters are the same.
+        /// </summary>
         [Fact]
         public async void GetCurrentUser_ShouldReturnCorrectClaimsIdentity()
         {
@@ -143,10 +166,12 @@
             mockContext.SetupGet(p => p.IsAuthenticated).Returns(true);
             mockContext.SetupGet(p => p.Claims).Returns(claimsList);

-            ApplicationIdentityService applicationIdentityService = new ApplicationIdentityService(_dbContext, _httpContextAccessor);
-
-            // Act
-            ApplicationUser retrievedUser = await applicationIdentityService.GetCurrentUser(mockContext.Object);
+            ApplicationIdentityService applicationIdentityService;
+            ApplicationUser retrievedUser;
+
+            // Act
+            applicationIdentityService = new ApplicationIdentityService(_dbContext, _httpContextAccessor);
+            retrievedUser = await applicationIdentityService.GetCurrentUser(mockContext.Object);

             // Assert
             Assert.NotNull(retrievedUser);
@@ -159,14 +184,17 @@
         }

         [Fact]
-        public async void GetCurrentUserByString_ShouldReturnCorrectClaimsIdentity()
-        {
+        public async void FindUserByRandomString_ShouldReturnNull()
+        {
+            // Arrange
             ApplicationIdentityService applicationIdentityService =
                 new ApplicationIdentityService(_dbContext, _httpContextAccessor);

-            ApplicationUser retrievedUser = await applicationIdentityService.FindUserAsync("my unit test object id");
-
-
+            // Act
+            ApplicationUser retrievedUser = await applicationIdentityService.FindUserAsync(Guid.NewGuid().ToString());
+
+            // Assert
+            Assert.Null(retrievedUser);
         }
     }
 }


Allow point of interest creation only when connected to Geeo

--- UnityProject/Assets/GeeoSdk/Scripts/DemoScript1.cs
+++ UnityProject/Assets/GeeoSdk/Scripts/DemoScript1.cs
@@ -18,6 +18,9 @@
 		// Format to get an ISO 8601 DateTime string
 		private const string dateTimeFormat_Iso8601 = "yyyy-MM-ddTHH:mm:ss.fffZ";

+		// If the Geeo SDK is connected
+		private bool geeoSdkConnected = false;
+
 		/// <summary>
 		/// At Start, initialize the Geeo SDK.
 		/// </summary>
@@ -102,6 +105,7 @@
 		{
 			Debug.Log("[DemoScript:Geeo_OnConnected] Geeo connected ›› Starting user location: " + lastUserLocation + ", Starting user view: " + lastUserView);
 			DisplayStatus(Status.Geeo, StatusState.Started);
+			geeoSdkConnected = true;

 			// Show the displayed used location
 			DisplayUserLocation(true);
@@ -121,6 +125,7 @@
 		{
 			Debug.LogWarning("[DemoScript:Geeo_OnDisconnected] Geeo disconnected");
 			DisplayStatus(Status.Geeo, StatusState.Stopped);
+			geeoSdkConnected = false;

 			// Hide the displayed used location
 			DisplayUserLocation(false);
@@ -261,8 +266,8 @@
 		/// </summary>
 		private void Update()
 		{
-			// If the left mouse button is clicked, add a point of interest to the clicked coordinates
-			if (Input.GetMouseButtonDown(0))
+			// If the left mouse button is clicked and a Geeo connection is established, add a point of interest to the clicked coordinates
+			if (Input.GetMouseButtonDown(0) && geeoSdkConnected)
 			{
 				// Convert the mouse screen X/Y position to world X/Y position
 				Vector3 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);


Refactor methods

Refactor methods

--- AnimatorComponent/PathData.cs
+++ AnimatorComponent/PathData.cs
@@ -241,20 +241,17 @@
         /// </summary>
         /// <param name="nodeIndex">Path node index.</param>
         /// <param name="nodeTimestamp">Path node timestamp.</param>
+        // todo rename to HandleDisableTiltingTool
         private void HandleRemoveTiltingTool(float nodeTimestamp) {
+            // Get nodes that have tilitng tool enabled.
+            var tiltedNodesTimestamps = Utilities.GetAnimationCurveTimestamps(TiltingCurve);
             // Find ease index for the given timestamp.
-            var tiltingKeyIndex = -1;
-            var tiltingTimestamps = Utilities.GetAnimationCurveTimestamps(TiltingCurve);
-            for (int i = 0; i < tiltingTimestamps.Count; i++) {
-                if (tiltingTimestamps[i] == nodeTimestamp) {
-                    tiltingKeyIndex = i;
-                    break;
-                }
-            }
+            var tiltingKeyIndex = tiltedNodesTimestamps.FindIndex(x => x == nodeTimestamp);

             // Remove key from ease curve.
-            if (tiltingKeyIndex == -1) return;
-            TiltingCurve.RemoveKey(tiltingKeyIndex);
+            if (tiltingKeyIndex != -1) {
+                TiltingCurve.RemoveKey(tiltingKeyIndex);
+            }
         }

         /// <summary>
@@ -262,21 +259,17 @@
         /// </summary>
         /// <param name="nodeIndex">Path node index.</param>
         /// <param name="nodeTimestamp">Path node timestamp.</param>
+        // todo rename to HandleDisableEaseTool
         private void HandleRemoveEaseTool(float nodeTimestamp) {
+            // Get nodes that have ease tool enabled.
+            var easedNodeTimestamps = Utilities.GetAnimationCurveTimestamps(EaseCurve);
             // Find ease index for the given timestamp.
-            var easeKeyIndex = -1;
-            var easeTimestamps = Utilities.GetAnimationCurveTimestamps(EaseCurve);
-            for (int i = 0; i < easeTimestamps.Count; i++) {
-                if (easeTimestamps[i] == nodeTimestamp) {
-                    easeKeyIndex = i;
-                    break;
-                }
-            }
-
-            // Remove key from ease curve.
-            if (easeKeyIndex == -1) return;
-            EaseCurve.RemoveKey(easeKeyIndex);
-
+            var easeKeyIndex = easedNodeTimestamps.FindIndex(x => x == nodeTimestamp);
+
+            if (easeKeyIndex != -1) {
+                // Remove key from ease curve.
+                EaseCurve.RemoveKey(easeKeyIndex);
+            }
         }


Sort UI scripts by name

Sort UI scripts by name

--- AnvilEditor/Models/Mission.cs
+++ AnvilEditor/Models/Mission.cs
@@ -126,6 +126,8 @@
             {
                 var json = sr.ReadToEnd();
                 this.availableScripts = JsonConvert.DeserializeObject<List<ScriptInclude>>(json);
+
+                this.availableScripts.Sort((a, b) => a.FriendlyName.CompareTo(b.FriendlyName));
             }
         }


Cleanup

Cleanup

--- Aspekt.Bootstrap/Bootstrap.cs
+++ Aspekt.Bootstrap/Bootstrap.cs
@@ -43,12 +43,7 @@

         private static bool HasMethod(TypeDefinition td, String methodName, params Type[] types)
         {
-            foreach (var mth in td.Methods)
-            {
-                if (mth.Name == methodName && CompareParameters(mth.Parameters, types))
-                    return true;
-            }
-            return false;
+            return td.Methods.Any((mth) => { return mth.Name == methodName && CompareParameters(mth.Parameters, types); });
         }

         private static PropertyDefinition GetAttributeProperty(CustomAttribute attr, Predicate<PropertyDefinition> pred)


Coins are now triggers

Coins are now triggers

--- Assets/Scripts/LevelLooper.cs
+++ Assets/Scripts/LevelLooper.cs
@@ -61,6 +61,7 @@
 						newTile.transform.position = new Vector3(x,y) + offset;
 						newTile.renderer.material.color = Color.yellow;
 						objectDeletionQueue.Enqueue(newTile);
+						newTile.collider2D.isTrigger = true;
 					break;
 				}
 			}
@@ -105,7 +106,8 @@
 					newTile.transform.position = new Vector3(columnCounter,y) + offset;
 					newTile.renderer.material.color = Color.yellow;
 					objectDeletionQueue.Enqueue(newTile);
-					break;
+					newTile.collider2D.isTrigger = true;
+				break;
 			}
 		}


Support IOS 2.0.*

Support IOS 2.0.*

--- Assets/Scripts/ScoreKeeper.cs
+++ Assets/Scripts/ScoreKeeper.cs
@@ -1,219 +1,206 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using Random = UnityEngine.Random;
-using SRandom = System.Random;
-
-public class ScoreKeeper:MonoBehaviour
-{
-    public int carrying;
-    public int carryLimit;
-    public int deposited;
-    public int winScore;
-
-    public int gameLength;
-
-    public GameObject guiMessage;
-
-    public int TotalScore;
-
-    public GUIText carryingGui;
-    public GUIText depositedGui;
-    public GUIText timerGui;
-    public GUIText totalScoreGui;
-
-    public List<AudioClip> collectSounds;
-    public AudioClip winSound;
-    public AudioClip loseSound;
-    public AudioClip pickupSound;
-    public AudioClip depositSound;
-
-    private float timeSinceLastPlay;
-    private float timeLeft;
-
-    private NextpeerGameManager NPManager = NextpeerGameManager.GetInstance();
-    private int LastManStandingTime = 30;
-
-    private Rect ForfeitButton;
-
-    public void Awake()
-    {
-        ForfeitButton = new Rect(Screen.width - 100,
-                                 0, 100, 60);
-    }
-
-    public void Start()
-    {
-        Debug.Log("start");
-
-        if (NPManager.TournamentType == GameType.LastManStanding)
-            gameLength = LastManStandingTime;
-		else if (NPManager.TournamentType != GameType.Solo)
-            gameLength = Nextpeer.TimeLeftInTournament().Seconds;
-        else
-            gameLength = 10;
-
-        timeLeft = gameLength;
-        timeSinceLastPlay = Time.time;
-
-        UpdateCarryingGui();
-        UpdateDepositedGui();
-        UpdateTotalScoreGui();
-        StartCoroutine(CheckTime());
-
-		carryingGui.pixelOffset = new Vector2((Screen.width - carryingGui.GetScreenRect().width)/2, carryingGui.pixelOffset.y);
-		depositedGui.pixelOffset = new Vector2((Screen.width - depositedGui.GetScreenRect().width)/2, depositedGui.pixelOffset.y);
-		totalScoreGui.pixelOffset = new Vector2((Screen.width - totalScoreGui.GetScreenRect().width)/2, totalScoreGui.pixelOffset.y);
-		timerGui.pixelOffset = new Vector2((Screen.width - timerGui.GetScreenRect().width)/2, timerGui.pixelOffset.y);
-    }
-
-    private void UpdateCarryingGui()
-    {
-        carryingGui.text = "Carrying: " + carrying + " of " + carryLimit;
-    }
-
-    private void UpdateDepositedGui()
-    {
-        depositedGui.text = "Deposited: " + deposited + " of " + winScore;
-    }
-
-    private void UpdateTotalScoreGui()
-    {
-        totalScoreGui.text = "Total Score: " + TotalScore;
-    }
-
-    private void UpdateTimerGui()
-    {
-        timerGui.text = "Time: " + TimeRemaining();
-    }
-
-    private IEnumerator CheckTime()
-    {
-	    // Rather than using Update(), use a co-routine that controls the timer.
-	    // We only need to check the timer once every second, not multiple times
-	    // per second.
-	    while ( timeLeft > 0 )
-	    {
-		    UpdateTimerGui();
-		    yield return new WaitForSeconds(1);
-		    timeLeft -= 1;
-	    }
-	    UpdateTimerGui();
-	    EndGame();
-    }
-
-
-    private void EndGame()
-    {
-
-	    GameObject prefab = (GameObject)Instantiate(guiMessage);
-	    GUIText endMessage = prefab.GetComponent<GUIText>();
-        endMessage.text = "";
-
-	    // Alert other components on this GameObject that the game has ended
-	    SendMessage( "OnEndGame" );
-
-        if (NPManager.TournamentType == GameType.LastManStanding)
-        {
-            Nextpeer.ReportControlledTournamentOverWithScore((uint)TotalScore);
-        }
-    }
-
-    public void Pickup(ParticlePickup pickup)
-    {
-	    if ( carrying < carryLimit )
-	    {
-	 	    carrying++;
-		    UpdateCarryingGui();
-            UpdateTotalScoreGui();
-            TotalScore++;
-            if(NextpeerGameManager.GetInstance().TournamentType != GameType.Solo)
-                Nextpeer.ReportScoreForCurrentTournament((uint)TotalScore);
-
-            if (NPManager.TournamentType == GameType.LastManStanding)
-            {
-                timeLeft += 1;
-            }
-
-		    // We don't want a voice played for every pickup as this would be annoying.
-		    // Only allow a voice to play with a random percentage of chance and only
-		    // after a minimum time has passed.
-		    var minTimeBetweenPlays = 5;
-		    if ( Random.value < 0.1 && Time.time > ( minTimeBetweenPlays + timeSinceLastPlay ) )
-		    {
-			    PlayAudioClip( collectSounds[ Random.Range( 0, collectSounds.Count) ], Vector3.zero, 0.25f );
-			    timeSinceLastPlay = Time.time;
-		    }
-
-	 	    pickup.Collected();
-		    PlayAudioClip( pickupSound, pickup.transform.position, 1.0f );
-	    }
-	    else
-	    {
-		    GameObject warning = (GameObject) Instantiate( guiMessage );
-		    warning.guiText.text = "You can't carry any more";
-		    Destroy(warning, 2);
-	    }
-
-	    // Show the player where to deposit the orbs
- 	    if ( carrying >= carryLimit )
-		    pickup.emitter.SendMessage( "ActivateDepository" );
-    }
-
-    public void Deposit()
-    {
-        TotalScore += carrying;
-        if (NextpeerGameManager.GetInstance().TournamentType != GameType.Solo)
-		{
-            Nextpeer.ReportScoreForCurrentTournament((uint)TotalScore);
-			NPManager.LastReportedScore = (uint)TotalScore;
-		}
-
-        if (NPManager.TournamentType == GameType.LastManStanding)
-        {
-            timeLeft += carrying;
-        }
-        deposited += carrying;
-        carrying = 0;
-        UpdateCarryingGui();
-        UpdateDepositedGui();
-        UpdateTotalScoreGui();
-        PlayAudioClip(depositSound, transform.position, 1.0f);
-    }
-
-
-    public String TimeRemaining()
-    {
-	    int remaining = (int) timeLeft;
-	    String val = "";
-	    if(remaining > 59) // Insert # of minutes
-	     val += remaining / 60 + ".";
-
-	    if(remaining >= 0) // Add # of seconds
-	    {
-		    String seconds = (remaining % 60).ToString();
-		    if(seconds.Length < 2)
-			    val += "0" + seconds; // insert leading 0
-		    else
-			    val += seconds;
-	    }
-	    return val;
-    }
-
-    AudioSource PlayAudioClip(AudioClip clip,
-                        Vector3 position,
-                        float volume)
-    {
-        var go = new GameObject("One shot audio");
-        go.transform.position = position;
-        AudioSource source = go.AddComponent<AudioSource>();
-        source.rolloffMode = AudioRolloffMode.Logarithmic;
-        source.clip = clip;
-        source.volume = volume;
-        source.Play();
-        Destroy(go, clip.length);
-        return source;
-    }
-
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using Random = UnityEngine.Random;
+using SRandom = System.Random;
+
+public class ScoreKeeper:MonoBehaviour
+{
+    public int carrying;
+    public int carryLimit;
+    public int deposited;
+    public int winScore;
+
+    public int gameLength;
+
+    public GameObject guiMessage;
+
+    public int TotalScore;
+
+    public GUIText carryingGui;
+    public GUIText depositedGui;
+    public GUIText timerGui;
+    public GUIText totalScoreGui;
+
+    public List<AudioClip> collectSounds;
+    public AudioClip winSound;
+    public AudioClip loseSound;
+    public AudioClip pickupSound;
+    public AudioClip depositSound;
+
+    private float timeSinceLastPlay;
+    private float timeLeft;
+
+    private NextpeerGameManager NPManager = NextpeerGameManager.GetInstance();
+    private int LastManStandingTime = 30;
+
+    public void Start()
+    {
+        Debug.Log("start");
+
+        if (NPManager.TournamentType == GameType.LastManStanding)
+            gameLength = LastManStandingTime;
+        else
+            gameLength = 20;
+
+        timeLeft = gameLength;
+        timeSinceLastPlay = Time.time;
+
+        UpdateCarryingGui();
+        UpdateDepositedGui();
+        UpdateTotalScoreGui();
+        StartCoroutine(CheckTime());
+
+		carryingGui.pixelOffset = new Vector2((Screen.width - carryingGui.GetScreenRect().width)/2, carryingGui.pixelOffset.y);
+		depositedGui.pixelOffset = new Vector2((Screen.width - depositedGui.GetScreenRect().width)/2, depositedGui.pixelOffset.y);
+		totalScoreGui.pixelOffset = new Vector2((Screen.width - totalScoreGui.GetScreenRect().width)/2, totalScoreGui.pixelOffset.y);
+		timerGui.pixelOffset = new Vector2((Screen.width - timerGui.GetScreenRect().width)/2, timerGui.pixelOffset.y);
+    }
+
+    private void UpdateCarryingGui()
+    {
+        carryingGui.text = "Carrying: " + carrying + " of " + carryLimit;
+    }
+
+    private void UpdateDepositedGui()
+    {
+        depositedGui.text = "Deposited: " + deposited + " of " + winScore;
+    }
+
+    private void UpdateTotalScoreGui()
+    {
+        totalScoreGui.text = "Total Score: " + TotalScore;
+    }
+
+    private void UpdateTimerGui()
+    {
+        timerGui.text = "Time: " + TimeRemaining();
+    }
+
+    private IEnumerator CheckTime()
+    {
+	    // Rather than using Update(), use a co-routine that controls the timer.
+	    // We only need to check the timer once every second, not multiple times
+	    // per second.
+	    while ( timeLeft > 0 )
+	    {
+		    UpdateTimerGui();
+		    yield return new WaitForSeconds(1);
+		    timeLeft -= 1;
+	    }
+	    UpdateTimerGui();
+	    EndGame();
+    }
+
+
+    private void EndGame()
+    {
+
+	    GameObject prefab = (GameObject)Instantiate(guiMessage);
+	    GUIText endMessage = prefab.GetComponent<GUIText>();
+        endMessage.text = "";
+
+	    // Alert other components on this GameObject that the game has ended
+	    SendMessage( "OnEndGame" );
+        Nextpeer.ReportControlledTournamentOverWithScore((uint)TotalScore);
+
+    }
+
+    public void Pickup(ParticlePickup pickup)
+    {
+	    if ( carrying < carryLimit )
+	    {
+	 	    carrying++;
+		    UpdateCarryingGui();
+            UpdateTotalScoreGui();
+            TotalScore++;
+            if(NextpeerGameManager.GetInstance().TournamentType != GameType.Solo)
+                Nextpeer.ReportScoreForCurrentTournament((uint)TotalScore);
+
+            if (NPManager.TournamentType == GameType.LastManStanding)
+            {
+                timeLeft += 1;
+            }
+
+		    // We don't want a voice played for every pickup as this would be annoying.
+		    // Only allow a voice to play with a random percentage of chance and only
+		    // after a minimum time has passed.
+		    var minTimeBetweenPlays = 5;
+		    if ( Random.value < 0.1 && Time.time > ( minTimeBetweenPlays + timeSinceLastPlay ) )
+		    {
+			    PlayAudioClip( collectSounds[ Random.Range( 0, collectSounds.Count) ], Vector3.zero, 0.25f );
+			    timeSinceLastPlay = Time.time;
+		    }
+
+	 	    pickup.Collected();
+		    PlayAudioClip( pickupSound, pickup.transform.position, 1.0f );
+	    }
+	    else
+	    {
+		    GameObject warning = (GameObject) Instantiate( guiMessage );
+		    warning.guiText.text = "You can't carry any more";
+		    Destroy(warning, 2);
+	    }
+
+	    // Show the player where to deposit the orbs
+ 	    if ( carrying >= carryLimit )
+		    pickup.emitter.SendMessage( "ActivateDepository" );
+    }
+
+    public void Deposit()
+    {
+        TotalScore += carrying;
+        if (NextpeerGameManager.GetInstance().TournamentType != GameType.Solo)
+		{
+            Nextpeer.ReportScoreForCurrentTournament((uint)TotalScore);
+			NPManager.LastReportedScore = (uint)TotalScore;
+		}
+
+        if (NPManager.TournamentType == GameType.LastManStanding)
+        {
+            timeLeft += carrying;
+        }
+        deposited += carrying;
+        carrying = 0;
+        UpdateCarryingGui();
+        UpdateDepositedGui();
+        UpdateTotalScoreGui();
+        PlayAudioClip(depositSound, transform.position, 1.0f);
+    }
+
+
+    public String TimeRemaining()
+    {
+	    int remaining = (int) timeLeft;
+	    String val = "";
+	    if(remaining > 59) // Insert # of minutes
+	     val += remaining / 60 + ".";
+
+	    if(remaining >= 0) // Add # of seconds
+	    {
+		    String seconds = (remaining % 60).ToString();
+		    if(seconds.Length < 2)
+			    val += "0" + seconds; // insert leading 0
+		    else
+			    val += seconds;
+	    }
+	    return val;
+    }
+
+    AudioSource PlayAudioClip(AudioClip clip,
+                        Vector3 position,
+                        float volume)
+    {
+        var go = new GameObject("One shot audio");
+        go.transform.position = position;
+        AudioSource source = go.AddComponent<AudioSource>();
+        source.rolloffMode = AudioRolloffMode.Logarithmic;
+        source.clip = clip;
+        source.volume = volume;
+        source.Play();
+        Destroy(go, clip.length);
+        return source;
+    }
+
 }


Update FreeCamera.cs

Update FreeCamera.cs


Simplify InheritsFrom method

Simplify InheritsFrom method

--- StyleCop.Analyzers.Status.Generator/SolutionReader.cs
+++ StyleCop.Analyzers.Status.Generator/SolutionReader.cs
@@ -235,13 +235,8 @@

         private bool InheritsFrom(INamedTypeSymbol declaration, INamedTypeSymbol possibleBaseType)
         {
-            while (true)
-            {
-                if (declaration == null)
-                {
-                    return false;
-                }
-
+            while (declaration != null)
+            {
                 if (declaration == possibleBaseType)
                 {
                     return true;
@@ -249,6 +244,8 @@

                 declaration = declaration.BaseType;
             }
+
+            return false;
         }
     }
 }


this still makes no sense

this still makes no sense

--- TCC.Core/Windows/Widgets/FloatingButtonWindow.xaml.cs
+++ TCC.Core/Windows/Widgets/FloatingButtonWindow.xaml.cs
@@ -68,6 +68,7 @@

             if (FocusManager.TeraScreen == null) return;
             var teraScreenBounds = FocusManager.TeraScreen.Bounds;
+            if (teraScreenBounds == null) return; // whateverrrrrrrrr
             Left = teraScreenBounds.X;
             Top = teraScreenBounds.Y + teraScreenBounds.Height / 2;
             //RefreshTopmost();


Fixes Bud.TmpDir tests.

Fixes Bud.TmpDir tests.

--- Bud.TmpDir.Test/TmpDirTest.cs
+++ Bud.TmpDir.Test/TmpDirTest.cs
@@ -54,7 +54,7 @@
     [Test]
     public void CreateFileFromResource_produces_the_file() {
       using (var dir = new TmpDir()) {
-        var fileFromResource = dir.CreateFileFromResource("Bud.TempDir.FooEmbeddedResource", "a");
+        var fileFromResource = dir.CreateFileFromResource("Bud.FooEmbeddedResource", "a");
         var expectedContent = dir.CreateFile("foo", "b");
         FileAssert.AreEqual(expectedContent, fileFromResource);
       }


Remove debugging code

Remove debugging code

--- Tests/Indicators/FractalAdaptiveMovingAverageTests.cs
+++ Tests/Indicators/FractalAdaptiveMovingAverageTests.cs
@@ -71,7 +71,6 @@

         private static void AssertResult(double expected, decimal actual)
         {
-            System.Diagnostics.Debug.WriteLine(expected + "," + actual + "," + Math.Abs((decimal)expected - actual));
             Assert.IsTrue(Math.Abs((decimal)expected - actual) < 0.006m);
         }


increased concurrency to force raceconditions

--- Tests/MQTTnet.TestApp.NetFramework/PerformanceTest.cs
+++ Tests/MQTTnet.TestApp.NetFramework/PerformanceTest.cs
@@ -7,6 +7,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;

 namespace MQTTnet.TestApp.NetFramework
@@ -16,7 +17,7 @@
         public static async Task RunAsync()
         {
             var server = Task.Run(() => RunServerAsync());
-            var client = Task.Run(() => RunClientAsync(50, TimeSpan.FromMilliseconds(10)));
+            var client = Task.Run(() => RunClientAsync(500, TimeSpan.FromMilliseconds(10)));

             await Task.WhenAll(server, client).ConfigureAwait(false);
         }
@@ -81,19 +82,11 @@

                 while (true)
                 {
-                    for (int i = 0; i < msgChunkSize; i++)
-                    {
-                        var applicationMessage = new MqttApplicationMessage(
-                            "A/B/C",
-                            Encoding.UTF8.GetBytes("Hello World"),
-                            MqttQualityOfServiceLevel.AtLeastOnce,
-                            false
-                        );
+                    var sendTasks = Enumerable.Range( 0, msgChunkSize )
+                        .Select( i => PublishSingleMessage( client, ref msgs ) )
+                        .ToList();

-                        //do not await to send as much messages as possible
-                        await client.PublishAsync(applicationMessage);
-                        msgs++;
-                    }
+                    await Task.WhenAll( sendTasks );

                     var now = DateTime.Now;
                     if (last < now - TimeSpan.FromSeconds(1))
@@ -110,6 +103,23 @@
             {
                 Console.WriteLine(exception);
             }
+        }
+
+        private static Task PublishSingleMessage( IMqttClient client, ref int count )
+        {
+            Interlocked.Increment( ref count );
+            return Task.Run( () =>
+            {
+                var applicationMessage = new MqttApplicationMessage(
+                    "A/B/C",
+                    Encoding.UTF8.GetBytes( "Hello World" ),
+                    MqttQualityOfServiceLevel.AtLeastOnce,
+                    false
+                );
+
+                //do not await to send as much messages as possible
+                return client.PublishAsync( applicationMessage );
+            } );
         }

         private static void RunServerAsync()


Change variables name

Change variables name

Changed name from count2++ to guessAttemptCounter;
Changed name from count1++ to cheatAttemptCounter;

--- Bulls-and-Cows-1/cows_buls.cs
+++ Bulls-and-Cows-1/cows_buls.cs
@@ -7,8 +7,8 @@
         private const byte GuessNumberLength = 4;
         private const byte AllDigitsCount = 10;
         private static List<PlayerInfo> klasirane = new List<PlayerInfo>();
-        private static int count1;
-        private static int count2;
+        private static int cheatAttemptCounter;
+        private static int guessAttemptCounter;
         private static string guessNumberToString;
         private static bool isGuessed;
         private static char[] helpingNumber;
@@ -43,7 +43,7 @@
                 }
             }

-            AddPlayerToScoreboard(count2);
+            AddPlayerToScoreboard(guessAttemptCounter);
             PrintScoreboard();
             CreateNewGame();
         }
@@ -51,8 +51,8 @@
         private static void Initialize()
         {
             randomGenerator = new Random();
-            count2 = 0;
-            count1 = 0;
+            guessAttemptCounter = 0;
+            cheatAttemptCounter = 0;
             isGuessed = false;
             helpingNumber = new char[] { 'X', 'X', 'X', 'X' };
         }
@@ -87,7 +87,7 @@
         private static void ProcessDigitCommand(string numberAsString)
         {

-            count2++;
+            guessAttemptCounter++;
             if (IsEqualToNumberForGuess(numberAsString))
             {
                 isGuessed = true;
@@ -164,16 +164,16 @@

         private static void PrintCongratulationMessage()
         {
-            if (count1 == 0)
+            if (cheatAttemptCounter == 0)
             {
                 Console.WriteLine(
                     "Congratulations! You guessed" +
                     " the secret number in {0} attempts.",
-                    count2);
+                    guessAttemptCounter);
             }
             else
             {
-                Console.WriteLine("Congratulations! You guessed the" + " secret number in {0}" + " attempts and {1} cheats.", count2, count1);
+                Console.WriteLine("Congratulations! You guessed the" + " secret number in {0}" + " attempts and {1} cheats.", guessAttemptCounter, cheatAttemptCounter);
             }

             Console.WriteLine();
@@ -199,7 +199,7 @@
                     break;
                 case "help":
                     RevealDigit();
-                    count1++;
+                    cheatAttemptCounter++;
                     break;
                 case "restart":
                     CreateNewGame();
@@ -256,7 +256,7 @@

         private static void AddPlayerToScoreboard(int guesses)
         {
-            if (count1 > 0)
+            if (cheatAttemptCounter > 0)
             {
                 Console.WriteLine(
                     "You are not allowed to enter the top scoreboard.");


[ACCEPTABLE TESTS] Remove, add and show user tests

Signed-off-by: arthur0496 <25191fdb53404c45a5ba1ff9d99486e5b82b147e@gmail.com>
Signed-off-by: Vitor Borges <42b9eb11ec8621fa21cde38bc2963670064dae63@gmail.com>

--- UnitTest/AutomatedTests/AdministratorAcceptionTest.cs
+++ UnitTest/AutomatedTests/AdministratorAcceptionTest.cs
@@ -32,6 +32,8 @@
                 app.WaitForNoElement("BtLoginLoginPage");
             }

+
+
             [Test]
             public void CreateNewForum() {
                 app.Tap("ButtonPlusAppMasterPageDetail");
@@ -47,6 +49,41 @@

                 //app.Repl();
                 Assert.IsNotNull(app.Query("OK"));
+
+            }
+            [Test]
+            public void UserRegistration() {
+                app.Tap(e => e.Marked("ButtonPlusAppMasterPageDetail"));
+                app.Tap(e => e.Marked("ButtonNewCoordenadorAppMasterPageDetail"));
+                app.EnterText("LabelNomeCompletoUserRegistrationPage", "Nome Teste");
+                app.EnterText("LabelEmailUserRegistrationPage", "teste@email.com");
+                app.EnterText("LabelMatriculaUserRegistrationPage", "246813579");
+                app.EnterText("LabelSenhaUserRegistrationPage", "Pb12345678");
+                app.DismissKeyboard();
+                app.ScrollDown();
+                app.Tap("PickerCursoUserRegistrationPage");
+                app.Tap("Engenharias");
+                app.Tap(e => e.Marked("ButtonConfirmarUserRegistrationPage"));
+                app.Tap(e => e.Marked("button1"));
+                Assert.IsNotNull("Registrar novo usuário");
+            }
+
+            [Test]
+            public void ShowUser() {
+                app.Tap(e => e.Marked("ButtonUserButtonAppMasterPageDetail"));
+                app.WaitForElement("Ver detalhes");
+                app.Tap(e => e.Marked("Nome Teste"));
+                Assert.IsNotNull("LabelRemoverUsuarioUserDetailPage");
+            }
+
+            [Test]
+            public void RemoveUser() {
+                app.Tap(e => e.Marked("ButtonUserButtonAppMasterPageDetail"));
+                app.WaitForElement("Ver detalhes");
+                app.Tap(e => e.Marked("Nome Teste"));
+                app.Tap(e => e.Marked("LabelRemoverUsuarioUserDetailPage"));
+                app.Tap(e => e.Marked("button1"));
+                Assert.IsNotNull("Ver detalhes");
             }

             [Test]


Fixes up Miss merge

Fixes up Miss merge

--- UnityProject/Assets/Scripts/Items/ItemAttributesV2.cs
+++ UnityProject/Assets/Scripts/Items/ItemAttributesV2.cs
@@ -18,7 +18,7 @@
 [RequireComponent(typeof(Pickupable))] //Inventory interaction
 [RequireComponent(typeof(ObjectBehaviour))] //pull and Push
 [RequireComponent(typeof(RegisterItem))] //Registry with subsistence
-public class ItemAttributesV2 : Attributes, IItemAttributes
+public class ItemAttributesV2 : Attributes
 {
 	[SerializeField]
 	[Tooltip("Initial traits of this item on spawn.")]
@@ -275,21 +275,6 @@
 	}
 	public string ItemName => name;

-	public float ServerHitDamage
-	{
-		get => hitDamage;
-		set => hitDamage = value;
-	}
-
-	public DamageType ServerDamageType
-	{
-		get => damageType;
-		set => damageType = value;
-	}
-
-	public bool CanConnectToTank { get; }
-
-
 	/// <summary>
 	/// CHange this item's size and sync it to clients
 	/// </summary>


Adds myself to exe copyright

Adds myself to exe copyright

--- VirtualDesktopGridSwitcher/Properties/AssemblyInfo.cs
+++ VirtualDesktopGridSwitcher/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("VirtualDesktopGridSwitcher")]
-[assembly: AssemblyCopyright("Copyright © Simon Liddington 2016")]
+[assembly: AssemblyCopyright("Copyright © Simon Liddington, Andrew Bradley 2016")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]


UI: graphics control disable vsync.

UI: graphics control disable vsync.

--- WzComparerR2.Common/Controls/GraphicsDeviceControl.cs
+++ WzComparerR2.Common/Controls/GraphicsDeviceControl.cs
@@ -83,7 +83,10 @@
                 this.swapChainRT = new SwapChainRenderTarget(graphicsDeviceService.GraphicsDevice,
                     this.Handle,
                     ClientSize.Width,
-                    ClientSize.Height);
+                    ClientSize.Height)
+                {
+                    PresentInterval = PresentInterval.Immediate
+                };

                 // Register the service, so components like ContentManager can find it.
                 services.AddService<IGraphicsDeviceService>(graphicsDeviceService);
@@ -270,7 +273,10 @@
                         this.graphicsDeviceService.GraphicsDevice,
                         this.Handle,
                         clientSize.Width,
-                        clientSize.Height);
+                        clientSize.Height)
+                    {
+                        PresentInterval = PresentInterval.Immediate
+                    };
                 }
                 catch (Exception e)
                 {


Refactor a method name.

Refactor a method name.

--- YegVote2013.Android/Service/ElectionResultsService.cs
+++ YegVote2013.Android/Service/ElectionResultsService.cs
@@ -45,7 +45,7 @@
         private async Task<string> DownloadXmlToFileAsync(WebClient webClient)
         {
             var settings = new ElectionServiceDownloadDirectory(this);
-            var fileName = settings.GetResultsXmlFile();
+            var fileName = settings.GetResultsXmlFileName();
 			var oldFileName = fileName + ".old";
             var fileInfo = new FileInfo(fileName);
             if (fileInfo.Exists)


Fix Umbraco package action not running

Fix Umbraco package action not running

--- Zbu.ModelsBuilder.AspNet/PackageActions/Configure2.cs
+++ Zbu.ModelsBuilder.AspNet/PackageActions/Configure2.cs
@@ -9,7 +9,7 @@
 {
     public class Configure2 : IPackageAction
     {
-        private const string ActionAlias = "Zbu.ModelsBuilder.Umbraco.PackageActions.Configure2";
+        private const string ActionAlias = "Zbu.ModelsBuilder.AspNet.PackageActions.Configure2";

         public string Alias()
         {


Get rid of ID3v2 local metadata containers

--- ATL/AudioData/IO/ID3v2.cs
+++ ATL/AudioData/IO/ID3v2.cs
@@ -93,12 +93,6 @@
             public int CRC = -1;
             public int TagRestrictions = -1;

-            // TODO : eventually remplace these local containers by appropriate containers in super.tagData
-
-            // Mapping between ATL fields and actual values contained in this file's metadata
-            public IDictionary<byte, string> Frames = new Dictionary<byte, string>();
-            // Storage for "unsupported" fields (i.e. fields that have no getter/setter defined in IMetaDataIO)
-            public IDictionary<string, string> AdditionalFrames = new Dictionary<string, string>();

             // **** BASE HEADER PROPERTIES ****
             public bool UsesUnsynchronisation
@@ -327,7 +321,7 @@

         // ---------------------------------------------------------------------------

-        private void setTagItem(String ID, String Data, ref TagInfo Tag, bool readAllMetaFrames)
+        private void setMetaField(String ID, String Data, ref TagInfo Tag, bool readAllMetaFrames)
         {
             byte supportedMetaId = 255;
             ID = ID.ToUpper();
@@ -341,17 +335,30 @@
                 if (frameMapping_v22.ContainsKey(ID)) supportedMetaId = frameMapping_v22[ID];
             }

-            // If ID has been mapped with an ATL field, store it in the dedicated Dictionary...
+            TagData.MetaFieldInfo fieldInfo;
+            // If ID has been mapped with an ATL field, store it in the dedicated place...
             if (supportedMetaId < 255)
             {
-                // Only stores first occurence of a tag
-                if (!Tag.Frames.ContainsKey(supportedMetaId))
-                {
-                    Tag.Frames[supportedMetaId] = Data;
-                }
-            } else if (readAllMetaFrames) // ...else store it in the additional fields Dictionary
-            {
-                Tag.AdditionalFrames.Add(ID, Data);
+                if (TagData.TAG_FIELD_GENRE == supportedMetaId)
+                {
+                    tagData.IntegrateValue(supportedMetaId, extractGenreFromID3v2Code(Data));
+                }
+                else
+                {
+                    tagData.IntegrateValue(supportedMetaId, Data);
+                }
+            }
+            else if (readAllMetaFrames) // ...else store it in the additional fields Dictionary
+            {
+                fieldInfo = new TagData.MetaFieldInfo(MetaDataIOFactory.TAG_ID3V2, ID, Data);
+                if (tagData.AdditionalFields.Contains(fieldInfo)) // Replace current value, since there can be no duplicate fields in ID3v2
+                {
+                    tagData.AdditionalFields.Remove(fieldInfo);
+                }
+                else
+                {
+                    tagData.AdditionalFields.Add(fieldInfo);
+                }
             }
         }

@@ -524,7 +531,7 @@
                         strData = Utils.StripEndingZeroChars(FEncoding.GetString(bData));
                     }

-                    setTagItem(Frame.ID, strData, ref Tag, readAllMetaFrames);
+                    setMetaField(Frame.ID, strData, ref Tag, readAllMetaFrames);

                     if (TAG_VERSION_2_2 == FVersion) fs.Seek(dataPosition + dataSize, SeekOrigin.Begin);
                 }
@@ -639,29 +646,6 @@
                 {
                     tagData = new TagData();
                     readFrames(source, ref FTagHeader, pictureStreamHandler, offset, readAllMetaFrames);
-
-                    foreach (byte b in FTagHeader.Frames.Keys)
-                    {
-                        tagData.IntegrateValue(b, FTagHeader.Frames[b]);
-                        if (TagData.TAG_FIELD_GENRE == b)
-                        {
-                            tagData.IntegrateValue(b, extractGenreFromID3v2Code(FTagHeader.Frames[b]));
-                        }
-                    }
-
-                    TagData.MetaFieldInfo fieldInfo;
-                    foreach (string s in FTagHeader.AdditionalFrames.Keys)
-                    {
-                        fieldInfo = new TagData.MetaFieldInfo(MetaDataIOFactory.TAG_ID3V2, s, FTagHeader.AdditionalFrames[s]);
-                        if (tagData.AdditionalFields.Contains(fieldInfo)) // Replace current value, since there can be no duplicate fields in ID3v2
-                        {
-                            tagData.AdditionalFields.Remove(fieldInfo);
-                        }
-                        else
-                        {
-                            tagData.AdditionalFields.Add(fieldInfo);
-                        }
-                    }
                 }
                 else
                 {


添加删除永久素材接口

添加删除永久素材接口

--- WX/OS.Social.WX/Offcial/Basic/WxOffcialMediaApi.cs
+++ WX/OS.Social.WX/Offcial/Basic/WxOffcialMediaApi.cs
@@ -201,7 +201,29 @@
                 return new ResultMo<byte[]>(ResultTypes.ObjectNull, "没有发现文件信息");
             });
         }
+
+
+
+        /// <summary>
+        ///  删除【永久】素材
+        /// </summary>
+        /// <param name="mediaId">素材Id</param>
+        /// <returns></returns>
+        public WxBaseResp DeleteMedia(string mediaId)
+        {
+            var req = new OsHttpRequest();
+
+            req.HttpMothed = HttpMothed.POST;
+            req.AddressUrl = string.Concat(m_ApiUrl, "/cgi-bin/material/del_material");
+            req.CustomBody = $"{{\"media_id\":\"{mediaId}\"}}";
+
+            return RestCommonOffcial<WxBaseResp>(req);
+        }
+
         #endregion
+
+
+

     }
 }


Use interface

Use interface

--- WalletWasabi.Backend/Controllers/HomeController.cs
+++ WalletWasabi.Backend/Controllers/HomeController.cs
@@ -7,7 +7,7 @@
 	public class HomeController : Controller
 	{
 		[HttpGet("")]
-		public ActionResult Index()
+		public IActionResult Index()
 		{
 			string host = HttpContext?.Request?.Host.Host;


whitespace

whitespace

Co-Authored-By: yahiheb <1ef907ec03476373b9c05d7f089a7d2fed4d8ea8@users.noreply.github.com>

--- WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
+++ WalletWasabi.Gui/ViewModels/MainWindowViewModel.cs
@@ -99,7 +99,7 @@
 			DisplayWalletManager();
 		}

-		public void Initialize ()
+		public void Initialize()
 		{
 			var global = Locator.Current.GetService<Global>();


[general.wp] Fixed MVVM tests for logging

--- Windows/Source/Mvvm.Tests/NavigationLoggerTests.cs
+++ Windows/Source/Mvvm.Tests/NavigationLoggerTests.cs
@@ -130,7 +130,7 @@

             vm.Command1.Execute();

-            CollectionAssert.AreEqual( new[] { Tuple.Create( "1", "C1", "" ) }, logger.CommandNavigations );
+            CollectionAssert.AreEqual( new[] { Tuple.Create( "1", "C1", (string) null ) }, logger.CommandNavigations );
         }

         [TestMethod]
@@ -144,7 +144,9 @@
             vm.Command1.Execute();
             vm.Command2.Execute();

-            CollectionAssert.AreEqual( new[] { Tuple.Create( "1", "C1", "" ), Tuple.Create( "1", "C2", "" ) }, logger.CommandNavigations );
+            CollectionAssert.AreEqual( new[] { Tuple.Create( "1", "C1", (string) null ),
+                                               Tuple.Create( "1", "C2", (string) null ) },
+                                       logger.CommandNavigations );
         }

         [TestMethod]
@@ -159,7 +161,7 @@

             vm2.Command3.Execute();

-            CollectionAssert.AreEqual( new[] { Tuple.Create( "2", "C3", "" ) }, logger.CommandNavigations );
+            CollectionAssert.AreEqual( new[] { Tuple.Create( "2", "C3", (string) null ) }, logger.CommandNavigations );
         }

         [TestMethod]
@@ -175,7 +177,7 @@

             vm1.Command1.Execute();

-            CollectionAssert.AreEqual( new[] { Tuple.Create( "1", "C1", "" ) }, logger.CommandNavigations );
+            CollectionAssert.AreEqual( new[] { Tuple.Create( "1", "C1", (string) null ) }, logger.CommandNavigations );
         }

         [TestMethod]
@@ -191,7 +193,7 @@

             vm2.Command3.Execute();

-            CollectionAssert.AreEqual( new[] { Tuple.Create( "1", "C3", "" ) }, logger.CommandNavigations );
+            CollectionAssert.AreEqual( new[] { Tuple.Create( "1", "C3", (string) null ) }, logger.CommandNavigations );
         }

         [TestMethod]


Lock motorDrv mutex when updating direction

--- WizardsChess/WizardsChess/Movement/Drv/MotorDrv.cs
+++ WizardsChess/WizardsChess/Movement/Drv/MotorDrv.cs
@@ -46,9 +46,9 @@
 				{
 					previousDirection = direction;
 					direction = value;
-				}
-				updatePins();
-			}
+                    updatePins();
+                }
+            }
 		}

 		public MoveDirection PreviousDirection
@@ -91,18 +91,17 @@

 		private void updatePins()
 		{
-            MoveDirection currentDir = direction;
-			switch (currentDir)
+			switch (direction)
 			{
 				case MoveDirection.Forward:
 					System.Diagnostics.Debug.WriteLine($"Moving the {information.Axis} motor forwards");
-					information.SetDirection(currentDir);
+					information.SetDirection(direction);
 					backwardPin.Write(GpioPinValue.Low);
 					forwardPin.Write(GpioPinValue.High);
 					break;
 				case MoveDirection.Backward:
 					System.Diagnostics.Debug.WriteLine($"Moving the {information.Axis} motor backwards");
-					information.SetDirection(currentDir);
+					information.SetDirection(direction);
 					forwardPin.Write(GpioPinValue.Low);
 					backwardPin.Write(GpioPinValue.High);
 					break;


Don't kill asteroids in non-DMP games.

Don't kill asteroids in non-DMP games.

--- Client/AsteroidWorker.cs
+++ Client/AsteroidWorker.cs
@@ -106,34 +106,37 @@

         private void OnVesselCreate(Vessel checkVessel)
         {
-            if (VesselIsAsteroid(checkVessel))
-            {
-                lock (serverAsteroidListLock)
-                {
-                    if (LockSystem.fetch.LockIsOurs("asteroid-spawning"))
-                    {
-                        if (!serverAsteroids.Contains(checkVessel.id.ToString()))
-                        {
-                            if (GetAsteroidCount() <= maxNumberOfUntrackedAsteroids)
-                            {
-                                DarkLog.Debug("Spawned in new server asteroid!");
-                                serverAsteroids.Add(checkVessel.id.ToString());
-                                VesselWorker.fetch.RegisterServerVessel(checkVessel.id.ToString());
-                                NetworkWorker.fetch.SendVesselProtoMessage(checkVessel.protoVessel, false, false);
-                            }
-                            else
-                            {
-                                DarkLog.Debug("Killing non-server asteroid " + checkVessel.id);
+            if (workerEnabled)
+            {
+                if (VesselIsAsteroid(checkVessel))
+                {
+                    lock (serverAsteroidListLock)
+                    {
+                        if (LockSystem.fetch.LockIsOurs("asteroid-spawning"))
+                        {
+                            if (!serverAsteroids.Contains(checkVessel.id.ToString()))
+                            {
+                                if (GetAsteroidCount() <= maxNumberOfUntrackedAsteroids)
+                                {
+                                    DarkLog.Debug("Spawned in new server asteroid!");
+                                    serverAsteroids.Add(checkVessel.id.ToString());
+                                    VesselWorker.fetch.RegisterServerVessel(checkVessel.id.ToString());
+                                    NetworkWorker.fetch.SendVesselProtoMessage(checkVessel.protoVessel, false, false);
+                                }
+                                else
+                                {
+                                    DarkLog.Debug("Killing non-server asteroid " + checkVessel.id);
+                                    checkVessel.Die();
+                                }
+                            }
+                        }
+                        else
+                        {
+                            if (!serverAsteroids.Contains(checkVessel.id.ToString()))
+                            {
+                                DarkLog.Debug("Killing non-server asteroid " + checkVessel.id + ", we don't own the asteroid-spawning lock");
                                 checkVessel.Die();
                             }
-                        }
-                    }
-                    else
-                    {
-                        if (!serverAsteroids.Contains(checkVessel.id.ToString()))
-                        {
-                            DarkLog.Debug("Killing non-server asteroid " + checkVessel.id + ", we don't own the asteroid-spawning lock");
-                            checkVessel.Die();
                         }
                     }
                 }


add PositionedToken abstract base class

add PositionedToken abstract base class

--- CobaltAHK/Lexer/Token.cs
+++ CobaltAHK/Lexer/Token.cs
@@ -23,6 +23,18 @@
 		public static readonly Token OpenBracket      = new CharacterToken('['); // object access or array literals
 		public static readonly Token CloseBracket     = new CharacterToken(']');
 		#endregion
+	}
+
+	public abstract class PositionedToken : Token
+	{
+		protected PositionedToken(SourcePosition pos)
+		{
+			position = pos;
+		}
+
+		private readonly SourcePosition position;
+
+		public SourcePosition Position { get { return position; } }
 	}

 	#region TextToken


bumped version

bumped version

--- CommonAssemblyInfo.cs
+++ CommonAssemblyInfo.cs
@@ -2,5 +2,5 @@

 [assembly: AssemblyTitle("Anotar")]
 [assembly: AssemblyProduct("Anotar")]
-[assembly: AssemblyVersion("2.7.3")]
-[assembly: AssemblyFileVersion("2.7.3")]
+[assembly: AssemblyVersion("2.7.4")]
+[assembly: AssemblyFileVersion("2.7.4")]


Added tolerance for null parameter in fields method

--- unirest-net/unirest-net/src/request/HttpRequest.cs
+++ unirest-net/unirest-net/src/request/HttpRequest.cs
@@ -162,6 +162,9 @@

         public HttpRequest fields(Dictionary<string, object> parameters)
         {
+            if (parameters == null)
+                return this;
+
             if (HttpMethod == HttpMethod.Get)
             {
                 throw new InvalidOperationException("Can't add body to Get request.");


BG sounds process won't start without sounds, lol

--- Core/Sounds/Sounds.cs
+++ Core/Sounds/Sounds.cs
@@ -37,6 +37,9 @@

         // Play the soundtrack sounds one after the other
+        if (bg.Length < 1)
+            return;
+
         int bgMark = 0;
         playBackground = this.tt().Add((ttHandler t) =>
         {