Corrreção

Corrreção

--- src/Boleto.Net/Banco/Banco_Itau.cs
+++ src/Boleto.Net/Banco/Banco_Itau.cs
@@ -1233,22 +1233,7 @@
                         _detalhe += Utils.FitStringLength(boleto.Instrucoes[1].Codigo.ToString(), 2, 2, '0', 0, true, true, true);
                         break;
                 }
-
-                //if (boleto.Instrucoes.Count > 1)
-                //    _detalhe += Utils.FitStringLength(boleto.Instrucoes[0].Codigo.ToString(), 2, 2, '0', 0, true, true, true);
-
-                //if (boleto.Instrucoes.Count > 2)
-                //    _detalhe += Utils.FitStringLength(boleto.Instrucoes[1].Codigo.ToString(), 2, 2, '0', 0, true, true, true);
-                //else
-                //_detalhe += "  ";
-                //    _detalhe += "    ";
-
-                // Juros de 1 dia
-                //Se o cliente optar pelo padro do Banco Ita ou solicitar o cadastramento permanente na conta corrente,
-                //no haver a necessidade de informar esse valor.
-                //Caso seja expresso em moeda varivel, dever ser preenchido com cinco casas decimais.
-
-                //_detalhe += "0000000000000";
+
                 _detalhe += Utils.FitStringLength(boleto.JurosMora.ApenasNumeros(), 13, 13, '0', 0, true, true, true);

                 // Data limite para desconto
@@ -1271,6 +1256,7 @@
                 ;
                 _detalhe += Utils.FitStringLength(boleto.Sacado.Endereco.Cidade, 15, 15, ' ', 0, true, true, false).ToUpper();
                 _detalhe += Utils.FitStringLength(boleto.Sacado.Endereco.UF, 2, 2, ' ', 0, true, true, false).ToUpper();
+
                 // SACADOR/AVALISTA
                 // Normalmente deve ser preenchido com o nome do sacador/avalista. Alternativamente este campo poder
                 // ter dois outros usos:
@@ -1285,16 +1271,18 @@
                    Posio 373 a 378 : Data do 3 desconto (DDMMAA)
                    Posio 379 a 391 : Valor do 3 desconto
                    Posio 392 a 394 : Brancos */
+
                 if (boleto.DataDescontoAntecipacao2.HasValue || boleto.DataDescontoAntecipacao3.HasValue)
                 {
+                    _detalhe += "  "; //352 - 353
                     if (boleto.DataDescontoAntecipacao2.HasValue)
                     {
-                        _detalhe += "00" + boleto.DataDescontoAntecipacao2.Value.ToString("ddMMyy") +
+                        _detalhe += boleto.DataDescontoAntecipacao2.Value.ToString("ddMMyy") +
                             Utils.FitStringLength(boleto.ValorDescontoAntecipacao2.Value.ApenasNumeros(), 13, 13, '0', 0, true, true, true);
                     }
                     else
                     {
-                        _detalhe += "000000000000000000000";
+                        _detalhe += "0000000000000000000";
                     }

                     if (boleto.DataDescontoAntecipacao3.HasValue)
@@ -1304,38 +1292,41 @@
                     }
                     else
                     {
-                        _detalhe += "000000000000000000000";
+                        _detalhe += "0000000000000000000";
                     }
+
+                    _detalhe += "   ";
                 }
                 else
                 {
                     _detalhe += Utils.FitStringLength(boleto.Sacado.Nome, 30, 30, ' ', 0, true, true, false).ToUpper();
-                }
-
-                _detalhe += "    "; // Complemento do registro
-                _detalhe += boleto.DataVencimento.ToString("ddMMyy");
-                // PRAZO - Quantidade de DIAS - ver nota 11(A) - depende das instrues de cobrana
-
-                if (boleto.Instrucoes.Count > 0)
-                {
-                    for (int i = 0; i < boleto.Instrucoes.Count; i++)
+                    _detalhe += "    "; // Complemento do registro
+                    _detalhe += boleto.DataVencimento.ToString("ddMMyy"); //Data de Mora
+
+                    if (boleto.Instrucoes.Count > 0)
                     {
-                        if (boleto.Instrucoes[i].Codigo == (int)EnumInstrucoes_Itau.Protestar ||
-                            boleto.Instrucoes[i].Codigo == (int)EnumInstrucoes_Itau.ProtestarAposNDiasCorridos ||
-                            boleto.Instrucoes[i].Codigo == (int)EnumInstrucoes_Itau.ProtestarAposNDiasUteis)
+                        for (int i = 0; i < boleto.Instrucoes.Count; i++)
+                        {
+                            if (boleto.Instrucoes[i].Codigo == (int)EnumInstrucoes_Itau.Protestar ||
+                                boleto.Instrucoes[i].Codigo == (int)EnumInstrucoes_Itau.ProtestarAposNDiasCorridos ||
+                                boleto.Instrucoes[i].Codigo == (int)EnumInstrucoes_Itau.ProtestarAposNDiasUteis)
                             {
                                 _detalhe += boleto.Instrucoes[i].QuantidadeDias.ToString("00");
                                 break;
                             }
                             else if (i == boleto.Instrucoes.Count - 1)
                                 _detalhe += "00";
+                        }
                     }
-                }
-                else
-                {
-                    _detalhe += "00";
-                }
-                _detalhe += " "; // Complemento do registro
+                    else
+                    {
+                        _detalhe += "00";
+                    }
+
+                    _detalhe += " "; // Complemento do registro
+                }
+
+
                 _detalhe += Utils.FitStringLength(numeroRegistro.ToString(), 6, 6, '0', 0, true, true, true);

                 _detalhe = Utils.SubstituiCaracteresEspeciais(_detalhe);


Update Banco_Itau.cs

Update Banco_Itau.cs

No campo sacador/avalista estava sendo passado o nome do sacado e da um problema ao protestar o título

--- src/Boleto.Net/Banco/Banco_Itau.cs
+++ src/Boleto.Net/Banco/Banco_Itau.cs
@@ -1302,7 +1302,7 @@
                 }
                 else
                 {
-                    _detalhe += Utils.FitStringLength(boleto.Sacado.Nome, 30, 30, ' ', 0, true, true, false).ToUpper();
+                    _detalhe += Utils.FitStringLength("", 30, 30, ' ', 0, true, true, false); //Utils.FitStringLength(boleto.Sacado.Nome, 30, 30, ' ', 0, true, true, false).ToUpper();
                     _detalhe += "    "; // Complemento do registro
                     _detalhe += boleto.DataVencimento.ToString("ddMMyy"); //Data de Mora


Improve settings log naming.

Improve settings log naming.

--- src/CompetitionPlatform/Startup.cs
+++ src/CompetitionPlatform/Startup.cs
@@ -193,16 +193,16 @@
                 WriteSettingsReadError(log, "StorageConnString");

             if (string.IsNullOrEmpty(settings.LykkeStreams.Authentication.ClientId))
-                WriteSettingsReadError(log, "ClientId");
+                WriteSettingsReadError(log, "Authentication-ClientId");

             if (string.IsNullOrEmpty(settings.LykkeStreams.Authentication.ClientSecret))
-                WriteSettingsReadError(log, "ClientSecret");
+                WriteSettingsReadError(log, "Authentication-ClientSecret");

             if (string.IsNullOrEmpty(settings.LykkeStreams.Authentication.PostLogoutRedirectUri))
-                WriteSettingsReadError(log, "PostLogoutRedirectUri");
+                WriteSettingsReadError(log, "Authentication-PostLogoutRedirectUri");

             if (string.IsNullOrEmpty(settings.LykkeStreams.Authentication.Authority))
-                WriteSettingsReadError(log, "Authority");
+                WriteSettingsReadError(log, "Authentication-Authority");

             if(string.IsNullOrEmpty(settings.EmailServiceBus.Key))
                 WriteSettingsReadError(log, "EmailServiceBus-Key");


Fancy icons swooping out on exit; text messages changes

--- Game1/Game1/Game1.cs
+++ Game1/Game1/Game1.cs
@@ -17,6 +17,7 @@
 using TreeSharp;
 using IndiegameGarden.Base;
 using Game1.Comps;
+using Game1.Systems;

 namespace Game1
 {
@@ -41,7 +42,7 @@
         public Entity SelectedGame, KeyboardSelectedGame;
         public Entity Music;
         public Entity BackgroundGameIcon, BackgroundRotatingStar;
-        public Entity TopLineText;
+        public Entity TopLineText, HelpText;
         public List<Entity> CollectionEntities; // all entities in game library
         public GlobalStateEnum GlobalState;
         public GameRunner GameRunner;
@@ -54,22 +55,28 @@

         // UI constants
         public const double ICON_SIZE = 128, // pixels
+
                             SCALE_SELECTED = 1.2,
-                            SCALE_SPEED_TO_SELECTED = 0.1,
                             SCALE_UNSELECTED = 1.0,
-                            SCALE_SPEED_TO_UNSELECTED = 0.1,
-                            SCALE_ICON_TO_BACKGROUND = SCALE_UNSELECTED,
-                            SCALE_ICON_TO_FOREGROUND = 1.42,
-                            SCALE_ICON_TO_FOREGROUND_SPEED = 0.005,
-                            SCALE_ICON_TO_BACKGROUND_SPEED = 0.0025,
+                            SCALE_WHILE_EXITING = 0.2,
+                            SCALE_TO_BACKGROUND = SCALE_UNSELECTED,
+                            SCALE_TO_FOREGROUND = 1.42,
+
+                            SPEED_SCALE_TO_SELECTED = 0.1,
+                            SPEED_SCALE_TO_UNSELECTED = 0.1,
+                            SPEED_SCALE_ICON_TO_FOREGROUND = 0.005,
+                            SPEED_SCALE_ICON_TO_BACKGROUND = 0.0025,
+                            SPEED_SCALE_ICON_WHILE_EXITING = 0.01,
+
                             BACKGROUND_STAR_ROTATION_SPEED = 0.05,
                             BACKGROUND_ICON_ROTATION_SPEED = 0.04,
                             BACKGROUND_ROTATION_SLOWDOWN_SPEED = 0.01,
                             BACKGROUND_ROTATION_SPEEDUP_SPEED = 0.01,
                             ROTATION_SPEEDUP_FACTOR_WHILE_LAUNCHING = 2.0,
                             ROTATION_SLOWDOWN_FACTOR_WHILE_PLAYING = 2.0,
+                            MOVE_ICONS_ON_EXIT_SPEED = 300.0,
                             MUSIC_FADEOUT_ON_EXIT_SPEED = 0.45;
-        public double       SCALE_MAX = Math.Max(SCALE_SELECTED, SCALE_ICON_TO_FOREGROUND);
+        public double       SCALE_MAX = Math.Max(SCALE_SELECTED, SCALE_TO_FOREGROUND);
         public const int    ICONCOUNT_HORIZONTAL = 9; // FIXME make adaptive to screen size

         public Game1()
@@ -127,6 +134,9 @@
             // text
             TopLineText = TTFactory.CreateTextlet("IndieGig", "m41_lovebit");
             TopLineText.GetComponent<PositionComp>().Position = new Vector2(80f, 20f);
+            HelpText = TTFactory.CreateTextlet("\"C\" to run game config", "m41_lovebit");
+            HelpText.GetComponent<DrawComp>().LayerDepth = 0f;
+            HelpText.GetComponent<PositionComp>().Position = new Vector2(TTFactory.BuildScreen.Width-200f, 20f);

             // music - build it to Root channel so it keeps playing always
             TTFactory.BuildTo(ChannelMgr.Root);
@@ -146,16 +156,18 @@
             {
                 case GlobalStateEnum.STATE_BROWSING:
                     MainChannel.IsActive = true; MainChannel.IsVisible = true;
-                    TopLineText.GetComponent<TextComp>().Text = IsExiting ? "Goodbye" : "IndieGig";
                     GameSelectionProcess();
-                    GameLaunchingProcess();
-                    BackgroundGameIconNewTextureProcess();
-                    BackgroundSpeedupRotationProcess(dt);
+                    if (!IsExiting)
+                    {
+                        GameLaunchingProcess();
+                        BackgroundGameIconNewTextureProcess();
+                        BackgroundSpeedupRotationProcess(dt);
+                    }
                     break;

                 case GlobalStateEnum.STATE_LAUNCHING:
                     MainChannel.IsActive = true; MainChannel.IsVisible = true;
-                    TopLineText.GetComponent<TextComp>().Text = "Launching";
+                    //TopLineText.GetComponent<TextComp>().Text = "Launching";
                     GameRunProcess();
                     IconsShrinkingProcess();
                     BackgroundGameIconNewTextureProcess();
@@ -163,7 +175,7 @@
                     break;

                 case GlobalStateEnum.STATE_PLAYING_PHASE1:
-                    TopLineText.GetComponent<TextComp>().Text = "Playing";
+                    //TopLineText.GetComponent<TextComp>().Text = "Playing";
                     BackgroundSlowdownRotationProcess(dt, ROTATION_SLOWDOWN_FACTOR_WHILE_PLAYING);
                     StatePlayingPhase1Process();
                     break;
@@ -191,6 +203,20 @@
                     afc.FadeSpeed = MUSIC_FADEOUT_ON_EXIT_SPEED;
                     afc.IsFading = true;
                     IsExiting = true;
+                    TopLineText.GetComponent<TextComp>().Text = "Bye  :-)";
+
+                    // disable the regular layouter process
+                    ChannelMgr.Root.DisableSystem<BasicLayouterSystem>();
+
+                    // icons shrink
+                    foreach (Entity e in CollectionEntities)
+                    {
+                        e.GetComponent<ScaleComp>().ScaleTarget = SCALE_WHILE_EXITING;
+                        e.GetComponent<ScaleComp>().ScaleSpeed = SPEED_SCALE_ICON_WHILE_EXITING;
+                        var x = e.GetComponent<PositionComp>().Position.X;
+                        e.GetComponent<TargetMotionComp>().Target = new Vector2(x/10f,-450f-x); // fly away to top
+                        e.GetComponent<TargetMotionComp>().TargetVelocity = MOVE_ICONS_ON_EXIT_SPEED;
+                    }
                 }
             }
             if (IsExiting)
@@ -266,8 +292,11 @@
                 var sc = e.GetComponent<ScaleComp>();
                 if (SelectedGame == null && coll.Contains(e))
                 {
-                    sc.ScaleTarget = SCALE_SELECTED;
-                    sc.ScaleSpeed = SCALE_SPEED_TO_SELECTED;
+                    if (!IsExiting)
+                    {
+                        sc.ScaleTarget = SCALE_SELECTED;
+                        sc.ScaleSpeed = SPEED_SCALE_TO_SELECTED;
+                    }
                     SelectedGame = e;
                     BackgroundGameIcon.GetComponent<SpriteComp>().CenterToMiddle();
                     if (IsMouseForSelection)
@@ -276,10 +305,10 @@
                         KeyboardSelectedGameIndex = CollectionEntities.IndexOf(KeyboardSelectedGame);
                     }
                 }
-                else
+                else if (!IsExiting)
                 {
                     sc.ScaleTarget = SCALE_UNSELECTED;
-                    sc.ScaleSpeed = SCALE_SPEED_TO_UNSELECTED;
+                    sc.ScaleSpeed = SPEED_SCALE_TO_UNSELECTED;
                 }

                 // biggest thing shows on top
@@ -410,13 +439,13 @@
                 var sc = e.GetComponent<ScaleComp>();
                 if (SelectedGame != e)
                 {
-                    sc.ScaleTarget = SCALE_ICON_TO_BACKGROUND;
-                    sc.ScaleSpeed = SCALE_ICON_TO_BACKGROUND_SPEED;
+                    sc.ScaleTarget = SCALE_TO_BACKGROUND;
+                    sc.ScaleSpeed = SPEED_SCALE_ICON_TO_BACKGROUND;
                 }
                 else
                 {
-                    sc.ScaleTarget = SCALE_ICON_TO_FOREGROUND;
-                    sc.ScaleSpeed = SCALE_ICON_TO_FOREGROUND_SPEED;
+                    sc.ScaleTarget = SCALE_TO_FOREGROUND;
+                    sc.ScaleSpeed = SPEED_SCALE_ICON_TO_FOREGROUND;
                 }
                 var dc = e.GetComponent<DrawComp>();
                 dc.LayerDepth = (float)((SCALE_MAX - sc.Scale) / SCALE_MAX);


Constant to modify the space between the bars

--- Histogent/Program.cs
+++ Histogent/Program.cs
@@ -12,6 +12,7 @@
         // Edit these constants to modify the watch face
         const bool ShowSeconds = true;  // if true print a bar for the seconds
         const int BarsWidth = 30;   // max 40 with seconds - max 60 without seconds
+        const int SpaceBetweenBars = 10;    // the space between bars

         static Bitmap _display;
         static Timer _updateClockTimer;
@@ -69,13 +70,13 @@
             };

             // A few variables
-            int x, y, width = BarsWidth, height, txtX, txtY;
+            int x, y, width = BarsWidth, height, txtX, txtY, space = SpaceBetweenBars;

             for (var i = 0; i < time.Length; i++)
             {
                 // Calculate rectangle dimensions
                 // e.g. 128px screen => 9px empty + 30px bar + 10px empty + 30px bar + 10px empty + 30px bar + 9px empty
-                x = (int)(((Bitmap.MaxWidth - (((width + 10)*time.Length) - 10)) / 2.0) + (i * (width + 10)));
+                x = (int)(((Bitmap.MaxWidth - (((width + space) * time.Length) - space)) / 2.0) + (i * (width + space)));
                 y = (int)(Bitmap.MaxHeight - ((time[i] / factors[i]) * Bitmap.MaxHeight));
                 height = Bitmap.MaxHeight - y;


Fix JSON Boolean serialisation.

Fix JSON Boolean serialisation.

--- Src/zipkin4net/Src/Tracers/Zipkin/JSONSpanSerializer.cs
+++ Src/zipkin4net/Src/Tracers/Zipkin/JSONSpanSerializer.cs
@@ -175,7 +175,7 @@
         )
         {
             WriteAnchor(writer, fieldName);
-            writer.Write(fieldValue);
+            writer.Write(fieldValue ? "true" : "false");
         }

         internal static void WriteField


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
@@ -2903,6 +2903,15 @@
     public void TestMethod_IsPrime_1997()
     {
       const int source = 1997;
+      const bool expected = true;
+      bool result = FunctionsMath.IsPrime(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsPrime_1999()
+    {
+      const int source = 1999;
       const bool expected = true;
       bool result = FunctionsMath.IsPrime(source);
       Assert.AreEqual(result, expected);


Add unit test

Add unit test

--- UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
+++ UnitTestUsefullFunctions/UnitTestFunctionsMathPrimes.cs
@@ -3110,6 +3110,15 @@
     public void TestMethod_IsPrime_2153()
     {
       const int source = 2153;
+      const bool expected = true;
+      bool result = FunctionsMath.IsPrime(source);
+      Assert.AreEqual(result, expected);
+    }
+
+    [TestMethod]
+    public void TestMethod_IsPrime_2161()
+    {
+      const int source = 2161;
       const bool expected = true;
       bool result = FunctionsMath.IsPrime(source);
       Assert.AreEqual(result, expected);


Add one unit test

Add one unit test


fixed inheritRotation bug

fixed inheritRotation bug

--- Unity/Demos/Assets/Scripts/DragonBones/armature/Bone.cs
+++ Unity/Demos/Assets/Scripts/DragonBones/armature/Bone.cs
@@ -142,8 +142,25 @@
                     if (!this.boneData.inheritRotation)
                     {
                         this._parent.UpdateGlobalTransform();
-
+
                         dR = this._parent.global.rotation; //
+
+                        flipY = _armature.flipY;
+                        if (flipX || flipY)
+                        {
+                            if (flipX && flipY)
+                            {
+                                dR += Transform.PI;
+                            }
+                            else
+                            {
+                                dR -= this._parent.global.rotation * 2.0f;
+                                if (flipX)
+                                {
+                                    dR += Transform.PI;
+                                }
+                            }
+                        }

                         if (DragonBones.yDown)
                         {


Add case for waiting on an empty id

Add case for waiting on an empty id

--- UnityProject/Assets/Scripts/Messages/GameMessageBase.cs
+++ UnityProject/Assets/Scripts/Messages/GameMessageBase.cs
@@ -9,6 +9,12 @@

 	protected IEnumerator WaitFor(NetworkInstanceId id)
 	{
+		if (id.IsEmpty())
+		{
+			Debug.LogError($"{this} tried to wait on an empty (0) id");
+			yield break;
+		}
+
 		int tries = 0;
 		while ((NetworkObject = ClientScene.FindLocalObject(id)) == null)
 		{


fix examin msg & use neutral pronouns for unknown examined player


Closes #928

Closes #928

--- src/Couchbase.Lite/Query/XQuery.cs
+++ src/Couchbase.Lite/Query/XQuery.cs
@@ -376,7 +376,7 @@
             if (Interlocked.Increment(ref _observingCount) == 1) {
                 Database?.ActiveLiveQueries?.Add(this);
                 _databaseChangedToken = Database?.AddChangeListener(null, OnDatabaseChanged);
-                Update();
+                Task.Factory.StartNew(Update);
             }

             return new ListenerToken(cbHandler);


[UBER-726] Update CheckBox.

[UBER-726] Update CheckBox.

--- src/Cruciatus/Elements/CheckBox.cs
+++ src/Cruciatus/Elements/CheckBox.cs
@@ -28,6 +28,8 @@
     {
         private const int MouseMoveSpeed = 2500;

+        private const int MaxClickCount = 10;
+
         private AutomationElement parent;

         public CheckBox()
@@ -85,25 +87,29 @@
             }
         }

-        /// <summary>
-        /// Возвращает состояние чекбокса.
-        /// </summary>
-        public CheckState CheckState
-        {
-            get
-            {
-                var toggleState = this.GetPropertyValue<CheckBox, ToggleState>(TogglePattern.ToggleStateProperty);
-                switch (toggleState)
+        public bool? IsChecked
+        {
+            get
+            {
+                switch (this.ToggleState)
                 {
                     case ToggleState.On:
-                        return CheckState.Checked;
+                        return true;

                     case ToggleState.Off:
-                        return CheckState.Unchecked;
+                        return false;

                     default:
-                        return CheckState.Indeterminate;
+                        return null;
                 }
+            }
+        }
+
+        internal ToggleState ToggleState
+        {
+            get
+            {
+                return this.GetPropertyValue<CheckBox, ToggleState>(TogglePattern.ToggleStateProperty);
             }
         }

@@ -141,32 +147,26 @@
             }
         }

-        /// <summary>
-        /// Устанавливает чекбоксу состояние сheck.
-        /// </summary>
-        public void Check()
-        {
-            var oldState = this.CheckState;
-            if (oldState == CheckState.Checked)
-            {
-                return;
-            }
-
-            this.SetState(CheckState.Checked);
-        }
-
-        /// <summary>
-        /// Устанавливает чекбоксу состояние uncheck.
-        /// </summary>
-        public void UnCheck()
-        {
-            var oldState = this.CheckState;
-            if (oldState == CheckState.Unchecked)
-            {
-                return;
-            }
-
-            this.SetState(CheckState.Unchecked);
+        public bool Check()
+        {
+            var oldState = this.IsChecked;
+            if (oldState != null && oldState.Value)
+            {
+                return true;
+            }
+
+            return this.SetState(ToggleState.On);
+        }
+
+        public bool UnCheck()
+        {
+            var oldState = this.IsChecked;
+            if (oldState != null && !oldState.Value)
+            {
+                return true;
+            }
+
+            return this.SetState(ToggleState.Off);
         }

         public void LazyInitialize(AutomationElement parent, string automationId)
@@ -186,13 +186,7 @@
             return this;
         }

-        /// <summary>
-        /// Устанавливает чекбоксу указанное состояние.
-        /// </summary>
-        /// <param name="newState">
-        /// Устанавливаемое состояние.
-        /// </param>
-        private void SetState(CheckState newState)
+        private bool SetState(ToggleState newState)
         {
             if (!this.IsEnabled)
             {
@@ -201,18 +195,15 @@

             Mouse.MouseMoveSpeed = MouseMoveSpeed;
             Mouse.Move(this.ClickablePoint);
-            int maxClickCount = 4;
-            while (this.CheckState != newState && maxClickCount != 0)
+
+            int maxClickCount = MaxClickCount;
+            while (this.ToggleState != newState && maxClickCount != 0)
             {
                 Mouse.Click(this.ClickablePoint);
                 --maxClickCount;
             }

-            if (maxClickCount == 0)
-            {
-                // TODO: Исключение вида - не удалось установить состояние newState контролу automationId
-                throw new Exception("Не получилось установить состояние чекбоксу.");
-            }
+            return maxClickCount != 0;
         }

         /// <summary>


Fixed messages relating to CellExists property.

--- src/Cruciatus/Elements/DataGrid.cs
+++ src/Cruciatus/Elements/DataGrid.cs
@@ -162,7 +162,8 @@
         /// Номер колонки.
         /// </param>
         /// <returns>
-        /// Значение true, если ячейка существует; false - в противном случае.
+        /// Значение true, если ячейка существует;
+        /// false, если ячейка не существует или находится вне видимости.
         /// </returns>
         public bool CellExists(int row, int column)
         {
@@ -206,7 +207,7 @@
             if (!this.CellExists(row, column))
             {
                 this.LastErrorMessage = string.Format(
-                    "В {0} не существует ячейки [{1}, {2}].",
+                    "В {0} ячейка [{1}, {2}] не существует или находится вне видимости.",
                     this.ToString(),
                     row,
                     column);


Messing around with launching and activation.

--- src/Crystal3/CrystalApplication.cs
+++ src/Crystal3/CrystalApplication.cs
@@ -170,18 +170,23 @@

         protected override async void OnLaunched(LaunchActivatedEventArgs args)
         {
-            if (args.PreviousExecutionState != ApplicationExecutionState.Running && args.PreviousExecutionState != ApplicationExecutionState.Suspended)
+            if (args.PreviousExecutionState != ApplicationExecutionState.Running && args.PreviousExecutionState != ApplicationExecutionState.Suspended && args.TileId == "App")
             {
                 await InitializeRootFrameAsync(args);

                 if (args.PreviousExecutionState != ApplicationExecutionState.Terminated)
                     OnFreshLaunch(args);
             }
+            else if ((args.PreviousExecutionState == ApplicationExecutionState.Running || args.PreviousExecutionState == ApplicationExecutionState.Suspended) && !string.IsNullOrWhiteSpace(args.Arguments))
+            {
+                OnActivation(args);
+            }
         }

         protected override async void OnActivated(IActivatedEventArgs args)
         {
-            await InitializeRootFrameAsync(args);
+            if (args.PreviousExecutionState != ApplicationExecutionState.Running && args.PreviousExecutionState != ApplicationExecutionState.Suspended)
+                await InitializeRootFrameAsync(args);

             OnActivation(args);
         }


Added Degree and MaxDegree extensions.

Added Degree and MaxDegree extensions.

--- WmcSoft.Core/Collections/Specialized/GraphExtensions.cs
+++ WmcSoft.Core/Collections/Specialized/GraphExtensions.cs
@@ -25,6 +25,7 @@
 #endregion

 using System.Collections.Generic;
+using System.Linq;

 namespace WmcSoft.Collections.Specialized
 {
@@ -116,6 +117,34 @@

         #endregion

+        #region Typical graph processing methods
+
+        /// <summary>
+        /// Computes the degree of the vertex <paramref name="v"/>.
+        /// </summary>
+        /// <typeparam name="TGraph">The type of graph.</typeparam>
+        /// <param name="graph">The graph.</param>
+        /// <param name="v">The vertex.</param>
+        /// <returns>The degree of the vertex.</returns>
+        public static int Degree<TGraph>(this TGraph graph, int v)
+            where TGraph : IGraph {
+            return graph.Adjacents(v).Count;
+        }
+
+        /// <summary>
+        /// Computes the maximum degree.
+        /// </summary>
+        /// <typeparam name="TGraph">The type of graph.</typeparam>
+        /// <param name="graph">The graph.</param>
+        /// <returns>The maximum degree.</returns>
+        public static int MaxDegree<TGraph>(this TGraph graph)
+            where TGraph : IGraph {
+            return Enumerable.Range(0, graph.VerticeCount)
+                .Max(v => graph.Adjacents(v).Count);
+        }
+
+        #endregion
+
         #region Connect

         public static TGraph Connect<TGraph, TVertex>(this TGraph graph, TVertex v, params TVertex[] w)


Home room

Home room

--- Yupi.Messages/Handlers/Rooms/SetHomeRoomMessageEvent.cs
+++ Yupi.Messages/Handlers/Rooms/SetHomeRoomMessageEvent.cs
@@ -1,4 +1,8 @@
 using System;
+using Yupi.Controller;
+using Yupi.Model.Domain;
+using Yupi.Model.Repository;
+using Yupi.Model;

@@ -6,25 +10,25 @@
 {
 	public class SetHomeRoomMessageEvent : AbstractHandler
 	{
-		public override void HandleMessage ( Yupi.Model.Domain.Habbo session, Yupi.Protocol.Buffers.ClientMessage request, Yupi.Protocol.IRouter router)
+		private Repository<RoomData> RoomRepository;
+		private Repository<UserInfo> UserRepository;
+
+		public SetHomeRoomMessageEvent ()
 		{
-			uint roomId = request.GetUInt32();
+			RoomRepository = DependencyFactory.Resolve<Repository<RoomData>> ();
+			UserRepository = DependencyFactory.Resolve<Repository<UserInfo>> ();
+		}

-			/*
-			RoomData data = Yupi.GetGame().GetRoomManager().GenerateRoomData(roomId);
+		public override void HandleMessage (Yupi.Model.Domain.Habbo session, Yupi.Protocol.Buffers.ClientMessage request, Yupi.Protocol.IRouter router)
+		{
+			int roomId = request.GetInteger ();

-			if (roomId != 0 && data == null)
-			{
-				session.GetHabbo().HomeRoom = roomId;
+			RoomData room = RoomRepository.FindBy (roomId);

-				using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
-					queryReactor.RunFastQuery(string.Concat("UPDATE users SET home_room = ", roomId,
-						" WHERE id = ", session.GetHabbo().Id));
-
-				router.GetComposer<HomeRoomMessageComposer> ().Compose (session, roomId);
+			if (room != null) {
+				session.Info.HomeRoom = room;
+				UserRepository.Save (session.Info);
 			}
-			*/
-			throw new NotImplementedException ();
 		}
 	}
 }


Remove if statement whose condition is always true.

--- src/Fixie/Execution/ClassRunner.cs
+++ src/Fixie/Execution/ClassRunner.cs
@@ -48,86 +48,83 @@

             bool runCasesInvokedByLifecycle = false;

-            if (cases.Any())
-            {
-                try
-                {
-                    lifecycle.Execute(testClass, caseLifecycle =>
-                    {
-                        if (runCasesInvokedByLifecycle)
-                            throw new Exception($"{lifecycle.GetType()} attempted to run {testClass.FullName}'s test cases multiple times, which is not supported.");
-
-                        runCasesInvokedByLifecycle = true;
-
-                        foreach (var @case in cases)
-                        {
-                            if (@case.Exception != null)
-                                continue;
-
-                            string reason;
-                            bool skipCase;
+            try
+            {
+                lifecycle.Execute(testClass, caseLifecycle =>
+                {
+                    if (runCasesInvokedByLifecycle)
+                        throw new Exception($"{lifecycle.GetType()} attempted to run {testClass.FullName}'s test cases multiple times, which is not supported.");
+
+                    runCasesInvokedByLifecycle = true;
+
+                    foreach (var @case in cases)
+                    {
+                        if (@case.Exception != null)
+                            continue;
+
+                        string reason;
+                        bool skipCase;
+
+                        try
+                        {
+                            skipCase = SkipCase(@case, out reason);
+                        }
+                        catch (Exception exception)
+                        {
+                            @case.Fail(exception);
+                            continue;
+                        }
+
+                        if (skipCase)
+                        {
+                            @case.SkipReason = reason;
+                            continue;
+                        }
+
+                        string consoleOutput;
+                        using (var console = new RedirectedConsole())
+                        {
+                            var caseStopwatch = Stopwatch.StartNew();

                             try
                             {
-                                skipCase = SkipCase(@case, out reason);
+                                caseLifecycle(@case);
                             }
                             catch (Exception exception)
                             {
-                                @case.Fail(exception);
-                                continue;
+                                Fail(new Case(@case, exception), summary);
                             }

-                            if (skipCase)
-                            {
-                                @case.SkipReason = reason;
-                                continue;
-                            }
-
-                            string consoleOutput;
-                            using (var console = new RedirectedConsole())
-                            {
-                                var caseStopwatch = Stopwatch.StartNew();
-
-                                try
-                                {
-                                    caseLifecycle(@case);
-                                }
-                                catch (Exception exception)
-                                {
-                                    Fail(new Case(@case, exception), summary);
-                                }
-
-                                caseStopwatch.Stop();
-
-                                @case.Duration += caseStopwatch.Elapsed;
-
-                                consoleOutput = console.Output;
-                                @case.Output += consoleOutput;
-                            }
-
-                            Console.Write(consoleOutput);
-                        }
-                    });
-                }
-                catch (Exception exception)
-                {
-                    foreach (var method in methods)
-                    {
-                        var @case = new Case(method);
-                        @case.Fail(exception);
-                        Fail(@case, summary);
-                    }
-                }
-
-                foreach (var @case in cases)
-                {
-                    if (@case.Exception != null)
-                        Fail(@case, summary);
-                    else if (@case.Executed)
-                        Pass(@case, summary);
-                    else
-                        Skip(@case, summary);
-                }
+                            caseStopwatch.Stop();
+
+                            @case.Duration += caseStopwatch.Elapsed;
+
+                            consoleOutput = console.Output;
+                            @case.Output += consoleOutput;
+                        }
+
+                        Console.Write(consoleOutput);
+                    }
+                });
+            }
+            catch (Exception exception)
+            {
+                foreach (var method in methods)
+                {
+                    var @case = new Case(method);
+                    @case.Fail(exception);
+                    Fail(@case, summary);
+                }
+            }
+
+            foreach (var @case in cases)
+            {
+                if (@case.Exception != null)
+                    Fail(@case, summary);
+                else if (@case.Executed)
+                    Pass(@case, summary);
+                else
+                    Skip(@case, summary);
             }

             classStopwatch.Stop();


バージョンアップ。

バージョンアップ。

--- Implem.Pleasanter/Properties/AssemblyInfo.cs
+++ Implem.Pleasanter/Properties/AssemblyInfo.cs
@@ -10,4 +10,4 @@
 [assembly: AssemblyCulture("")]
 [assembly: ComVisible(false)]
 [assembly: Guid("ec0d3d5b-8879-462b-835f-ff1737a01543")]
-[assembly: AssemblyVersion("0.47.89.*")]+[assembly: AssemblyVersion("0.48.1.*")]


Fix the tests for exception types

Fix the tests for exception types

Signed-off-by: Dimitar Dobrev <ca751a5c976abad79158718440750fc638d19ebc@protonmail.com>

--- src/Generator.Tests/AST/TestAST.cs
+++ src/Generator.Tests/AST/TestAST.cs
@@ -503,12 +503,12 @@
                 Is.EqualTo(ExceptionSpecType.BasicNoexcept));

             var noExceptTrue = AstContext.FindFunction("noExceptTrue").First();
-            Assert.That(((FunctionType) noExcept.FunctionType.Type).ExceptionSpecType,
-                Is.EqualTo(ExceptionSpecType.NoexceptTrue).Or.EqualTo(ExceptionSpecType.BasicNoexcept));
+            Assert.That(((FunctionType) noExceptTrue.FunctionType.Type).ExceptionSpecType,
+                Is.EqualTo(ExceptionSpecType.NoexceptTrue));

             var noExceptFalse = AstContext.FindFunction("noExceptFalse").First();
-            Assert.That(((FunctionType) noExcept.FunctionType.Type).ExceptionSpecType,
-                Is.EqualTo(ExceptionSpecType.NoexceptFalse).Or.EqualTo(ExceptionSpecType.BasicNoexcept));
+            Assert.That(((FunctionType) noExceptFalse.FunctionType.Type).ExceptionSpecType,
+                Is.EqualTo(ExceptionSpecType.NoexceptFalse));

             var regular = AstContext.FindFunction("testSignature").First();
             Assert.IsFalse(regular.IsConstExpr);


Fix concurrency in DefaultTypeConverter. (#620)

--- Jint/Runtime/Interop/DefaultTypeConverter.cs
+++ Jint/Runtime/Interop/DefaultTypeConverter.cs
@@ -1,6 +1,6 @@
 using System;
+using System.Collections.Concurrent;
 using System.Collections.ObjectModel;
-using System.Collections.Generic;
 using System.Linq.Expressions;
 using System.Reflection;
 using Jint.Native;
@@ -10,8 +10,7 @@
     public class DefaultTypeConverter : ITypeConverter
     {
         private readonly Engine _engine;
-        private static readonly Dictionary<string, bool> _knownConversions = new Dictionary<string, bool>();
-        private static readonly object _lockObject = new object();
+        private static readonly ConcurrentDictionary<string, bool> _knownConversions = new ConcurrentDictionary<string, bool>();

         private static readonly MethodInfo convertChangeType = typeof(Convert).GetMethod("ChangeType", new Type[] { typeof(object), typeof(Type), typeof(IFormatProvider) });
         private static readonly MethodInfo jsValueFromObject = typeof(JsValue).GetMethod("FromObject");
@@ -208,27 +207,18 @@
         {
             var key = value == null ? $"Null->{type}" : $"{value.GetType()}->{type}";

-            if (!_knownConversions.TryGetValue(key, out var canConvert))
-            {
-                lock (_lockObject)
-                {
-                    if (!_knownConversions.TryGetValue(key, out canConvert))
-                    {
-                        try
-                        {
-                            converted = Convert(value, type, formatProvider);
-                            _knownConversions.Add(key, true);
-                            return true;
-                        }
-                        catch
-                        {
-                            converted = null;
-                            _knownConversions.Add(key, false);
-                            return false;
-                        }
-                    }
-                }
-            }
+            var canConvert = _knownConversions.GetOrAdd(key, _ =>
+            {
+                try
+                {
+                    Convert(value, type, formatProvider);
+                    return true;
+                }
+                catch
+                {
+                    return false;
+                }
+            });

             if (canConvert)
             {


Fix last commit.

Fix last commit.

--- JsonRpc.Dataflow/DataflowRpcClientHandler.cs
+++ JsonRpc.Dataflow/DataflowRpcClientHandler.cs
@@ -15,7 +15,7 @@
     /// Provides options for <see cref="JsonRpcClient"/>.
     /// </summary>
     [Flags]
-    public enum JsonRpcClientOptions
+    public enum DataflowRpcClientOptions
     {
         /// <summary>
         /// No special configurations.
@@ -38,11 +38,11 @@
         private readonly Dictionary<MessageId, TaskCompletionSource<ResponseMessage>> impendingRequestDict
             = new Dictionary<MessageId, TaskCompletionSource<ResponseMessage>>();

-        public DataflowRpcClientHandler() : this(JsonRpcClientOptions.None)
+        public DataflowRpcClientHandler() : this(DataflowRpcClientOptions.None)
         {
         }

-        public DataflowRpcClientHandler(JsonRpcClientOptions options)
+        public DataflowRpcClientHandler(DataflowRpcClientOptions options)
         {
             Options = options;
             OutBufferBlock = new BufferBlock<RequestMessage>();
@@ -66,7 +66,7 @@
         /// <summary>
         /// Client options.
         /// </summary>
-        public JsonRpcClientOptions Options { get; }
+        public DataflowRpcClientOptions Options { get; }

         /// <summary>
         /// The input buffer used to receive responses.
@@ -99,8 +99,8 @@
                     if (!tcs1.TrySetCanceled()) return;
                     // Note that server might still send the response after cancellation on the client.
                     // If we are going to keep all "foreign" responses, we need to be able to recgnize it later.
-                    var keepRequestIdInMind = (Options & JsonRpcClientOptions.PreserveForeignResponses) ==
-                                              JsonRpcClientOptions.PreserveForeignResponses;
+                    var keepRequestIdInMind = (Options & DataflowRpcClientOptions.PreserveForeignResponses) ==
+                                              DataflowRpcClientOptions.PreserveForeignResponses;
                     if (keepRequestIdInMind)
                     {
 #pragma warning disable 4014
@@ -170,8 +170,8 @@
                 var resp = m as ResponseMessage;
                 if (resp == null) return false;
                 // Discard foreign responses, if any.
-                if ((Options & JsonRpcClientOptions.PreserveForeignResponses) !=
-                    JsonRpcClientOptions.PreserveForeignResponses) return true;
+                if ((Options & DataflowRpcClientOptions.PreserveForeignResponses) !=
+                    DataflowRpcClientOptions.PreserveForeignResponses) return true;
                 // Or we will check if we're wating for this response.
                 lock (impendingRequestDict) return impendingRequestDict.ContainsKey(resp.Id);
             });


not yet

not yet

--- MasterActivator/MasterActivator/KurisuLib.cs
+++ MasterActivator/MasterActivator/KurisuLib.cs
@@ -1,4 +1,4 @@
-/* KurisuLib borrowed from Kurisu's Morgana with his permission
+/* KurisuLib borrowed from Kurisu's Morgana
 Kurisu is a pretty cool bro and a good developer.
 You can find his github here:
 https://github.com/Kurisu44/


Remove stray comment

Remove stray comment

--- MonoDevelop.Addins.Tasks/GenerateManifest.cs
+++ MonoDevelop.Addins.Tasks/GenerateManifest.cs
@@ -49,7 +49,6 @@

 		[Required]
 		public ITaskItem [] AddinFilesWithLinkMetadata { get; set; }
-		//@(_MDResolvedAddins->'%(AddinFile)')

 		public override bool Execute ()
 		{


some method sig changes

some method sig changes

--- Macboy/MyDocument.cs
+++ Macboy/MyDocument.cs
@@ -93,7 +93,7 @@
 			LoadNote (currentNoteID, true);
 		}

-		void HandleFinishedLoad (object sender, MonoMac.WebKit.WebFrameEventArgs e)
+		private void HandleFinishedLoad (object sender, MonoMac.WebKit.WebFrameEventArgs e)
 		{
 			var dom = e.ForFrame.DomDocument;

@@ -107,7 +107,7 @@
 			}
 		}

-		void LoadNewNote ()
+		private void LoadNewNote ()
 		{
 			// this thing still has issues. The noteWebView is not initialized and I don't know how to get it.
 			LoadingFromString = true;
@@ -120,7 +120,7 @@
 			LoadingFromString = false;
 		}

-		void LoadNote (string newNoteId, bool withHistory = true)
+		private void LoadNote (string newNoteId, bool withHistory = true)
 		{
 			if (HasUnautosavedChanges)
 				SaveData ();
@@ -173,7 +173,7 @@
 		/// <param name='editable'>
 		/// Editable.
 		/// </param>
-		void Editable (bool editable)
+		private void Editable (bool editable)
 		{
 			noteWebView.Editable = editable; // So that Notes can be Edited
 		}


un-LINQ the Transition property matching codepath.

--- src/Avalonia.Animation/Animatable.cs
+++ src/Avalonia.Animation/Animatable.cs
@@ -68,16 +68,19 @@
         {
             if (_transitions is null || _previousTransitions is null || e.Priority == BindingPriority.Animation) return;

-            var match = Transitions.FirstOrDefault(x => x.Property == e.Property);
+            // PERF-SENSITIVE: Called on every property change. Don't use LINQ here (too many allocations).
+            foreach (var transition in Transitions)
+            {
+                if (transition.Property == e.Property)
+                {
+                    if (_previousTransitions.TryGetValue(e.Property, out var dispose))
+                        dispose.Dispose();

-            if (match != null)
-            {
-                if (_previousTransitions.TryGetValue(e.Property, out var dispose))
-                    dispose.Dispose();
+                    var instance = transition.Apply(this, Clock ?? Avalonia.Animation.Clock.GlobalClock, e.OldValue, e.NewValue);

-                var instance = match.Apply(this, Clock ?? Avalonia.Animation.Clock.GlobalClock, e.OldValue, e.NewValue);
-
-                _previousTransitions[e.Property] = instance;
+                    _previousTransitions[e.Property] = instance;
+                    return;
+                }
             }
         }
     }


Moved the setting of FocusedElement

Moved the setting of FocusedElement

This allows the LostFocus event to check the newly focused element

--- src/Avalonia.Input/KeyboardDevice.cs
+++ src/Avalonia.Input/KeyboardDevice.cs
@@ -46,13 +46,13 @@
             if (element != FocusedElement)
             {
                 var interactive = FocusedElement as IInteractive;
+                FocusedElement = element;

                 interactive?.RaiseEvent(new RoutedEventArgs
                 {
                     RoutedEvent = InputElement.LostFocusEvent,
                 });

-                FocusedElement = element;
                 interactive = element as IInteractive;

                 interactive?.RaiseEvent(new GotFocusEventArgs


BrowserDialog to WebView2

BrowserDialog to WebView2

--- src/BloomExe/MiscUI/BrowserDialog.cs
+++ src/BloomExe/MiscUI/BrowserDialog.cs
@@ -31,7 +31,7 @@

 	public partial class BrowserDialog : Form, IBrowserDialog
 	{
-		private GeckoFxBrowser _browser;
+		private Browser _browser;
 		private Boolean _hidden;

 		// This applies only to cases where the dialog is created but not shown (hidden is true)
@@ -127,7 +127,10 @@

 			// The Size setting is needed on Linux to keep the browser from coming up as a small
 			// rectangle in the upper left corner...
-			_browser = new GeckoFxBrowser { Dock = DockStyle.Fill, Location = new Point(3, 3), Size = new Size(this.Width - 6, this.Height - 6) };
+			_browser = BrowserMaker.MakeBrowser();
+			_browser.Dock = DockStyle.Fill;
+			_browser.Location = new Point(3, 3);
+			_browser.Size = new Size(this.Width - 6, this.Height - 6);
 			_browser.BackColor = Color.White;

 			var dummy = _browser.Handle; // gets the WebBrowser created


Simplify code

Simplify code

Simplify the code that sets up the handler wrapper.

--- src/LondonTravel.Skill/Function.cs
+++ src/LondonTravel.Skill/Function.cs
@@ -1,11 +1,9 @@
 // Copyright (c) Martin Costello, 2017. All rights reserved.
 // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.

-using System;
 using System.Threading.Tasks;
 using Alexa.NET.Request;
 using Alexa.NET.Response;
-using Amazon.Lambda.Core;
 using Amazon.Lambda.RuntimeSupport;
 using Amazon.Lambda.Serialization.Json;

@@ -31,9 +29,7 @@
             var serializer = new JsonSerializer();
             var function = new AlexaFunction();

-            Func<SkillRequest, ILambdaContext, Task<SkillResponse>> handler = function.HandlerAsync;
-
-            using var handlerWrapper = HandlerWrapper.GetHandlerWrapper(handler, serializer);
+            using var handlerWrapper = HandlerWrapper.GetHandlerWrapper<SkillRequest, SkillResponse>(function.HandlerAsync, serializer);
             using var bootstrap = new LambdaBootstrap(handlerWrapper);

             await bootstrap.RunAsync();


Send 'mi-async on' for later versions of GDB (#1250)

Later verisons of GDB have depricated 'target-async' and replaced it
with 'mi-async'.

This PR first sends 'mi-async', and if it fails, it sends the old
'target-async' instead.

--- src/MICore/CommandFactories/gdb.cs
+++ src/MICore/CommandFactories/gdb.cs
@@ -183,11 +183,18 @@
             return addresses;
         }

-        public override Task EnableTargetAsyncOption()
+        public override async Task EnableTargetAsyncOption()
         {
             // Linux attach TODO: GDB will fail this command when attaching. This is worked around
             // by using signals for that case.
-            return _debugger.CmdAsync("-gdb-set target-async on", ResultClass.None);
+            Results result = await _debugger.CmdAsync("-gdb-set mi-async on", ResultClass.None);
+
+            // 'set mi-async on' will error on older versions of gdb (older than 11.x)
+            // Try enabling with the older 'target-async' keyword.
+            if (result.ResultClass == ResultClass.error)
+            {
+                await _debugger.CmdAsync("-gdb-set target-async on", ResultClass.None);
+            }
         }

         public override async Task Terminate()


Remove some debug spew.

Remove some debug spew.

--- src/Manos/Manos.Http/HttpParser.cs
+++ src/Manos/Manos.Http/HttpParser.cs
@@ -1286,8 +1286,6 @@

 					c = UNHEX[ch];
 					if (c == -1) {
-
-						Console.WriteLine ("THE CHAR:  '{0}'", (char) ch);
 						settings.RaiseOnError(this, "invalid hex char in chunk content length", data, p_err);
 					}
 					content_length = c;
@@ -1312,7 +1310,6 @@
 							state = State.chunk_parameters;
 							break;
 						}
-						Console.WriteLine ("THE CHAR: '{0}'", (char) ch);
 						settings.RaiseOnError(this, "invalid hex char in chunk content length", data, p_err);
 					}


fixing unlinked property: page

fixing unlinked property: page

--- src/Brew.Webforms/Widgets/Spinner.cs
+++ src/Brew.Webforms/Widgets/Spinner.cs
@@ -35,7 +35,7 @@
 				new WidgetOption { Name = "max", DefaultValue = null },
 				new WidgetOption { Name = "min", DefaultValue = null },
 				new WidgetOption { Name = "numberFormat", DefaultValue = null },
-				new WidgetOption { Name = "page", DefaultValue = null },
+				new WidgetOption { Name = "page", DefaultValue = null, PropertyName = "PageSteps" },
 				new WidgetOption { Name = "step", DefaultValue = null }
 			};
 		}


Added EntryId field into the LogEntry

Added EntryId field into the LogEntry

--- src/ClrCoder/Logging/Std/LogEntry.cs
+++ src/ClrCoder/Logging/Std/LogEntry.cs
@@ -5,6 +5,8 @@

 namespace ClrCoder.Logging.Std
 {
+    using System;
+
     using JetBrains.Annotations;

     using Newtonsoft.Json;
@@ -19,6 +21,17 @@
     /// </summary>
     public class LogEntry : JLogEntry
     {
+        [JsonConstructor]
+        public LogEntry (string entryId)
+        {
+            EntryId = entryId;
+        }
+
+        public LogEntry(): this(Guid.NewGuid().ToString())
+        {
+
+        }
+
         /// <summary>
         /// Call place information.
         /// </summary>
@@ -36,6 +49,12 @@
         /// </summary>
         [CanBeNull]
         public string DotNetType { get; set; }
+
+        /// <summary>
+        /// Log entry identifier.
+        /// </summary>
+        [NotNull]
+        public string EntryId { get; }

         /// <summary>
         /// UTC when event was raised.


Scaffolding for ProblemListerner.

Scaffolding for ProblemListerner.

--- pddlnet/pddl.cs
+++ pddlnet/pddl.cs
@@ -203,6 +203,108 @@
 }

 internal class ProblemListener : pddlBaseListener {
+        /*
+        self.objects = {}
+        self.initialstate = []
+        self.goals = []
+        self.scopes = []
+        */
+    HashSet<object> objects = new HashSet<object>();
+    List<object> initialstate = new List<object>();
+    List<object> goals = new List<object>();
+    List<object> scopes = new List<object>();
+
+    public override void EnterInit(pddlParser.InitContext ctx) {
+        /*
+        self.scopes.append(Scope())
+        */
+    }
+
+    public override void ExitInit(pddlParser.InitContext ctx) {
+        /*
+        self.initialstate = set( self.scopes.pop().atoms )
+        */
+    }
+
+    public override void EnterGoal(pddlParser.GoalContext ctx) {
+        /*
+        self.scopes.append(Scope())
+        */
+    }
+
+    public override void ExitGoal(pddlParser.GoalContext ctx) {
+        /*
+        self.goals = set( self.scopes.pop().atoms )
+        */
+    }
+
+    public override void EnterAtomicNameFormula(pddlParser.AtomicNameFormulaContext ctx) {
+        /*
+        pred = []
+        for c in ctx.getChildren():
+            n = c.getText()
+            if n == '(' or n == ')':
+                continue
+            pred.append(n)
+        scope = self.scopes[-1]
+        scope.addatom(Atom(pred))
+        */
+    }
+
+    public override void EnterAtomicTermFormula(pddlParser.AtomicTermFormulaContext ctx) {
+        /*
+        # with a NOT!
+        pred = []
+        for c in ctx.getChildren():
+            n = c.getText()
+            if n == '(' or n == ')':
+                continue
+            pred.append(n)
+        scope = self.scopes[-1]
+        scope.addatom(Atom(pred))
+        */
+    }
+
+    public override void EnterTypedNameList(pddlParser.TypedNameListContext ctx) {
+        /*
+        for v in ctx.NAME():
+            vname = v.getText()
+            self.scopes[-1].variable_list[v.getText()] = None
+        for vs in ctx.singleTypeNameList():
+            t = vs.r_type().getText()
+            for v in vs.NAME():
+                vname = v.getText()
+                self.scopes[-1].variable_list[vname] = t
+        */
+    }
+
+    public override void EnterObjectDecl(pddlParser.ObjectDeclContext ctx) {
+        /*
+        self.scopes.append(Obj())
+        */
+    }
+
+    public override void ExitObjectDecl(pddlParser.ObjectDeclContext ctx) {
+        /*
+        scope = self.scopes.pop()
+        self.objects = scope.variable_list
+        */
+    }
+
+    public override void ExitProblem(pddlParser.ProblemContext ctx) {
+        /*
+        if not self.objects:
+            vs = set()
+            for a in self.initialstate:
+                for s in a.predicate:
+                    vs.add( (s, None) )
+            for a in self.goals:
+                for s in a.predicate:
+                    vs.add( (s, None) )
+            self.objects = dict( vs )
+        */
+    }
+
 }

 public class DomainProblem {


Small optimisation

Small optimisation

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

--- src/MonoTorrent.Dht/MessageLoop.cs
+++ src/MonoTorrent.Dht/MessageLoop.cs
@@ -180,10 +180,9 @@
             KeyValuePair<IPEndPoint, Message> receive = receiveQueue.Dequeue();
             Message m = receive.Value;
             IPEndPoint source = receive.Key;
-			waitingResponse.RemoveAll(delegate(SendDetails msg)
-			{
-                return msg.Message.TransactionId.Equals(m.TransactionId);
-            });
+            for (int i = 0; i < waitingResponse.Count; i++)
+                if (waitingResponse[i].Message.TransactionId.Equals(m.TransactionId))
+                    waitingResponse.RemoveAt(i--);

             try
             {


removed assertionfailure to allow collections to be refreshed

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@266

--- src/NHibernate/Impl/SessionImpl.cs
+++ src/NHibernate/Impl/SessionImpl.cs
@@ -2444,7 +2444,8 @@
 		/// <param name="entry"></param>
 		private void PrepareCollectionForUpdate(PersistentCollection coll, CollectionEntry entry) {

-			if ( entry.processed ) throw new AssertionFailure("hibernate has a bug processing collections");
+			// TODO: figure out if this message is accurate.  seems to work fine without this
+			//if ( entry.processed ) throw new AssertionFailure("hibernate has a bug processing collections");

 			entry.processed = true;


Update status flags on load register operations

--- src/NesZord.Core/Microprocessor.cs
+++ src/NesZord.Core/Microprocessor.cs
@@ -605,6 +605,7 @@
 		private void LoadAccumulator(byte value)
 		{
 			this.Accumulator.Value = value;
+			this.UpdateFlagsWith(this.Accumulator.Value);
 		}

 		private void LoadXRegister(MemoryLocation location)
@@ -615,6 +616,7 @@
 		private void LoadXRegister(byte value)
 		{
 			this.X.Value = value;
+			this.UpdateFlagsWith(this.X.Value);
 		}

 		private void LoadYRegister(MemoryLocation location)
@@ -625,6 +627,7 @@
 		private void LoadYRegister(byte value)
 		{
 			this.Y.Value = value;
+			this.UpdateFlagsWith(this.Y.Value);
 		}

 		private void LogicalShiftRightOnMemory(MemoryLocation location)
@@ -835,5 +838,11 @@

 			return value;
 		}
+
+		private void UpdateFlagsWith(byte value)
+		{
+			this.Zero = value == 0x00;
+			this.Negative = (value & 0x80) == 0x80;
+		}
 	}
 }


Use ArrayPool to rent a temp buffer for generating multipart boundaries

--- MimeKit/Multipart.cs
+++ MimeKit/Multipart.cs
@@ -27,14 +27,15 @@
 using System;
 using System.IO;
 using System.Text;
+using System.Buffers;
 using System.Threading;
 using System.Collections;
 using System.Threading.Tasks;
 using System.Collections.Generic;

+using MimeKit.IO;
+using MimeKit.Utils;
 using MimeKit.Encodings;
-using MimeKit.Utils;
-using MimeKit.IO;

 namespace MimeKit {
 	/// <summary>
@@ -146,14 +147,19 @@
 		{
 			var base64 = new Base64Encoder (true);
 			var digest = new byte[16];
-			var buf = new byte[24];
 			int length;

 			MimeUtils.GetRandomBytes (digest);

-			length = base64.Flush (digest, 0, digest.Length, buf);
-
-			return "=-" + Encoding.ASCII.GetString (buf, 0, length);
+			var buf = ArrayPool<byte>.Shared.Rent (24);
+
+			try {
+				length = base64.Flush (digest, 0, digest.Length, buf);
+
+				return "=-" + Encoding.ASCII.GetString (buf, 0, length);
+			} finally {
+				ArrayPool<byte>.Shared.Return (buf);
+			}
 		}

 		/// <summary>


Clone Test

Clone Test

--- MinMethod/Program.cs
+++ MinMethod/Program.cs
@@ -4,6 +4,9 @@
 {
 	class MainClass
 	{
+
+	    // mинимално число
+
 		public static void Main(string[] args)
 		{
 			int a = int.Parse(Console.ReadLine());


CMFormatDescription: add the video methods, fixes #3916

--- src/CoreMedia/CMFormatDescription.cs
+++ src/CoreMedia/CMFormatDescription.cs
@@ -11,7 +11,7 @@
 //
 using System;
 using System.Runtime.InteropServices;
-
+using System.Drawing;
 using MonoMac;
 using MonoMac.Foundation;
 using MonoMac.CoreFoundation;
@@ -210,6 +210,49 @@
 				}
 			}
 		}
+
+		[DllImport (Constants.CoreMediaLibrary)]
+		extern static Size CMVideoFormatDescriptionGetDimensions (IntPtr handle);
+		public Size  VideoDimensions {
+			get {
+				return CMVideoFormatDescriptionGetDimensions (handle);
+			}
+		}
+
+		[DllImport (Constants.CoreMediaLibrary)]
+		extern static RectangleF CMVideoFormatDescriptionGetCleanAperture (IntPtr handle, bool originIsAtTopLeft);
+
+		public RectangleF GetVideoCleanAperture (bool originIsAtTopLeft)
+		{
+			return CMVideoFormatDescriptionGetCleanAperture (handle);
+		}
+
+		[DllImport (Constants.CoreMediaLibrary)]
+		extern static IntPtr CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers ();
+		public static NSObject [] GetExtensionKeysCommonWithImageBuffers ()
+		{
+			var arr = CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers ();
+			return NSArray.ArrayFromHandle<NSString> (arr);
+		}
+
+		[DllImport (Constants.CoreMediaLibrary)]
+		extern static SizeF CMVideoFormatDescriptionGetPresentationDimensions (IntPtr handle, bool usePixelAspectRatio, bool useCleanAperture);
+
+		public SizeF GetVideoPresentationDimensions (bool usePixelAspectRatio, bool useCleanAperture)
+		{
+			return CMVideoFormatDescriptionGetPresentationDimensions (handle, usePixelAspectRatio, useCleanAperture);
+		}
+
+		[DllImport (Constants.CoreMediaLibrary)]
+		extern static int CMVideoFormatDescriptionMatchesImageBuffer (IntPtr handle, IntPtr imageBufferRef);
+
+		public VideoMatchesImageBuffer (CVImageBuffer imageBuffer)
+		{
+			if (imageBuffer == null)
+				throw new ArgumentNullException ("imageBuffer");
+			return CMVideoFormatDescriptionMatchesImageBuffer (handle, imageBuffer.Handle) != 0;
+		}
+
 #endif
 	}
 }


Flush streams

Flush streams

--- src/Costura.Fody/ResourceEmbedder.cs
+++ src/Costura.Fody/ResourceEmbedder.cs
@@ -518,6 +518,7 @@
             using (var fileStream = File.Open(cacheFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
             {
                 fileStream.CopyTo(memoryStream);
+                memoryStream.Flush();
             }
         }
         else
@@ -531,16 +532,19 @@
                         using (var compressedStream = new DeflateStream(memoryStream, CompressionMode.Compress, true))
                         {
                             fileStream.CopyTo(compressedStream);
+                            compressedStream.Flush();
                         }
                     }
                     else
                     {
                         fileStream.CopyTo(memoryStream);
+                        memoryStream.Flush();
                     }
                 }

                 memoryStream.Position = 0;
                 memoryStream.CopyTo(cacheFileStream);
+                cacheFileStream.Flush();
             }
         }


added sort users

added sort users

--- Octokit/Models/Request/SearchUsersRequest.cs
+++ Octokit/Models/Request/SearchUsersRequest.cs
@@ -29,9 +29,9 @@

         /// <summary>
         /// For http://developer.github.com/v3/search/#search-users
-        /// Optional Sort field. One of followers, repositories, or joined. If not provided, results are sorted by best match.
+        /// Optional Sort field. One of followers, repositories, or joined. If not provided (null), results are sorted by best match.
         /// </summary>
-        //public string Sort { get; set; } //re-add later
+        public SortUsers? Sort { get; set; }

         /// <summary>
         /// Optional Sort order if sort parameter is provided. One of asc or desc; the default is desc.
@@ -109,4 +109,11 @@
         Email,
         FullName
     }
+
+    public enum SortUsers
+    {
+        Followers,
+        Repositories,
+        Joined
+    }
 }


Add VSA attribut add test

Add VSA attribut add test

--- OpenCymd.Nps.SamplePlugin/SampleNpsPlugin.cs
+++ OpenCymd.Nps.SamplePlugin/SampleNpsPlugin.cs
@@ -2,13 +2,14 @@
 {
     using System;
     using System.Globalization;
+    using System.Text;

     using log4net;

     using OpenCymd.Nps.Plugin;

     /// <summary>
-    /// Sample NPS plugin that prints all request attributes and the attributes of the accept response.
+    /// Sample NPS plugin that prints all request attributes, adds 3 VSAs and prints the attributes of the accept response.
     /// </summary>
     public class SampleNpsPlugin : INpsPlugin
     {
@@ -32,16 +33,25 @@
                 var attribName = Enum.IsDefined(typeof(RadiusAttributeType), attrib.AttributeId)
                                         ? ((RadiusAttributeType)attrib.AttributeId).ToString()
                                         : attrib.AttributeId.ToString(CultureInfo.InvariantCulture);
-                var attribValue = attrib.Value is byte[] ? "byte[" + ((byte[])attrib.Value).Length + "]" : attrib.Value;
+                var attribValue = attrib.Value is byte[] ? "byte[" + ((byte[])attrib.Value).Length + "] / " + Encoding.UTF8.GetString((byte[])attrib.Value) : attrib.Value;
                 Logger.DebugFormat("{0}={1}", attribName, attribValue);
             }
+
+            control.Response[RadiusCode.AccessAccept].Add(
+                new RadiusAttribute(RadiusAttributeType.VendorSpecific, new VendorSpecificAttribute(312, 1, new byte[] { 1, 2, 3, 4 })));
+
+            control.Response[RadiusCode.AccessChallenge].Add(
+                new RadiusAttribute(RadiusAttributeType.VendorSpecific, new VendorSpecificAttribute(313, 1, new byte[] { 4, 5, 6, 7 })));
+
+            control.Response[RadiusCode.AccessReject].Add(
+                new RadiusAttribute(RadiusAttributeType.VendorSpecific, new VendorSpecificAttribute(314, 1, new byte[] { 9, 10, 11, 12 })));

             foreach (var attrib in control.Response[RadiusCode.AccessAccept])
             {
                 var attribName = Enum.IsDefined(typeof(RadiusAttributeType), attrib.AttributeId)
                                      ? ((RadiusAttributeType)attrib.AttributeId).ToString()
                                      : attrib.AttributeId.ToString(CultureInfo.InvariantCulture);
-                var attribValue = attrib.Value is byte[] ? "byte[" + ((byte[])attrib.Value).Length + "]" : attrib.Value;
+                var attribValue = attrib.Value is byte[] ? "byte[" + ((byte[])attrib.Value).Length + "] / " + Encoding.UTF8.GetString((byte[])attrib.Value) : attrib.Value;
                 Logger.DebugFormat("{0}={1}", attribName, attribValue);
             }
         }


Refactored Program.Run.

Refactored Program.Run.

--- AppBrix.Backgammon.ConsoleApp/Program.cs
+++ AppBrix.Backgammon.ConsoleApp/Program.cs
@@ -37,13 +37,12 @@

         private static void Run(IApp app)
         {
-            Program.players["Player 1"] = app.Get<IGameFactory>().CreatePlayer("Player 1");
-            Program.players["Player 2"] = app.Get<IGameFactory>().CreatePlayer("Player 2");
-
             app.GetEventHub().Subscribe<IGameEnded>(Program.OnGameEnded);
             app.GetEventHub().Subscribe<ITurnChanged>(Program.OnTurnChanged);

-            var game = app.Get<IGameFactory>().CreateGame(players.Values.ToList());
+            var players = new List<IPlayer> { app.Get<IGameFactory>().CreatePlayer("Player 1"), app.Get<IGameFactory>().CreatePlayer("Player 2") };
+            players.ForEach(x => Program.players.Add(x.Name, x));
+            var game = app.Get<IGameFactory>().CreateGame(players);
         }

         private static void OnGameEnded(IGameEnded gameEnded)


Init parameter collection with the param count

- to reduce resizes

--- Mono.Cecil/Import.cs
+++ Mono.Cecil/Import.cs
@@ -695,9 +695,8 @@
 				if (!method.HasParameters)
 					return reference;

-				var reference_parameters = reference.Parameters;
-
 				var parameters = method.Parameters;
+				var reference_parameters = reference.parameters = new ParameterDefinitionCollection (reference, parameters.Count);
 				for (int i = 0; i < parameters.Count; i++)
 					reference_parameters.Add (
 						new ParameterDefinition (ImportType (parameters [i].ParameterType, context)));


Updated VSCodeUnity.cs, fixed "unsupported platform" message being overwritten by path not found check.

--- Assets/Editor/VSCodeUnity/VSCodeUnity.cs
+++ Assets/Editor/VSCodeUnity/VSCodeUnity.cs
@@ -104,7 +104,7 @@
 	private static void AddUnitySymbolsToVSC()
 	{
 		string cSharpDefPath = null;
-		string message = "";
+		string message = null;

 		if( Application.platform == RuntimePlatform.OSXEditor)
 		{
@@ -117,7 +117,7 @@

 		if( cSharpDefPath == null)
 		{
-			message = "Couldn't find Visual Studio Code application or CSharpDef";
+			message = message ?? "Couldn't find Visual Studio Code application or CSharpDef";
 		}
 		else
 		{


add whitespace to CameraFollow

add whitespace to CameraFollow

--- Assets/PDXcc/Trails/Code/CameraFollow.cs
+++ Assets/PDXcc/Trails/Code/CameraFollow.cs
@@ -7,8 +7,10 @@
     {
         // Target for the camera to follow
         public Transform target;
+
         // Distance to maintain between camera and target
         public Vector3 offset;
+
         // How quickly to follow
         public float speed = 1f;

@@ -16,6 +18,7 @@
         {
             // Get the position of the target, add the offset
             Vector3 targetPosition = target.position + offset;
+
             // Lerp between the current position and the target position using deltaTime for consistency
             transform.position = Vector3.Lerp(transform.position, targetPosition, speed * Time.deltaTime);
         }


fix merge code bug

fix merge code bug

--- Assets/Plugins/Slua_Managed/LuaObject.cs
+++ Assets/Plugins/Slua_Managed/LuaObject.cs
@@ -1391,15 +1391,17 @@
                     return Enum.ToObject(t, number);
                 }

-                object convertObj;
-                if (t.IsInstanceOfType(obj))
-                {
-                    convertObj = obj; // if t is parent of obj, ignore change type
-                }
-                else
-                {
-                    convertObj = Convert.ChangeType(obj, t);
-                }
+				object convertObj = null;
+				if(obj!=null) {
+	                if (t.IsInstanceOfType(obj))
+	                {
+	                    convertObj = obj; // if t is parent of obj, ignore change type
+	                }
+	                else
+	                {
+	                    convertObj = Convert.ChangeType(obj, t);
+	                }
+				}
                 return obj == null ? null : convertObj;
             }
             catch(Exception e) {


forgotten changes in last commit of branch feature/form on BackEndManager.cs


allow changing max music volume

allow changing max music volume

--- AudioBuddy.SharedProject/AudioManager.cs
+++ AudioBuddy.SharedProject/AudioManager.cs
@@ -30,7 +30,7 @@

 		#region Music

-		const float MaxVolume = 0.7f;
+		public float MaxMusicVolume { get; set; } = 0.7f;

 		/// <summary>
 		/// Flag for whether or not the music needs to be restarted


Fixes issue #64

Fixes issue #64

--- MoreLinq/Generate.cs
+++ MoreLinq/Generate.cs
@@ -35,9 +35,9 @@
         /// </remarks>
         /// <example>
         /// <code>
-        /// IEnumerable<int> result = Sequence.Generate(2, n => n * n).Take(6);
+        /// IEnumerable<int> result = Sequence.Generate(2, n => n * n).Take(5);
         /// </code>
-        /// The <c>result</c> variable, when iterated over, will yield 2, 4, 8, 16, 32, and 64, in turn.
+        /// The <c>result</c> variable, when iterated over, will yield 2, 4, 16, 256, and 65536, in turn.
         /// </example>

         public static IEnumerable<TResult> Generate<TResult>(TResult initial, Func<TResult, TResult> generator)


Fixed zoom, off-screen drag glitching (Fixes #47)

--- vimage/Source/ImageViewer.cs
+++ vimage/Source/ImageViewer.cs
@@ -260,6 +260,8 @@
             Stopwatch clock = new Stopwatch();
             clock.Start();

+            bool doRedraw;
+
             while (Window.IsOpen)
             {
                 // Add in some idle time to not thrash the CPU
@@ -280,12 +282,14 @@
                     ReloadConfigNextTick = false;
                 }

+                doRedraw = false;
+
                 // Animated Image?
                 if (Image is AnimatedImage)
                 {
                     bool imageUpdated = Image.Update((float)clock.Elapsed.TotalMilliseconds);
                     if (!Updated && imageUpdated)
-                        Redraw();
+                        doRedraw = true;
                 }
                 clock.Restart();

@@ -326,6 +330,8 @@
                         Window.Position = NextWindowPos - DWM.GetTitleBarDifference(Window.SystemHandle);
                     else
                         Window.Position = NextWindowPos;
+
+                    doRedraw = true;
                 }
                 else if (Cropping)
                 {
@@ -340,7 +346,8 @@
                         MousePos.Y = (int)Window.Size.Y;
                     Vector2f m = Window.MapPixelToCoords(MousePos);
                     CropRect.Size = new Vector2f(m.X - CropRect.Position.X, m.Y - CropRect.Position.Y);
-                    Redraw();
+
+                    doRedraw = true;
                 }

                 // Update
@@ -348,9 +355,12 @@
                 {
                     Updated = false;
                     Window.Size = NextWindowSize;
-                    Redraw();
                     Window.Position = NextWindowPos;
-                }
+                    doRedraw = true;
+                }
+
+                // Redraw
+                if (doRedraw) Redraw();

                 if (ForceAlwaysOnTopNextTick)
                     ForceAlwaysOnTop();


-WheelDrivingMotor.ForceAxis now returns a value instead of crashing.

--- BEPUphysics/Vehicle/WheelDrivingMotor.cs
+++ BEPUphysics/Vehicle/WheelDrivingMotor.cs
@@ -94,7 +94,7 @@
         /// </summary>
         public Vector3 ForceAxis
         {
-            get { return ForceAxis; }
+            get { return forceAxis; }
         }

         /// <summary>


LUCENENET-121: StopFilter  tries to access the i'th item of a hashtable as item[i] where i is not a key.

git-svn-id: 6c68d65edd5507bf6b37474e0d155329cbeeff2a@677454 13f79535-47bb-0310-9956-ffa450edef68

--- C#/src/Lucene.Net/Analysis/StopFilter.cs
+++ C#/src/Lucene.Net/Analysis/StopFilter.cs
@@ -70,9 +70,9 @@
 			else
 			{
 				this.stopWords = new CharArraySet(stopWords.Count, ignoreCase);
-				for (int i = 0; i < stopWords.Count; i++)
+				foreach (System.String sw in stopWords.Values)
 				{
-					this.stopWords.Add(stopWords[i]);
+					this.stopWords.Add(sw);
 				}
 			}
 		}


fixed the IndexOutOfIndex exception of the sending queue

--- Common/SendingQueue.cs
+++ Common/SendingQueue.cs
@@ -95,7 +95,7 @@

             Interlocked.Increment(ref m_UpdatingCount);

-            while (true)
+            while (!m_ReadOnly)
             {
                 bool conflict = false;

@@ -129,20 +129,20 @@

             bool conflict;

-            while (true)
+            while (!m_ReadOnly)
             {
                 if (TryEnqueue(items, out conflict, trackID))
-                    break;
-
-                if (!conflict)
                 {
                     Interlocked.Decrement(ref m_UpdatingCount);
-                    return false;
+                    return true;
                 }
+
+                if (!conflict)
+                    break;
             }

             Interlocked.Decrement(ref m_UpdatingCount);
-            return true;
+            return false;
         }

         private bool TryEnqueue(IList<ArraySegment<byte>> items, out bool conflict, ushort trackID)


SB-270 change to vehicle type

SB-270 change to vehicle type

--- CCW/src/CCW/Controllers/CCWController.cs
+++ CCW/src/CCW/Controllers/CCWController.cs
@@ -232,7 +232,7 @@
                 ccwdata.ICBCRegOwnerProv = vehicle.owner.mailingAddress4;
                 ccwdata.ICBCRegOwnerRODL = vehicle.owner.driverLicenseNumber;
                 ccwdata.ICBCSeatingCapacity = SanitizeInt(vehicle.seatingCapacity);
-                ccwdata.ICBCVehicleType = vehicle.vehicleType;
+                ccwdata.ICBCVehicleType = vehicle.vehicleType + " - " + vehicle.vehicleTypeDescription;

                 ccwdata.ICBCVehicleIdentificationNumber = vehicle.serialNumber;


Woops.

Woops.

--- CK.Globbing/FileFilter/FileNameFilter.cs
+++ CK.Globbing/FileFilter/FileNameFilter.cs
@@ -5,6 +5,7 @@
 using System.Collections.ObjectModel;
 using System.IO;
 using System.Xml.Linq;
+using CK.Core;

 namespace CK.Globbing
 {


Refactor EffectHandler initialization in EffTaskMethodBuilder.

--- src/Eff.Core/EffTaskMethodBuilder.cs
+++ src/Eff.Core/EffTaskMethodBuilder.cs
@@ -8,7 +8,7 @@

 namespace Eff.Core
 {
-    public class EffTaskMethodBuilder<TResult>
+    public struct EffTaskMethodBuilder<TResult>
     {
         private AsyncTaskMethodBuilder<TResult> methodBuilder;
         private TResult result;
@@ -16,18 +16,21 @@
         private bool useBuilder;
         private IEffectHandler handler;

-        public static EffTaskMethodBuilder<TResult> Create() =>
-            new EffTaskMethodBuilder<TResult>()
-            {
-                methodBuilder = AsyncTaskMethodBuilder<TResult>.Create()
-            };
-
-        public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine
+        public static EffTaskMethodBuilder<TResult> Create()
         {
-            handler = EffectExecutionContext.Handler;
+            var handler = EffectExecutionContext.Handler;
             if (handler == null)
                 throw new EffException("EffectExecutionContext handler is empty");

+            return new EffTaskMethodBuilder<TResult>()
+            {
+                handler = handler,
+                methodBuilder = AsyncTaskMethodBuilder<TResult>.Create()
+            };
+        }
+
+        public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine
+        {
             handler.HandleStart(ref stateMachine);
             methodBuilder.Start(ref stateMachine);
         }


Program no longer crashes if the database doesn't exist.

--- MyMDb/MyMDb/Form1.cs
+++ MyMDb/MyMDb/Form1.cs
@@ -51,9 +51,9 @@
             ftpClient.Dispose();
         }

-        private void TabPages(bool show)
-        {
-            int showupto = 3;
+		private void TabPages(bool show)
+		{
+			int showupto = 3;
 			if (tabControl1.InvokeRequired)
 			{
 				tabControl1.Invoke((MethodInvoker)delegate
@@ -95,7 +95,7 @@
 					}
 				}
 			}
-        }
+		}

         private Dictionary<string, short> GetGenresTable()
         {
@@ -890,33 +890,33 @@
             return value;
         }

-        private bool DBExists(string dbname)
-        {
-            if (string.IsNullOrEmpty(Program.connstr))
-                return false;
-            bool rtn = true;
-            try
-            {
-                using (SqlConnection conn = new SqlConnection(Program.connstr))
-                {
-                    conn.Open();
-                    using (SqlCommand com = new SqlCommand("SELECT name FROM sys.databases WHERE name = @dbname", conn))
-                    {
-                        com.Parameters.AddWithValue("@dbname", dbname);
-                        using (SqlDataReader rs = com.ExecuteReader())
-                        {
-                            rs.Read();
-                            rtn = !rs.IsDBNull(0);
-                        }
-                    }
-                }
-            }
-            finally
-            {
-
-            }
-            return rtn;
-        }
+		private bool DBExists(string dbname)
+		{
+			if (string.IsNullOrEmpty(Program.connstr))
+				return false;
+			bool dbExists = true;
+			try
+			{
+				using (SqlConnection conn = new SqlConnection(Program.connstr))
+				{
+					conn.Open();
+					using (SqlCommand com = new SqlCommand("SELECT name FROM sys.databases WHERE name = @dbname", conn))
+					{
+						com.Parameters.AddWithValue("@dbname", dbname);
+						using (SqlDataReader rs = com.ExecuteReader())
+						{
+							rs.Read();
+							dbExists = rs.HasRows && !rs.IsDBNull(0);
+						}
+					}
+				}
+			}
+			finally
+			{
+
+			}
+			return dbExists;
+		}

         private long RowCount(string objName)
         {


Reduce GetValidSlides complexity

Reduce GetValidSlides complexity

--- Mzinga.Core/Board.cs
+++ Mzinga.Core/Board.cs
@@ -928,33 +928,30 @@
                 {
                     Position slidePosition = targetPiece.Position.NeighborAt(slideDirection);

-                    if (slidePosition != startingPosition && CanSlide(targetPiece.Position, slideDirection))
-                    {
-                        Move move = new Move(targetPiece.PieceName, slidePosition);
-
-                        if (validMoves.Add(move))
+                    if (slidePosition != startingPosition && !HasPieceAt(slidePosition))
+                    {
+                        // Slide position is open
+
+                        Direction right = EnumUtils.RightOf(slideDirection);
+                        Direction left = EnumUtils.LeftOf(slideDirection);
+
+                        if (HasPieceAt(targetPiece.Position.NeighborAt(right)) != HasPieceAt(targetPiece.Position.NeighborAt(left)))
                         {
-                            Position preSlidePosition = targetPiece.Position;
-                            MovePiece(targetPiece, move.Position);
-                            GetValidSlides(targetPiece, startingPosition, currentRange + 1, maxRange, validMoves);
-                            MovePiece(targetPiece, preSlidePosition);
+                            // Can slide into slide position
+                            Move move = new Move(targetPiece.PieceName, slidePosition);
+
+                            if (validMoves.Add(move))
+                            {
+                                // Sliding from this position has not been tested yet
+                                Position preSlidePosition = targetPiece.Position;
+                                MovePiece(targetPiece, move.Position);
+                                GetValidSlides(targetPiece, startingPosition, currentRange + 1, maxRange, validMoves);
+                                MovePiece(targetPiece, preSlidePosition);
+                            }
                         }
                     }
                 }
             }
-        }
-
-        private bool CanSlide(Position position, Direction direction)
-        {
-            if (null == position)
-            {
-                throw new ArgumentNullException("position");
-            }
-
-            Direction right = EnumUtils.RightOf(direction);
-            Direction left = EnumUtils.LeftOf(direction);
-
-            return !HasPieceAt(position.NeighborAt(direction)) && (HasPieceAt(position.NeighborAt(right)) != HasPieceAt(position.NeighborAt(left)));
         }

         protected bool CanMoveWithoutBreakingHive(Piece targetPiece)


Improve custom attribute analysis logic

Improve custom attribute analysis logic

--- src/Flame.Ecs/AttributeConverters.cs
+++ src/Flame.Ecs/AttributeConverters.cs
@@ -30,6 +30,15 @@
                 return Node;
         }

+        private static bool IsAttributeClass(IType Type)
+        {
+            return Type != null
+            && Type.GetIsReferenceType()
+            && !Type.GetIsDelegate()
+            && !Type.GetIsArray()
+            && !Type.GetIsInterface();
+        }
+
         /// <summary>
         /// Converts a type node for a custom attribute. This
         /// includes appending an 'Attribute' suffix if initial
@@ -46,9 +55,9 @@
             var suffixedType = Converter.ConvertType(
                 AppendAttributeSuffix(Node), Scope);

-            if (simpleType == null)
+            if (!IsAttributeClass(simpleType))
             {
-                if (suffixedType == null)
+                if (!IsAttributeClass(suffixedType))
                 {
                     Scope.Log.LogError(new LogEntry(
                             "type resolution",
@@ -62,12 +71,14 @@
             }
             else
             {
-                if (suffixedType != null)
+                if (IsAttributeClass(suffixedType))
                 {
                     Scope.Log.LogError(new LogEntry(
                         "type resolution",
                         NodeHelpers.HighlightEven(
-                            "attribute type '", Node.ToString(), "' is ambiguous."),
+                            "attribute type '", Node.ToString(), "' is ambiguous " +
+                            "between classes '", Scope.TypeNamer.Convert(simpleType),
+                            "' and '", Scope.TypeNamer.Convert(suffixedType), "'."),
                         NodeHelpers.ToSourceLocation(Node.Range)));
                 }


Fix migration helper

Fix migration helper

--- src/ResXManager.Tests/UnitTest1.cs
+++ src/ResXManager.Tests/UnitTest1.cs
@@ -28,7 +28,7 @@
                 .Where(path => !path.Contains("Release"))
                 .Distinct(new DelegateEqualityComparer<string>(Path.GetFileName));

-            var targetFolder = Path.Combine(sourceFolder, @".migration\after");
+            var targetFolder = Path.Combine(sourceFolder, @".migration\before");

             foreach (var assemblyFileName in assemblyFileNames)
             {
@@ -40,6 +40,7 @@

                 var targetFile = Path.Combine(targetFolder, Path.GetFileNameWithoutExtension(assemblyFileName) + ".mef.json");

+                Directory.CreateDirectory(Path.GetDirectoryName(targetFile));
                 File.WriteAllText(targetFile, data);
             }
         }


Removing inheritdoc tags

Removing inheritdoc tags

--- PlugIns/Gorgon.FileSystem.Zip/ZipProvider.cs
+++ PlugIns/Gorgon.FileSystem.Zip/ZipProvider.cs
@@ -48,13 +48,35 @@
 		#endregion

 		#region Methods.
-		/// <inheritdoc/>
-		protected override GorgonPhysicalFileSystemData OnEnumerate(string physicalMountPoint, IGorgonVirtualDirectory mountPoint)
+		///
+		/// Function to enumerate the files and directories from a physical location and map it to a virtual location.
+		///
+		/// <param name="physicalLocation">The physical location containing files and directories to enumerate.</param>
+		/// <param name="mountPoint">A <see cref="IGorgonVirtualDirectory"/> that the directories and files from the physical file system will be mounted into.</param>
+		/// <returns>A <see cref="GorgonPhysicalFileSystemData"/> object containing information about the directories and files contained within the physical file system.</returns>
+		/// <exception cref="ArgumentNullException">Thrown when the <paramref name="physicalLocation"/>, or the <paramref name="mountPoint"/> parameters are null (Nothing in VB.Net).</exception>
+		/// <exception cref="ArgumentException">Thrown when the <paramref name="physicalLocation"/> parameter is empty.</exception>
+		/// <remarks>
+		/// <para>
+		/// This will return a <see cref="GorgonPhysicalFileSystemData"/> representing the paths to directories and <see cref="IGorgonPhysicalFileInfo"/> objects under the virtual file system. Each file
+		/// system file and directory is mapped from its <paramref name="physicalLocation"/> on the physical file system to a <paramref name="mountPoint"/> on the virtual file system. For example, if the
+		/// mount point is set to <c>/MyMount/</c>, and the physical location of a file is <c>c:\SourceFileSystem\MyDirectory\MyTextFile.txt</c>, then the returned value should be
+		/// <c>/MyMount/MyDirectory/MyTextFile.txt</c>.
+		/// </para>
+		/// <para>
+		/// Implementors of a <see cref="GorgonFileSystemProvider"/> plug in can override this method to read the list of files from another type of file system, like a Zip file.
+		/// </para>
+		/// <para>
+		/// Implementors of a <see cref="GorgonFileSystemProvider"/> should override this method to read the list of directories and files from another type of file system, like a Zip file.
+		/// The default functionality will only enumerate directories and files from the operating system file system.
+		/// </para>
+		/// </remarks>
+		protected override GorgonPhysicalFileSystemData OnEnumerate(string physicalLocation, IGorgonVirtualDirectory mountPoint)
 		{
             var directories = new List<string>();
             var files = new List<IGorgonPhysicalFileInfo>();

-			using (var zipStream = new ZipInputStream(File.Open(physicalMountPoint, FileMode.Open, FileAccess.Read, FileShare.Read)))
+			using (var zipStream = new ZipInputStream(File.Open(physicalLocation, FileMode.Open, FileAccess.Read, FileShare.Read)))
 			{
 				ZipEntry entry;

@@ -77,7 +99,7 @@
 							directories.Add(directoryName);
 						}

-						files.Add(new ZipPhysicalFileInfo(entry, physicalMountPoint, mountPoint));
+						files.Add(new ZipPhysicalFileInfo(entry, physicalLocation, mountPoint));
 					}
 					else
 					{
@@ -89,13 +111,50 @@
 			return new GorgonPhysicalFileSystemData(directories, files);
 		}

-		/// <inheritdoc/>
+		///
+		/// Function to open a stream to a file on the physical file system from the <see cref="IGorgonVirtualFile"/> passed in.
+		///
+		/// <param name="file">The <see cref="IGorgonVirtualFile"/> that will be used to locate the file that will be opened on the physical file system.</param>
+		/// <returns>A <see cref="Stream"/> to the file, or null (Nothing in VB.Net) if the file does not exist.</returns>
+		/// <exception cref="ArgumentNullException">Thrown when the <paramref name="file"/> parameter is null (Nothing in VB.Net).</exception>
+		/// <remarks>
+		/// <para>
+		/// This will take the <see cref="IGorgonVirtualFile"/> and open its corresponding physical file location as a stream for reading. The stream that is returned will be opened, and as such, it is the
+		/// responsibility of the user to close the stream when finished.
+		/// </para>
+		/// <para>
+		/// If the file does not exist in the physical file system, this method should return null (Nothing in VB.Net).
+		/// </para>
+		/// <para>
+		/// Implementors of a <see cref="GorgonFileSystemProvider"/> plug in can overload this method to return a stream into a file within their specific native provider (e.g. a Zip file provider will
+		/// return a stream into the zip file positioned at the location of the compressed file within the zip file).
+		/// </para>
+		/// </remarks>
 		protected override GorgonFileSystemStream OnOpenFileStream(IGorgonVirtualFile file)
 		{
 			return new ZipFileStream(file, File.Open(file.MountPoint.PhysicalPath, FileMode.Open, FileAccess.Read, FileShare.Read));
-		}
+		}

-		/// <inheritdoc/>
+		///
+		/// Function to determine if a physical file system can be read by this provider.
+		///
+		/// <param name="physicalPath">Path to the packed file containing the file system.</param>
+		/// <returns>true if the provider can read the packed file, false if not.</returns>
+		/// <exception cref="System.ArgumentNullException">Thrown when the <paramref name="physicalPath"/> parameter is NULL (Nothing in VB.Net).</exception>
+		/// <exception cref="System.ArgumentException">Thrown when the <paramref name="physicalPath"/> parameter is an empty string.</exception>
+		/// <remarks>
+		/// <para>
+		/// This will test a physical file system (e.g. a Zip file) to see if the provider can open it or not. If used with a directory on an operating system file system, this method should always return
+		/// false.
+		/// </para>
+		/// <para>
+		/// When used with a <see cref="IGorgonFileSystemProvider"/> that supports a non operating system based physical file system, such as the <see cref="GorgonFileSystemRamDiskProvider"/>, then this
+		/// method should compare the <paramref name="physicalPath"/> with its <see cref="IGorgonFileSystemProvider.Prefix"/> to ensure that the <see cref="IGorgonFileSystem"/> requesting the provider is using the correct provider.
+		/// </para>
+		/// <para>
+		/// Implementors of a <see cref="GorgonFileSystemProvider"/> should override this method to determine if a packed file can be read by reading the header of the file specified in <paramref name="physicalPath"/>.
+		/// </para>
+		/// </remarks>
 		protected override bool OnCanReadFile(string physicalPath)
 		{
 		    var headerBytes = new byte[4];


Fix db tool build with sw.

Fix db tool build with sw.

--- Plugins/DBTool/Source/DBTool/DBTool.Build.cs
+++ Plugins/DBTool/Source/DBTool/DBTool.Build.cs
@@ -78,7 +78,7 @@

         PrivatePCHHeaderFile = "DBToolPrivatePCH.h";

-        var sqlite3 = File.ReadAllText(Path.Combine(ThirdPartyPath, Name, "win64", "sqlite3_RelWithDebInfo.txt"));
+        var sqlite3 = File.ReadAllText(Path.Combine(ThirdPartyPath, Name, ".sw", "sqlite3_ReleaseWithDebugInformation.txt"));
         PublicAdditionalLibraries.Add(sqlite3);
     }
 }


Removed old commented code.

Removed old commented code.

--- Project.Gtfs.Net/Project.GtfsNet/GtfsFeed.cs
+++ Project.Gtfs.Net/Project.GtfsNet/GtfsFeed.cs
@@ -6,27 +6,6 @@
 {
 	public class GtfsFeed : IFeedElement
 	{
-		//[Required]
-		//public HashSet<Agency> Agencies { get; set; } = new HashSet<Agency>();
-		//[Required]
-		//public HashSet<Stop> Stops { get; set; } = new HashSet<Stop>();
-		//[Required]
-		//public HashSet<Route> Routes { get; set; } = new HashSet<Route>();
-		//[Required]
-		//public HashSet<Trip> Trips { get; set; } = new HashSet<Trip>();
-		//[Required]
-		//public HashSet<StopTime> StopTimes { get; set; } = new HashSet<StopTime>();
-		//[Required]
-		//public HashSet<Calendar> Calendars { get; set; } = new HashSet<Calendar>();
-
-		//public HashSet<CalendarDate> CalendarDates { get; set; } = new HashSet<CalendarDate>();
-		//public HashSet<FareAttribute> FareAttributes { get; set; } = new HashSet<FareAttribute>();
-		//public HashSet<FareRule> FareRules { get; set; } = new HashSet<FareRule>();
-		//public HashSet<Shape> Shapes { get; set; } = new HashSet<Shape>();
-		//public HashSet<Frequency> Frequencies { get; set; } = new HashSet<Frequency>();
-		//public HashSet<Transfer> Transfers { get; set; } = new HashSet<Transfer>();
-		//public HashSet<FeedInfo> FeedInfos { get; set; } = new HashSet<FeedInfo>();
-
 		[Required]
 		public AgencyCollection Agencies { get; set; } = new AgencyCollection();
 		[Required]


Tweaked GribFile error checking

Tweaked GribFile error checking

--- src/GribApi.NET/Grib.Api/GribFile.cs
+++ src/GribApi.NET/Grib.Api/GribFile.cs
@@ -45,7 +45,7 @@
             Contract.Requires(Directory.Exists(GribEnvironment.DefinitionsPath), "GribEnvironment::DefinitionsPath must be a valid path.");
             Contract.Requires(System.IO.File.Exists(Path.Combine(GribEnvironment.DefinitionsPath, "boot.def")), "Could not locate 'definitions/boot.def'.");

-            FileInfo fi = new FileInfo(FileName);
+            FileInfo fi = new FileInfo(fileName);

             // need a better check
             if (fi.Length < 4)


Fixed issue #45 - SaveConfigValue errors are being logged when several PsISEProjectExplorers are running.

--- PsISEProjectExplorer/Config/ConfigHandler.cs
+++ PsISEProjectExplorer/Config/ConfigHandler.cs
@@ -11,7 +11,9 @@
     {
         private static readonly Logger Logger = LogManager.GetCurrentClassLogger();

-        private static readonly Configuration Config;
+        private static readonly string ConfigFilePath;
+
+        private static Object ConfigHandlerLock = new Object();

         static ConfigHandler()
         {
@@ -21,31 +23,26 @@
             {
                 return;
             }
-            string configFilePath = Path.Combine(currentPath, "PsISEProjectExplorer.config");
-            var map = new ExeConfigurationFileMap { ExeConfigFilename = configFilePath };
-            try
-            {
-                Config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
-            }
-            catch (Exception e)
-            {
-                Logger.Error("Cannot open configuration file at " + configFilePath, e);
-            }
+            ConfigFilePath = Path.Combine(currentPath, "PsISEProjectExplorer.config");
         }

         public static string ReadConfigStringValue(string key)
         {
-            if (Config == null)
+            lock (ConfigHandlerLock)
             {
-                return null;
-            }
-            try
-            {
-                return Config.AppSettings.Settings[key].Value;
-            }
-            catch (Exception)
-            {
-                return null;
+                var config = OpenConfigFile();
+                if (config == null)
+                {
+                    return null;
+                }
+                try
+                {
+                    return config.AppSettings.Settings[key].Value;
+                }
+                catch (Exception)
+                {
+                    return null;
+                }
             }
         }

@@ -90,19 +87,23 @@

         public static void SaveConfigValue(string key, string value)
         {
-            if (Config == null)
+            lock (ConfigHandlerLock)
             {
-                return;
-            }
-            try
-            {
-                Config.AppSettings.Settings.Remove(key);
-                Config.AppSettings.Settings.Add(key, value);
-                Config.Save(ConfigurationSaveMode.Modified);
-            }
-            catch (Exception e)
-            {
-                Logger.Error("Cannot save config file", e);
+                var config = OpenConfigFile();
+                if (config == null)
+                {
+                    return;
+                }
+                try
+                {
+                    config.AppSettings.Settings.Remove(key);
+                    config.AppSettings.Settings.Add(key, value);
+                    config.Save(ConfigurationSaveMode.Modified);
+                }
+                catch (Exception e)
+                {
+                    Logger.Error("Cannot save config file", e);
+                }
             }
         }

@@ -111,5 +112,19 @@
             var str = value == null ? String.Empty : String.Join(",", value);
             SaveConfigValue(key, str);
         }
+
+        private static Configuration OpenConfigFile()
+        {
+            var map = new ExeConfigurationFileMap { ExeConfigFilename = ConfigFilePath };
+            try
+            {
+                return ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
+            }
+            catch (Exception e)
+            {
+                Logger.Error("Cannot open configuration file at " + ConfigFilePath, e);
+                return null;
+            }
+        }
     }
 }


someones changes to home controller

someones changes to home controller

--- Purchasing.Web/Controllers/HomeController.cs
+++ Purchasing.Web/Controllers/HomeController.cs
@@ -17,7 +17,8 @@
     [Version(MajorVersion = 1)]
     [Profile]
     [HandleTransactionsManually] //Don't create transactions for home controller methods
-    public class HomeController : SuperController
+    //public class HomeController : SuperController
+    public class HomeController : ApplicationController
     {
         private readonly IOrderAccessService _orderAccessService;
         private readonly IRepositoryWithTypedId<User, string> _userRepository;
@@ -143,7 +144,8 @@
             //addressRepo.EnsurePersistent(newAddress);
             */

-
+            Message = "hello this is my facebook status";
+            ErrorMessage = "this is twitter's fail whale";

             return View();
         }