Add test for reversed string.

Add test for reversed string.

--- src/Workspaces/CSharpTest/EmbeddedLanguages/VirtualChars/CSharpVirtualCharServiceTests.cs
+++ src/Workspaces/CSharpTest/EmbeddedLanguages/VirtualChars/CSharpVirtualCharServiceTests.cs
@@ -14,27 +14,33 @@
     {
         private const string _statementPrefix = "var v = ";

-        private SyntaxToken GetStringToken(string text)
+        private SyntaxToken GetStringToken(string text, bool allowFailure)
         {
             var statement = _statementPrefix + text;
             var parsedStatement = (LocalDeclarationStatementSyntax)SyntaxFactory.ParseStatement(statement);
             var expression = parsedStatement.Declaration.Variables[0].Initializer.Value;

-            var token = expression is LiteralExpressionSyntax literal
-                ? literal.Token
-                : expression is InterpolatedStringExpressionSyntax interpolation
-                    ? ((InterpolatedStringTextSyntax)interpolation.Contents[0]).TextToken
-                    : throw new InvalidOperationException();
-
-            Assert.True(token.Kind() == SyntaxKind.StringLiteralToken ||
-                        token.Kind() == SyntaxKind.InterpolatedStringTextToken);
-
-            return token;
+            if (expression is LiteralExpressionSyntax literal)
+            {
+                return literal.Token;
+            }
+            else if (expression is InterpolatedStringExpressionSyntax interpolation)
+            {
+                return ((InterpolatedStringTextSyntax)interpolation.Contents[0]).TextToken;
+            }
+            else if (allowFailure)
+            {
+                return default;
+            }
+            else
+            {
+                throw new InvalidOperationException();
+            }
         }

         private void Test(string stringText, string expected)
         {
-            var token = GetStringToken(stringText);
+            var token = GetStringToken(stringText, allowFailure: false);
             var virtualChars = CSharpVirtualCharService.Instance.TryConvertToVirtualChars(token);
             var actual = ConvertToString(virtualChars);
             Assert.Equal(expected, actual);
@@ -42,7 +48,12 @@

         private void TestFailure(string stringText)
         {
-            var token = GetStringToken(stringText);
+            var token = GetStringToken(stringText, allowFailure: true);
+            if (token == default)
+            {
+                return;
+            }
+
             var virtualChars = CSharpVirtualCharService.Instance.TryConvertToVirtualChars(token);
             Assert.True(virtualChars.IsDefault);
         }
@@ -84,6 +95,12 @@
         }

         [Fact]
+        public void TestReverseInterpolatedVerbatimString()
+        {
+            TestFailure("@$\"{{\"");
+        }
+
+        [Fact]
         public void TestEscapeInInterpolatedSimpleString()
         {
             Test("$\"\\n\"", @"['\u000A',[2,4]]");
@@ -224,7 +241,7 @@
         [Fact]
         public void TestValidButUnsupportedLongEscape1()
         {
-            var token = GetStringToken(@"""\U00010000""");
+            var token = GetStringToken(@"""\U00010000""", allowFailure: false);
             Assert.False(token.ContainsDiagnostics);
             TestFailure(@"""\U00010000""");
         }


#21 finishing coeverage tests. Preparing release

--- Dot.Net.DevFast/src/Dot.Net.DevFast.Tests/Extensions/StreamPipeExt/StreamPipeExtsTest.cs
+++ Dot.Net.DevFast/src/Dot.Net.DevFast.Tests/Extensions/StreamPipeExt/StreamPipeExtsTest.cs
@@ -209,24 +209,33 @@
         public async Task Object_ToJson_Then_Back_Object_In_Streaming()
         {
             //ASYNC
-            var obj = new TestObject();
-            var postStream = await Task.FromResult(obj).PushJsonAsync()
-                .ThenCompress()
-                .AndWriteBytesAsync()
-                .Pull()
-                .ThenDecompress()
-                .AndParseJsonAsync<TestObject>().ConfigureAwait(false);
-            AssertOnValueEquality(obj, postStream);
-
-            //SYNC
-            obj = new TestObject();
-            postStream = (await obj.PushJson()
+            using (var mem1 = new MemoryStream())
+            {
+                var obj = new TestObject();
+                var byteCount = await Task.FromResult(obj)
+                    .PushJsonAsync()
                     .ThenCompress()
-                    .AndWriteBytesAsync().ConfigureAwait(false))
-                .Pull()
-                .ThenDecompress()
-                .AndParseJson<TestObject>();
-            AssertOnValueEquality(obj, postStream);
+                    .ThenConcurrentlyWriteTo(mem1, false)
+                    .AndCountBytesAsync().ConfigureAwait(false);
+                var postStreamBytes = Task.FromResult(mem1.ToArray());
+                var postStream = await postStreamBytes
+                    .Pull()
+                    .ThenCountBytes(out var byteCounter)
+                    .ThenDecompress()
+                    .AndParseJsonAsync<TestObject>().ConfigureAwait(false);
+                AssertOnValueEquality(obj, postStream);
+                Assert.True((await postStreamBytes.ConfigureAwait(false)).Length.Equals((int) byteCounter.ByteCount));
+                Assert.True(byteCount.Equals(byteCounter.ByteCount));
+                //SYNC
+                obj = new TestObject();
+                postStream = (await obj.PushJson()
+                        .ThenCompress()
+                        .AndWriteBytesAsync().ConfigureAwait(false))
+                    .Pull()
+                    .ThenDecompress()
+                    .AndParseJson<TestObject>();
+                AssertOnValueEquality(obj, postStream);
+            }
         }

         [Test]
@@ -274,61 +283,75 @@
             var file = AppDomain.CurrentDomain.BaseDirectory.ToDirectoryInfo().CreateFileInfo($"{fileName}.txt");
             try
             {
-                var obj = new TestObject();
-                var sourceForPull = await Task.FromResult(JsonConvert.SerializeObject(obj)
-                        .ToByteSegment(new UTF8Encoding(false)))
-                    .Push()
-                    .ThenCountBytes(out var pushByteCounter)
-                    .ThenCompress()
-                    .AndWriteBytesAsync().ConfigureAwait(false);
-                await sourceForPull
-                    .Pull()
-                    .ThenDecompress()
-                    .AndWriteFileAsync(file).ConfigureAwait(false);
-                AssertOnValueEquality(obj, JsonConvert.DeserializeObject<TestObject>(File.ReadAllText(file.FullName)));
-
-                var buff = await sourceForPull
-                    .Pull()
-                    .ThenDecompress()
-                    .AndWriteBufferAsync(seekToOrigin: true).ConfigureAwait(false);
-                AssertOnValueEquality(obj,
-                    JsonConvert.DeserializeObject<TestObject>(new UTF8Encoding(false).GetString(buff.ToArray())));
-
-                await sourceForPull
-                    .Pull()
-                    .ThenDecompress()
-                    .AndWriteStreamAsync(file.CreateStream(FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite),
-                        disposeTarget: true)
-                    .ConfigureAwait(false);
-                AssertOnValueEquality(obj, JsonConvert.DeserializeObject<TestObject>(File.ReadAllText(file.FullName)));
-
-                var strVal = await sourceForPull
-                    .Pull()
-                    .ThenDecompress()
-                    .AndWriteStringAsync().ConfigureAwait(false);
-                AssertOnValueEquality(obj, JsonConvert.DeserializeObject<TestObject>(strVal));
-
-                var strBuild = await sourceForPull
-                    .Pull()
-                    .ThenDecompress()
-                    .AndWriteStringBuilderAsync().ConfigureAwait(false);
-                AssertOnValueEquality(obj, JsonConvert.DeserializeObject<TestObject>(strBuild.ToString()));
-
-                strBuild.Clear();
-                await sourceForPull
-                    .Pull()
-                    .ThenDecompress()
-                    .AndWriteStringBuilderAsync(strBuild).ConfigureAwait(false);
-                AssertOnValueEquality(obj, JsonConvert.DeserializeObject<TestObject>(strBuild.ToString()));
-
-                await sourceForPull
-                    .Pull()
-                    .ThenDecompress()
-                    .ThenCountBytes(out var pullByteCounter)
-                    .AndExecuteAsync().ConfigureAwait(false);
-
-                Assert.True(pullByteCounter.ByteCount != sourceForPull.Length);
-                Assert.True(pushByteCounter.ByteCount == pullByteCounter.ByteCount);
+                using (var mem1 = new MemoryStream())
+                {
+                    using (var mem2 = new MemoryStream())
+                    {
+                        var obj = new TestObject();
+                        await Task.FromResult(JsonConvert.SerializeObject(obj)
+                                .ToByteSegment(new UTF8Encoding(false)))
+                            .Push()
+                            .ThenCountBytes(out var pushByteCounter)
+                            .ThenCompress()
+                            .ThenConcurrentlyWriteTo(mem1, false)
+                            .ThenConcurrentlyWriteTo(mem2, false)
+                            .AndExecuteAsync().ConfigureAwait(false);
+                        var sourceForPull = mem1.ToArray();
+                        await sourceForPull
+                            .Pull()
+                            .ThenDecompress()
+                            .AndWriteFileAsync(file).ConfigureAwait(false);
+                        AssertOnValueEquality(obj,
+                            JsonConvert.DeserializeObject<TestObject>(File.ReadAllText(file.FullName)));
+
+                        Assert.True(mem1.ToArray().SequenceEqual(mem2.ToArray()));
+                        var buff = await sourceForPull
+                            .Pull()
+                            .ThenDecompress()
+                            .AndWriteBufferAsync(seekToOrigin: true).ConfigureAwait(false);
+                        AssertOnValueEquality(obj,
+                            JsonConvert.DeserializeObject<TestObject>(
+                                new UTF8Encoding(false).GetString(buff.ToArray())));
+
+                        await sourceForPull
+                            .Pull()
+                            .ThenDecompress()
+                            .AndWriteStreamAsync(
+                                file.CreateStream(FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite),
+                                disposeTarget: true)
+                            .ConfigureAwait(false);
+                        AssertOnValueEquality(obj,
+                            JsonConvert.DeserializeObject<TestObject>(File.ReadAllText(file.FullName)));
+
+                        var strVal = await sourceForPull
+                            .Pull()
+                            .ThenDecompress()
+                            .AndWriteStringAsync().ConfigureAwait(false);
+                        AssertOnValueEquality(obj, JsonConvert.DeserializeObject<TestObject>(strVal));
+
+                        var strBuild = await sourceForPull
+                            .Pull()
+                            .ThenDecompress()
+                            .AndWriteStringBuilderAsync().ConfigureAwait(false);
+                        AssertOnValueEquality(obj, JsonConvert.DeserializeObject<TestObject>(strBuild.ToString()));
+
+                        strBuild.Clear();
+                        await sourceForPull
+                            .Pull()
+                            .ThenDecompress()
+                            .AndWriteStringBuilderAsync(strBuild).ConfigureAwait(false);
+                        AssertOnValueEquality(obj, JsonConvert.DeserializeObject<TestObject>(strBuild.ToString()));
+
+                        await sourceForPull
+                            .Pull()
+                            .ThenDecompress()
+                            .ThenCountBytes(out var pullByteCounter)
+                            .AndExecuteAsync().ConfigureAwait(false);
+
+                        Assert.True(pullByteCounter.ByteCount != sourceForPull.Length);
+                        Assert.True(pushByteCounter.ByteCount == pullByteCounter.ByteCount);
+                    }
+                }
             }
             finally
             {


Update ApplyConditionalFormattingFormula.cs

--- Examples/CSharp/Articles/ApplyConditionalFormatting/ApplyConditionalFormattingFormula.cs
+++ Examples/CSharp/Articles/ApplyConditionalFormatting/ApplyConditionalFormattingFormula.cs
@@ -9,6 +9,7 @@
     {
         public static void Main(string[] args)
         {
+            //ExStart:1
             // The path to the documents directory.
             string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

@@ -56,8 +57,9 @@

             //Saving the Excel file
             workbook.Save(dataDir+ "output.out.xls", SaveFormat.Auto);
+            //ExEnd:1

         }
     }
-}+}


Fixed issues with tokens being wrongly replaced

--- OfficeDevPnP.Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/TokenParser.cs
+++ OfficeDevPnP.Core/OfficeDevPnP.Core/Framework/Provisioning/ObjectHandlers/TokenParser.cs
@@ -17,12 +17,14 @@

         public TokenParser(Web web)
         {
-            _web = web;
+            _web = web;
+
+            // ORDER IS IMPORTANT!
+            _tokens.Add(new SiteCollectionTermStoreIdToken(web));
             _tokens.Add(new SiteCollectionToken(web));
             _tokens.Add(new SiteToken(web));
             _tokens.Add(new MasterPageCatalogToken(web));
             _tokens.Add(new ThemeCatalogToken(web));
-            _tokens.Add(new SiteCollectionTermStoreIdToken(web));
         }

         public string Parse(string input)


横纵向SV正确滚动

横纵向SV正确滚动

--- PA_VarTracer/Assets/PerfAssist/PAVarTracer/graphicsTool/GraphIt/Scripts/GraphItWindow.cs
+++ PA_VarTracer/Assets/PerfAssist/PAVarTracer/graphicsTool/GraphIt/Scripts/GraphItWindow.cs
@@ -328,7 +328,7 @@
             Rect find_y = EditorGUILayout.BeginVertical(GUIStyle.none);
             EditorGUILayout.EndVertical();

-            float scrolled_y_pos = y_offset;
+            float scrolled_y_pos = y_offset - mGraphViewScrollPos.y;
             if (Event.current.type == EventType.Repaint)
             {
                 GL.PushMatrix();
@@ -353,7 +353,7 @@
                 }
                 GL.End();

-                scrolled_y_pos = y_offset;
+                scrolled_y_pos = y_offset - mGraphViewScrollPos.y;
                 //Draw Lines
                 GL.Begin(GL.LINES);

@@ -395,6 +395,12 @@
                                     if (x0 >= mWidth + x_offset) break;
                                     value = g.mDataInfos[i].Value;
                                     float y0 = scrolled_y_pos + height * (1 - (previous_value - y_min) / y_range);
+
+                                    if(i==1)
+                                    {
+                                        x0 = x_offset;
+                                        y0 = scrolled_y_pos + height;
+                                    }

                                     float x1 = x_offset + i * kv.Value.XStep - kv.Value.ScrollPos.x;
                                     float y1 = scrolled_y_pos + height * (1 - (value - y_min) / y_range);
@@ -442,42 +448,8 @@
                 }
                 GL.End();

-
-                scrolled_y_pos = y_offset;
-                foreach (KeyValuePair<string, GraphItData> kv in VarTracer.Instance.Graphs)
-                {
-                    float height = kv.Value.GetHeight();
-                    foreach (var varBody in VarTracer.Instance.VariableBodys)
-                    {
-                        foreach (var var in varBody.Value.VariableDict.Values)
-                        {
-                            foreach (var channelName in var.ChannelDict.Values)
-                            {
-                                if (channelName.Equals(kv.Key))
-                                {
-                                    foreach (var eventInfo in varBody.Value.EventInfos.Values)
-                                    {
-                                        foreach (var data in eventInfo)
-                                        {
-                                            if (data.m_eventFrameIndex > 0)
-                                            {
-                                                float x = x_offset + data.m_eventFrameIndex * kv.Value.XStep - kv.Value.ScrollPos.x;
-                                                if (x <= x_offset - kv.Value.XStep) continue;
-                                                if (x >= mWidth + x_offset) break;
-                                                float y0 = scrolled_y_pos + height;
-
-                                                Rect tooltip_r = new Rect(x - 75, y0, 100, 20);
-                                                HoverText.normal.textColor = Color.white;
-                                                GUI.Label(tooltip_r, data.m_eventName, HoverText);
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    scrolled_y_pos += (height + y_gap);
-                }
+                scrolled_y_pos = y_offset - mGraphViewScrollPos.y;
+                scrolled_y_pos = ShowEventLabel(scrolled_y_pos);
                 GL.PopMatrix();

                 GL.Viewport(new Rect(0, 0, rect.width, rect.height));
@@ -509,10 +481,6 @@
                 s.stretchWidth = true;
                 Rect r = EditorGUILayout.BeginVertical(s);
                 r.height = height;
-                //if (r.width !=0)
-                //{
-                //    mWidth = r.width - x_offset;
-                //}

                 string num_format = "###,###,##0.";
                 for( int i = 0; i < precision_slider; i++ )
@@ -523,27 +491,33 @@
                 //skip subgraph title if only one, and it's the same.
                 NameLabel.normal.textColor = Color.white;

-                EditorGUILayout.BeginHorizontal();
+                GUILayout.BeginHorizontal();
                 EditorGUILayout.LabelField(kv.Key, NameLabel, GUILayout.Width(x_offset-80));
-                    if(kv.Value.mData.Count>0)
+                GUILayout.BeginVertical();
+                    if (kv.Value.mData.Count > 0)
                         EditorGUILayout.LabelField("Max:" + kv.Value.m_maxValue.ToString(num_format), NameLabel);
-                EditorGUILayout.EndHorizontal();
+                    if (kv.Value.mData.Count > 0)
+                        EditorGUILayout.LabelField("Max:" + kv.Value.m_maxValue.ToString(num_format), NameLabel);
+                    if (kv.Value.mData.Count > 0)
+                        EditorGUILayout.LabelField("Max:" + kv.Value.m_maxValue.ToString(num_format), NameLabel);
+                GUILayout.EndVertical();
+                GUILayout.EndHorizontal();
+
+                foreach (KeyValuePair<string, GraphItDataInternal> entry in kv.Value.mData)
+                {
+                    GraphItDataInternal g = entry.Value;
+                    if (kv.Value.mData.Count > 1 || entry.Key != VarTracer.BASE_GRAPH)
+                    {
+                        NameLabel.normal.textColor = g.mColor;
+                    }
+                    //EditorGUILayout.LabelField(entry.Key +"   Avg: " + g.mAvg.ToString(num_format) + " (" + g.mFastAvg.ToString(num_format) + "),Min: " + g.mMin.ToString(num_format) + ",Max: " + g.mMax.ToString(num_format), NameLabel);
+                    EditorGUILayout.LabelField(entry.Key + "   Value: " + g.mCurrentValue.ToString(num_format), NameLabel);
+                }

                 EditorGUILayout.BeginHorizontal();
                 if (kv.Value.mData.Count > 0)
                     EditorGUILayout.LabelField("Min:" + kv.Value.m_minValue.ToString(num_format), NameLabel);
                 EditorGUILayout.EndHorizontal();
-
-                foreach (KeyValuePair<string, GraphItDataInternal> entry in kv.Value.mData)
-                {
-                    GraphItDataInternal g = entry.Value;
-                    if (kv.Value.mData.Count > 1 || entry.Key != VarTracer.BASE_GRAPH)
-                    {
-                        NameLabel.normal.textColor = g.mColor;
-                    }
-                    //EditorGUILayout.LabelField(entry.Key +"   Avg: " + g.mAvg.ToString(num_format) + " (" + g.mFastAvg.ToString(num_format) + "),Min: " + g.mMin.ToString(num_format) + ",Max: " + g.mMax.ToString(num_format), NameLabel);
-                    EditorGUILayout.LabelField(entry.Key + "   Value: " + g.mCurrentValue.ToString(num_format), NameLabel);
-                }

                 GUILayout.BeginHorizontal();
                 HoverText.normal.textColor = Color.grey;
@@ -566,16 +540,55 @@
                     window.Repaint();
                 }

-                EditorGUILayout.EndVertical();
-
                 GUILayout.BeginHorizontal();
                 GUILayout.Space(x_offset);
                 kv.Value.ScrollPos = GUILayout.BeginScrollView(kv.Value.ScrollPos, GUILayout.Width(mWidth), GUILayout.Height(0));
                 GUILayout.Label("", GUILayout.Width(width), GUILayout.Height(0));
                 GUILayout.EndScrollView();
                 GUILayout.EndHorizontal();
+
+                EditorGUILayout.EndVertical();
             }
             EditorGUILayout.EndScrollView();
         }
     }
+
+    private static float ShowEventLabel(float scrolled_y_pos)
+    {
+        foreach (KeyValuePair<string, GraphItData> kv in VarTracer.Instance.Graphs)
+        {
+            float height = kv.Value.GetHeight();
+            foreach (var varBody in VarTracer.Instance.VariableBodys)
+            {
+                foreach (var var in varBody.Value.VariableDict.Values)
+                {
+                    foreach (var channelName in var.ChannelDict.Values)
+                    {
+                        if (channelName.Equals(kv.Key))
+                        {
+                            foreach (var eventInfo in varBody.Value.EventInfos.Values)
+                            {
+                                foreach (var data in eventInfo)
+                                {
+                                    if (data.m_eventFrameIndex > 0)
+                                    {
+                                        float x = x_offset + data.m_eventFrameIndex * kv.Value.XStep - kv.Value.ScrollPos.x;
+                                        if (x <= x_offset - kv.Value.XStep) continue;
+                                        if (x >= mWidth + x_offset) break;
+                                        float y0 = scrolled_y_pos + height;
+
+                                        Rect tooltip_r = new Rect(x - 75, y0, 100, 20);
+                                        HoverText.normal.textColor = Color.white;
+                                        GUI.Label(tooltip_r, data.m_eventName, HoverText);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            scrolled_y_pos += (height + y_gap);
+        }
+        return scrolled_y_pos;
+    }
 }


Added the Electrified Status' icon and spark animation

-Added a private CroppedTexture2D SparkIcon field in ElectrifiedStatus and defined a StatusIcon for ElectrifiedStatus
-Overrode DrawStatusInfo() in ElectrifiedStatus and drew the spark icon with an instance-independent scale

--- PaperMarioBattleSystem/PaperMarioBattleSystem/Classes/StatusEffects/ElectrifiedStatus.cs
+++ PaperMarioBattleSystem/PaperMarioBattleSystem/Classes/StatusEffects/ElectrifiedStatus.cs
@@ -3,6 +3,8 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;

 namespace PaperMarioBattleSystem
 {
@@ -12,6 +14,8 @@
     /// </summary>
     public sealed class ElectrifiedStatus : StatusEffect
     {
+        private CroppedTexture2D SparkIcon = null;
+
         public ElectrifiedStatus(int duration)
         {
             StatusType = Enumerations.StatusTypes.Electrified;
@@ -19,9 +23,15 @@
             //Stone Caps suppress Electrified
             Alignment = StatusAlignments.Negative;

+            StatusIcon = new CroppedTexture2D(AssetManager.Instance.LoadAsset<Texture2D>($"{ContentGlobals.UIRoot}/Battle/BattleGFX"),
+                new Rectangle(658, 106, 38, 46));
+
             Duration = duration;

             AfflictedMessage = "Electrified! Enemies that\nmake contact will get hurt!";
+
+            SparkIcon = new CroppedTexture2D(AssetManager.Instance.LoadAsset<Texture2D>($"{ContentGlobals.UIRoot}/Battle/BattleGFX"),
+                new Rectangle(458, 103, 26, 30));
         }

         protected override void OnAfflict()
@@ -53,5 +63,30 @@
         {
             return new ElectrifiedStatus(Duration);
         }
+
+        public override void DrawStatusInfo(Vector2 iconPos, float depth, float turnStringDepth)
+        {
+            base.DrawStatusInfo(iconPos, depth, turnStringDepth);
+
+            //Draw the Spark symbol
+            //It's stored as a separate graphic since it scales
+
+            //The spark is initially at a smaller scale and scales to its normal size roughly every 2 seconds for roughly 10 frames (I eyeballed it from a video)
+            float sparkScale = .8f;
+            const double smallInterval = 2000d;
+            const double largeInterval = 170d;
+
+            //Get the remainder of the small interval. If it's less than the large interval value, then scale up the spark
+            double scaleInterval = (Time.ActiveMilliseconds % smallInterval);
+            if (scaleInterval < largeInterval) sparkScale = 1f;
+
+            Vector2 sparkOrigin = SparkIcon.SourceRect.Value.GetCenterOrigin();
+            sparkOrigin = new Vector2((int)(sparkOrigin.X * 1.5f), (int)(sparkOrigin.Y * 1.5f) - 3);
+
+            Vector2 sparkPos = iconPos + sparkOrigin;
+            float sparkDepth = depth + .00001f;
+
+            SpriteRenderer.Instance.Draw(SparkIcon.Tex, sparkPos, SparkIcon.SourceRect, Color.White, 0f, new Vector2(.5f, .5f), sparkScale, false, sparkDepth, true);
+        }
     }
 }


Add the Context to the Imports list, since we ALWAYS use it!

--- SmaSTraDesigner/code/local/SmaSTraDesigner/BusinessLogic/codegeneration/JavaGenerator.cs
+++ SmaSTraDesigner/code/local/SmaSTraDesigner/BusinessLogic/codegeneration/JavaGenerator.cs
@@ -153,6 +153,8 @@

 			/////////import section///////
 			List<string> imports = code[0];
+            //Do not forget to add Android context!
+            imports.Add("android.content.Context");
 			imports = imports.Distinct().ToList();
 			string import = "";


Add failing unit test 'GetChanges_On_Deleted_Customer_With_Deleted_CustomerSetting_Should_Return_CustomerSetting_Marked_As_Deleted' Issue #122

--- Source/Tests/TrackableEntities.Client.Tests/ChangeTrackingCollectionWithChildrenTests.cs
+++ Source/Tests/TrackableEntities.Client.Tests/ChangeTrackingCollectionWithChildrenTests.cs
@@ -1838,6 +1838,31 @@
             Assert.Equal(TrackingState.Unchanged, customerSetting.TrackingState);
         }

+        [Fact]
+        public void GetChanges_On_Deleted_Customer_With_Deleted_CustomerSetting_Should_Return_CustomerSetting_Marked_As_Deleted()
+        {
+            // Arrange
+            var database = new MockNorthwind();
+            var customer = database.Customers[0];
+            customer.CustomerSetting = new CustomerSetting
+            {
+                CustomerId = customer.CustomerId,
+                Setting = "Setting1",
+                Customer = customer
+            };
+            var changeTracker = new ChangeTrackingCollection<Customer>(customer);
+
+            // Act
+            customer.CustomerSetting.TrackingState = TrackingState.Deleted;
+            changeTracker.Remove(customer);
+            var changes = changeTracker.GetChanges();
+
+            // Assert
+            Assert.NotEmpty(changes);
+            Assert.Equal(TrackingState.Deleted, changes.First().TrackingState);
+            Assert.Equal(TrackingState.Deleted, changes.First().CustomerSetting.TrackingState);
+        }
+
         #endregion
     }
 }


Using singlecomment partial view for generating all the comments in the facility details page

--- Source/Web/SportsBook.Web/Areas/Facilities/Views/FacilitiesPublic/FacilityDetails.cshtml
+++ Source/Web/SportsBook.Web/Areas/Facilities/Views/FacilitiesPublic/FacilityDetails.cshtml
@@ -114,64 +114,23 @@

                 <button class="submit-comment-button btn btn-primary" data-id="@Model.Id">Add comment</button>

-

-

-
-
     @foreach (var comment in Model.FacilityComments)
     {
         if (comment.IsDeleted == false)
         {
-

-

-

-                        @comment.AuthorName@Html.DisplayFor(m => comment.CreatedOn, "DateTimeTemplate")
-

-

-

-

-

-                            @comment.Content
-

-

-                    @if (User.Identity.GetUserId() == @comment.AuthorId)
-                    {
-

-

-

-

-                                        @Html.ActionLink("Edit", "EditComment", "Comments", new { area = "Facilities", id = comment.Id }, new { @class = "btn btn-warning" })
-                                        @using (Html.BeginForm("DeleteComment", "Comments", new { area = "Facilities", id = comment.Id }, FormMethod.Post))
-                                        {
-                                            @Html.AntiForgeryToken()
-                                            <input type="submit" class="btn btn-danger" value="Delete" />
-                                            @*@Html.ActionLink("Delete", "DeleteComment", "Comments", new { id = comment.Id }, new { @class = "btn btn-danger"})*@
-                                        }
-

-

-

-

-                    }
-

-

-
+

+                @{
+                    var commentViewModel = SportsBook.Web.Infrastructure.Mapping.AutoMapperConfig.Configuration.CreateMapper().Map<SportsBook.Web.Areas.Facilities.ViewModels.Comments.CommentViewModel>(comment);
+                    @Html.Partial("_SingleComment", commentViewModel)
+                }

-
         }
     }

-
-
-
-
-
-
-
-

 @section ToggleCommentsSection{


added UTC time for static update methods

--- Source/nHydrate.Generator.EFCodeFirst/Generators/SQLHelper/SQLHelperGeneratedTemplate.cs
+++ Source/nHydrate.Generator.EFCodeFirst/Generators/SQLHelper/SQLHelperGeneratedTemplate.cs
@@ -584,7 +584,7 @@
             var fieldName = _model.Database.ModifiedByColumnName;
             sb.AppendLine("					if (hasModifyAudit && (fieldName != \"" + fieldName + "\")) sql += \", [\" + parser.GetTableAlias(fieldName, leafTable) + \"].[" + fieldName + "] = NULL\\r\\n\";");
             fieldName = _model.Database.ModifiedDateColumnName;
-            sb.AppendLine("					if (hasModifyAudit && (fieldName != \"" + fieldName + "\")) sql += \", [\" + parser.GetTableAlias(fieldName, leafTable) + \"].[" + fieldName + "] = sysdatetime()\\r\\n\";");
+            sb.AppendLine("					if (hasModifyAudit && (fieldName != \"" + fieldName + "\")) sql += \", [\" + parser.GetTableAlias(fieldName, leafTable) + \"].[" + fieldName + "] = " + (_model.UseUTCTime ? "sysutcdatetime" : "sysdatetime") + "()\\r\\n\";");
             sb.AppendLine("					sql += parser.GetFromClause(new QueryOptimizer()) + \"\\r\\n\";");
             sb.AppendLine("					sql += parser.GetWhereClause();");
             sb.AppendLine("					sql += \";select @@rowcount\";");


Added test for events with multiple contexts

--- Tests/Tests/Tests/Entitas.CodeGeneration/DataProviders/describe_ComponentDataProvider.cs
+++ Tests/Tests/Tests/Entitas.CodeGeneration/DataProviders/describe_ComponentDataProvider.cs
@@ -119,10 +119,26 @@
                 var d = getMultipleData<StandardEventComponent>();
                 d.Length.should_be(2);
                 d[1].IsEvent().should_be_false();
-                d[1].GetTypeName().should_be("TestStandardEventListenerComponent");
+                d[1].GetTypeName().should_be("StandardEventListenerComponent");
                 d[1].GetMemberData().Length.should_be(1);
                 d[1].GetMemberData()[0].name.should_be("value");
-                d[1].GetMemberData()[0].type.should_be("ITestStandardEventListener");
+                d[1].GetMemberData()[0].type.should_be("IStandardEventListener");
+            };
+
+            it["creates data for event listeners with multiple contexts"] = () => {
+                var d = getMultipleData<MultipleContextStandardEventComponent>();
+                d.Length.should_be(3);
+                d[1].IsEvent().should_be_false();
+                d[1].GetTypeName().should_be("TestMultipleContextStandardEventListenerComponent");
+                d[1].GetMemberData().Length.should_be(1);
+                d[1].GetMemberData()[0].name.should_be("value");
+                d[1].GetMemberData()[0].type.should_be("ITestMultipleContextStandardEventListener");
+
+                d[2].IsEvent().should_be_false();
+                d[2].GetTypeName().should_be("Test2MultipleContextStandardEventListenerComponent");
+                d[2].GetMemberData().Length.should_be(1);
+                d[2].GetMemberData()[0].name.should_be("value");
+                d[2].GetMemberData()[0].type.should_be("ITest2MultipleContextStandardEventListener");
             };
         };


fixed play controller minigame path

fixed play controller minigame path

--- WebApp/ToTheRescueWebApplication/ToTheRescueWebApplication/Controllers/PlayController.cs
+++ WebApp/ToTheRescueWebApplication/ToTheRescueWebApplication/Controllers/PlayController.cs
@@ -365,6 +365,7 @@
                 }
                 model.MiniGameID = minigames[ranGame].ID;
                 model.CategoryID = minigames[ranGame].MiniGameCategoryID;
+                model.MiniGame = minigames[ranGame].MiniGamePath;
             }
             else    //free play mode
             {


added Worker.PhotoItems is virtual test

added Worker.PhotoItems is virtual test

--- WhenItsDone/Tests/LibTests/WhenItsDone.Models.Tests/WorkerTests/WorkerPhotoItemsTests.cs
+++ WhenItsDone/Tests/LibTests/WhenItsDone.Models.Tests/WorkerTests/WorkerPhotoItemsTests.cs
@@ -1,6 +1,7 @@
 using Moq;
 using NUnit.Framework;
 using System.Collections.Generic;
+using System.Linq;

 namespace WhenItsDone.Models.Tests.WorkerTests
 {
@@ -18,5 +19,19 @@

             Assert.AreSame(mockedCollection.Object, obj.PhotoItems);
         }
+
+        [Test]
+        public void PhotoItems_ShouldBe_Virtual()
+        {
+            var obj = new Worker();
+
+            var result = obj.GetType()
+                            .GetProperty("PhotoItems")
+                            .GetAccessors()
+                            .Where(x => x.IsVirtual)
+                            .Any();
+
+            Assert.IsTrue(result);
+        }
     }
 }


Update

Update

--- Runtime/LibMono/Actor.cs
+++ Runtime/LibMono/Actor.cs
@@ -306,6 +306,18 @@

 			return actor;
 		}
+
+		public static Actor Create(GameObject prefab, Vector3 position, bool pooled = false)
+		{
+			var tr = pooled ? HelperFramework.SpawnInternal(Pool.Entities, prefab, position) : HelperFramework.SpawnInternal(prefab, position);
+			var actor = tr.AddGetActor();
+
+			actor.isPooled = pooled;
+			actor.Launch();
+
+			return actor;
+		}
+

 		public static Actor Create(GameObject prefab, bool pooled = false)
 		{


Update EventAdminControllerTests to use MakeUserAnOrgAdmin and MakeUserNotAnOrgAdmin extenstion methods of ControllerTestHelpers (#1165)

--- AllReadyApp/Web-App/AllReady.UnitTest/Areas/Admin/Controllers/EventAdminControllerTests.cs
+++ AllReadyApp/Web-App/AllReady.UnitTest/Areas/Admin/Controllers/EventAdminControllerTests.cs
@@ -58,11 +58,7 @@
             mediator.Setup(x => x.SendAsync(It.IsAny<EventDetailQuery>())).ReturnsAsync(new EventDetailViewModel { Id = 1, Name = "Itinerary", OrganizationId = 1 });

             var sut = new EventController(null, mediator.Object, null);
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, It.IsAny<int>().ToString())
-            });
+            sut.MakeUserNotAnOrgAdmin();
             Assert.IsType<UnauthorizedResult>(await sut.Details(It.IsAny<int>()));
         }

@@ -73,11 +69,7 @@
             mediator.Setup(x => x.SendAsync(It.IsAny<EventDetailQuery>())).ReturnsAsync(new EventDetailViewModel { Id = 1, Name = "Itinerary", OrganizationId = 1 });

             var sut = new EventController(null, mediator.Object, null);
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, It.IsAny<int>().ToString())
-            });
+            sut.MakeUserNotAnOrgAdmin();
             Assert.IsType<UnauthorizedResult>(await sut.Details(It.IsAny<int>()));
         }

@@ -128,11 +120,7 @@
             mediator.Setup(x => x.SendAsync(It.IsAny<EventDetailQuery>())).ReturnsAsync(new EventDetailViewModel { Id = 1, Name = "Itinerary", OrganizationId = 1 });

             var sut = new EventController(null, mediator.Object, null);
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, It.IsAny<int>().ToString())
-            });
+            sut.MakeUserNotAnOrgAdmin();

             Assert.IsType<UnauthorizedResult>(await sut.Create(It.IsAny<int>()));
         }
@@ -266,11 +254,7 @@
             mediator.Setup(x => x.SendAsync(It.IsAny<EventEditQuery>())).ReturnsAsync(new EventEditViewModel { Id = 1, Name = "Itinerary", OrganizationId = 1 });

             var sut = new EventController(null, mediator.Object, null);
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, It.IsAny<int>().ToString())
-            });
+            sut.MakeUserNotAnOrgAdmin();
             Assert.IsType<UnauthorizedResult>(await sut.Edit(It.IsAny<int>()));
         }

@@ -402,11 +386,7 @@
             mediator.Setup(x => x.SendAsync(It.IsAny<EventDetailQuery>())).ReturnsAsync(new EventDetailViewModel { Id = 1, Name = "Itinerary", OrganizationId = 1 });

             var sut = new EventController(null, mediator.Object, null);
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, It.IsAny<int>().ToString())
-            });
+            sut.MakeUserNotAnOrgAdmin();

             Assert.IsType<UnauthorizedResult>(await sut.Delete(It.IsAny<int>()).ConfigureAwait(false));
         }
@@ -458,11 +438,7 @@
             mediator.Setup(x => x.SendAsync(It.IsAny<EventDetailQuery>())).ReturnsAsync(new EventDetailViewModel { Id = 1, Name = "Itinerary", OrganizationId = 1 });

             var sut = new EventController(null, mediator.Object, null);
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, It.IsAny<int>().ToString())
-            });
+            sut.MakeUserNotAnOrgAdmin();

             Assert.IsType<UnauthorizedResult>(await sut.DeleteConfirmed(It.IsAny<int>()).ConfigureAwait(false));
         }
@@ -523,11 +499,7 @@
             mediator.Setup(x => x.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { CampaignId = 1, Campaign = new Campaign { ManagingOrganizationId = 1 } });

             var sut = new EventController(null, mediator.Object, null);
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.BasicUser.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, "1")
-            });
+            sut.MakeUserNotAnOrgAdmin();

             Assert.IsType<UnauthorizedResult>(sut.Assign(It.IsAny<int>()));
         }
@@ -535,15 +507,13 @@
         [Fact]
         public void AssignReturnsCorrectViewModel()
         {
-            var mediator = new Mock<IMediator>();
-            mediator.Setup(x => x.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { CampaignId = 1, Campaign = new Campaign { ManagingOrganizationId = 1 } });
-
-            var sut = new EventController(null, mediator.Object, null);
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, "1")
-            });
+            const int orgId = 1;
+
+            var mediator = new Mock<IMediator>();
+            mediator.Setup(x => x.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { CampaignId = 1, Campaign = new Campaign { ManagingOrganizationId = orgId } });
+
+            var sut = new EventController(null, mediator.Object, null);
+            sut.MakeUserAnOrgAdmin(orgId.ToString());

             var result = (ViewResult) sut.Assign(It.IsAny<int>());
             var resultModel = result.ViewData.Model;
@@ -718,6 +688,107 @@
             var mockMediator = new Mock<IMediator>();
             mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = 1000 } }).Verifiable();

+            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
+            sut.MakeUserNotAnOrgAdmin();
+
+            Assert.IsType<UnauthorizedResult>(await sut.Requests(It.IsAny<int>(), null));
+        }
+
+        [Fact]
+        public async Task RequestsReturnsRedirectWhenStatusDoesNotMatchEnumOptions()
+        {
+            const int orgId = 1;
+
+            var mockMediator = new Mock<IMediator>();
+            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = orgId } }).Verifiable();
+
+            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
+            sut.MakeUserAnOrgAdmin(orgId.ToString());
+
+            Assert.IsType<RedirectToActionResult>(await sut.Requests(It.IsAny<int>(), "MadeUp"));
+        }
+
+        [Fact]
+        public async Task RequestsSendsEventRequestsQueryWhenNoStatusRouteParamPassedAndUserIsOrgAdmin()
+        {
+            const int orgId = 1;
+            var mockMediator = new Mock<IMediator>();
+            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = orgId } }).Verifiable();
+            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<EventRequestsQuery>())).ReturnsAsync(new EventRequestsViewModel()).Verifiable();
+
+            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
+            sut.MakeUserAnOrgAdmin(orgId.ToString());
+
+            await sut.Requests(1, null);
+
+            mockMediator.Verify(x => x.SendAsync(It.IsAny<EventRequestsQuery>()), Times.Once);
+        }
+
+        [Fact]
+        public async Task RequestsSendsEventRequestListItemsQueryWhenNoStatusRouteParamPassedAndUserIsOrgAdmin()
+        {
+            const int orgId = 1;
+
+            var mockMediator = new Mock<IMediator>();
+            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = orgId } }).Verifiable();
+            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<EventRequestsQuery>())).ReturnsAsync(new EventRequestsViewModel()).Verifiable();
+            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<RequestListItemsQuery>())).ReturnsAsync(new List<RequestListViewModel>()).Verifiable();
+
+            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
+            sut.MakeUserAnOrgAdmin(orgId.ToString());
+
+            await sut.Requests(1, null);
+
+            mockMediator.Verify(x => x.SendAsync(It.IsAny<RequestListItemsQuery>()), Times.Once);
+        }
+
+        [Fact]
+        public async Task RequestsSendsEventRequestsQueryWhenValidStatusRouteParamPassedAndUserIsOrgAdmin()
+        {
+            const int orgId = 1;
+
+            var mockMediator = new Mock<IMediator>();
+            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = orgId }}).Verifiable();
+            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<EventRequestsQuery>())).ReturnsAsync(new EventRequestsViewModel()).Verifiable();
+
+            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
+            sut.MakeUserAnOrgAdmin(orgId.ToString());
+
+            await sut.Requests(1, "Assigned");
+
+            mockMediator.Verify(x => x.SendAsync(It.IsAny<EventRequestsQuery>()), Times.Once);
+        }
+
+        [Fact]
+        public async Task RequestsSetsCorrectPageTitleOnModelWhenStatusParamIsNotSet()
+        {
+            const int orgId = 1;
+
+            var mockMediator = new Mock<IMediator>();
+            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = orgId } }).Verifiable();
+            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<EventRequestsQuery>())).ReturnsAsync(new EventRequestsViewModel()).Verifiable();
+
+            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
+            sut.MakeUserAnOrgAdmin(orgId.ToString());
+
+            var result = await sut.Requests(1, null) as ViewResult;
+
+            result.ShouldNotBeNull();
+
+            var castModel = result.Model as EventRequestsViewModel;
+
+            castModel.ShouldNotBeNull();
+
+            castModel.PageTitle.ShouldBe("All Requests");
+        }
+
+        [Fact]
+        public async Task RequestsSetsCorrectPageTitleOnModelWhenStatusParamIsSet()
+        {
+            var mockMediator = new Mock<IMediator>();
+            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = 1 } }).Verifiable();
+            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<EventRequestsQuery>())).ReturnsAsync(new EventRequestsViewModel()).Verifiable();
+
             var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
             sut.SetClaims(new List<Claim>
             {
@@ -725,122 +796,6 @@
                 new Claim(AllReady.Security.ClaimTypes.Organization, "1")
             });

-            Assert.IsType<UnauthorizedResult>(await sut.Requests(It.IsAny<int>(), null));
-        }
-
-        [Fact]
-        public async Task RequestsReturnsRedirectWhenStatusDoesNotMatchEnumOptions()
-        {
-            var mockMediator = new Mock<IMediator>();
-            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = 1 } }).Verifiable();
-
-            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, "1")
-            });
-
-            Assert.IsType<RedirectToActionResult>(await sut.Requests(It.IsAny<int>(), "MadeUp"));
-        }
-
-        [Fact]
-        public async Task RequestsSendsEventRequestsQueryWhenNoStatusRouteParamPassedAndUserIsOrgAdmin()
-        {
-            var mockMediator = new Mock<IMediator>();
-            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = 1 } }).Verifiable();
-            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<EventRequestsQuery>())).ReturnsAsync(new AllReady.Areas.Admin.ViewModels.Event.EventRequestsViewModel()).Verifiable();
-
-            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, "1")
-            });
-
-            await sut.Requests(1, null);
-
-            mockMediator.Verify(x => x.SendAsync(It.IsAny<EventRequestsQuery>()), Times.Once);
-        }
-
-        [Fact]
-        public async Task RequestsSendsEventRequestListItemsQueryWhenNoStatusRouteParamPassedAndUserIsOrgAdmin()
-        {
-            var mockMediator = new Mock<IMediator>();
-            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = 1 } }).Verifiable();
-            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<EventRequestsQuery>())).ReturnsAsync(new EventRequestsViewModel()).Verifiable();
-            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<RequestListItemsQuery>())).ReturnsAsync(new List<RequestListViewModel>()).Verifiable();
-
-            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, "1")
-            });
-
-            await sut.Requests(1, null);
-
-            mockMediator.Verify(x => x.SendAsync(It.IsAny<RequestListItemsQuery>()), Times.Once);
-        }
-
-        [Fact]
-        public async Task RequestsSendsEventRequestsQueryWhenValidStatusRouteParamPassedAndUserIsOrgAdmin()
-        {
-            var mockMediator = new Mock<IMediator>();
-            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = 1 } }).Verifiable();
-            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<EventRequestsQuery>())).ReturnsAsync(new EventRequestsViewModel()).Verifiable();
-
-            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, "1")
-            });
-
-            await sut.Requests(1, "Assigned");
-
-            mockMediator.Verify(x => x.SendAsync(It.IsAny<EventRequestsQuery>()), Times.Once);
-        }
-
-        [Fact]
-        public async Task RequestsSetsCorrectPageTitleOnModelWhenStatusParamIsNotSet()
-        {
-            var mockMediator = new Mock<IMediator>();
-            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = 1 } }).Verifiable();
-            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<EventRequestsQuery>())).ReturnsAsync(new EventRequestsViewModel()).Verifiable();
-
-            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, "1")
-            });
-
-            var result = await sut.Requests(1, null) as ViewResult;
-
-            result.ShouldNotBeNull();
-
-            var castModel = result.Model as EventRequestsViewModel;
-
-            castModel.ShouldNotBeNull();
-
-            castModel.PageTitle.ShouldBe("All Requests");
-        }
-
-        [Fact]
-        public async Task RequestsSetsCorrectPageTitleOnModelWhenStatusParamIsSet()
-        {
-            var mockMediator = new Mock<IMediator>();
-            mockMediator.Setup(mock => mock.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { ManagingOrganizationId = 1 } }).Verifiable();
-            mockMediator.Setup(mock => mock.SendAsync(It.IsAny<EventRequestsQuery>())).ReturnsAsync(new EventRequestsViewModel()).Verifiable();
-
-            var sut = new EventController(Mock.Of<IImageService>(), mockMediator.Object, Mock.Of<IValidateEventDetailModels>());
-            sut.SetClaims(new List<Claim>
-            {
-                new Claim(AllReady.Security.ClaimTypes.UserType, UserType.OrgAdmin.ToString()),
-                new Claim(AllReady.Security.ClaimTypes.Organization, "1")
-            });
-
             var result = await sut.Requests(1, "Assigned") as ViewResult;

             result.ShouldNotBeNull();


add of report num

add of report num

--- Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
+++ Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/SolrResponseItem.cs
@@ -66,7 +66,7 @@

         //IAdvertise
         public string[] reactions { get; set; }
-
+        public string report_number { get; set; }

     }
 }


Create Task 3.3 - Save Properties With BinaryWriter.cs


Fixed metadata tests

Fixed metadata tests

--- GridDomain.Tests.Unit/Metadata/Metadata_from_command_passed_to_produced_scheduled_fault.cs
+++ GridDomain.Tests.Unit/Metadata/Metadata_from_command_passed_to_produced_scheduled_fault.cs
@@ -31,7 +31,7 @@
             var res = await GridNode.PrepareCommand(_command, _commandMetadata)
                                     .Expect<JobFailed>()
                                     .And<IFault<RaiseScheduledDomainEventCommand>>()
-                                    .Execute(TimeSpan.FromSeconds(30));
+                                    .Execute(TimeSpan.FromSeconds(30),false);

             _schedulingCommandFault = res.Message<IMessageMetadataEnvelop<IFault<RaiseScheduledDomainEventCommand>>>();
             _jobFailedEnvelop = res.Message<IMessageMetadataEnvelop<JobFailed>>();


Initial highlighting spheres

Initial highlighting spheres

--- Assets/StateMech.cs
+++ Assets/StateMech.cs
@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System.Collections;

 public class StateMech : MonoBehaviour {
@@ -11,6 +11,8 @@

 	private GameObject camera3rdPerson;
 	private GameObject camera1stPerson;
+
+	private ArrayList spheres = new ArrayList();

 	public bool OVRActive = false;
 	public float timeLoop = (float)30.0;
@@ -38,7 +40,7 @@

 	// Update is called once per frame
 	void Update () {
-		//Debug.Log ("Time: " + Time.time);
+		Debug.Log ("Time: " + Time.time);
 		if (Time.time > timeLoop + timeOffset) { // Seconds since start of game
 			//Debug.Log("Stopped recording");
 			if(position == 0) {
@@ -53,7 +55,15 @@
 				//findGameObject("Dana", gameObject).GetComponent("Zig Skeleton").active = false;

 			}
+
+			// Destroy the last frame of spheres
+			foreach(GameObject sphere in spheres) {
+				Destroy(sphere);
+			}
+			spheres.Clear();
+
 			setFromHash(gameObject.transform);
+
 			position++;
 			if (position == max) {
 				timeOffset = Time.time;
@@ -65,6 +75,7 @@
 				gameObject.rigidbody.velocity = new Vector3(0, 0, 0);
 				saved = new Hashtable();
 				position = 0;
+				max = 0;
 			}
 		} else {
 			//Debug.Log("Atleast Im here?");
@@ -80,6 +91,21 @@
 			Quaternion gamerotation = reference.rotation;
 			transform.position = gamePosition;
 			transform.rotation = gamerotation;
+
+			// Create red highlighted portions for all transforms that contain a certain string
+			if(transform.name.Contains("Leg")) {
+				GameObject mySphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
+				spheres.Add(mySphere);
+				mySphere.collider.enabled = false;
+				mySphere.transform.localScale = new Vector3(1, 1, 1) / 5;
+				mySphere.transform.position = transform.position;
+				Color color = mySphere.renderer.material.color;
+				color = Color.red;
+				color.a = 1-reference.score;
+				mySphere.renderer.material.color = color;
+				mySphere.renderer.material.shader = Shader.Find( "Transparent/Diffuse" );
+			}
+
 			foreach(Transform child in transform) {
 				if(!child.name.Contains("camera")){
 					setFromHash(child);
@@ -149,7 +175,7 @@
 class GOReference {
 	public Vector3 position;
 	public Quaternion rotation;
-	public float score;
+	public float score = 0.5f;
 }

 class PlayerData {


changed eatall instances to eattext.

changed eatall instances to eattext.

--- StripSystem/Filter.cs
+++ StripSystem/Filter.cs
@@ -46,7 +46,7 @@
         }

         private void OnChannelNormalMessage(ChannelNormalMessageArgs argument)
-        {
+        {
             //sometimes ( mostly twitch ) user ident or host is not yet known even though a message was received
             if (argument.User == null || argument.User.Ident == null || argument.User.Host == null)
                 return;
@@ -54,7 +54,7 @@
             var userKey = argument.Server.Network + argument.Channel.Name + argument.User.Host;

             if (!_userDatabase.ContainsKey(userKey))
-            {
+            {
                 var newData = new UserData { AnnouncedJoin = true, LastMessage = DateTime.Now };
                 _userDatabase.Add(userKey, newData);
             }
@@ -63,15 +63,14 @@
                 var userData = _userDatabase[userKey];

                 if (!userData.AnnouncedJoin)
-                {
-
+                {
                     argument.Message += $" {ColourCode}(logged in {userData.TimeSinceJoin()} ago)";

                     userData.AnnouncedJoin = true;
                 }

                 userData.LastMessage = DateTime.Now;
-            }
+            }
         }

         private void OnChannelJoin(ChannelJoinArgs argument)
@@ -191,7 +190,7 @@
                 }
             }

-            argument.EatData = EatData.EatAll;
+            argument.EatData = EatData.EatText;
             var userKey = argument.Server.Network + argument.Channel.Name + user.Host;

             if (!_userDatabase.ContainsKey(userKey)) return;


Implement single mesh generation

Implement single mesh generation

--- Scene/EditMapRenderer.cs
+++ Scene/EditMapRenderer.cs
@@ -1,4 +1,5 @@
-using System;
+using System.Collections.Generic;
+using UnityEditor;
 using UnityEngine;

 namespace MetroTileEditor.Renderers
@@ -14,7 +15,7 @@

         public GameObject BlockAdded(int x, int y, int z, BlockData data)
         {
-            var newBlock = GenerateCube(new Vector3(x + 0.5f, y + 0.5f, z - 0.5f), data.blockType);
+            var newBlock = GenerateCube(new Vector3(x + 0.5f, y + 0.5f, z - 0.5f), data.blockType, parent);
             newBlock.GetComponent<Block>().SetBlockData(data);
             return newBlock;
         }
@@ -67,7 +68,22 @@
             }
         }

-        private GameObject GenerateCube(Vector3 pos, string blockType)
+        public void RecreateMap(BlockData[,,] blockDataArray, Vector3 offset, string mapName)
+        {
+            Debug.Log("Recreating blocks");
+            parent = FindSceneObject(mapName + "_data").transform;
+            foreach (Block block in GameObject.Find(mapName + "_data").GetComponentsInChildren<Block>())
+            {
+                Vector3 raw = block.gameObject.transform.position;
+                int x = (int)(raw.x - offset.x);
+                int y = (int)(raw.y - offset.y);
+                int z = (int)(raw.z + 1 - offset.z);
+                blockDataArray[x, y, z] = block.data;
+                blockDataArray[x, y, z].placed = true;
+            }
+        }
+
+        private GameObject GenerateCube(Vector3 pos, string blockType, Transform parent)
         {
             var o = Resources.Load("Blocks/Prefabs/" + blockType);
             GameObject newCube = (GameObject)Instantiate(o ? o : Resources.Load("Blocks/Prefabs/" + "basic_cube"));
@@ -130,23 +146,93 @@
             }
         }

-        public void GenerateMesh(BlockData[,,] blockDataArray, string mapName)
-        {
-            // combine with colliders and create objects in new parent
-        }
-
-        public void RecreateMap(BlockData[,,] blockDataArray,Vector3 offset, string mapName)
-        {
-            Debug.Log("Recreating blocks");
-            parent = FindSceneObject(mapName + "_data").transform;
-            foreach (Block block in GameObject.Find(mapName + "_data").GetComponentsInChildren<Block>())
-            {
-                Vector3 raw = block.gameObject.transform.position;
-                int x = (int)(raw.x - offset.x);
-                int y = (int)(raw.y - offset.y);
-                int z = (int)(raw.z + 1 - offset.z);
-                blockDataArray[x, y, z] = block.data;
-            }
+        public void GenerateMesh(BlockData[,,] blockDataArray, string mapName)
+        {
+            GameObject mapParent = FindSceneObject(mapName + "_mesh");
+            Block[] cols = mapParent.GetComponentsInChildren<Block>();
+            for (int c = 0; c < cols.Length; c++) DestroyImmediate(cols[c].gameObject);
+
+            List<MeshFilter> filters = new List<MeshFilter>();
+            List<CombineInstance> combines = new List<CombineInstance>();
+
+            for (int i = 0; i < blockDataArray.GetLength(0); i++)
+            {
+                for (int j = 0; j < blockDataArray.GetLength(1); j++)
+                {
+                    for (int k = 0; k < blockDataArray.GetLength(2); k++)
+                    {
+                        BlockData curData = blockDataArray[i, j, k];
+                        if (curData != null && curData.placed)
+                        {
+                            GameObject g = GenerateCube(new Vector3(i + 0.5f, j + 0.5f, k - 0.5f), curData.blockType, mapParent.transform);
+                            g.GetComponent<Block>().SetBlockData(curData);
+
+                            MeshFilter gMeshFilter = g.GetComponent<MeshFilter>();
+                            Mesh gMesh = gMeshFilter.mesh;
+
+                            List<Vector2> newUVs = new List<Vector2>(gMesh.uv);
+                            int[] triangles;
+                            for (int x = 0; x < 6; x++)
+                            {
+                                string s = curData.materialIDs[x];
+                                if (!string.IsNullOrEmpty(s))
+                                {
+                                    string[] split = s.Split('_');
+                                    float UVx = int.Parse(split[2]);
+                                    float UVy = int.Parse(split[3]);
+
+                                    triangles = gMesh.GetTriangles(x);
+
+                                    HashSet<int> trianglesIndexSet = new HashSet<int>();
+                                    for (int v = 0; v < triangles.Length; v++)
+                                    {
+                                        trianglesIndexSet.Add(triangles[v]);
+                                    }
+
+                                    foreach (int vertIndex in trianglesIndexSet)
+                                    {
+                                        var newUV = newUVs[vertIndex];
+                                        newUV.x /= 8;
+                                        newUV.y /= 8;
+                                        newUV.x += (UVx / 8);
+                                        newUV.y += (UVy / 8);
+                                        newUVs[vertIndex] = newUV;
+                                    }
+
+                                }
+                            }
+
+                            gMesh.uv = newUVs.ToArray();
+                            gMeshFilter.mesh = gMesh;
+
+                            for (int x = 0; x < 6; x++)
+                            {
+                                string s = curData.materialIDs[x];
+                                if (!string.IsNullOrEmpty(s))
+                                {
+                                    CombineInstance inst = new CombineInstance();
+                                    inst.mesh = gMesh;
+                                    inst.subMeshIndex = x;
+                                    inst.transform = gMeshFilter.transform.localToWorldMatrix;
+                                    combines.Add(inst);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            GameObject finalMesh = new GameObject();
+            Mesh newMesh = new Mesh();
+            newMesh.CombineMeshes(combines.ToArray(), true);
+            Unwrapping.GenerateSecondaryUVSet(newMesh);
+            finalMesh.AddComponent<MeshFilter>().mesh = newMesh;
+            finalMesh.AddComponent<MeshRenderer>();
+            finalMesh.gameObject.SetActive(true);
+            finalMesh.isStatic = true;
+            finalMesh.name = mapName + "_mesh";
+
+            DestroyImmediate(mapParent);
         }
     }
 }


Revert "dnn-26928 Wrong handling of AllowNullBannerType in /Admin/Skins/Banner.ascx.cs"

This reverts commit c24b9e5c2c5106f5cad83547121152f3c215c3cf.

--- Website/admin/Skins/Banner.ascx.cs
+++ Website/admin/Skins/Banner.ascx.cs
@@ -91,14 +91,16 @@
             if (PortalSettings.BannerAdvertising != 0 && Visible)
             {
                 int BannerType = 0;
-                //read bannertype from definition, if not use portalsetting
-                if (!string.IsNullOrEmpty(BannerTypeId))
-                {
-                    BannerType = Int32.Parse(Convert.ToString(BannerTypeId));
+                if (AllowNullBannerType)
+                {
+                    if (!string.IsNullOrEmpty(BannerTypeId))
+                    {
+                        BannerType = Int32.Parse(Convert.ToString(BannerTypeId));
+                    }
                 }
                 else
                 {
-                    if (AllowNullBannerType)
+                    if (string.IsNullOrEmpty(BannerTypeId))
                     {
                         BannerType = PortalController.GetPortalSettingAsInteger("BannerTypeId", PortalSettings.PortalId, 1);
                     }


Made BaseUrl property virtual

Made BaseUrl property virtual

I have a settings object that is the one true source for `BaseUrl`. I'd rather avoid having to observe changes to that object in order to set the `BaseUrl` property on the `RestClient`. Instead, I have a derived `MyRestClient` that sets `BaseUrl` to the value of my settings object. If `BaseUrl` is virtual, I can do this. :)

--- RestSharp/RestClient.cs
+++ RestSharp/RestClient.cs
@@ -261,7 +261,7 @@
 		/// <example>
 		/// client.BaseUrl = "http://example.com";
 		/// </example>
-		public string BaseUrl
+		public virtual string BaseUrl
 		{
 			get
 			{


Got the initial parsing pass really working and did not need to implement complex backtracking.

--- Runic/retreat/Parser.cs
+++ Runic/retreat/Parser.cs
@@ -51,42 +51,13 @@
         //            return read(code, start);
         //        }

-        public Legend read(string start_name = "start")
-        {
-            var start = grammar.rhymes[start_name];
-            var stone = new Position(code, this);
-            var result = match(stone, start, null);
-
-            if (stone.index < code.Length)
-            {
-                stone = check_globals_greedy(stone);
-
-                if (stone.index < code.Length)
-                {
-                    throw new Exception("Could not find match at " + furthest_legend_result.stone.get_position_string());
-                }
-            }
-
-            if (result != null)
-            {
-                return result.legend;
-            }
-
-            if (furthest_legend_result == null)
-            {
-                throw new Exception("Could not find match at 1:1.");
-            }
-            else
-            {
-                throw new Exception("Could not find match at " + furthest_legend_result.stone.get_position_string());
-            }
-
-        }
-
-        public Legend_Result check_globals(Position position)
+        public Legend_Result check_globals(Position position, Rhyme except = null)
         {
             foreach (var rhyme in grammar.global_rhymes)
             {
+                if (rhyme == except)
+                    continue;
+
                 var result = rhyme.match(position, null);
                 if (result != null)
                 {
@@ -97,10 +68,10 @@
             return null;
         }

-        public Position check_globals_greedy(Position stone)
+        public Position check_globals_greedy(Position stone, Rhyme except = null)
         {
             Legend_Result extra = null;
-            while ((extra = check_globals(stone)) != null && extra.stone.index > stone.index)
+            while ((extra = check_globals(stone, except)) != null && extra.stone.index > stone.index)
             {
                 stone = extra.stone;
             }
@@ -112,7 +83,7 @@
         {
 //            if (!grammar.global_rhymes.Contains(rhyme))
 //            {
-//                stone = check_globals_greedy(stone);
+                stone = check_globals_greedy(stone, rhyme);
 //            }

             var result = rhyme.match(stone, parent);
@@ -138,5 +109,38 @@

             return result;
         }
+
+        public Legend read(string start_name = "start")
+        {
+            var start = grammar.rhymes[start_name];
+            var stone = new Position(code, this);
+            var result = match(stone, start, null);
+
+            if (result != null)
+            {
+                stone = result.stone;
+                if (stone.index < code.Length)
+                {
+                    stone = check_globals_greedy(stone);
+
+                    if (stone.index < code.Length)
+                    {
+                        throw new Exception("Could not find match at " + furthest_legend_result.stone.get_position_string());
+                    }
+                }
+
+                return result.legend;
+            }
+
+            if (furthest_legend_result == null)
+            {
+                throw new Exception("Could not find match at 1:1.");
+            }
+            else
+            {
+                throw new Exception("Could not find match at " + furthest_legend_result.stone.get_position_string());
+            }
+
+        }
     }
 }


Update ents.cs

Update ents.cs

--- Runtime/LibMisc/ents.cs
+++ Runtime/LibMisc/ents.cs
@@ -51,6 +51,18 @@
 			source[length++] = entity;
 		}

+		[Il2CppSetOption(Option.NullChecks | Option.ArrayBoundsChecks, false)]
+		public void Add(params ent[] entity)
+		{
+			foreach (var e in entity)
+			{
+				if (length >= source.Length)
+					Array.Resize(ref source, length << 1);
+
+				source[length++] = e;
+			}
+		}
+

 		[Il2CppSetOption(Option.NullChecks | Option.ArrayBoundsChecks, false)]
 		public bool Remove(in ent entity)
@@ -176,7 +188,7 @@

 		public void Clear()
 		{
-			source = new int[cap > 0 ? cap : 5];
+			source = new int[source.Length];
 			length = 0;
 		}


Set A_KeyDelay and A_KeyPressDuration.

Set A_KeyDelay and A_KeyPressDuration.

--- Rusty/Core/Accessors.cs
+++ Rusty/Core/Accessors.cs
@@ -417,11 +417,21 @@
         }

         /// <summary>
-        /// The current delay set by <see cref="SetKeyDelay"/>.
+        /// The delay that will occur after each keystroke sent by <see cref="Send"/> and <see cref="ControlSend"/>.
         /// </summary>
         public static int A_KeyDelay
         {
-            get { return _KeyDelay ?? 10; }
+            get { return _KeyDelay ?? 0; }
+            set { _KeyDelay = value; }
+        }
+
+        /// <summary>
+        /// The delay between the press of a key and before its release, used with <see cref="A_KeyDelay"/>.
+        /// </summary>
+        public static int A_KeyPressDuration
+        {
+            get { return _KeyPressDuration ?? 0; }
+            set { _KeyPressDuration = value; }
         }

         /// <summary>


log worker POST status

log worker POST status

--- TempyWorker/Worker.cs
+++ TempyWorker/Worker.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Diagnostics;
+using System.Net;
 using System.Threading;
 using Microsoft.Extensions.Configuration;
 using NetatmoLib;
@@ -12,7 +13,7 @@
 {
     public class Worker
     {
-
+

         public void Run()
         {
@@ -101,7 +102,7 @@
             return measurement;
         }

-        public void PostMeasurement(string tempyApiTarget, DataObjects.Measurement measurement)
+        public bool PostMeasurement(string tempyApiTarget, DataObjects.Measurement measurement)
         {
             var client = new RestClient();
             client.BaseUrl = new Uri($"http://{tempyApiTarget}/");
@@ -112,8 +113,18 @@
             request.AddHeader("Content-Type", "application/json");
             request.AddParameter("application/json; charset=utf-8", json, ParameterType.RequestBody);
             // todo: make the execute async
-            client.Execute(request);
-            // todo: check and return result of the POST query
+            var response = client.Execute(request);
+            if (response.StatusCode == HttpStatusCode.OK)
+            {
+                Log.Debug($"Post OK");
+                return true;
+            }
+            else
+            {
+                Log.Warning($"Post FAILED");
+                return false;
+
+            }
         }
     }
 }


doing a primitive health check upon first run


Options help indent bug

Options help indent bug

--- TitleCleanerConsole/Options.cs
+++ TitleCleanerConsole/Options.cs
@@ -283,15 +283,16 @@
                     foreach (var w in l.Split(' '))
                     {
                         var word = w;
-                        if (lenP != 0)
-                        {
-                            word = ' ' + word;
-                        }
+
                         if (lenP + word.Length > len)
                         {
                             Console.Write("\n\t\t");
                             lenP = 0;
                         }
+                        else if (lenP != 0)
+                        {
+                            word = ' ' + word;
+                        }
                         Console.Write(word);
                         lenP += word.Length;
                     }


ブラックリストの判定を修正

ブラックリストの判定を修正

@ つきの ScreenName を使用する
あとリスト追加

--- Shanghai/TwitterCheck.cs
+++ Shanghai/TwitterCheck.cs
@@ -9,8 +9,9 @@
 {
     class TwitterCheck
     {
+        // @ScreenName
         private static readonly string[] BlackList = {
-            "Mewdra", "nippy", "metto0226",
+            "Mewdra", "nippy2284", "metto0226", "CucumberDragon",
         };
         private static readonly int SettingMax = 100;
         private readonly ReadOnlyCollection<string> BlackWords, WhiteWords;
@@ -67,15 +68,21 @@
             {
                 return false;
             }
-            if (Array.IndexOf(BlackList, status.User.Name) < 0)
+            if (Array.IndexOf(BlackList, status.User.ScreenName) < 0)
             {
                 return false;
+            }
+
+            string targetText = status.Text;
+            foreach (var replace in ReplaceList)
+            {
+                targetText = targetText.Replace(replace.Key, replace.Value);
             }

             bool black = false;
             foreach (var word in BlackWords)
             {
-                black = black || status.Text.Contains(word);
+                black = black || targetText.Contains(word);
             }

             const int AfterHour = 21;


Derp.

Derp.

--- SharpFont/Interpreter.cs
+++ SharpFont/Interpreter.cs
@@ -195,7 +195,7 @@
                             var y = stack.Pop();
                             var x = stack.Pop();
                             var vec = Vector2.Normalize(new Vector2(F2Dot14ToFloat(x), F2Dot14ToFloat(y)));
-                            if (opcode == OpCode.SPVFS)
+                            if (opcode == OpCode.SFVFS)
                                 state.Freedom = vec;
                             else {
                                 state.Projection = vec;


Gracefully handle corrupt plugin zips

Gracefully handle corrupt plugin zips

--- Torch/Plugins/PluginManager.cs
+++ Torch/Plugins/PluginManager.cs
@@ -206,6 +206,8 @@
             PluginsLoaded?.Invoke(_plugins.Values.AsReadOnly());
         }

+        //debug flag is set when the user asks us to run with a specific plugin for plugin development debug
+        //please do not change references to this arg unless you are very sure you know what you're doing
         private List<PluginItem> GetLocalPlugins(string pluginDir, bool debug = false)
         {
             var firstLoad = Torch.Config.Plugins.Count == 0;
@@ -505,18 +507,26 @@

         private PluginManifest GetManifestFromZip(string path)
         {
-            using (var zipFile = ZipFile.OpenRead(path))
-            {
-                foreach (var entry in zipFile.Entries)
-                {
-                    if (!entry.Name.Equals(MANIFEST_NAME, StringComparison.CurrentCultureIgnoreCase))
-                        continue;
-
-                    using (var stream = new StreamReader(entry.Open()))
-                    {
-                        return PluginManifest.Load(stream);
-                    }
-                }
+            try
+            {
+                using (var zipFile = ZipFile.OpenRead(path))
+                {
+                    foreach (var entry in zipFile.Entries)
+                    {
+                        if (!entry.Name.Equals(MANIFEST_NAME, StringComparison.CurrentCultureIgnoreCase))
+                            continue;
+
+                        using (var stream = new StreamReader(entry.Open()))
+                        {
+                            return PluginManifest.Load(stream);
+                        }
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                _log.Error(ex, $"Error opening zip! File is likely corrupt. File at {path} will be deleted and re-acquired on the next restart!");
+                File.Delete(path);
             }

             return null;


Remove ThreadStatic.

Remove ThreadStatic.

--- SimpSim.NET/Assembler.cs
+++ SimpSim.NET/Assembler.cs
@@ -8,14 +8,15 @@
 {
     public class Assembler
     {
-        [ThreadStatic]
-        private static IDictionary<string, byte> _symbolTable;
+        private readonly IDictionary<string, byte> _symbolTable;
         private readonly InstructionByteCollection _bytes;
+        private readonly AddressSyntaxParser _addressSyntaxParser;

         public Assembler()
         {
             _symbolTable = new Dictionary<string, byte>();
-            _bytes = new InstructionByteCollection();
+            _bytes = new InstructionByteCollection(_symbolTable);
+            _addressSyntaxParser = new AddressSyntaxParser(_symbolTable);
         }

         public Instruction[] Assemble(string assemblyCode)
@@ -105,12 +106,12 @@

         private void Load(string[] operands)
         {
-            if (RegisterSyntax.TryParse(operands[0], out var register) && AddressSyntax.TryParse(operands[1], out var address))
+            if (RegisterSyntax.TryParse(operands[0], out var register) && _addressSyntaxParser.TryParse(operands[1], out var address))
             {
                 _bytes.Add(Opcode.ImmediateLoad, register.Index);
                 _bytes.Add(address);
             }
-            else if (RegisterSyntax.TryParse(operands[0], out register) && AddressSyntax.TryParse(operands[1], out address, BracketExpectation.Present))
+            else if (RegisterSyntax.TryParse(operands[0], out register) && _addressSyntaxParser.TryParse(operands[1], out address, BracketExpectation.Present))
             {
                 _bytes.Add(Opcode.DirectLoad, register.Index);
                 _bytes.Add(address);
@@ -124,7 +125,7 @@

         private void Store(string[] operands)
         {
-            if (RegisterSyntax.TryParse(operands[0], out var register) && AddressSyntax.TryParse(operands[1], out var address, BracketExpectation.Present))
+            if (RegisterSyntax.TryParse(operands[0], out var register) && _addressSyntaxParser.TryParse(operands[1], out var address, BracketExpectation.Present))
             {
                 _bytes.Add(Opcode.DirectStore, register.Index);
                 _bytes.Add(address);
@@ -170,7 +171,7 @@
             if (!RegisterSyntax.TryParse(registers[1], out var rightRegister) || rightRegister.Index != 0)
                 throw new AssemblyException("Expected a comparison with R0.");

-            if (RegisterSyntax.TryParse(registers[0], out var leftRegister) && AddressSyntax.TryParse(operands[1], out var address))
+            if (RegisterSyntax.TryParse(registers[0], out var leftRegister) && _addressSyntaxParser.TryParse(operands[1], out var address))
             {
                 _bytes.Add(Opcode.JumpEqual, leftRegister.Index);
                 _bytes.Add(address);
@@ -179,7 +180,7 @@

         private void JmpLE(string[] operands)
         {
-            if (RegisterSyntax.TryParse(operands[0].Split('<', '=')[0], out var register) && AddressSyntax.TryParse(operands[1], out var address))
+            if (RegisterSyntax.TryParse(operands[0].Split('<', '=')[0], out var register) && _addressSyntaxParser.TryParse(operands[1], out var address))
             {
                 _bytes.Add(Opcode.JumpLessEqual, register.Index);
                 _bytes.Add(address);
@@ -192,7 +193,7 @@

             if (operands.Length != 1)
                 invalidSyntax = true;
-            else if (AddressSyntax.TryParse(operands[0], out var address))
+            else if (_addressSyntaxParser.TryParse(operands[0], out var address))
             {
                 _bytes.Add(Opcode.JumpEqual, 0x0);
                 _bytes.Add(address);
@@ -488,21 +489,16 @@
             }
         }

-        private class AddressSyntax
-        {
-            public byte Value { get; }
-
-            public string UndefinedLabel { get; }
-
-            public bool ContainsUndefinedLabel => !string.IsNullOrWhiteSpace(UndefinedLabel);
-
-            private AddressSyntax(byte value, string undefinedLabel)
-            {
-                Value = value;
-                UndefinedLabel = undefinedLabel;
-            }
-
-            public static bool TryParse(string input, out AddressSyntax addressSyntax, BracketExpectation bracketExpectation = BracketExpectation.NotPresent)
+        private class AddressSyntaxParser
+        {
+            private readonly IDictionary<string, byte> _symbolTable;
+
+            public AddressSyntaxParser(IDictionary<string, byte> symbolTable)
+            {
+                _symbolTable = symbolTable;
+            }
+
+            public bool TryParse(string input, out AddressSyntax addressSyntax, BracketExpectation bracketExpectation = BracketExpectation.NotPresent)
             {
                 bool isSuccess;

@@ -523,7 +519,7 @@
                 return isSuccess;
             }

-            private static bool IsAddress(string input, out byte address, out string undefinedLabel)
+            private bool IsAddress(string input, out byte address, out string undefinedLabel)
             {
                 undefinedLabel = null;

@@ -541,9 +537,24 @@
                 return true;
             }

-            private static bool IsRegister(string input)
+            private bool IsRegister(string input)
             {
                 return RegisterSyntax.TryParse(input, out _);
+            }
+        }
+
+        private class AddressSyntax
+        {
+            public byte Value { get; }
+
+            public string UndefinedLabel { get; }
+
+            public bool ContainsUndefinedLabel => !string.IsNullOrWhiteSpace(UndefinedLabel);
+
+            public AddressSyntax(byte value, string undefinedLabel)
+            {
+                Value = value;
+                UndefinedLabel = undefinedLabel;
             }

             public override string ToString()
@@ -578,11 +589,13 @@

         private class InstructionByteCollection
         {
+            private readonly IDictionary<string, byte> _symbolTable;
             private readonly InstructionByte[] _bytes;
             private byte _originAddress;

-            public InstructionByteCollection()
-            {
+            public InstructionByteCollection(IDictionary<string, byte> symbolTable)
+            {
+                _symbolTable = symbolTable;
                 _bytes = new InstructionByte[0x100];
             }

@@ -642,10 +655,10 @@
                     byte byte2 = 0x00;

                     if (_bytes[i] != null)
-                        byte1 = _bytes[i].GetValue();
+                        byte1 = _bytes[i].GetValue(_symbolTable);

                     if (_bytes[i + 1] != null)
-                        byte2 = _bytes[i + 1].GetValue();
+                        byte2 = _bytes[i + 1].GetValue(_symbolTable);

                     instructions.Add(new Instruction(byte1, byte2));
                 }
@@ -677,17 +690,17 @@
                     }
                 }

-                public byte GetValue()
+                public byte GetValue(IDictionary<string, byte> symbolTable)
                 {
                     switch (_addressType)
                     {
                         case AddressType.DirectValue:
                             return _byte;
                         case AddressType.Label:
-                            if (!_symbolTable.ContainsKey(_address.UndefinedLabel))
+                            if (!symbolTable.ContainsKey(_address.UndefinedLabel))
                                 throw new LabelAssemblyException(_address.UndefinedLabel);

-                            return _symbolTable[_address.UndefinedLabel];
+                            return symbolTable[_address.UndefinedLabel];
                         default:
                             return 0x00;
                     }


Implemented Bind IPv4 and IPv6 test

Implemented Bind IPv4 and IPv6 test

--- UdtProtocol-Test/SocketTest.cs
+++ UdtProtocol-Test/SocketTest.cs
@@ -105,6 +105,35 @@
         [Test]
         public void Bind_IPAddress_int()
         {
+            using (Udt.Socket socket = new Udt.Socket(AddressFamily.InterNetwork, SocketType.Stream))
+            {
+                socket.Bind(IPAddress.Any, 10000);
+
+                IPEndPoint localEP = socket.LocalEndPoint;
+                Assert.AreEqual(IPAddress.Any, localEP.Address);
+                Assert.AreEqual(10000, localEP.Port);
+            }
+        }
+
+        /// <summary>
+        /// Test for <see cref="Udt.Socket.Bind(IPAddress,int)"/> with IPv6 address.
+        /// </summary>
+        [Test]
+        public void Bind_IPAddress_int__IPV6()
+        {
+            if (!Socket.OSSupportsIPv6)
+            {
+                Assert.Ignore("OS does not support IPv6");
+            }
+
+            using (Udt.Socket socket = new Udt.Socket(AddressFamily.InterNetworkV6, SocketType.Stream))
+            {
+                socket.Bind(IPAddress.IPv6Any, 10000);
+
+                IPEndPoint localEP = socket.LocalEndPoint;
+                Assert.AreEqual(IPAddress.IPv6Any, localEP.Address);
+                Assert.AreEqual(10000, localEP.Port);
+            }
         }

         /// <summary>


Adjusted the test to check shared read access.

--- UdtProtocol-Test/SocketTest.cs
+++ UdtProtocol-Test/SocketTest.cs
@@ -601,7 +601,7 @@
 					server.Listen(1);

 					using (Udt.Socket accept = server.Accept())
-					using (Udt.StdFileStream file = new Udt.StdFileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.Read))
+					using (Udt.StdFileStream file = new Udt.StdFileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))
 					{
 						accept.SendFile(file);

@@ -611,18 +611,18 @@
 				}
 			});

-			byte[] buffer = new byte[1024];
-
 			using (Udt.Socket client = new Udt.Socket(AddressFamily.InterNetwork, SocketType.Stream))
 			{
+				byte[] buffer = new byte[1024];
+
 				client.Connect(IPAddress.Loopback, port);
 				Assert.AreEqual(44, client.Receive(buffer));
-
+
+				CollectionAssert.AreEqual(File.ReadAllBytes(path), buffer.Take(44));
+
 				clientDoneEvent.Set();
 				Assert.IsTrue(serverDoneEvent.WaitOne(1000));
 			}
-
-			CollectionAssert.AreEqual(File.ReadAllBytes(path), buffer.Take(44));

 			serverTask.Wait();
 		}


Final magic fields removal from GameObject.

--- Whisper.Game/Objects/GameObject.cs
+++ Whisper.Game/Objects/GameObject.cs
@@ -304,24 +304,6 @@
                 SetField((ushort)UnitFields.DamageRangedMax, 3.4f);
                 SetField((ushort)UnitFields.DamageRangedMin, 2.4f);
                 SetField((ushort)CharacterFields.XPNextLevel, 400);
-                SetField((ushort)CharacterFields.CharacterPoints2, 2);
-
-                SetField((ushort)CharacterFields.SkillInfoFirst1, 0x00000006);
-                SetField((ushort)0x02cf, 0x00010001);
-                SetField((ushort)0x02d1, 0x00000008);
-                SetField((ushort)0x02d2, 0x00010001);
-                SetField((ushort)0x02d4, 0x0000005f);
-                SetField((ushort)0x02d5, 0x00050001);
-                SetField((ushort)0x02d7, 0x00000062);
-                SetField((ushort)0x02d8, 0x012c012c);
-                SetField((ushort)0x02da, 0x00000088);
-                SetField((ushort)0x02db, 0x00050001);
-                SetField((ushort)0x02dd, 0x000000a2);
-                SetField((ushort)0x02de, 0x00050001);
-                SetField((ushort)0x02e0, 0x000000e4);
-                SetField((ushort)0x02e1, 0x00050001);
-                SetField((ushort)0x02e3, 0x0000019f);
-                SetField((ushort)0x02e4, 0x00010001);

                 UpdateMask updateMask = BuildCreationUpdateMask();
                 log.DebugFormat("create updatemask block count is 0x{0:x2}", updateMask.BlockCount);


#1271 Don't replace unknown templates in edit mode if throwException is false

--- WorldModel/WorldModel/Templates.cs
+++ WorldModel/WorldModel/Templates.cs
@@ -51,7 +51,7 @@
         {
             if (!m_templateLookup.ContainsKey(t))
             {
-                if (m_worldModel.EditMode)
+                if (m_worldModel.EditMode && throwException)
                 {
                     return string.Format("{{UNKNOWN TEMPLATE: {0}}}", t);
                 }


Add disk check

Add disk check

--- Shanghai/HealthCheck.cs
+++ Shanghai/HealthCheck.cs
@@ -10,9 +10,15 @@

         public void Proc(TaskServer server, string taskName)
         {
-            var msg = new StringBuilder();
-            msg.Append("[Health Check]\n");
+            var msg = new StringBuilder("[Health Check]\n");
+
             msg.AppendFormat("CPU Temp: {0:F3}\n", GetCpuTemp());
+
+            double free, total;
+            GetDiskInfoG(out free, out total);
+            msg.AppendFormat("Disk: {0:F3}G/{1:F3}G Free ({2}%)",
+                free, total, (int)(free * 100.0 / total));
+
             TwitterManager.Update(msg.ToString());
         }

@@ -26,5 +32,13 @@
             }
             return int.Parse(src) / 1000.0;
         }
+
+        private static void GetDiskInfoG(out double free, out double total)
+        {
+            const double Unit = 1024.0 * 1024.0 * 1024.0;
+            var info = new DriveInfo("/");
+            free = info.TotalFreeSpace / Unit;
+            total = info.TotalSize / Unit;
+        }
     }
 }


Always play shaking sound even if the camera is currently shaking.

--- Xmas-Hell/Xmas-Hell-Core/Camera.cs
+++ Xmas-Hell/Xmas-Hell-Core/Camera.cs
@@ -89,6 +89,8 @@
         // Time in seconds
         public void Shake(float time, float magnitude)
         {
+            SoundManager.PlaySound(Assets.GetSound("Audio/SE/shake"));
+
             if (_shaking)
                 return;

@@ -96,8 +98,6 @@
             _shakingMagnitude = magnitude;
             _shakingTimer = TimeSpan.FromSeconds(time);
             _initialPosition = Position;
-
-            SoundManager.PlaySound(Assets.GetSound("Audio/SE/shake"));
         }

         public void ZoomTo(float targetZoom, double time, Vector2? origin = null)


Remove System.ComponentModel dependency by making TabWidth private

--- Yeena/Data/StashImageSummarizer.cs
+++ Yeena/Data/StashImageSummarizer.cs
@@ -13,7 +13,6 @@
 // limitations under the License.

 using System;
-using System.ComponentModel;
 using System.Drawing;
 using System.Net.Http;
 using Yeena.PathOfExile;
@@ -40,8 +39,7 @@
             }
         }

-        [Browsable(false)]
-        public int TabWidth { get { return PoEGame.StashWidth * CellSize; } }
+        private int TabWidth { get { return PoEGame.StashWidth * CellSize; } }

         public StashImageSummarizer(ImageCache imgCache) {
             _imageCache = imgCache;


Added a suboptimal index

Added a suboptimal index

--- YoctoScheduler.Core/MasterModel.cs
+++ YoctoScheduler.Core/MasterModel.cs
@@ -1,7 +1,9 @@
 namespace YoctoScheduler.Core
 {
     using System;
+    using System.ComponentModel.DataAnnotations.Schema;
     using System.Data.Entity;
+    using System.Data.Entity.Infrastructure.Annotations;
     using System.Linq;

     public class MasterModel : DbContext
@@ -39,6 +41,23 @@
                         .HasForeignKey(m => m.TaskID)
                         .WillCascadeOnDelete(false);

+            #region IX_LastUpdate
+            modelBuilder.Entity<ExecutionStatus>()
+                        .Property(e => e.LastUpdate)
+                        .HasColumnAnnotation("Index", new IndexAnnotation(new IndexAttribute("IX_LastUpdate", 0)));
+
+            modelBuilder.Entity<ExecutionStatus>()
+                        .Property(e => e.TaskID)
+                        .HasColumnAnnotation("Index", new IndexAnnotation(new IndexAttribute("IX_LastUpdate", 1)));
+
+            modelBuilder.Entity<ExecutionStatus>()
+                        .Property(e => e.ServerID)
+                        .HasColumnAnnotation("Index", new IndexAnnotation(new IndexAttribute("IX_LastUpdate", 2)));
+
+            modelBuilder.Entity<ExecutionStatus>()
+                        .Property(e => e.Status)
+                        .HasColumnAnnotation("Index", new IndexAnnotation(new IndexAttribute("IX_LastUpdate", 3)));
+            #endregion
         }
     }


fixed freeplay mode

fixed freeplay mode

--- Source/CreditsManager.cs
+++ Source/CreditsManager.cs
@@ -52,7 +52,13 @@
 		/// Gets or sets a value indicating whether this <see cref="InsertCoinBuddy.CreditsWatcher"/> is on free play.
 		/// </summary>
 		/// <value><c>true</c> if free play; otherwise, <c>false</c>.</value>
-		public bool FreePlay { get; set; }
+		public bool FreePlay
+		{
+			get
+			{
+				return (0 == CoinsPerCredit);
+			}
+		}

 		/// <summary>
 		/// The number of coins that are currently in the system, available for use.


Fix build error

Fix build error

--- WalletWasabi.Tests/RegTests.cs
+++ WalletWasabi.Tests/RegTests.cs
@@ -104,7 +104,7 @@
 		{
 			using (var client = new WasabiClient(new Uri(RegTestFixture.BackendEndPoint)))
 			{
-				var uptodate = await client.CheckUpdatesAsync();
+				var uptodate = await client.CheckUpdatesAsync(CancellationToken.None);
 				Assert.True(uptodate.backendCompatible);
 				Assert.True(uptodate.clientUpToDate);
 			}