Add files via upload

Add files via upload

Correção já enviada anteriormente por outro usuário... Necessária para usar o arquivo de retorno sem especificar o cedente.

--- Boleto2.Net/Arquivo/ArquivoRetorno.cs
+++ Boleto2.Net/Arquivo/ArquivoRetorno.cs
@@ -1,218 +1,218 @@
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Boleto2Net
-{
-    public class ArquivoRetorno
-    {
-        public IBanco Banco { get; set; }
-        public TipoArquivo TipoArquivo { get; set; }
-        public Boletos Boletos { get; set; } = new Boletos();
-        public DateTime? DataGeracao { get; set; }
-        public int? NumeroSequencial { get; set; }
-
-        private bool _ignorarCarteiraBoleto = false;
-        #region Construtores
-
-        public ArquivoRetorno(IBanco banco, TipoArquivo tipoArquivo, bool variasCarteiras = false)
-        {
-            Banco = banco;
-            TipoArquivo = tipoArquivo;
-            _ignorarCarteiraBoleto = variasCarteiras;
-        }
-
-        /// <summary>
-        /// Neste construtor o boleto2net  responsvel por atribuir o TipoArquivo e o Banco de acordo com o contedo do arquivo de retorno.
-        /// O prprio construtor chama o mtodo LerArquivoRetorno2 responsvel por carregar/atribuir os boletos e demais informaes do arquivo de retorno
-        /// </summary>
-        /// <param name="arquivo">Stream do arquivo de retorno</param>
-        public ArquivoRetorno(Stream arquivo)
-        {
-            LerArquivoRetorno2(arquivo);
-        }
-
-        #endregion
-
-        public Boletos LerArquivoRetorno(Stream arquivo)
-        {
-            Boletos.Clear();
-            try
-            {
-                if (TipoArquivo == TipoArquivo.CNAB400 && Banco.IdsRetornoCnab400RegistroDetalhe.Count == 0)
-                    throw new Exception("Banco " + Banco.Codigo.ToString() + " no implementou os Ids do Registro Retorno do CNAB400.");
-
-                using (StreamReader arquivoRetorno = new StreamReader(arquivo, System.Text.Encoding.UTF8))
-                {
-                    while (!arquivoRetorno.EndOfStream)
-                    {
-                        var registro = arquivoRetorno.ReadLine();
-                        if (TipoArquivo == TipoArquivo.CNAB240)
-                        {
-                            LerLinhaDoArquivoRetornoCNAB240(registro);
-                        }
-                        if (TipoArquivo == TipoArquivo.CNAB400)
-                        {
-                            LerLinhaDoArquivoRetornoCNAB400(registro);
-                        }
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                throw new Exception("Erro ao ler arquivo.", ex);
-            }
-            return Boletos;
-        }
-
-        private void LerArquivoRetorno2(Stream arquivo)
-        {
-
-            Boletos.Clear();
-            try
-            {
-                using (StreamReader arquivoRetorno = new StreamReader(arquivo, System.Text.Encoding.UTF8))
-                {
-                    if (arquivoRetorno.EndOfStream)
-                        return;
-
-                    //busca o primeiro registro do arquivo
-                    var registro = arquivoRetorno.ReadLine();
-
-                    //atribui o tipo de acordo com o contedo do arquivo
-                    TipoArquivo = registro.Length == 240 ? TipoArquivo.CNAB240 : TipoArquivo.CNAB400;
-
-                    if (TipoArquivo == TipoArquivo.CNAB400 && Banco.IdsRetornoCnab400RegistroDetalhe.Count == 0)
-                        throw new Exception("Banco " + Banco.Codigo.ToString() + " no implementou os Ids do Registro Retorno do CNAB400.");
-
-                    //instacia o banco de acordo com o codigo/id do banco presente no arquivo de retorno
-                    Banco = Boleto2Net.Banco.Instancia(Utils.ToInt32(registro.Substring(TipoArquivo == TipoArquivo.CNAB240 ? 0 : 76, 3)));
-
-                    //define a posicao do reader para o incio
-                    arquivoRetorno.DiscardBufferedData();
-                    arquivoRetorno.BaseStream.Seek(0, SeekOrigin.Begin);
-
-                    while (!arquivoRetorno.EndOfStream)
-                    {
-                        registro = arquivoRetorno.ReadLine();
-                        if (TipoArquivo == TipoArquivo.CNAB240)
-                        {
-                            LerLinhaDoArquivoRetornoCNAB240(registro);
-                        }else
-                        if (TipoArquivo == TipoArquivo.CNAB400)
-                        {
-                            LerLinhaDoArquivoRetornoCNAB400(registro);
-                        }
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                throw new Exception("Erro ao ler arquivo.", ex);
-            }
-
-        }
-
-        private void LerLinhaDoArquivoRetornoCNAB240(string registro)
-        {
-            var tipoRegistro = registro.Substring(7, 1);
-            var tipoSegmento = registro.Substring(13, 1);
-
-            if (tipoRegistro == "0")
-            {
-                //REGISTRO HEADER DO ARQUIVO RETORNO
-                Banco.LerHeaderRetornoCNAB240(this, registro);
-                return;
-            }
-
-            if (tipoRegistro == "3" & tipoSegmento == "T")
-            {
-                // Segmento T - Indica um novo boleto
-                var boleto = new Boleto(this.Banco, _ignorarCarteiraBoleto);
-                Banco.LerDetalheRetornoCNAB240SegmentoT(ref boleto, registro);
-                Boletos.Add(boleto);
-                return;
-            }
-
-            if (tipoRegistro == "3" & tipoSegmento == "U")
-            {
-                // Segmento U - Continuao do segmento T anterior (localiza o ltimo boleto da lista)
-                var boleto = Boletos.LastOrDefault();
-                // Se no encontrou um boleto vlido, ocorreu algum problema, pois deveria ter criado um novo objeto no registro que foi analisado anteriormente.
-                if (boleto == null)
-                    throw new Exception("Objeto boleto no identificado");
-                Banco.LerDetalheRetornoCNAB240SegmentoU(ref boleto, registro);
-                return;
-            }
-        }
-
-        private void LerLinhaDoArquivoRetornoCNAB400(string registro)
-        {
-            // Identifica o tipo do registro (primeira posio da linha)
-            var tipoRegistro = registro.Substring(0, 1);
-
-            // Registro HEADER
-            if (tipoRegistro == "0")
-            {
-                Banco.LerHeaderRetornoCNAB400(this, registro);
-                return;
-            }
-
-            // Registro TRAILER
-            if (tipoRegistro == "9")
-            {
-                Banco.LerTrailerRetornoCNAB400(registro);
-                return;
-            }
-
-            // Se o registro no estiver na lista a ser processada pelo banco selecionado, ignora o registro
-            if (!Banco.IdsRetornoCnab400RegistroDetalhe.Contains(tipoRegistro))
-                return;
-
-            // O primeiro ID da lista, identifica um novo boleto.
-            bool novoBoleto = false;
-            if (tipoRegistro == Banco.IdsRetornoCnab400RegistroDetalhe.First())
-                novoBoleto = true;
-
-
-            // Se for um novo boleto, cria um novo objeto, caso contrrio, seleciona o ltimo boleto
-            // Estamos considerando que, quando houver mais de um registro para o mesmo boleto, no arquivo retorno, os registros sero apresentados na sequencia.
-            Boleto boleto;
-            if (novoBoleto)
-            {
-                boleto = new Boleto(this.Banco, _ignorarCarteiraBoleto);
-            }
-            else
-            {
-                boleto = Boletos.Last();
-                // Se no encontrou um boleto vlido, ocorreu algum problema, pois deveria ter criado um novo objeto no registro que foi analisado anteriormente.
-                if (boleto == null)
-                    throw new Exception("Objeto boleto no identificado");
-            }
-
-
-            // Identifica o tipo de registro que deve ser analisado pelo Banco.
-            switch (tipoRegistro)
-            {
-                case "1":
-                    Banco.LerDetalheRetornoCNAB400Segmento1(ref boleto, registro);
-                    break;
-                case "7":
-                    Banco.LerDetalheRetornoCNAB400Segmento7(ref boleto, registro);
-                    break;
-                default:
-                    break;
-            }
-
-            // Se for um novo boleto, adiciona na lista de boletos.
-            if (novoBoleto)
-            {
-                Boletos.Add(boleto);
-            }
-
-        }
-    }
-
-}
-
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Boleto2Net
+{
+    public class ArquivoRetorno
+    {
+        public IBanco Banco { get; set; }
+        public TipoArquivo TipoArquivo { get; set; }
+        public Boletos Boletos { get; set; } = new Boletos();
+        public DateTime? DataGeracao { get; set; }
+        public int? NumeroSequencial { get; set; }
+
+        private bool _ignorarCarteiraBoleto = false;
+        #region Construtores
+
+        public ArquivoRetorno(IBanco banco, TipoArquivo tipoArquivo, bool variasCarteiras = false)
+        {
+            Banco = banco;
+            TipoArquivo = tipoArquivo;
+            _ignorarCarteiraBoleto = variasCarteiras;
+        }
+
+        /// <summary>
+        /// Neste construtor o boleto2net  responsvel por atribuir o TipoArquivo e o Banco de acordo com o contedo do arquivo de retorno.
+        /// O prprio construtor chama o mtodo LerArquivoRetorno2 responsvel por carregar/atribuir os boletos e demais informaes do arquivo de retorno
+        /// </summary>
+        /// <param name="arquivo">Stream do arquivo de retorno</param>
+        public ArquivoRetorno(Stream arquivo)
+        {
+            LerArquivoRetorno2(arquivo);
+        }
+
+        #endregion
+
+        public Boletos LerArquivoRetorno(Stream arquivo)
+        {
+            Boletos.Clear();
+            try
+            {
+                if (TipoArquivo == TipoArquivo.CNAB400 && Banco.IdsRetornoCnab400RegistroDetalhe.Count == 0)
+                    throw new Exception("Banco " + Banco.Codigo.ToString() + " no implementou os Ids do Registro Retorno do CNAB400.");
+
+                using (StreamReader arquivoRetorno = new StreamReader(arquivo, System.Text.Encoding.UTF8))
+                {
+                    while (!arquivoRetorno.EndOfStream)
+                    {
+                        var registro = arquivoRetorno.ReadLine();
+                        if (TipoArquivo == TipoArquivo.CNAB240)
+                        {
+                            LerLinhaDoArquivoRetornoCNAB240(registro);
+                        }
+                        if (TipoArquivo == TipoArquivo.CNAB400)
+                        {
+                            LerLinhaDoArquivoRetornoCNAB400(registro);
+                        }
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                throw new Exception("Erro ao ler arquivo.", ex);
+            }
+            return Boletos;
+        }
+
+        private void LerArquivoRetorno2(Stream arquivo)
+        {
+
+            Boletos.Clear();
+            try
+            {
+                using (StreamReader arquivoRetorno = new StreamReader(arquivo, System.Text.Encoding.UTF8))
+                {
+                    if (arquivoRetorno.EndOfStream)
+                        return;
+
+                    //busca o primeiro registro do arquivo
+                    var registro = arquivoRetorno.ReadLine();
+
+                    //atribui o tipo de acordo com o contedo do arquivo
+                    TipoArquivo = registro.Length == 240 ? TipoArquivo.CNAB240 : TipoArquivo.CNAB400;
+
+                    //instacia o banco de acordo com o codigo/id do banco presente no arquivo de retorno
+                    Banco = Boleto2Net.Banco.Instancia(Utils.ToInt32(registro.Substring(TipoArquivo == TipoArquivo.CNAB240 ? 0 : 76, 3)));
+
+                    if (TipoArquivo == TipoArquivo.CNAB400 && Banco.IdsRetornoCnab400RegistroDetalhe.Count == 0)
+                        throw new Exception("Banco " + Banco.Codigo.ToString() + " no implementou os Ids do Registro Retorno do CNAB400.");
+
+                    //define a posicao do reader para o incio
+                    arquivoRetorno.DiscardBufferedData();
+                    arquivoRetorno.BaseStream.Seek(0, SeekOrigin.Begin);
+
+                    while (!arquivoRetorno.EndOfStream)
+                    {
+                        registro = arquivoRetorno.ReadLine();
+                        if (TipoArquivo == TipoArquivo.CNAB240)
+                        {
+                            LerLinhaDoArquivoRetornoCNAB240(registro);
+                        }else
+                        if (TipoArquivo == TipoArquivo.CNAB400)
+                        {
+                            LerLinhaDoArquivoRetornoCNAB400(registro);
+                        }
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                throw new Exception("Erro ao ler arquivo.", ex);
+            }
+
+        }
+
+        private void LerLinhaDoArquivoRetornoCNAB240(string registro)
+        {
+            var tipoRegistro = registro.Substring(7, 1);
+            var tipoSegmento = registro.Substring(13, 1);
+
+            if (tipoRegistro == "0")
+            {
+                //REGISTRO HEADER DO ARQUIVO RETORNO
+                Banco.LerHeaderRetornoCNAB240(this, registro);
+                return;
+            }
+
+            if (tipoRegistro == "3" & tipoSegmento == "T")
+            {
+                // Segmento T - Indica um novo boleto
+                var boleto = new Boleto(this.Banco, _ignorarCarteiraBoleto);
+                Banco.LerDetalheRetornoCNAB240SegmentoT(ref boleto, registro);
+                Boletos.Add(boleto);
+                return;
+            }
+
+            if (tipoRegistro == "3" & tipoSegmento == "U")
+            {
+                // Segmento U - Continuao do segmento T anterior (localiza o ltimo boleto da lista)
+                var boleto = Boletos.LastOrDefault();
+                // Se no encontrou um boleto vlido, ocorreu algum problema, pois deveria ter criado um novo objeto no registro que foi analisado anteriormente.
+                if (boleto == null)
+                    throw new Exception("Objeto boleto no identificado");
+                Banco.LerDetalheRetornoCNAB240SegmentoU(ref boleto, registro);
+                return;
+            }
+        }
+
+        private void LerLinhaDoArquivoRetornoCNAB400(string registro)
+        {
+            // Identifica o tipo do registro (primeira posio da linha)
+            var tipoRegistro = registro.Substring(0, 1);
+
+            // Registro HEADER
+            if (tipoRegistro == "0")
+            {
+                Banco.LerHeaderRetornoCNAB400(this, registro);
+                return;
+            }
+
+            // Registro TRAILER
+            if (tipoRegistro == "9")
+            {
+                Banco.LerTrailerRetornoCNAB400(registro);
+                return;
+            }
+
+            // Se o registro no estiver na lista a ser processada pelo banco selecionado, ignora o registro
+            if (!Banco.IdsRetornoCnab400RegistroDetalhe.Contains(tipoRegistro))
+                return;
+
+            // O primeiro ID da lista, identifica um novo boleto.
+            bool novoBoleto = false;
+            if (tipoRegistro == Banco.IdsRetornoCnab400RegistroDetalhe.First())
+                novoBoleto = true;
+
+
+            // Se for um novo boleto, cria um novo objeto, caso contrrio, seleciona o ltimo boleto
+            // Estamos considerando que, quando houver mais de um registro para o mesmo boleto, no arquivo retorno, os registros sero apresentados na sequencia.
+            Boleto boleto;
+            if (novoBoleto)
+            {
+                boleto = new Boleto(this.Banco, _ignorarCarteiraBoleto);
+            }
+            else
+            {
+                boleto = Boletos.Last();
+                // Se no encontrou um boleto vlido, ocorreu algum problema, pois deveria ter criado um novo objeto no registro que foi analisado anteriormente.
+                if (boleto == null)
+                    throw new Exception("Objeto boleto no identificado");
+            }
+
+
+            // Identifica o tipo de registro que deve ser analisado pelo Banco.
+            switch (tipoRegistro)
+            {
+                case "1":
+                    Banco.LerDetalheRetornoCNAB400Segmento1(ref boleto, registro);
+                    break;
+                case "7":
+                    Banco.LerDetalheRetornoCNAB400Segmento7(ref boleto, registro);
+                    break;
+                default:
+                    break;
+            }
+
+            // Se for um novo boleto, adiciona na lista de boletos.
+            if (novoBoleto)
+            {
+                Boletos.Add(boleto);
+            }
+
+        }
+    }
+
+}
+


Added FFZ Integration

Added FFZ Integration

--- BotVentic/BotVentic/MessageHandler.cs
+++ BotVentic/BotVentic/MessageHandler.cs
@@ -54,6 +54,20 @@
                             if (code == emote.Code)
                             {
                                 reply = "http:" + Program.BttvTemplate.Replace("{{id}}", emote.Id).Replace("{{image}}", "2x");
+                                found = true;
+                                break;
+                            }
+                        }
+                    }
+
+                    if (!found)
+                    {
+                        foreach (var emote in Program.FFZEmotes)
+                        {
+                            if (code == emote.Code)
+                            {
+                                Console.WriteLine(emote.Code);
+                                reply = "http://cdn.frankerfacez.com/emoticon/" + emote.Id + "/2";
                                 found = true;
                                 break;
                             }


added ForceClick method to extensions

added ForceClick method to extensions

--- Bumblebee/Extensions/Miscellaneous.cs
+++ Bumblebee/Extensions/Miscellaneous.cs
@@ -1,5 +1,7 @@
 using System;
 using System.Collections.Generic;
+using Bumblebee.Implementation;
+using Bumblebee.Interfaces;

 namespace Bumblebee.Extensions
 {
@@ -12,5 +14,11 @@
                 function(member);
             }
         }
+
+        public static TResult ForceClick<TResult>(this IClickable element) where TResult : IBlock
+        {
+            element.Tag.ExecuteJQueryFunction<bool?>("trigger('click')");
+            return element.Session.CurrentBlock<TResult>(((Clickable)element).ParentBlock.Tag);
+        }
     }
 }


made sure test inputs are unique

made sure test inputs are unique

--- CFGLibTest/ContinuousRandomTesting.cs
+++ CFGLibTest/ContinuousRandomTesting.cs
@@ -69,7 +69,11 @@
 			}

 			AddRandomSentences(preparedSentences, terminals);
-
+			var uniquifySentences = new Dictionary<string, Sentence>();
+			foreach (var sentence in preparedSentences) {
+				uniquifySentences[sentence.AsTerminals()] = sentence;
+			}
+			preparedSentences = uniquifySentences.Values.ToList();

 			// Console.WriteLine("Parsing sentences...");
 			EarleyParser earley1;
@@ -99,7 +103,7 @@
 			return false;
 		}

-		private void AddRandomSentences(List<Sentence> preparedSentences, IList<Terminal> terminals) {
+		private void AddRandomSentences(IList<Sentence> preparedSentences, IList<Terminal> terminals) {
 			for (var i = 0; i < _numRandomSentences; i++) {
 				var length = _r.Next(_maxInputLength + 1, _maxInputLength * 4);
 				var sentenceArray = new Terminal[length];


add previous to interface

add previous to interface

--- Adzerk.Api/Client.cs
+++ Adzerk.Api/Client.cs
@@ -21,6 +21,7 @@
         IEnumerable<Advertiser> ListAdvertisers();
         IEnumerable<Campaign> ListCampaigns();
         IEnumerable<Channel> ListChannels();
+        IEnumerable<Creative> ListAdvertiserCreatives(long advertiserId);
         IEnumerable<Flight> ListFlights();
         IEnumerable<Flight> ListCampaignFlights(long campaignId);
         IEnumerable<Login> ListLogins();


Fixed Priorities

Fixed Priorities

--- AttributedTaskTag.cs
+++ AttributedTaskTag.cs
@@ -43,7 +43,7 @@

 		public Priorities TaskPriority {
 			get {
-				return (Priorities)int.Parse (Attributes["Priority"]);
+				return (Priorities) Enum.Parse ( typeof (Priorities), Attributes["Priority"] );
 			}
 			set {
 				Attributes["Priority"] = value.ToString ();
@@ -70,7 +70,7 @@

 			Attributes.Add ("Done", "false");
 			Attributes.Add ("Duedate", "");
-			Attributes.Add ("Priority", "0");
+			Attributes.Add ("Priority", "LOW");
 		}
 	}
 }


(GH-656) Update codecov reference from 1.12.2 to 1.12.3

--- Cake.Recipe/Content/toolsettings.cake
+++ Cake.Recipe/Content/toolsettings.cake
@@ -40,7 +40,7 @@
     public static string KuduSyncGlobalTool { get; private set; }

     public static void SetToolPreprocessorDirectives(
-        string codecovTool = "#tool nuget:?package=codecov&version=1.12.2",
+        string codecovTool = "#tool nuget:?package=codecov&version=1.12.3",
         // This is specifically pinned to 0.7.0 as later versions of same package publish .Net Global Tool, rather than full framework version
         string coverallsTool = "#tool nuget:?package=coveralls.net&version=0.7.0",
         string gitReleaseManagerTool = "#tool nuget:?package=GitReleaseManager&version=0.11.0",


clean code

clean code

--- Core/CharacterDocumentViewer.cs
+++ Core/CharacterDocumentViewer.cs
@@ -411,7 +411,6 @@
                     Rectangle clip = e.ClipRectangle;
                     Graphics g = e.Graphics;
                     RenderProfile profile = GetRenderProfile();
-                    int paneheight = GetHeightInLines();

                     // determine background color of the view
                     Color backColor;
@@ -497,7 +496,7 @@
             GLine l = _document.FindLineOrNull(topline_id + param.LineFrom);
             if (l != null) {
                 int poolIndex = 0;
-                for (int i = param.LineFrom; i < param.LineFrom + param.LineCount; i++) {
+                for (int i = 0; i < param.LineCount; i++) {
                     GLine cloned;
                     if (poolIndex < _glinePool.Count) {
                         cloned = _glinePool[poolIndex];
@@ -562,7 +561,6 @@
             }
         }

-
         private void DrawLines(Graphics g, RenderParameter param, Color baseBackColor) {
             RenderProfile prof = GetRenderProfile();
             Caret caret = _caret;


rewrite new ird results parsing to reduce allocations and # of passes

--- Clients/IrdLibraryClient/IrdClient.cs
+++ Clients/IrdLibraryClient/IrdClient.cs
@@ -40,6 +40,7 @@

         public async Task<SearchResult?> SearchAsync(string query, CancellationToken cancellationToken)
         {
+            query = query.ToUpper();
             try
             {
                 var requestUri = new Uri(BaseUrl + "/ird.html");
@@ -48,40 +49,34 @@
                 try
                 {
                     await response.Content.LoadIntoBufferAsync().ConfigureAwait(false);
-
                     var result = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
-
                     HtmlDocument doc = new();
                     doc.LoadHtml(result);
-
-                    List<string[]> table = doc.DocumentNode
-                                .Descendants("tr")
-                                .Skip(1)
-                                .Where(tr => tr.Elements("td").Count() > 1 && tr.Elements("td").First().InnerText == query.ToUpper())
-                                .Select(tr => tr.Elements("td").Select(td => td.InnerText.Trim()).ToArray())
-                                .ToList();
-
-                    SearchResult searchResults = new();
-                    searchResults.Data = new();
-
-                    foreach (var item in table)
-					{
-                        var r = new SearchResultItem();
-                        r.Id = item[0];
-                        r.Title = item[1];
-                        r.GameVersion = item[2];
-                        r.UpdateVersion = item[3];
-                        r.Size = item[4];
-                        r.FileCount = item[5];
-                        r.FolderCount = item[6];
-                        r.MD5 = item[7];
-                        r.IrdName = item[8];
-
-                        r.Filename = r.Id + "-" + r.IrdName + ".ird";
-                        searchResults?.Data?.Add(r);
-                    }
-
-                    return searchResults;
+                    return new()
+                    {
+                        Data = doc.DocumentNode.Descendants("tr")
+                            .Skip(1)
+                            .Select(tr => tr.Elements("td").ToList())
+                            .Where(tds => tds.Count > 1 && tds[0].InnerText == query)
+                            .Select(tds =>
+                            {
+                                var i = tds.Select(td => td.InnerText.Trim()).ToArray();
+                                return new SearchResultItem
+                                {
+                                    Id = i[0],
+                                    Title = i[1],
+                                    GameVersion = i[2],
+                                    UpdateVersion = i[3],
+                                    Size = i[4],
+                                    FileCount = i[5],
+                                    FolderCount = i[6],
+                                    MD5 = i[7],
+                                    IrdName = i[8],
+                                    Filename = i[0] + "-" + i[8] + ".ird",
+                                };
+                            })
+                            .ToList(),
+                    };
                 }
                 catch (Exception e)
                 {


Roll back uploader to an earlier version

--- CupCake.Upload/UploadService.cs
+++ CupCake.Upload/UploadService.cs
@@ -1,5 +1,5 @@
 using System;
-using System.Linq;
+using System.Collections.Generic;
 using System.Threading;
 using CupCake.Core;
 using CupCake.Core.Events;
@@ -14,8 +14,8 @@
 {
     public sealed class UploadService : CupCakeService
     {
-        private readonly Deque<UploadRequestEvent> _checkQueue = new Deque<UploadRequestEvent>();
-        private int[,,] _uploaded;
+        private readonly Queue<UploadRequestEvent> _checkQueue = new Queue<UploadRequestEvent>();
+        private bool[,,] _uploaded;
         private DequeWorker _workThread;
         private WorldService _world;

@@ -137,23 +137,11 @@

             lock (this._checkQueue)
             {
-                if (request.SendTries < 5)
-                {
-                    // If there already was a block in the lag checks, remove it, add this one instead
-                    if (this._uploaded[(int)e.Layer, e.X, e.Y] > 0)
-                    {
-                        UploadRequestEvent prev =
-                            this._checkQueue.FirstOrDefault(
-                                req =>
-                                    req.SendEvent.Layer == e.Layer && req.SendEvent.X == e.X && req.SendEvent.Y == e.Y);
-                        if (prev != null)
-                        {
-                            this._checkQueue.Remove(prev);
-                        }
-                    }
-                    this._uploaded[(int)e.Layer, e.X, e.Y]++;
-
-                    this._checkQueue.AddToBack(request);
+                if (!this._uploaded[(int)e.Layer, e.X, e.Y] && request.SendTries < 5)
+                {
+                    this._uploaded[(int)e.Layer, e.X, e.Y] = true;
+
+                    this._checkQueue.Enqueue(request);
                 }
             }
         }
@@ -210,14 +198,9 @@

         private void OnBlockPlace(object sender, PlaceWorldEvent e)
         {
-            // If there has been a block uploaded at this position
-            if (this._uploaded[(int)e.WorldBlock.Layer, e.WorldBlock.X, e.WorldBlock.Y] > 0)
-            {
-                // If this is the last block being uploaded to this position
-                if (--this._uploaded[(int)e.WorldBlock.Layer, e.WorldBlock.X, e.WorldBlock.Y] == 0)
-                {
-                    this.DoLagCheck(false);
-                }
+            if (this._uploaded[(int)e.WorldBlock.Layer, e.WorldBlock.X, e.WorldBlock.Y])
+            {
+                this.DoLagCheck(false);
             }
         }

@@ -227,10 +210,10 @@
             {
                 while (this._checkQueue.Count > 0)
                 {
-                    UploadRequestEvent request = this._checkQueue.RemoveFromFront();
+                    UploadRequestEvent request = this._checkQueue.Dequeue();
                     IBlockPlaceSendEvent er = request.SendEvent;

-                    this._uploaded[(int)er.Layer, er.X, er.Y] = 0;
+                    this._uploaded[(int)er.Layer, er.X, er.Y] = false;
                     if (this.IsUploaded(er))
                     {
                         request.Verified = true;
@@ -274,7 +257,7 @@

         private void ResetUploaded(int width, int height)
         {
-            this._uploaded = new int[2, width, height];
+            this._uploaded = new bool[2, width, height];
         }

         public void UploadBlock(int x, int y, Block block)


update

update

--- Demos/HelloCSharpGL/FormMain.cs
+++ Demos/HelloCSharpGL/FormMain.cs
@@ -69,7 +69,7 @@
             var teapot = TeapotRenderer.Create();
             teapot.Scale *= 0.5f;

-            int width = 400, height = 200;
+            int width = 600, height = 400;
             var innerCamera = new Camera(new vec3(0, 2, 5), new vec3(0, 0, 0), new vec3(0, 1, 0), CameraType.Ortho, width, height);
             var rtt = new RTTRenderer(width, height, innerCamera);
             rtt.Children.Add(teapot);


Remark votes endpoints

Remark votes endpoints

--- Coolector.Api/Modules/RemarkModule.cs
+++ Coolector.Api/Modules/RemarkModule.cs
@@ -7,6 +7,7 @@
 using Coolector.Services.Remarks.Shared.Dto;
 using System.Collections.Generic;
 using Coolector.Services.Remarks.Shared.Commands.Models;
+using System;

 namespace Coolector.Api.Modules
 {
@@ -34,7 +35,6 @@
             Get("categories", async args => await FetchCollection<BrowseRemarkCategories, RemarkCategoryDto>
                 (async x => await remarkStorage.BrowseCategoriesAsync(x)).HandleAsync());

-
             Get("tags", async args => await FetchCollection<BrowseRemarkTags, TagDto>
                 (async x => await remarkStorage.BrowseTagsAsync(x)).HandleAsync());

@@ -68,6 +68,15 @@
             Delete("{remarkId}", async args => await For<DeleteRemark>()
                 .OnSuccessAccepted(string.Empty)
                 .DispatchAsync());
+
+            Put("{remarkId}/votes", async args => await For<SubmitRemarkVote>()
+                .Set(x => x.CreatedAt = DateTime.UtcNow)
+                .OnSuccessAccepted($"remarks/{args.remarkId}")
+                .DispatchAsync());
+
+            Delete("{remarkId}/votes", async args => await For<DeleteRemarkVote>()
+                .OnSuccessAccepted($"remarks/{args.remarkId}")
+                .DispatchAsync());
         }
     }
 }


Cleanup debug

Cleanup debug

--- D2MPMaster/Client/ClientController.cs
+++ D2MPMaster/Client/ClientController.cs
@@ -31,10 +31,6 @@
         public ClientController()
         {
             this.OnClose += DeregisterClient;
-            this.OnOpen += (sender, args) =>
-                           {
-                               log.Debug("Client connected.");
-                           };
         }

         void DeregisterClient(object se, OnClientDisconnectArgs e)
@@ -104,7 +100,7 @@
                     case OnInstalledMod.Msg:
                     {
                         var msg = jdata.ToObject<OnInstalledMod>();
-                        log.Debug("Client installed " + msg.Mod.name + ".");
+                        log.Debug(SteamID+" -> installed " + msg.Mod.name + ".");
                         Mods.Add(msg.Mod);
                         XSocketHelper.AsyncSendTo(Browser, x=>x.user!=null&&x.user.services.steam.steamid==SteamID, BrowserController.InstallResponse("The mod has been installed.", true),
                             rf => { });
@@ -113,11 +109,9 @@
                     case Init.Msg:
                     {
                         var msg = jdata.ToObject<Init>();
-                        log.Debug("Client init with version "+msg.Version);
                         InitData = msg;
                         if (msg.Version != Version.ClientVersion)
                         {
-                            log.Debug("Old version, sending shutdown message.");
                             XSocketHelper.SendJson(this, JObject.FromObject(new Shutdown()).ToString(Formatting.None), "commands");
                             return;
                         }
@@ -131,7 +125,7 @@
             }
             catch (Exception ex)
             {
-                log.Error("Parsing client message.", ex);
+                //log.Error("Parsing client message.", ex);
             }
         }


Cake SymbolLocation now returns Structure

--- tests/OmniSharp.Roslyn.CSharp.Tests/FindSymbolsFacts.cs
+++ tests/OmniSharp.Roslyn.CSharp.Tests/FindSymbolsFacts.cs
@@ -161,7 +161,7 @@

             var usages = await FindSymbolsAsync(code, filename);
             var symbols = usages.QuickFixes.Cast<SymbolLocation>().Select(q => q.Kind);
-            Assert.Equal("Struct", symbols.First());
+            Assert.Equal("Structure", symbols.First());
         }

         [Theory]
@@ -182,12 +182,12 @@
         public async Task Finds_partial_method_with_body(string filename)
         {
             const string code = @"
-public partial class MyClass
+public partial class MyClass
 {
     partial void Method();
 }

-public partial class MyClass
+public partial class MyClass
 {
     partial void Method()
     {
@@ -330,7 +330,8 @@
             SharedOmniSharpTestHost.AddFilesToWorkspace(testFile);
             var requestHandler = GetRequestHandler(SharedOmniSharpTestHost);

-            return await requestHandler.Handle(new FindSymbolsRequest {
+            return await requestHandler.Handle(new FindSymbolsRequest
+            {
                 Filter = filter,
                 MinFilterLength = minFilterLength,
                 MaxItemsToReturn = maxItemsToReturn


make some pb comparisons actually equivalent

--- Benchmark/Program.cs
+++ Benchmark/Program.cs
@@ -450,7 +450,7 @@
                     jilMedFailures.Add(type);
                 }

-                if (jil.Min <= proto.Min)
+                if (jil.Min < proto.Min)
                 {
                     jilMinBeatPB.Add(type);
                 }


Display milestone due date in roadmap, making it consistent with current milestone view. Closes #2226.

git-svn-id: 0d96b0c1a6983ccc08b3732614f4d6bfcf9cbb42@3375 af82e41b-90c4-0310-8c96-b1721e28e2e2

--- templates/roadmap.cs
+++ templates/roadmap.cs
@@ -30,7 +30,7 @@
        <?cs var:milestone.due_delta ?> late<?cs
       else ?>
        Due in <?cs var:milestone.due_delta ?><?cs
-      /if ?><?cs
+      /if ?> (<?cs var:milestone.due_date ?>)<?cs
      else ?>>
       No date set<?cs
      /if ?>


fix quickhelp on SerializedParameterAttribute

--- Dot42/SerializedParameterAttribute.cs
+++ Dot42/SerializedParameterAttribute.cs
@@ -5,10 +5,13 @@
     /// <summary>
     /// Specifies this parameter is used in serialization. Types and objects passed
     /// as this parameter will have all their public fields and public and private
-    /// properties preserved and not pruned.
+    /// properties preserved and not pruned.
     /// <para/>
     /// <para/>
     /// Can be used on normal and generic method parameters.
+    /// <para>
+    /// Propagates recursivly to the types of fields and properties of the passed type.
+    /// </para>
     /// <para/>
     /// Note that this Attribute is not inherited when used on generic method parameters.
     /// </summary>


Add simple low level driver in main

Add simple low level driver in main

--- DynamixelServo.TestConsole/Program.cs
+++ DynamixelServo.TestConsole/Program.cs
@@ -1,5 +1,7 @@
 using System;
 using System.Collections.Generic;
+using System.IO.Ports;
+using System.Linq;
 using System.Threading;
 using DynamixelServo.Driver;
 using Timer = System.Timers.Timer;
@@ -10,19 +12,75 @@
    {
       static void Main(string[] args)
       {
-         Record();
-         //Console.WriteLine("Starting");
-         //using (DynamixelDriver driver = new DynamixelDriver("COM17"))
-         //{
-         //   driver.SetMovingSpeed(1, 0, DynamixelProtocol.Version2);
-         //   driver.SetGoalPosition(1, 0, DynamixelProtocol.Version2);
-         //   Thread.Sleep(1000);
-         //   driver.SetGoalPosition(1, 1023, DynamixelProtocol.Version2);
-         //   Thread.Sleep(1000);
-         //   driver.SetGoalPosition(1, 0, DynamixelProtocol.Version2);
-         //}
-         //Console.WriteLine("Press enter to exit");
-         //Console.ReadLine();
+         Console.WriteLine("Starting");
+         using (SerialPort port = new SerialPort("COM17", 1000000))
+         {
+            port.Open();
+            Thread.Sleep(400);
+            byte id = 4;
+            byte instruction = 3;
+            byte parameter1 = 25;
+            byte parameter2 = 0;
+
+            byte[] data = EncodeMessage(id, instruction, new [] {parameter1, parameter2});
+            port.Write(data, 0, data.Length);
+            Console.WriteLine("Sent");
+            List<byte> buffer = new List<byte>();
+            while (true)
+            {
+               buffer.Add((byte)port.ReadByte());
+               bool flag = DecodeMessage(buffer.ToArray());
+               if (flag)
+               {
+                  buffer.Clear();
+               }
+            }
+         }
+         Console.WriteLine("Press enter to exit");
+         Console.ReadLine();
+      }
+
+      public static bool DecodeMessage(byte[] data)
+      {
+         if (data[0] != 0xFF || data[1] != 0xFF)
+         {
+            Console.WriteLine("not a packet");
+            return false;
+         }
+         byte id = data[2];
+         byte length = data[3];
+         byte error = data[4];
+         byte[] incoming = new byte[length-2];
+         Array.Copy(data, 5,incoming, 0, length-2);
+         byte checksum = data[data.Length - 1];
+         int localChecksum = id + length + error + incoming.Sum(num => num);
+         localChecksum = ~localChecksum;
+         if (checksum!= localChecksum)
+         {
+            Console.WriteLine("Checksum error");
+            return false;
+         }
+         Console.WriteLine("It worked!");
+         return true;
+      }
+
+      public static byte[] EncodeMessage(byte id, byte instruction, byte[] parameters)
+      {
+         byte length = (byte) (2 + parameters.Length);
+         int checksum = id + length + instruction + parameters.Sum(num => num);
+         checksum = ~checksum;
+         byte[] data = new byte[parameters.Length + 6];
+         data[0] = 0xFF;
+         data[1] = 0xFF;
+         data[2] = id;
+         data[3] = length;
+         data[4] = instruction;
+         for (int i = 0; i < parameters.Length; i++)
+         {
+            data[5 + i] = parameters[i];
+         }
+         data[data.Length - 1] = (byte) checksum;
+         return data;
       }

       public static void RecordContinuouse()


Fix version number

Fix version number

--- EarTrumpet/Properties/AssemblyInfo.cs
+++ EarTrumpet/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@
 [assembly: AssemblyCopyright("")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("1.4.0.0")]
-[assembly: AssemblyFileVersion("1.4.0.0")]
+[assembly: AssemblyVersion("1.3.1.0")]
+[assembly: AssemblyFileVersion("1.3.1.0")]
 [assembly: ComVisible(false)]
 [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]


no need for UpdateLayout :D

no need for UpdateLayout :D

--- EarTrumpet/Views/FlyoutWindow.xaml.cs
+++ EarTrumpet/Views/FlyoutWindow.xaml.cs
@@ -92,7 +92,6 @@
                         _expandOnCloseThenOpen = false;

                         _viewModel.DoExpandCollapse();
-                        UpdateLayout();
                         _viewModel.BeginOpen();
                     }
                     break;


Remove unused property

Remove unused property

--- Editor/AnimationPathAnimatorEditor.cs
+++ Editor/AnimationPathAnimatorEditor.cs
@@ -112,11 +112,6 @@

         public virtual KeyCode RotationModeKey {
             get { return KeyCode.I; }
-        }
-
-        public AnimationPathAnimator Script1 {
-            set { script = value; }
-            get { return script; }
         }

         public KeyCode ShortJumpBackwardKey {


Fix benchmark subscription when also present in portfolio at startup

This change ensures the benchmark is added after the brokerage holdings, so the symbol is subscribed as a normal feed instead of an internal one.

--- Engine/Setup/BrokerageSetupHandler.cs
+++ Engine/Setup/BrokerageSetupHandler.cs
@@ -221,7 +221,6 @@
                 brokerage.Message += brokerageOnMessage;

                 algorithm.Transactions.SetOrderProcessor(transactionHandler);
-                algorithm.PostInitialize();

                 Log.Trace("BrokerageSetupHandler.Setup(): Connecting to brokerage...");
                 try
@@ -331,6 +330,8 @@
                     return false;
                 }

+                algorithm.PostInitialize();
+
                 //Set the starting portfolio value for the strategy to calculate performance:
                 StartingPortfolioValue = algorithm.Portfolio.TotalPortfolioValue;
                 StartingDate = DateTime.Now;


fix wasn't passing attribute names for put

--- DynamoDB/Contexts/PutContext.cs
+++ DynamoDB/Contexts/PutContext.cs
@@ -61,7 +61,10 @@
 				ReturnValues = returnOldItem ? AwsEnums.ReturnValue.ALL_OLD : AwsEnums.ReturnValue.NONE,
 			};
 			if(condition != null)
+			{
 				request.ConditionExpression = condition.Expression;
+				request.ExpressionAttributeNames = AwsAttributeNames.GetCombined(condition);
+			}
 			request.ExpressionAttributeValues = AwsAttributeValues.GetCombined(condition, values);
 			return request;
 		}


Create indexes if they don't exist

Create indexes if they don't exist

--- EDDiscovery/DB/SQLiteDBClass.cs
+++ EDDiscovery/DB/SQLiteDBClass.cs
@@ -427,6 +427,8 @@

                 if (dbver < 20)
                     UpgradeDB20(conn);
+
+                CreateTableIndexes();

                 return true;
             }
@@ -655,6 +657,37 @@
             });
         }

+        private static void CreateTableIndexes()
+        {
+            string[] queries = new[]
+            {
+                "CREATE INDEX IF NOT EXISTS DistanceName ON Distances (NameA ASC, NameB ASC)",
+                "CREATE INDEX IF NOT EXISTS stationIndex ON Stations (system_id ASC)",
+                "CREATE INDEX IF NOT EXISTS VisitedSystemIndex ON VisitedSystems (Name ASC, Time ASC)",
+                "CREATE INDEX IF NOT EXISTS station_commodities_index ON station_commodities (station_id ASC, commodity_id ASC, type ASC)",
+                "CREATE INDEX IF NOT EXISTS StationsIndex_ID  ON Stations (id ASC)",
+                "CREATE INDEX IF NOT EXISTS StationsIndex_system_ID  ON Stations (system_id ASC)",
+                "CREATE INDEX IF NOT EXISTS StationsIndex_system_Name  ON Stations (Name ASC)",
+                "CREATE INDEX IF NOT EXISTS Distances_EDSM_ID_Index ON Distances (id_edsm ASC)",
+                "CREATE INDEX IF NOT EXISTS VisitedSystems_id_edsm_assigned ON VisitedSystems (id_edsm_assigned)",
+                "CREATE INDEX IF NOT EXISTS VisitedSystems_position ON VisitedSystems (X, Y, Z)",
+                "CREATE INDEX IF NOT EXISTS SystemAliases_name ON SystemAliases (name)",
+                "CREATE UNIQUE INDEX IF NOT EXISTS SystemAliases_id_edsm ON SystemAliases (id_edsm)",
+                "CREATE INDEX IF NOT EXISTS SystemAliases_id_edsm_mergedto ON SystemAliases (id_edsm_mergedto)",
+                "CREATE INDEX IF NOT EXISTS TravelLogUnits_Name ON TravelLogUnits (Name)"
+            };
+            using (SQLiteConnectionED conn = new SQLiteConnectionED())
+            {
+                foreach (string query in queries)
+                {
+                    using (DbCommand cmd = conn.CreateCommand(query))
+                    {
+                        cmd.ExecuteNonQuery();
+                    }
+                }
+            }
+        }
+
         public static void DropSystemsTableIndexes()
         {
             string[] queries = new[]


Added comments

Added comments

--- Espera/Espera.Core/Library/Library.cs
+++ Espera/Espera.Core/Library/Library.cs
@@ -88,11 +88,23 @@
             get { return this.playlist.CurrentSongIndex; }
         }

+        /// <summary>
+        /// Gets a value indicating whether the next song in the playlist can be played.
+        /// </summary>
+        /// <value>
+        /// true if the next song in the playlist can be played; otherwise, false.
+        /// </value>
         public bool CanPlayNextSong
         {
             get { return this.playlist.CanPlayNextSong; }
         }

+        /// <summary>
+        /// Gets a value indicating whether the previous song in the playlist can be played.
+        /// </summary>
+        /// <value>
+        /// true if the previous song in the playlist can be played; otherwise, false.
+        /// </value>
         public bool CanPlayPreviousSong
         {
             get { return this.playlist.CanPlayPreviousSong; }


Fixed Equals to avoid null reference exceptions

--- CallMeMaybe/Maybe.cs
+++ CallMeMaybe/Maybe.cs
@@ -121,19 +121,24 @@
             }
             // Maybe values can be compared with other Maybe values.
             var maybe = obj as IMaybe;
-            if (maybe == null)
+            if (maybe != null)
             {
-                // Maybe.From(1) == 1
-                return obj is T && _value.Equals((T) obj);
+                object value;
+                if (!maybe.TryGetValue(out value))
+                {
+                    // If the other one doesn't have a value, then we're
+                    // only "equal" if this one doesn't either.
+                    return !HasValue;
+                }
+                return Equals(_value, value);
             }
-            object value;
-            if (!maybe.TryGetValue(out value))
+            // If it's not a Maybe, then maybe it's a T
+            // Maybe.From(1) == 1
+            if (obj is T)
             {
-                // If the other one doesn't have a value, then we're
-                // only "equal" if this one doesn't either.
-                return !HasValue;
+                return _hasValue && _value.Equals((T)obj);
             }
-            return Equals(_value, value);
+            return false;
         }

         public override int GetHashCode()


Clean up

Clean up

--- CallMeMaybe/Maybe.cs
+++ CallMeMaybe/Maybe.cs
@@ -45,19 +45,29 @@
             return _hasValue ? _value.ToString() : "";
         }

-        #region Equality
-
-        public bool Equals(Maybe<T> other)
-        {
-            return _hasValue == other._hasValue &&
-                   (!_hasValue || EqualityComparer<T>.Default.Equals(_value, other._value));
-        }
+        #region IEnumerable

         IEnumerator<T> IEnumerable<T>.GetEnumerator()
         {
-            var collection = _hasValue ? new[] {_value} : new T[0];
+            var collection = _hasValue ? new[] { _value } : new T[0];
             return collection.AsEnumerable().GetEnumerator();
         }
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return ((IEnumerable<T>)this).GetEnumerator();
+        }
+
+
+        #endregion
+
+        #region Equality
+
+        bool IEquatable<Maybe<T>>.Equals(Maybe<T> other)
+        {
+            return Equals(other);
+        }
+

         public override bool Equals(object obj)
         {
@@ -92,11 +102,6 @@
             }
         }

-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return ((IEnumerable<T>) this).GetEnumerator();
-        }
-
         public static bool operator ==(Maybe<T> left, Maybe<T> right)
         {
             return left.Equals(right);


subscribes now return promises.

subscribes now return promises.

--- src/Carrot/MessageQueue.cs
+++ src/Carrot/MessageQueue.cs
@@ -14,6 +14,8 @@
         private readonly IModel _model;
         private readonly IMessageTypeResolver _resolver;
         private readonly ISerializerFactory _serializerFactory;
+
+        private readonly ISet<ConsumingPromise> _promises = new HashSet<ConsumingPromise>();

         // TODO: restore private
         internal MessageQueue(String name,
@@ -70,32 +72,30 @@
             return _name.GetHashCode();
         }

-        public void SubscribeByAtMostOnce(Action<SubscriptionConfiguration> configure)
+        public ConsumingPromise SubscribeByAtMostOnce(Action<SubscriptionConfiguration> configure)
         {
-            SubscribeByAtMostOnce(configure, NoFallbackStrategy.Instance);
+            return SubscribeByAtMostOnce(configure, NoFallbackStrategy.Instance);
         }

-        public void SubscribeByAtMostOnce(Action<SubscriptionConfiguration> configure,
-                                          IFallbackStrategy fallbackStrategy)
+        public ConsumingPromise SubscribeByAtMostOnce(Action<SubscriptionConfiguration> configure,
+                                                      IFallbackStrategy fallbackStrategy)
         {
-            var builder = new ConsumedMessageBuilder(_serializerFactory, _resolver);
-            Subscribe(configure,
-                      _ => new AtMostOnceConsumingPromise(this, builder, _),
-                      fallbackStrategy);
+            return Subscribe(configure,
+                             (b, c) => new AtMostOnceConsumingPromise(this, b, c),
+                             fallbackStrategy);
         }

-        public void SubscribeByAtLeastOnce(Action<SubscriptionConfiguration> configure)
+        public ConsumingPromise SubscribeByAtLeastOnce(Action<SubscriptionConfiguration> configure)
         {
-            SubscribeByAtLeastOnce(configure, NoFallbackStrategy.Instance);
+            return SubscribeByAtLeastOnce(configure, NoFallbackStrategy.Instance);
         }

-        public void SubscribeByAtLeastOnce(Action<SubscriptionConfiguration> configure,
-                                           IFallbackStrategy fallbackStrategy)
+        public ConsumingPromise SubscribeByAtLeastOnce(Action<SubscriptionConfiguration> configure,
+                                                       IFallbackStrategy fallbackStrategy)
         {
-            var builder = new ConsumedMessageBuilder(_serializerFactory, _resolver);
-            Subscribe(configure,
-                      _ => new AtLeastOnceConsumingPromise(this, builder, _),
-                      fallbackStrategy);
+            return Subscribe(configure,
+                            (b, c) => new AtLeastOnceConsumingPromise(this, b, c),
+                            fallbackStrategy);
         }

         internal static MessageQueue New(IModel model,
@@ -114,13 +114,17 @@
             return queue;
         }

-        private void Subscribe(Action<SubscriptionConfiguration> configure,
-                               Func<SubscriptionConfiguration, ConsumingPromise> promise,
-                               IFallbackStrategy fallbackStrategy)
+        private ConsumingPromise Subscribe(Action<SubscriptionConfiguration> configure,
+                                           Func<IConsumedMessageBuilder, SubscriptionConfiguration, ConsumingPromise> func,
+                                           IFallbackStrategy fallbackStrategy)
         {
+            var builder = new ConsumedMessageBuilder(_serializerFactory, _resolver);
             var configuration = new SubscriptionConfiguration(fallbackStrategy);
             configure(configuration);
-            promise(configuration).Declare(_model);
+            var promise = func(builder, configuration);
+            _promises.Add(promise);
+            promise.Declare(_model); // TODO: should be deferred.
+            return promise;
         }
     }

@@ -158,7 +162,7 @@
         }
     }

-    internal abstract class ConsumingPromise
+    public abstract class ConsumingPromise
     {
         private readonly MessageQueue _queue;
         private readonly IConsumedMessageBuilder _builder;


- added a method to allow to pre-create mapping

--- src/Cartographer/Mapper.cs
+++ src/Cartographer/Mapper.cs
@@ -26,6 +26,14 @@
 			this.typeMapper = typeMapper;
 			this.mappingStrategyBuilder = mappingStrategyBuilder;
 			this.mappingCompiler = mappingCompiler;
+		}
+
+		// TODO: this method temporarily serves as entry point to allow to pre-create mappings.
+		// in a longer run this will be abstracted to something like IMappingCache or similar
+		public void CreateMapping(Type sourceType, Type targetType, bool preexistingTargetInstance)
+		{
+			var key = typeMapper.GetMappingInfo(sourceType, targetType, preexistingTargetInstance);
+			mappins.GetOrAdd(key, CreateMapping);
 		}

 		public TTarget Convert<TTarget>(object source)


Changed capitalization.

Changed capitalization.

--- Edity.Mvc/EdityMvcExtensions.cs
+++ Edity.Mvc/EdityMvcExtensions.cs
@@ -22,7 +22,7 @@
 {
     public static class EdityMvcExtensions
     {
-        public static void AddEdity(this IServiceCollection services, EditySettings EditySettings, ProjectConfiguration ProjectConfiguration)
+        public static void AddEdity(this IServiceCollection services, EditySettings editySettings, ProjectConfiguration projectConfiguration)
         {
             services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();

@@ -30,21 +30,21 @@

             services.AddScoped<AuthUserInfo>();

-            services.AddSingleton<EditySettings>(s => EditySettings);
+            services.AddSingleton<EditySettings>(s => editySettings);

-            switch (ProjectConfiguration.ProjectMode)
+            switch (projectConfiguration.ProjectMode)
             {
                 case "SingleRepo":
                 default:
                     services.AddTransient<ProjectFinder, OneRepo>(s =>
                     {
-                        return new OneRepo(ProjectConfiguration.ProjectPath, ProjectConfiguration.BackupFilePath);
+                        return new OneRepo(projectConfiguration.ProjectPath, projectConfiguration.BackupFilePath);
                     });
                     break;
                 case "OneRepoPerUser":
                     services.AddTransient<ProjectFinder, OneRepoPerUser>(s =>
                     {
-                        return new OneRepoPerUser(ProjectConfiguration.ProjectPath, ProjectConfiguration.BackupFilePath);
+                        return new OneRepoPerUser(projectConfiguration.ProjectPath, projectConfiguration.BackupFilePath);
                     });
                     break;
             }
@@ -79,12 +79,12 @@
                 {
                     InDir = projectFinder.PublishedProjectPath,
                     BackupPath = projectFinder.BackupPath,
-                    OutDir = ProjectConfiguration.OutputPath,
-                    SiteName = ProjectConfiguration.SiteName
+                    OutDir = projectConfiguration.OutputPath,
+                    SiteName = projectConfiguration.SiteName
                 };
             });

-            switch (ProjectConfiguration.Compiler)
+            switch (projectConfiguration.Compiler)
             {
                 case "RoundRobin":
                     services.AddTransient<SiteBuilder, RoundRobinSiteBuilder>(s =>
@@ -93,7 +93,7 @@
                         var settings = s.GetRequiredService<SiteBuilderSettings>();
                         var builder = new RoundRobinSiteBuilder(settings, new EdityMcEditface.WebConfigRoundRobinDeployer());

-                        if (ProjectConfiguration.ProjectMode == "OneRepoPerUser")
+                        if (projectConfiguration.ProjectMode == "OneRepoPerUser")
                         {
                             builder.addPreBuildTask(new PullPublish(projectFinder.MasterRepoPath, projectFinder.PublishedProjectPath));
                         }
@@ -109,7 +109,7 @@
                         var settings = s.GetRequiredService<SiteBuilderSettings>();
                         var builder = new DirectOutputSiteBuilder(settings);

-                        if (ProjectConfiguration.ProjectMode == "OneRepoPerUser")
+                        if (projectConfiguration.ProjectMode == "OneRepoPerUser")
                         {
                             builder.addPreBuildTask(new PullPublish(projectFinder.MasterRepoPath, projectFinder.PublishedProjectPath));
                         }
@@ -122,7 +122,7 @@
             // Add framework services.
             var mvcBuilder = services.AddMvc(o =>
             {
-                o.UseExceptionErrorFilters(EditySettings.DetailedErrors);
+                o.UseExceptionErrorFilters(editySettings.DetailedErrors);
             })
             .AddJsonOptions(o =>
             {


Add comment to code.

Add comment to code.

--HG--
branch : 1.6

--- src/Core/ProjectManager.cs
+++ src/Core/ProjectManager.cs
@@ -420,6 +420,10 @@

             IPackage package = resolvePackage();

+            // the condition (allowPrereleaseVersions || targetVersionSetExplicitly || oldPackage.IsReleaseVersion() || !package.IsReleaseVersion() || oldPackage.Version < package.Version)
+            // is to fix bug 1574. We want to do nothing if, let's say, you have package 2.0alpha installed, and you do:
+            //      update-package
+            // without specifying a version explicitly, and the feed only has version 1.0 as the latest stable version.
             if (package != null &&
                 oldPackage.Version != package.Version &&
                 (allowPrereleaseVersions || targetVersionSetExplicitly || oldPackage.IsReleaseVersion() || !package.IsReleaseVersion() || oldPackage.Version < package.Version))


Pass key as handle to HashCore

Pass key as handle to HashCore

--- src/Cryptography/Blake2.cs
+++ src/Cryptography/Blake2.cs
@@ -57,7 +57,7 @@
                 throw new ArgumentException(Error.ArgumentExceptionMessage, nameof(key));

             byte[] hash = new byte[DefaultHashSize];
-            HashCore(key, data, hash);
+            HashCore(key.Handle, data, hash);
             return hash;
         }

@@ -76,7 +76,7 @@
                 throw new ArgumentOutOfRangeException(nameof(hashSize));

             byte[] hash = new byte[hashSize];
-            HashCore(key, data, hash);
+            HashCore(key.Handle, data, hash);
             return hash;
         }

@@ -94,7 +94,7 @@
             if (hash.Length > MaxHashSize)
                 throw new ArgumentException(Error.ArgumentExceptionMessage, nameof(hash));

-            HashCore(key, data, hash);
+            HashCore(key.Handle, data, hash);
         }

         internal override void CreateKey(
@@ -161,17 +161,17 @@
         }

         private static void HashCore(
-            Key key,
+            SecureMemoryHandle keyHandle,
             ReadOnlySpan<byte> data,
             Span<byte> hash)
         {
-            Debug.Assert(key != null);
-            Debug.Assert(key.Handle.Length >= 0);
-            Debug.Assert(key.Handle.Length <= BLAKE2B_KEYBYTES);
+            Debug.Assert(keyHandle != null);
+            Debug.Assert(keyHandle.Length >= 0);
+            Debug.Assert(keyHandle.Length <= BLAKE2B_KEYBYTES);
             Debug.Assert(hash.Length > 0);
             Debug.Assert(hash.Length <= BLAKE2B_OUTBYTES);

-            crypto_generichash_blake2b_init(out crypto_generichash_blake2b_state state, key.Handle, (UIntPtr)key.Handle.Length, (UIntPtr)hash.Length);
+            crypto_generichash_blake2b_init(out crypto_generichash_blake2b_state state, keyHandle, (UIntPtr)keyHandle.Length, (UIntPtr)hash.Length);
             crypto_generichash_blake2b_update(ref state, ref data.DangerousGetPinnableReference(), (ulong)data.Length);
             crypto_generichash_blake2b_final(ref state, ref hash.DangerousGetPinnableReference(), (UIntPtr)hash.Length);
         }


Append directory separator to roleRoot

Append directory separator to roleRoot

--- ElasticsearchRole/WorkerRole.cs
+++ ElasticsearchRole/WorkerRole.cs
@@ -68,6 +68,16 @@
             string elasticRoot = RoleEnvironment.GetLocalResource("ElasticRoot").RootPath;
             string emulatorDataRoot = RoleEnvironment.GetLocalResource("EmulatorDataRoot").RootPath; // we need this cause we can't emulate shares
             string roleRoot = Environment.GetEnvironmentVariable("ROLEROOT");
+
+            /**
+             * Issue #1.  In azure the role root is just a drive letter. Unfortunately, System.IO doesn't add needed slash
+             *  so Path.Combine("E:","path\to\file") yields E:path\to\file
+             *  Still hoping there is a .net api that I an use to avoid the code below.
+             */
+            if (!roleRoot.EndsWith(@"\"))
+            {
+                roleRoot +=   @"\";
+            }
             string tempPath = Path.GetTempPath();
             #endregion


palindrome-products: improve performance of example implementation

--- exercises/palindrome-products/Example.cs
+++ exercises/palindrome-products/Example.cs
@@ -4,56 +4,70 @@

 public static class PalindromeProducts
 {
+    public static (int, IEnumerable<(int,int)>) Smallest(int minFactor, int maxFactor)
+    {
+        if (minFactor > maxFactor) throw new ArgumentException();
+
+        var smallestPalindromeProduct = int.MaxValue;
+        var smallestPalindromeProductFactors = new List<(int, int)>();
+
+        foreach (var (x, y) in Pairs(minFactor, maxFactor))
+        {
+            var product = x * y;
+
+            if (product > smallestPalindromeProduct || !IsPalindrome(product))
+                continue;
+
+            if (product < smallestPalindromeProduct)
+                smallestPalindromeProductFactors.Clear();
+
+            smallestPalindromeProductFactors.Add((x, y));
+            smallestPalindromeProduct = product;
+        }
+
+        if (smallestPalindromeProduct == int.MaxValue) throw new ArgumentException();
+
+        return (smallestPalindromeProduct, smallestPalindromeProductFactors);
+    }
+
     public static (int, IEnumerable<(int,int)>) Largest(int minFactor, int maxFactor)
     {
-        return FindPalindrome(minFactor, maxFactor, x => x.Max(p => p.Item1));
+        if (minFactor > maxFactor) throw new ArgumentException();
+
+        var largestPalindromeProduct = int.MinValue;
+        var largestPalindromeProductFactors = new List<(int, int)>();
+
+        foreach (var (x, y) in Pairs(minFactor, maxFactor).Reverse())
+        {
+            var product = x * y;
+
+            if (product < largestPalindromeProduct || !IsPalindrome(product))
+                continue;
+
+            if (product > largestPalindromeProduct)
+                largestPalindromeProductFactors.Clear();
+
+            largestPalindromeProductFactors.Add((x, y));
+            largestPalindromeProduct = product;
+        }
+
+        if (largestPalindromeProduct == int.MinValue) throw new ArgumentException();
+
+        largestPalindromeProductFactors.Reverse();
+
+        return (largestPalindromeProduct, largestPalindromeProductFactors);
     }

-    public static (int, IEnumerable<(int,int)>) Smallest(int minFactor, int maxFactor)
-    {
-        return FindPalindrome(minFactor, maxFactor, x => x.Min(p => p.Item1));
-    }
-
-    private static (int, IEnumerable<(int, int)>) FindPalindrome(int minFactor, int maxFactor,
-        Func<List<(int, (int, int))>, int> valueSelector)
-    {
-        if (minFactor > maxFactor || maxFactor < minFactor)
-        {
-            throw new ArgumentException();
-        }
-
-        try
-        {
-            var palindromes = FindAllPalindromes(minFactor, maxFactor);
-            var value = valueSelector(palindromes);
-            var factors = new HashSet<(int, int)>(palindromes.Where(p => p.Item1 == value).Select(p => p.Item2));
-            return (value, factors);
-        } catch (InvalidOperationException)
-        {
-            throw new ArgumentException();
-        }
-    }
-
-    private static List<(int, (int, int))> FindAllPalindromes(int minFactor, int maxFactor)
-    {
-        return (from pair in Pairs(minFactor, maxFactor)
-                let product = pair.Item1 * pair.Item2
-                where IsPalindrome(product)
-                select (product, pair))
-                .ToList();
-    }
-
-    private static IEnumerable<(int, int)> Pairs(int minFactor, int maxFactor)
-    {
-        return from x in Enumerable.Range(minFactor, maxFactor + 1 - minFactor)
-               from y in Enumerable.Range(x, maxFactor + 1 - x)
-               select (x, y);
-    }
+    private static IEnumerable<(int, int)> Pairs(int minFactor, int maxFactor)
+        => from x in Enumerable.Range(minFactor, maxFactor + 1 - minFactor)
+           from y in Enumerable.Range(x, maxFactor + 1 - x)
+           select (x, y);

     private static bool IsPalindrome(int num)
     {
         var n = num;
         var rev = 0;
+
         while (num > 0)
         {
             var dig = num % 10;


(IgsDataOpener): works on physical file system only.

--- Experimental/CellWorks/ArcDB.cs
+++ Experimental/CellWorks/ArcDB.cs
@@ -47,7 +47,7 @@

         public override ArcFile TryOpen (ArcView file)
         {
-            if (!file.Name.EndsWith (".dat", StringComparison.InvariantCultureIgnoreCase))
+            if (VFS.IsVirtual || !file.Name.EndsWith (".dat", StringComparison.InvariantCultureIgnoreCase))
                 return null;
             var db_files = VFS.GetFiles (VFS.CombinePath (VFS.GetDirectoryName (file.Name), "*.db"));
             if (!db_files.Any())


Added Scoreboard

Added Scoreboard

--- test/test/Program.cs
+++ test/test/Program.cs
@@ -4,11 +4,14 @@
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
+using System.IO;

 namespace test
 {
     class Program
+
     {
+
         static void Main()
         {
             Random generator = new Random();
@@ -19,10 +22,15 @@
             SetFieldSize();
             int distanceBetweenObstacles = 0;
             int gameSpeed = 1;
+            int startResult = 0;
+            string fileName = System.IO.Path.GetFullPath(Directory.GetCurrentDirectory() + @"\HighScores.txt");
+            string[] scores = System.IO.File.ReadAllLines(fileName);
+            string highscore = scores[0];

-
+
             while (true)
             {
+
                 int chance = generator.Next(1, 101);

                 if (chance < 30)
@@ -46,9 +54,10 @@
                 {
                     trap.MoveObstacle(gameSpeed);
                 }
-
+
                 Console.Clear();
-
+
+                Score(startResult,highscore);
                 trollPath.DrawPath();
                 for (int i = 0; i < cloudsContainer.Count; i++)
                 {
@@ -62,6 +71,7 @@

                 for (int i = 0; i < trapsContainer.Count; i++)
                 {
+
                     trapsContainer[i].DrawObstacle();

                     if (trapsContainer[i].X == 0)
@@ -69,18 +79,30 @@
                         trapsContainer.RemoveAt(i);
                     }
                 }
-
+
                 distanceBetweenObstacles++;
+                startResult+=10;
                 Thread.Sleep(50);
+
             }
+
+        }
+        static void Score(int result,string high)
+        {
+            Console.SetCursorPosition(0, Console.BufferHeight - 1);
+            Console.Write("Current Score: {0}", result);
+
+            Console.SetCursorPosition((108-high.Length-1), Console.BufferHeight - 1);
+            Console.Write("High Score: {0}", high);
+
         }

         static void SetFieldSize()
         {
-            Console.WindowHeight = 20;
+            Console.WindowHeight = 22;
             Console.WindowWidth = 120;
             Console.BufferWidth = 120;
-            Console.BufferHeight = 20;
+            Console.BufferHeight = 22;
         }
     }
 }


JSONSettings1: remove code smells and format

--- Files/Settings/JSONSettings1.cs
+++ Files/Settings/JSONSettings1.cs
@@ -3,69 +3,91 @@

 namespace ArachNGIN.Files.Settings
 {
-    /* example:
-     *
-     * class Program
-     * {
-     *      static void Main(string[] args)
-     *      {
-     *          MySettings settings = MySettings.Load();
-     *          Console.WriteLine("Current value of 'myInteger': " + settings.myInteger);
-     *          Console.WriteLine("Incrementing 'myInteger'...");
-     *          settings.myInteger++;
-     *          Console.WriteLine("Saving settings...");
-     *          settings.Save();
-     *          Console.WriteLine("Done.");
-     *          Console.ReadKey();
-     *      }
-     *
-     *      class MySettings : AppSettings<MySettings>
-     *      {
-     *          public string myString = "Hello World";
-     *          public int myInteger = 1;
-     *      }
-     * }
-     */
-
     /// <summary>
-    /// Třída na uložení nastavení do JSONů
+    ///     Třída na uložení nastavení do JSONů
     /// </summary>
     /// <typeparam name="T">t</typeparam>
+    /// <example>
+    ///     class Program
+    ///     {
+    ///     static void Main(string[] args)
+    ///     {
+    ///     MySettings settings = MySettings.Load();
+    ///     Console.WriteLine("Current value of 'myInteger': " + settings.myInteger);
+    ///     Console.WriteLine("Incrementing 'myInteger'...");
+    ///     settings.myInteger++;
+    ///     Console.WriteLine("Saving settings...");
+    ///     settings.Save();
+    ///     Console.WriteLine("Done.");
+    ///     Console.ReadKey();
+    ///     }
+    ///     class MySettings : AppSettings MySettings
+    ///     {
+    ///     public string myString = "Hello World";
+    ///     public int myInteger = 1;
+    ///     }
+    ///     }
+    /// </example>
     public class JsonSettings1<T> where T : new()
     {
         private const string DefaultFilename = "settings.jsn";

-
         /// <summary>
-        /// Saves the specified file name.
+        ///     Saves the specified file name.
         /// </summary>
-        /// <param name="fileName">Name of the file.</param>
-        public void Save(string fileName = DefaultFilename)
+        public void Save()
         {
-            File.WriteAllText(fileName, (new JavaScriptSerializer()).Serialize(this));
+            Save(DefaultFilename);
         }

         /// <summary>
-        /// Saves the specified p settings.
+        ///     Saves the specified file name.
+        /// </summary>
+        /// <param name="fileName">Name of the file.</param>
+        public void Save(string fileName)
+        {
+            File.WriteAllText(fileName, new JavaScriptSerializer().Serialize(this));
+        }
+
+        /// <summary>
+        ///     Saves the specified p settings.
+        /// </summary>
+        /// <param name="pSettings">The p settings.</param>
+        public static void Save(T pSettings)
+        {
+            Save(pSettings, DefaultFilename);
+        }
+
+        /// <summary>
+        ///     Saves the specified p settings.
         /// </summary>
         /// <param name="pSettings">The p settings.</param>
         /// <param name="fileName">Name of the file.</param>
-        public static void Save(T pSettings, string fileName = DefaultFilename)
+        public static void Save(T pSettings, string fileName)
         {
-            File.WriteAllText(fileName, (new JavaScriptSerializer()).Serialize(pSettings));
+            File.WriteAllText(fileName, new JavaScriptSerializer().Serialize(pSettings));
         }

         /// <summary>
-        /// Loads the specified file name.
+        ///     Loads the specified file name.
         /// </summary>
         /// <param name="fileName">Name of the file.</param>
         /// <returns></returns>
-        public static T Load(string fileName = DefaultFilename)
+        public static T Load(string fileName)
         {
             var t = new T();
             if (File.Exists(fileName))
-                t = (new JavaScriptSerializer()).Deserialize<T>(File.ReadAllText(fileName));
+                t = new JavaScriptSerializer().Deserialize<T>(File.ReadAllText(fileName));
             return t;
+        }
+
+        /// <summary>
+        ///     Loads the specified file name.
+        /// </summary>
+        /// <returns></returns>
+        public static T Load()
+        {
+            return Load(DefaultFilename);
         }
     }
 }


Adding file contents verification instead of minimum file size

--- FinamTicksDownloader/Program.cs
+++ FinamTicksDownloader/Program.cs
@@ -15,12 +15,11 @@
         {
             return new List<Period>
             {
-                new Period { Name = "ticks", Description = "Tick data", ParameterId = "1", DataFormat = "9", MinimumFileSizeBytes = 5 * 100 * 1024 },
-                new Period { Name = "M1", Description = "1 minute", ParameterId = "2", DataFormat = "5", MinimumFileSizeBytes = 500 },
-                new Period { Name = "M5", Description = "5 minutes", ParameterId = "3", DataFormat = "5", MinimumFileSizeBytes = 500 }
+                new Period { Name = "ticks", Description = "Tick data", ParameterId = "1", DataFormat = "9" },
+                new Period { Name = "M1", Description = "1 minute", ParameterId = "2", DataFormat = "5" },
+                new Period { Name = "M5", Description = "5 minutes", ParameterId = "3", DataFormat = "5" }
             };
         }
-

         static void Main(string[] args)
         {
@@ -126,9 +125,9 @@
                         continue;
                     }

-                    if (size < period.MinimumFileSizeBytes)
+                    if (!fileContainsStockData(currentDate, fileName))
                     {
-                        Console.WriteLine("File size less than " + period.MinimumFileSizeBytes + " bytes, trying again");
+                        Console.WriteLine("File doesn't contain stock data, trying again (file size: " + size + " bytes)");
                         if (size > 0 && size < 300)
                         {
                             Console.WriteLine("Message: ");
@@ -149,5 +148,25 @@
                 currentDate = currentDate.AddDays(1);
             }
         }
+
+        private static bool fileContainsStockData(DateTime currentDate, string filename)
+        {
+            string str = String.Format("{0:D4}{1:D2}{2:D2},",
+                currentDate.Year,
+                currentDate.Month,
+                currentDate.Day);
+
+            using(StreamReader reader = new StreamReader(File.Open(filename, FileMode.Open, FileAccess.Read)))
+            {
+                while(!reader.EndOfStream)
+                {
+                    string line = reader.ReadLine();
+                    if (line.StartsWith(str))
+                        return true;
+                }
+            }
+
+            return false;
+        }
     }
 }


Converting 'RequestMessage.Headers' to a property with a readonly backing field

--- src/Http/RequestMessage.cs
+++ src/Http/RequestMessage.cs
@@ -6,22 +6,39 @@

 namespace Http
 {
+    using System.Diagnostics.Contracts;
+
     public class RequestMessage : IRequestMessage
     {
+        private readonly IHeaderCollection headers;
+
         public RequestMessage(string method, string requestUri, Version httpVersion)
         {
             this.Method = method;
             this.RequestUri = requestUri;
             this.HttpVersion = httpVersion;
-            this.Headers = new HeaderCollection();
+            this.headers = new HeaderCollection();
         }

-        public IHeaderCollection Headers { get; private set; }
+        public IHeaderCollection Headers
+        {
+            get
+            {
+                return this.headers;
+            }
+        }

         public string Method { get; set; }

         public string RequestUri { get; set; }

         public Version HttpVersion { get; set; }
+
+        [ContractInvariantMethod]
+        private void ObjectInvariant()
+        {
+            Contract.Invariant(this.headers != null);
+        }
+
     }
 }


fix eio_req binding

fix eio_req binding

--- src/Manos/Libeio/Libeio.cs
+++ src/Manos/Libeio/Libeio.cs
@@ -28,8 +28,8 @@
 			public double nv2;
 			public int type;
 			public int int1;
-			public long int2;
-			public long int3;
+			public IntPtr int2;
+			public IntPtr int3;
 			public int errorno;
 			public byte flags;
 			public byte pri;


Catch errors from timeSyncer vessel packing. Don't pack already packed vessels.

--- Client/TimeSyncer.cs
+++ Client/TimeSyncer.cs
@@ -183,15 +183,32 @@
                 }
                 foreach (Vessel v in FlightGlobals.fetch.vessels)
                 {
-                    if (v != FlightGlobals.fetch.activeVessel && !v.packed)
-                    {
-                        v.GoOnRails();
-                    }
-                    if (v == FlightGlobals.fetch.activeVessel)
-                    {
-                        if (SafeToStepClock(v, targetTick))
+                    if (!v.packed)
+                    {
+                        if (v != FlightGlobals.fetch.activeVessel)
                         {
-                            v.GoOnRails();
+                            try
+                            {
+                                v.GoOnRails();
+                            }
+                            catch
+                            {
+                                DarkLog.Debug("Error packing vessel " + v.id.ToString());
+                            }
+                        }
+                        if (v == FlightGlobals.fetch.activeVessel)
+                        {
+                            if (SafeToStepClock(v, targetTick))
+                            {
+                                try
+                                {
+                                    v.GoOnRails();
+                                }
+                                catch
+                                {
+                                    DarkLog.Debug("Error packing active vessel " + v.id.ToString());
+                                }
+                            }
                         }
                     }
                 }


Disable time stepping for low-flying sub-orbital vessels to reduce accidents.

--- Client/TimeSyncer.cs
+++ Client/TimeSyncer.cs
@@ -198,8 +198,16 @@
                     }
                 case Vessel.Situations.ORBITING:
                 case Vessel.Situations.ESCAPING:
+                    return true;
                 case Vessel.Situations.SUB_ORBITAL:
-                    return true;
+                    if (checkVessel.altitude < 10000)
+                    {
+                        return true;
+                    }
+                    else
+                    {
+                        return false;
+                    }
                 default :
                     return false;
             }


Remove extra spaces

Remove extra spaces

--HG--
branch : dev

--- src/Orchard/IDependency.cs
+++ src/Orchard/IDependency.cs
@@ -4,8 +4,8 @@
 namespace Orchard {
     public interface IDependency {
     }
-
-    public interface ISingletonDependency : IDependency {
+
+    public interface ISingletonDependency : IDependency {
     }

     public interface ITransientDependency : IDependency {


PG-1290: When filter change happens as part of initialization logic, delay processing until the Window handle is created, so the rainbow view will get initialized accordingly.

--- Glyssen/Dialogs/AssignCharacterDlg.cs
+++ Glyssen/Dialogs/AssignCharacterDlg.cs
@@ -1045,8 +1045,15 @@

 		private void HandleFilterChanged(object sender, EventArgs e)
 		{
-			if (!IsHandleCreated)
+			if (IsHandleCreated)
+			{
+				HandleCreated -= HandleFilterChanged;
+			}
+			else
+			{
+				HandleCreated += HandleFilterChanged;
 				return;
+			}

 			Cursor = Cursors.WaitCursor;