Last time I had not committed HpricotScanner.cs with the latest changes introduced by a little refactoring of BasicData, AttributeData and ElementData. Sorry, shame on me.

--- src/HpricotScanner.cs
+++ src/HpricotScanner.cs
@@ -1033,31 +1033,31 @@
             if (ele is Hpricot.Element) {
                 ElementData he = ele.GetData<ElementData>();

-                he.name = 0;
-                he.tag = tag;
-                he.attr = attr;
+                he.Name = 0;
+                he.Tag = tag;
+                he.Attr = attr;
                 he.EC = ec;

                 if (raw > 0 && (sym_emptytag.Equals(sym) || sym_stag.Equals(sym) || sym_etag.Equals(sym) || sym_doctype.Equals(sym))) {
-                    he.raw = MutableString.Create(new String(buf, raw, rawlen));
+                    he.Raw = MutableString.Create(new String(buf, raw, rawlen));
                 }
             }
             else if (ele is Hpricot.DocumentType || ele is Hpricot.ProcedureInstruction || ele is Hpricot.XmlDeclaration || ele is Hpricot.ETag || ele is Hpricot.BogusETag) {
                 AttributeData ha = ele.GetData<AttributeData>();

-                ha.tag = tag;
+                ha.Tag = tag;
                 if (ele is Hpricot.ETag || ele is Hpricot.BogusETag) {
                     if (raw > 0) {
-                        ha.attr = MutableString.Create(new String(buf, raw, rawlen));
+                        ha.Attr = MutableString.Create(new String(buf, raw, rawlen));
                     }
                 }
                 else {
-                    ha.attr = attr;
+                    ha.Attr = attr;
                 }
             }
             else {
                 BasicData hb = ele.GetData<BasicData>();
-                hb.tag = tag;
+                hb.Tag = tag;
             }

             state.Last = ele;
@@ -1068,13 +1068,13 @@
             ElementData he = focus.GetData<ElementData>();
             BasicData he2 = ele.GetData<BasicData>();

-            RubyArray children = he.children as RubyArray;
+            RubyArray children = he.Children as RubyArray;
             if (children == null) {
                 children = new RubyArray(1);
-                he.children = children;
+                he.Children = children;
             }
             children.Add(ele);
-            he2.parent = focus;
+            he2.Parent = focus;
         }

         #endregion
@@ -1113,7 +1113,7 @@
                 // TODO: tag.GetHashCode() == last.name.GetHashCode() ??
                 if (sym_cdata.Equals(last.EC) &&
                     (!sym_procins.Equals(sym) && !sym_comment.Equals(sym) && !sym_cdata.Equals(sym) && !sym_text.Equals(sym)) &&
-                    !(sym_etag.Equals(sym) && tag.GetHashCode() == last.name.GetHashCode())) {
+                    !(sym_etag.Equals(sym) && tag.GetHashCode() == last.Name.GetHashCode())) {
                     sym = sym_text;
                     tag = MutableString.Create(new String(buf, raw, rawlen));
                 }
@@ -1143,7 +1143,7 @@
                 Hpricot.Element ele = H_ELE<Hpricot.Element>(state, sym, tag, attr, ec, raw, rawlen);
                 ElementData he = ele.GetData<ElementData>();
                 // tag.GetHashCode() ???
-                he.name = tag.GetHashCode();
+                he.Name = tag.GetHashCode();

                 if (!state.Xml) {
                     Object match = null;
@@ -1155,7 +1155,7 @@

                         if (hee.EC is Hash) {
                             Object has;
-                            if ((hee.EC as Hash).TryGetValue(he.name, out has)) {
+                            if ((hee.EC as Hash).TryGetValue(he.Name, out has)) {
                                 if (has is bool && (bool) has == true) {
                                     if (match == null) {
                                         match = e;
@@ -1167,11 +1167,11 @@
                                 else if (symDeny.Equals(has)) {
                                     match = null;
                                 }
-                            }
+                            }
                         }

                         //Debug.Assert(he.parent is IHpricotDataContainer, "he.parent is not an IHpricotDataContainer");
-                        e = hee.parent as IHpricotDataContainer;
+                        e = hee.Parent as IHpricotDataContainer;
                     }

                     if (match == null) {
@@ -1219,13 +1219,13 @@

                 while (e != state.Doc) {
                     ElementData he = e.GetData<ElementData>();
-                    if (he.name == name) {
+                    if (he.Name == name) {
                         match = e;
                         break;
                     }

-                    Debug.Assert(he.parent is Hpricot.Element);
-                    e = he.parent as Hpricot.Element;
+                    Debug.Assert(he.Parent is Hpricot.Element);
+                    e = he.Parent as Hpricot.Element;
                 }

                 if (match == null) {
@@ -1236,10 +1236,10 @@
                     Hpricot.ETag ele = H_ELE<Hpricot.ETag>(state, sym, tag, attr, ec, raw, rawlen);
                     Debug.Assert(match is Hpricot.Element);
                     ElementData he = (match as Hpricot.Element).GetData<ElementData>();
-                    he.tag = ele;
-                    Debug.Assert(he.parent is IHpricotDataContainer);
-                    Debug.Assert(he.parent is IHpricotDataContainer);
-                    state.Focus = he.parent as IHpricotDataContainer;
+                    he.Tag = ele;
+                    Debug.Assert(he.Parent is IHpricotDataContainer);
+                    Debug.Assert(he.Parent is IHpricotDataContainer);
+                    state.Focus = he.Parent as IHpricotDataContainer;
                     state.Last = null;
                 }

@@ -1274,9 +1274,9 @@
                     ElementData he = (state.Last as Hpricot.Element).GetData<ElementData>();

                     Debug.Assert(tag is MutableString);
-                    Debug.Assert(he.tag is MutableString);
-
-                    (he.tag as MutableString).Append(tag as MutableString);
+                    Debug.Assert(he.Tag is MutableString);
+
+                    (he.Tag as MutableString).Append(tag as MutableString);
                 }
                 else {
                     rb_hpricot_add(state.Focus, H_ELE<Hpricot.Text>(state, sym, tag, attr, ec, raw, rawlen));


Removed a few useless comments, fixed a note and added a message for every assertion.

--- src/HpricotScanner.cs
+++ src/HpricotScanner.cs
@@ -1124,7 +1124,7 @@

                 if (sym_emptytag.Equals(sym) || sym_stag.Equals(sym) || sym_etag.Equals(sym)) {
                     // is state.EC really an hash? not sure yet...
-                    Debug.Assert(state.EC is Hash);
+                    Debug.Assert(state.EC is Hash, "state.EC is not an instance of Hash");
                     if (state.EC is Hash && (state.EC as Hash).ContainsKey(tag)) {
                         Object tagu = (state.EC as Hash)[tag];
                         // TODO: downcase tag and set state.EC to tag;
@@ -1146,12 +1146,10 @@
             if (sym_emptytag.Equals(sym) || sym_stag.Equals(sym)) {
                 Hpricot.Element ele = H_ELE<Hpricot.Element>(state, sym, tag, attr, ec, raw, rawlen);
                 ElementData he = ele.GetData<ElementData>();
-                // tag.GetHashCode() ???
                 he.Name = tag.GetHashCode();

                 if (!state.Xml) {
                     Object match = null;
-                    //Hpricot.Element e = state.Focus as Hpricot.Element;
                     IHpricotDataContainer e = state.Focus;

                     while (e != state.Doc) {
@@ -1174,15 +1172,14 @@
                             }
                         }

-                        //Debug.Assert(he.parent is IHpricotDataContainer, "he.parent is not an IHpricotDataContainer");
+                        Debug.Assert(he.Parent is Hpricot.Element, "he.Parent is not an instance of Hpricot.Element");
                         e = hee.Parent as IHpricotDataContainer;
                     }

                     if (match == null) {
                         match = state.Focus;
                     }
-                    // hmmm...
-                    //state.Focus = match as IHpricotDataContainer<BasicData>;
+
                     state.Focus = match as IHpricotDataContainer;
                 }

@@ -1205,7 +1202,7 @@
                 Object match = null;
                 Hpricot.Element e = state.Focus as Hpricot.Element;
                 if (state.Strict) {
-                    Debug.Assert(state.EC is Hash);
+                    Debug.Assert(state.EC is Hash, "state.EC is not an instance of Hash");
                     if (!(state.EC as Hash).ContainsKey(tag)) {
                         tag = MutableString.Create("div");
                     }
@@ -1217,7 +1214,6 @@
                 //
                 // (see also: the search above for fixups)
                 //
-                // tag.GetHashCode() ??
                 name = tag.GetHashCode();

                 while (e != state.Doc) {
@@ -1227,7 +1223,7 @@
                         break;
                     }

-                    Debug.Assert(he.Parent is Hpricot.Element);
+                    Debug.Assert(he.Parent is Hpricot.Element, "he.Parent is not an instance of Hpricot.Element");
                     e = he.Parent as Hpricot.Element;
                 }

@@ -1237,13 +1233,13 @@
                 }
                 else {
                     Hpricot.ETag ele = H_ELE<Hpricot.ETag>(state, sym, tag, attr, ec, raw, rawlen);
-                    Debug.Assert(match is Hpricot.Element);
+                    Debug.Assert(match is Hpricot.Element, "match is not an instance of Hpricot.Element");
                     ElementData he = (match as Hpricot.Element).GetData<ElementData>();

                     // TODO: couldn't find this in the original implementation but it still sounds right.
                     he.ETag = ele;

-                    Debug.Assert(he.Parent is IHpricotDataContainer);
+                    Debug.Assert(he.Parent is Hpricot.Element, "he.Parent is not an instance of Hpricot.Element");
                     state.Focus = he.Parent as IHpricotDataContainer;
                     state.Last = null;
                 }
@@ -1258,14 +1254,14 @@
             else if (sym_doctype.Equals(sym)) {
                 if (state.Strict) {
                     // TODO: need to check is attr is really an Hash instance
-                    Debug.Assert(attr is Hash);
+                    Debug.Assert(attr is Hash, "attr is not an instance of Hash");
                     (attr as Hash).Add(SymbolTable.StringToId("system_id"), MutableString.Create("http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"));
                     (attr as Hash).Add(SymbolTable.StringToId("public_id"), MutableString.Create("-//W3C//DTD XHTML 1.0 Strict//EN"));
                 }
                 rb_hpricot_add(state.Focus, H_ELE<Hpricot.DocumentType>(state, sym, tag, attr, ec, raw, rawlen));
             }
             else if (sym_procins.Equals(sym)) {
-                Debug.Assert(tag is MutableString);
+                Debug.Assert(tag is MutableString, "tag is not an instance of MutableString");
                 System.Text.RegularExpressions.Match match = ProcInsParse.Match(tag as MutableString);
                 // TODO: tag is String or MutableString?
                 tag = MutableString.Create(match.Captures[0].Value);
@@ -1275,11 +1271,11 @@
             else if (sym_text.Equals(sym)) {
                 // TODO: add raw_string as well?
                 if (state.Last != null && state.Last is Hpricot.Text) {
-                    Debug.Assert(state.Last is Hpricot.Element);
+                    Debug.Assert(state.Last is Hpricot.Element, "state.Last is not an instance of Hpricot.Element");
                     ElementData he = (state.Last as Hpricot.Element).GetData<ElementData>();

-                    Debug.Assert(tag is MutableString);
-                    Debug.Assert(he.Tag is MutableString);
+                    Debug.Assert(tag is MutableString, "tag is not an instance of MutableString");
+                    Debug.Assert(he.Tag is MutableString, "he.Tag is not an instance of MutableString");

                     (he.Tag as MutableString).Append(tag as MutableString);
                 }
@@ -1313,7 +1309,7 @@
                     if (raw > 0) {
                         raw_string = MutableString.Create(new String(buf, raw, rawlen));
                     }
-                    // NOTE: right before v0.7 the third argument of rb_yield_tokens was yielding raw_string
+                    // NOTE: right before v0.7 the fourth argument of rb_yield_tokens was yielding raw_string
                     //       but now it yields null (hardcoded). I still have to understand why, but this
                     //       might be a way to limit the memory usage of Hpricot given that raw_string was
                     //       not really that used in userland.


No, really fix the test.

No, really fix the test.

git-svn-id: e915c4f8b2ea2a6e63cbe989b51c0994a698cc26@3513 52acb1d6-8a22-11de-b505-999d5b087335

--- OpenMetaverse.Tests/PacketTests.cs
+++ OpenMetaverse.Tests/PacketTests.cs
@@ -165,6 +165,7 @@
             scriptDialogPacket.Data.ObjectName = Utils.EmptyBytes;
             scriptDialogPacket.Buttons = new ScriptDialogPacket.ButtonsBlock[0];
             scriptDialogPacket.OwnerData = new ScriptDialogPacket.OwnerDataBlock[1];
+            scriptDialogPacket.OwnerData[0] = new ScriptDialogPacket.OwnerDataBlock();
             scriptDialogPacket.OwnerData[0].OwnerID = UUID.Zero;

             byte[][] splitPacket = scriptDialogPacket.ToBytesMultiple();


LIBOMV-931: Head tattoo's disappear at rebaking
Patch by Ard van der Leeuw and Thijs Wenker

git-svn-id: e915c4f8b2ea2a6e63cbe989b51c0994a698cc26@3598 52acb1d6-8a22-11de-b505-999d5b087335

--- OpenMetaverse/Imaging/BakeLayer.cs
+++ OpenMetaverse/Imaging/BakeLayer.cs
@@ -155,9 +155,9 @@
                     continue;
                 }

-                // Don't draw skin on head bake first
-                // For head bake skin texture is drawn last, go figure
-                if (bakeType == BakeType.Head && i == 0) continue;
+                // Don't draw skin and tattoo on head bake first
+                // For head bake the skin and texture are drawn last, go figure
+                if (bakeType == BakeType.Head && (i == 0 || i == 1)) continue;

                 ManagedImage texture = textures[i].Texture.Image.Clone();
                 //File.WriteAllBytes(bakeType + "-texture-layer-" + i + ".tga", texture.ExportTGA());
@@ -172,8 +172,8 @@

                 // Special case for hair layer for the head bake
                 // If we don't have skin texture, we discard hair alpha
-                // and apply hair pattern over the texture
-                if (!SkinTexture && bakeType == BakeType.Head && i == 1)
+                // and apply hair(i==2) pattern over the texture
+                if (!SkinTexture && bakeType == BakeType.Head && i == 2)
                 {
                     if (texture.Alpha != null)
                     {
@@ -260,7 +260,7 @@
                 //File.WriteAllBytes(bakeType + "-layer-" + i + ".tga", texture.ExportTGA());
             }

-            // For head, we add skin last
+            // For head and tattoo, we add skin last
             if (SkinTexture && bakeType == BakeType.Head)
             {
                 ManagedImage texture = textures[0].Texture.Image.Clone();
@@ -270,6 +270,18 @@
                     catch (Exception) { }
                 }
                 DrawLayer(texture, false);
+
+                // Add head tattoo here (if available, order-dependant)
+                if (textures.Count > 1 && textures[1].Texture != null)
+                {
+                    texture = textures[1].Texture.Image.Clone();
+                    if (texture.Width != bakeWidth || texture.Height != bakeHeight)
+                    {
+                        try { texture.ResizeNearestNeighbor(bakeWidth, bakeHeight); }
+                        catch (Exception) { }
+                    }
+                    DrawLayer(texture, false);
+                }
             }

             // Apply any alpha wearable textures to make parts of the avatar disappear


Applied jradfords patch from issue 348, correct dictionaries are locked in the object tracker now

git-svn-id: baf6e02d125cf6f9bfcfe153b2eb83d6e1f5ace6@1379 52acb1d6-8a22-11de-b505-999d5b087335

--- libsecondlife/ObjectTracker.cs
+++ libsecondlife/ObjectTracker.cs
@@ -135,7 +135,7 @@

         public void ForEach(Action<Primitive> action)
         {
-            lock (Avatars)
+            lock (Prims)
             {
                 foreach (Primitive prim in Prims.Values)
                 {
@@ -146,7 +146,7 @@

         public void ForEach(Action<Avatar> action)
         {
-            lock (Prims)
+            lock (Avatars)
             {
                 foreach (Avatar avatar in Avatars.Values)
                 {


LIBOMV-246 Cleans up resource usage in parcel tracking

git-svn-id: c32cf1ecefca26b8770d7b0740bc0c5c174087e4@1878 c754d5e9-d413-0410-bcdf-9574c9dba6b7

--- libsecondlife/ParcelManager.cs
+++ libsecondlife/ParcelManager.cs
@@ -844,11 +844,12 @@
         /// <param name="refresh">If TRUE, will force a full refresh</param>
         public void RequestAllSimParcels(Simulator simulator, bool refresh)
         {
-
             if (refresh)
             {
                 lock (simulator.ParcelMap)
-                    simulator.ParcelMap = new int[64, 64];
+                    for (int y = 0; y < 64; y++)
+                        for (int x = 0; x < 64; x++)
+                            simulator.ParcelMap[y, x] = 0;
             }

             Thread th = new Thread(delegate()
@@ -869,6 +870,7 @@
                     }
                 }
             });
+
             th.Start();
         }


revert InitialLOBFetchSize change

revert InitialLOBFetchSize change

--- Source/LinqToDB/DataProvider/Oracle/OracleDataProvider.cs
+++ Source/LinqToDB/DataProvider/Oracle/OracleDataProvider.cs
@@ -462,10 +462,9 @@

 			dynamic command = Proxy.GetUnderlyingObject((DbCommand)dataConnection.Command);

+			// https://docs.oracle.com/cd/B19306_01/win.102/b14307/featData.htm
 			// For LONG data type fetching initialization
 			command.InitialLONGFetchSize = -1;
-			// For LOB data type fetching initialization
-			command.InitialLOBFetchSize  = -1;

 			if (parameters != null)
 				foreach (var parameter in parameters)


made global start shortcut continue instead of starting new entry (win), closes #1531

--- src/ui/windows/TogglDesktop/TogglDesktop/WPF/windows/MainWindow.xaml.cs
+++ src/ui/windows/TogglDesktop/TogglDesktop/WPF/windows/MainWindow.xaml.cs
@@ -364,7 +364,7 @@
             {
                 using (Performance.Measure("starting time entry from global short cut, manual mode: {0}", this.isInManualMode))
                 {
-                    this.startTimeEntry();
+                    this.startTimeEntry(true);
                 }
             }
         }
@@ -660,7 +660,7 @@
             }
         }

-        private void startTimeEntry()
+        private void startTimeEntry(bool continueIfNotInManualMode = false)
         {
             if (this.isInManualMode)
             {
@@ -669,7 +669,14 @@
             }
             else
             {
-                Toggl.Start("", "", 0, 0, "", "");
+                if (continueIfNotInManualMode)
+                {
+                    Toggl.ContinueLatest();
+                }
+                else
+                {
+                    Toggl.Start("", "", 0, 0, "", "");
+                }
             }
         }


Fix issues that Tarcontar noted

Fix issues that Tarcontar noted

--- src/OpenSage.Game/Data/Sav/SaveFile.cs
+++ src/OpenSage.Game/Data/Sav/SaveFile.cs
@@ -20,20 +20,11 @@
             using (var reader = new BinaryReader(stream, Encoding.Unicode, true))
             {
                 var chunkHeaders = new List<SaveChunkHeader>();
-
-                while (true)
-                {
-                    var chunkHeader = SaveChunkHeader.Parse(reader);
+                var chunkHeader = SaveChunkHeader.Parse(reader);
+
+                while (!chunkHeader.IsEof)
+                {
                     chunkHeaders.Add(chunkHeader);
-
-                    if (chunkHeader.IsEof)
-                    {
-                        if (stream.Position != stream.Length)
-                        {
-                            throw new InvalidDataException();
-                        }
-                        break;
-                    }

                     var end = stream.Position + chunkHeader.DataLength;

@@ -277,6 +268,13 @@
                     {
                         throw new InvalidDataException($"Error parsing chunk '{chunkHeader.Name}'. Expected stream to be at position {end} but was at {stream.Position}.");
                     }
+
+                    chunkHeader = SaveChunkHeader.Parse(reader);
+                }
+
+                if (stream.Position != stream.Length)
+                {
+                    throw new InvalidDataException();
                 }

                 var chunkHeaderNames = string.Join(Environment.NewLine, chunkHeaders.Select(x => x.Name));
@@ -341,10 +339,7 @@
                     throw new InvalidDataException();
                 }

-                if (result.Unknown2 != 1u)
-                {
-                    //throw new InvalidDataException();
-                }
+                //TODO: Check for result.Unknown2

                 return result;
             }


Update HttpContextAccessor.cs

Update HttpContextAccessor.cs

--- src/Orchard/Mvc/HttpContextAccessor.cs
+++ src/Orchard/Mvc/HttpContextAccessor.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Runtime.Remoting;
 using System.Runtime.Remoting.Messaging;
 using System.Web;

@@ -9,8 +10,15 @@

         public HttpContextBase Current() {
             var httpContext = GetStaticProperty();
-            return !IsBackgroundHttpContext(httpContext) ? new HttpContextWrapper(httpContext) :
-                _httpContext ?? CallContext.LogicalGetData("HttpContext") as HttpContextBase;
+
+            if (!IsBackgroundHttpContext(httpContext))
+                return new HttpContextWrapper(httpContext);
+
+            if (_httpContext != null)
+                return _httpContext;
+
+            var context = CallContext.LogicalGetData("HttpContext") as ObjectHandle;
+            return context != null ? context.Unwrap() as HttpContextBase : null;
         }

         public void Set(HttpContextBase httpContext) {


Added IdiotDriverApp Twitter Follow button.

--- ParkerSmart/Views/Home/Work.cshtml
+++ ParkerSmart/Views/Home/Work.cshtml
@@ -54,6 +54,15 @@

Idiot Driver - A voice driven twitter client to rant about idiots on the road.  Coming soon to the Apple Store and Google Play.

+
+

+
+			Follow @@IdiotDriverApp
+
+


check uwp names

check uwp names

--- Plugins/Wox.Plugin.Program/Main.cs
+++ Plugins/Wox.Plugin.Program/Main.cs
@@ -42,6 +42,10 @@
             });
             Log.Info($"|Wox.Plugin.Program.Main|Number of preload win32 programs <{_win32s.Length}>");
             Log.Info($"|Wox.Plugin.Program.Main|Number of preload uwps <{_uwps.Length}>");
+            foreach (var uwp in _uwps)
+            {
+                Log.Info($"|Wox.Plugin.Program.Main| uwp: {uwp.DisplayName}>");
+            }

             var a = Task.Run(() =>
             {


Fixed logic error, now adds all messages after initial population to markov chains via AddToMarkovChain(), which also removes oldest messages.

--- ConsoleApplication1/KiteChat.cs
+++ ConsoleApplication1/KiteChat.cs
@@ -55,7 +55,10 @@
 			Console.WriteLine("(" + e.User.Name + "/" + e.User.Id + ") - " + e.Message.Text);
 		    IsRaeTyping(e);

-			if (e.Channel.Name.ToLower().Contains("vinncorobocorps"))
+            //add all messages to the Markov Chain list
+            AddToMarkovChain(e);
+
+            if (e.Channel.Name.ToLower().Contains("vinncorobocorps"))
 			{
 				string response = kiteGame.GetGameResponse(e.Message);
 				if (response != null)
@@ -72,19 +75,19 @@
 				await client.SendMessage(e.Channel, "http://i.imgur.com/QhcNUWo.gifv");
 			}

-			else if (!e.Message.IsAuthor && e.Message.Text.StartsWith(@"@KiteBot /forceUpdate"))
+			else if (!e.Message.IsAuthor && e.Message.Text.StartsWith(@"@KiteBotBeta /forceUpdate"))
 			{
 				giantBombRss.UpdateFeeds();
 			}

-            else if (!e.Message.IsAuthor && e.Message.Text.StartsWith(@"@KiteBot /testMarkov"))
+            else if (!e.Message.IsAuthor && e.Message.Text.StartsWith(@"@KiteBotBeta /testMarkov"))
             {
                 await client.SendMessage(e.Channel, await GetMarkovChain(e));
             }

-            else if (!e.Message.IsAuthor && e.Message.Text.StartsWith("@KiteBot"))
-			{
-				if (e.Message.Text.StartsWith("@KiteBot #420") || e.Message.Text.ToLower().StartsWith("@KiteBot #blaze") ||
+            else if (!e.Message.IsAuthor && e.Message.Text.StartsWith("@KiteBotBeta"))
+			{
+				if (e.Message.Text.StartsWith("@KiteBotBeta #420") || e.Message.Text.ToLower().StartsWith("@KiteBotBeta #blaze") ||
 				    0 <= e.Message.Text.ToLower().IndexOf("waifu", 0))
 				{
 					await client.SendMessage(e.Channel, "http://420.moe/");
@@ -163,7 +166,7 @@
 				}
 				else
 				{
-					await
+                    await
 						client.SendMessage(e.Channel, "KiteBot ver. 0.8.3 \"Less Pizza, More Meat.\"");
 				}
 			}
@@ -178,6 +181,7 @@

         private async Task<string> GetMarkovChain(MessageEventArgs e)
         {
+            //Check if the dictionary entry for the channel exists, populate the new list if it does not.
             if(!chatLogDictionary.ContainsKey(e.Channel.Id))
             {
                 chatLogDictionary.Add(e.Channel.Id, new List<Message>());
@@ -191,16 +195,10 @@
                 }
             }

-            else
-            {
-                chatLogDictionary[e.Channel.Id].Add(e.Message);
-                chatLogDictionary[e.Channel.Id].RemoveRange(0,1);
-            }
-
             TextMarkovChain textMarkovChain = new TextMarkovChain();
             foreach (var v in chatLogDictionary[e.Channel.Id])
             {
-                if (v.Text.ToLower().Contains("@kitebot") || v.User.Name.Equals("KiteBot"))
+                if (v.Text.ToLower().Contains("@kitebot") || v.User.Name.Equals("KiteBotBeta"))
                 {

                 }
@@ -227,6 +225,15 @@
             else
             {
                 return "poop";
+            }
+        }
+
+        private void AddToMarkovChain(MessageEventArgs e)
+        {
+            if (chatLogDictionary.ContainsKey(e.Channel.Id) && !e.User.Name.ToLower().Contains("kitebot"))
+            {
+                chatLogDictionary[e.Channel.Id].Add(e.Message);
+                chatLogDictionary[e.Channel.Id].RemoveRange(0, 1);
             }
         }


Add Linktype to Field

Add Linktype to Field

--- Contentful.Core/Models/Field.cs
+++ Contentful.Core/Models/Field.cs
@@ -38,6 +38,11 @@
         public bool Localized { get; set; }

         /// <summary>
+        /// The type of link, if any. Normally Asset or Entry.
+        /// </summary>
+        public string LinkType { get; set; }
+
+        /// <summary>
         /// Whether this field is disabled. Disabled fields are not visible in the Contentful web app.
         /// </summary>
         public bool Disabled { get; set; }


Added server statistics to API for tracking live mode

--- Api/Api.cs
+++ Api/Api.cs
@@ -97,6 +97,23 @@
         }

         /// <summary>
+        /// Send the statistics to storage for performance tracking.
+        /// </summary>
+        /// <param name="algorithmId">Identifier for algorithm</param>
+        /// <param name="unrealized">Unrealized gainloss</param>
+        /// <param name="fees">Total fees</param>
+        /// <param name="netProfit">Net profi</param>
+        /// <param name="holdings">Algorithm holdings</param>
+        /// <param name="capital">Total capital</param>
+        /// <param name="volume">Volume traded</param>
+        /// <param name="trades">Total trades since inception</param>
+        /// <param name="sharpe">Sharpe ratio since inception</param>
+        public void SendStatistics(string algorithmId, decimal unrealized, decimal fees, decimal netProfit, decimal holdings, decimal capital, decimal volume, int trades, double sharpe)
+        {
+            //
+        }
+
+        /// <summary>
         /// Get the calendar open hours for the today.
         /// </summary>
         public MarketToday MarketToday(SecurityType type)


Updated the Object.Equals method of the Azimuth struct to work properly when called by the IEquatable<T>.Equals method.

--- Azimuth.cs
+++ Azimuth.cs
@@ -1243,8 +1243,8 @@
             if (obj is Azimuth)
                 return Equals((Azimuth)obj);

-            // Nothing else will work, so False
-            return false;
+            // Compare degree value
+            return _DecimalDegrees.Equals(obj);
         }

         /// <summary>Returns a unique code for this instance.</summary>


Simplify date/time parsing in console app

--- NCrontabConsole/Program.cs
+++ NCrontabConsole/Program.cs
@@ -67,20 +67,11 @@
 }

 static DateTime ParseDateArgument(string arg, string hint)
-{
-    try
-    {
-        return DateTime.Parse(arg, null, DateTimeStyles.AssumeLocal);
-    }
-    catch (FormatException e)
-    {
-        throw new ApplicationException("Invalid " + hint + " date or date format argument.", e);
-    }
-}
+    => DateTime.TryParse(arg, null, DateTimeStyles.AssumeLocal, out var v) ? v
+     : throw new ApplicationException("Invalid " + hint + " date or date format argument.");

 sealed class ApplicationException : Exception
 {
     public ApplicationException() {}
     public ApplicationException(string message) : base(message) {}
-    public ApplicationException(string message, Exception inner) : base(message, inner) {}
 }


VaR fix

VaR fix

--- src/Qwack.Models/Risk/VaRCalculator.cs
+++ src/Qwack.Models/Risk/VaRCalculator.cs
@@ -123,7 +123,7 @@

         public void CalculateModels()
         {
-            var allAssetIds = _portfolio.AssetIds();
+            var allAssetIds = _portfolio.AssetIds().Where(x=>!(x.Length==7 && x[3]=='/')).ToArray();
             var allDates = _spotTypeBumps.First().Value.Bumps.Keys.ToList();
             foreach (var kv in _spotTypeBumps)
             {


Added GetAttributes and HasAttribute ext. methods

--- Core/Theraot/Core/TypeHelper.cs
+++ Core/Theraot/Core/TypeHelper.cs
@@ -122,6 +122,12 @@
         public static TReturn Default<TReturn>()
         {
             return FuncHelper.GetDefaultFunc<TReturn>().Invoke();
+        }
+
+        public static TAttribute[] GetAttributes<TAttribute>(this ICustomAttributeProvider item, bool inherit)
+    where TAttribute : Attribute
+        {
+            return (TAttribute[])Check.NotNullArgument(item, "item").GetCustomAttributes(typeof(TAttribute), inherit);
         }

         public static Func<TReturn> GetDefault<TReturn>()
@@ -177,6 +183,13 @@
             }
         }

+        public static bool HasAttribute<TAttribute>(this ICustomAttributeProvider item)
+            where TAttribute : Attribute
+        {
+            var attributes = item.GetAttributes<TAttribute>(true);
+            return attributes != null && attributes.Length > 0;
+        }
+
         public static bool HasConstructor(this Type type, params Type[] typeArguments)
         {
             var constructorInfo = type.GetConstructor(typeArguments);


Update Music.cs

Update Music.cs

--- NadekoBot/Modules/Music.cs
+++ NadekoBot/Modules/Music.cs
@@ -202,7 +202,7 @@
                     });

                 cgb.CreateCommand("setgame")
-                    .Description("Sets the game of the bot to the number of songs playing.**Owner only**")
+                    .Description("Sets the game of the bot to the number of songs playing. **Owner only**")
                     .AddCheck(SimpleCheckers.OwnerOnly())
                     .Do(async e => {
                         await e.Channel.SendMessage("❗This command is deprecated. " +
@@ -233,7 +233,7 @@
                     });

                 cgb.CreateCommand("lopl")
-                    .Description("Queues up to 50 songs from a directory.")
+                    .Description("Queues up to 50 songs from a directory. **Owner Only!**")
                     .Parameter("directory", ParameterType.Unparsed)
                     .AddCheck(Classes.Permissions.SimpleCheckers.OwnerOnly())
                     .Do(async e => {
@@ -261,7 +261,7 @@
                     });

                 cgb.CreateCommand("lo")
-                    .Description("Queues a local file by specifying a full path. BOT OWNER ONLY.")
+                    .Description("Queues a local file by specifying a full path. **Owner Only!**")
                     .Parameter("path", ParameterType.Unparsed)
                     .AddCheck(Classes.Permissions.SimpleCheckers.OwnerOnly())
                     .Do(async e => {
@@ -307,7 +307,7 @@
                     });

                 cgb.CreateCommand("cleanup")
-                    .Description("Cleans up hanging voice connections. BOT OWNER ONLY")
+                    .Description("Cleans up hanging voice connections. **Owner Only!**")
                     .AddCheck(SimpleCheckers.OwnerOnly())
                     .Do(e => {
                         foreach (var kvp in MusicPlayers) {


Add parse overload for stopIndent loop condition

The default condition of 0 would produce undesired result if immediate
parsing didn't yield a squiggly bracket.  The function would exit
prematurely.

--- Nectarine/ParadoxParser.cs
+++ Nectarine/ParadoxParser.cs
@@ -134,7 +134,7 @@
             return file;
         }

-        private void parse(Stream stream, IDictionary<string, Action<ParadoxParser>> strategy, int stopIndent = 0)
+        private void parse(Stream stream, IDictionary<string, Action<ParadoxParser>> strategy)
         {
             Action<ParadoxParser> action;
             do
@@ -145,9 +145,22 @@
                     if (strategy.TryGetValue(currentLine, out action))
                         action(this);
                 }
-            } while (!eof && currentIndent > stopIndent);
-        }
-
+            } while (!eof);
+        }
+
+        private void parse(Stream stream, IDictionary<string, Action<ParadoxParser>> strategy, int stopIndent)
+        {
+            Action<ParadoxParser> action;
+            do
+            {
+                string currentLine = GetToken(stream);
+                if (!String.IsNullOrEmpty(currentLine))
+                {
+                    if (strategy.TryGetValue(currentLine, out action))
+                        action(this);
+                }
+            } while (!eof && currentIndent < stopIndent);
+        }

         private string GetToken(Stream fs)
         {


Fixed this case to use accurate actual plate dimensions

--- GeometryStubLibrary/PolyhedronStubs.cs
+++ GeometryStubLibrary/PolyhedronStubs.cs
@@ -8,7 +8,7 @@
     {
         public override Volume Volume { get { return new Volume(VolumeType.CubicInches, 96); } }
         public override Point Centroid { get { return Point.MakePointWithInches(2, 6, 1); } }
-        public TestRectangularBox1() : base(Point.MakePointWithInches(4, 12, 2)) { }
+        public TestRectangularBox1() : base(Point.MakePointWithInches(3.5, 144, 2)) { }
     }

     public class TestRectangularBox2 : RectangularPrism


currency conversion bug fix

currency conversion bug fix

--- TIKSN.Core/Finance/ForeignExchange/CurrencylayerDotCom.cs
+++ TIKSN.Core/Finance/ForeignExchange/CurrencylayerDotCom.cs
@@ -96,7 +96,7 @@

 				var responseJsonString = await response.Content.ReadAsStringAsync();

-				var responseJsonObject = JsonConvert.DeserializeObject<Dictionary<string, object>>(responseJsonString);
+				var responseJsonObject = JsonConvert.DeserializeObject<Dictionary<string, object>>(responseJsonString, new JsonSerializerSettings { Culture = CultureInfo.InvariantCulture });

 				var success = (bool)responseJsonObject["success"];


Throw Timeout exception, if waiting more than timeout time

--- Tests/Boxed.Templates.Test/Framework/ProjectExtensions.cs
+++ Tests/Boxed.Templates.Test/Framework/ProjectExtensions.cs
@@ -211,6 +211,7 @@
                     try
                     {
                         await httpClient.GetAsync("/");
+                        return;
                     }
                     catch (HttpRequestException exception)
                     when (IsApiDownException(exception))
@@ -218,6 +219,9 @@
                         await Task.Delay(intervalMilliseconds);
                     }
                 }
+
+                throw new TimeoutException(
+                    $"Timed out after waiting {timeout} for application to start using dotnet run.");
             }
         }


Forgot to add this

Forgot to add this

--- BARABAS.cs
+++ BARABAS.cs
@@ -4339,7 +4339,7 @@
 		string hydro_str = !has_hydrogen_tanks ? "N/A" : String.Format("{0:0.0}%",
 					cur_hydrogen_level);

-		if (oxygen_low_watermark > 0 && cur_oxygen_level < oxygen_low_watermark && ore_status[ICE] == 0) {
+		if (has_oxygen_tanks && oxygen_low_watermark > 0 && cur_oxygen_level < oxygen_low_watermark && ore_status[ICE] == 0) {
 			alert = true;
 			addAntennaAlert(ALERT_LOW_OXYGEN);
 		} else {


SoundMath.Bessel0メソッドに例外処理を追加

--- src/Math/SoundMath.cs
+++ src/Math/SoundMath.cs
@@ -38,6 +38,12 @@

         public static double Bessel0(double x, int iterate = 100)
         {
+            if (x < 0.0)
+                throw new ArgumentOutOfRangeException("x");
+
+            if (iterate < 0)
+                throw new ArgumentOutOfRangeException("iterate");
+
             double y = 0.0;
             double f;


More tests.

More tests.

--- Gu.Wpf.ToolTips.UiTests/WindowTests.cs
+++ Gu.Wpf.ToolTips.UiTests/WindowTests.cs
@@ -131,6 +131,23 @@
         [TestCase("Button 2")]
         [TestCase("TextBlock 1")]
         [TestCase("Label 1")]
+        public void TapThenMouseOver(string name)
+        {
+            using var app = Application.AttachOrLaunch(ExeFileName, this.windowName);
+            var window = app.MainWindow;
+            var element = window.FindFirstChild(Conditions.ByName(name), x => new UiElement(x));
+            Touch.Tap(element.Bounds.Center());
+            var toolTip = element.FindToolTip();
+            Assert.AreEqual(true, toolTip.IsOpen());
+
+            Mouse.MoveTo(element.Bounds.Center());
+            Assert.AreEqual(true, toolTip.IsOpen());
+        }
+
+        [TestCase("Button 1")]
+        [TestCase("Button 2")]
+        [TestCase("TextBlock 1")]
+        [TestCase("Label 1")]
         public void TapAdornerTwice(string name)
         {
             using var app = Application.AttachOrLaunch(ExeFileName, this.windowName);


Return old method of getting focus on 2D/3D view and texture map

--- DarkUI/Docking/DarkDockGroup.cs
+++ DarkUI/Docking/DarkDockGroup.cs
@@ -673,21 +673,13 @@

         private void DockPanel_ActiveContentChanged(object sender, DockContentEventArgs e)
         {
-            if (!_contents.Contains(e.Content))
-                return;
-
-            if (e.Content == VisibleContent)
-            {
-                VisibleContent.Focus();
-                return;
-            }
+            if (e.Content == VisibleContent || !_contents.Contains(e.Content))
+                return;

             VisibleContent = e.Content;

             foreach (var content in _contents)
                 content.Visible = content == VisibleContent;
-
-            VisibleContent.Focus();

             EnsureVisible();
             Invalidate();


Add try catch in catch if webserver because connection could be canceled

--- HttpWebcamLiveStream/Web/HttpServer.cs
+++ HttpWebcamLiveStream/Web/HttpServer.cs
@@ -55,7 +55,11 @@
             }
             catch (Exception exception)
             {
-                HttpServerResponse.WriteResponseError(exception.Message, socket.OutputStream);
+                try
+                {
+                    HttpServerResponse.WriteResponseError(exception.Message, socket.OutputStream);
+                }
+                catch (Exception) { }
             }
         }


Fix crash on grids not found for rotors and pistons

--- BARABAS.cs
+++ BARABAS.cs
@@ -1,5 +1,5 @@
 /*
- * BARABAS v1.54
+ * BARABAS v1.55
  *
  * (Burillo's Automatic Resource Administration for BAses and Ships)
  *
@@ -46,7 +46,7 @@
  *
  */

-const string VERSION = "1.54";
+const string VERSION = "1.55";

 // configuration
 const int OP_MODE_AUTO = 0x0;
@@ -989,14 +989,14 @@
     return o.CubeGrid;
 }

-IMyCubeGrid getConnectedGrid(IMyMotorBase r, List<IMyCubeGrid> grids) {
+IMyCubeGrid getConnectedGrid(IMyMotorBase r) {
     if (!r.IsAttached) {
         return null;
     }
     return r.TopGrid;
 }

-IMyCubeGrid getConnectedGrid(IMyPistonBase p, List<IMyCubeGrid> grids) {
+IMyCubeGrid getConnectedGrid(IMyPistonBase p) {
     if (!p.IsAttached) {
         return null;
     }
@@ -1065,6 +1065,14 @@
             local_assemblers.Add(b);
         } else if (b is IMyShipConnector) {
             local_connectors.Add(b);
+
+			// also add connected grid
+			var c = b as IMyShipConnector;
+			var g = getConnectedGrid(c);
+			if (g != null && !tmp_grid_data.TryGetValue(g, out data)) {
+				data = new GridData();
+				tmp_grid_data.Add(g, data);
+			}
         } else if (b is IMyCargoContainer) {
             local_storage.Add(b);
         } else if (b is IMyShipDrill) {
@@ -1089,10 +1097,26 @@
             local_oxygen_generators.Add(b);
         } else if (b is IMyPistonBase) {
             pistons.Add(b);
+
+			// also add connected grid
+			var p = b as IMyPistonBase;
+			var g = getConnectedGrid(p);
+			if (g != null && !tmp_grid_data.TryGetValue(g, out data)) {
+				data = new GridData();
+				tmp_grid_data.Add(g, data);
+			}
         } else if (b is IMyMotorSuspension) {
             data.has_wheels = true;
         } else if (b is IMyMotorBase) {
             rotors.Add(b);
+
+			// also add connected grid
+			var r = b as IMyMotorBase;
+			var g = getConnectedGrid(r);
+			if (g != null && !tmp_grid_data.TryGetValue(g, out data)) {
+				data = new GridData();
+				tmp_grid_data.Add(g, data);
+			}
         } else if (b is IMyThrust) {
             data.has_thrusters = true;
         } else if (b is IMyProgrammableBlock && b != Me && b.CubeGrid != Me.CubeGrid) {
@@ -1111,7 +1135,7 @@

     // first, go through all pistons
     foreach (IMyPistonBase p in pistons) {
-        var connected_grid = getConnectedGrid(p, grids);
+        var connected_grid = getConnectedGrid(p);

         if (connected_grid != null) {
             // grids connected to pistons are local to their source
@@ -1121,7 +1145,7 @@

     // do the same for rotors
     foreach (IMyMotorBase rotor in rotors) {
-        var connected_grid = getConnectedGrid(rotor, grids);
+        var connected_grid = getConnectedGrid(rotor);

         if (connected_grid != null) {
             // grids connected to locals are local to their source


Simplified test.

Simplified test.

Simplified @donandren's test for #1936.

--- tests/Avalonia.Controls.UnitTests/ListBoxTests.cs
+++ tests/Avalonia.Controls.UnitTests/ListBoxTests.cs
@@ -4,6 +4,7 @@
 using System;
 using System.Collections.ObjectModel;
 using System.Linq;
+using Avalonia.Collections;
 using Avalonia.Controls.Presenters;
 using Avalonia.Controls.Templates;
 using Avalonia.Data;
@@ -171,106 +172,28 @@
             Assert.Equal(new Size(100, 10), target.Scroll.Viewport);
         }

-        [Theory]
-        [InlineData(ItemVirtualizationMode.Simple)]
-        [InlineData(ItemVirtualizationMode.None)]
-        public void When_Added_Removed_AfterItems_Reset_Should_Work(ItemVirtualizationMode virtMode)
-        {
-            using (UnitTestApplication.Start(TestServices.StyledWindow))
-            {
-                var items = new ObservableCollection<string>();
-
-                void create()
-                {
-                    foreach (var i in Enumerable.Range(1, 7))
-                    {
-                        items.Add(i.ToString());
-                    }
-                }
-
-                create();
-
-                var wnd = new Window() { SizeToContent = SizeToContent.WidthAndHeight };
-
-                wnd.IsVisible = true;
-
-                var target = new ListBox() { VirtualizationMode = virtMode };
-
-                wnd.Content = target;
-
-                var lm = wnd.LayoutManager;
-
-                target.Height = 110;//working fine when <=106 or >=119
-                target.Width = 50;
-
-                target.ItemTemplate = new FuncDataTemplate<object>(c =>
-                {
-                    var tb = new TextBlock() { Height = 10, Width = 30 };
-                    tb.Bind(TextBlock.TextProperty, new Binding());
-                    return tb;
-                }, true);
-
-                target.DataContext = items;
-
-                lm.ExecuteInitialLayoutPass(wnd);
-
-                target.Bind(ItemsControl.ItemsProperty, new Binding());
-
-                lm.ExecuteLayoutPass();
-
-                var panel = target.Presenter.Panel;
-
-                string itemsToString() =>
-                      string.Join(",", panel.Children.OfType<ListBoxItem>().Select(l => l.Content.ToString()).ToArray());
-
-                void addafter(string item, string newitem)
-                {
-                    items.Insert(items.IndexOf(item) + 1, newitem);
-                    lm.ExecuteLayoutPass();
-                }
-
-                void remove(string item)
-                {
-                    items.Remove(item);
-                    lm.ExecuteLayoutPass();
-                }
-
-                addafter("1", "1+");//expected 1,1+,2,3,4,5,6,7
-
-                addafter("2", "2+");//expected 1,1+,2,2+,3,4,5,6
-
-                remove("2+");//expected 1,1+,2,3,4,5,6,7
-
-                //Reset items
-                items.Clear();
-                create();
-
-                addafter("1", "1+");//expected 1,1+,2,3,4,5,6,7
-
-                addafter("2", "2+");//expected 1,1+,2,2+,3,4,5,6
-
-                remove("2+");//expected 1,1+,2,3,4,5,6,7
-
-                var sti = itemsToString();
-
-                var lbItems = panel.Children.OfType<ListBoxItem>().ToArray();
-
-                Assert.Equal("1", lbItems[0].Content);
-                Assert.Equal("1+", lbItems[1].Content);
-                Assert.Equal("2", lbItems[2].Content);
-                Assert.Equal("3", lbItems[3].Content); //bug it's 2+ instead
-                Assert.Equal("4", lbItems[4].Content);
-
-                int lbi = 0;
-
-                //ensure all items are fine
-                foreach (var lb in lbItems)
-                {
-                    Assert.Equal(items[lbi++], lb.Content);
-                }
-
-                //Assert.Equal("1,1+,2,3,4,5,6,7", sti);
-            }
+        [Fact]
+        public void Containers_Correct_After_Clear_Add_Remove()
+        {
+            // Issue #1936
+            var items = new AvaloniaList<string>(Enumerable.Range(0, 11).Select(x => $"Item {x}"));
+            var target = new ListBox
+            {
+                Template = ListBoxTemplate(),
+                Items = items,
+                ItemTemplate = new FuncDataTemplate<string>(x => new TextBlock { Width = 20, Height = 10 }),
+                SelectedIndex = 0,
+            };
+
+            Prepare(target);
+
+            items.Clear();
+            items.AddRange(Enumerable.Range(0, 11).Select(x => $"Item {x}"));
+            items.Remove("Item 2");
+
+            Assert.Equal(
+                items,
+                target.Presenter.Panel.Children.Cast<ListBoxItem>().Select(x => (string)x.Content));
         }

         private FuncControlTemplate ListBoxTemplate()


Fix flipped operator in random data generator (#5446)

--- ToolBox/RandomDataGenerator/RandomDataGeneratorProgram.cs
+++ ToolBox/RandomDataGenerator/RandomDataGeneratorProgram.cs
@@ -131,7 +131,7 @@
                 var tickHistory = tickGenerator.GenerateTicks(symbol).ToList();

                 // Companies rarely IPO then disappear within 6 months
-                if (willBeDelisted && tickHistory.Select(tick => tick.Time.Month).Distinct().Count() >= 6)
+                if (willBeDelisted && tickHistory.Select(tick => tick.Time.Month).Distinct().Count() <= 6)
                 {
                     willBeDelisted = false;
                 }


Testing of examples. Commented out examples in Program class.

--- ISAAR.MSolve.SamplesConsole/Program.cs
+++ ISAAR.MSolve.SamplesConsole/Program.cs
@@ -42,12 +42,7 @@
             //CantileverExampleNL.Cantilever2DExample();
             //CantileverExampleOneElement.Cantilever2DExample();
             //TrussExample.Truss2DExample();
-            TwoBlocksInContactExample.Two3DBlocksInContact();
-
-            //Console.WriteLine();
-            //Vector<double> v1 = new Vector<double>(new double[] { 3, 4, 7 });
-            //Vector<double> v2 = new Vector<double>(new double[] { 2, 8, 1 });
-            //Vector<double> v3 = Vector<double>.CrossProductInR3(v1, v2);
+            //TwoBlocksInContactExample.Two3DBlocksInContact();

         }


* More work on serializing exceptions

* More work on serializing exceptions

--- NotV1SupportedException.cs
+++ NotV1SupportedException.cs
@@ -11,7 +11,7 @@
 	/// Abstract class for throwing a method specific exception.
 	/// </summary>
 	[System.Diagnostics.DebuggerStepThrough, Serializable]
-	public abstract class TSNotSupportedException : Exception, ISerializable
+	public abstract class TSNotSupportedException : Exception
 	{
 		/// <summary>Defines the minimum supported version for the action not allowed by this exception.</summary>
 		protected TaskCompatibility min;
@@ -25,6 +25,8 @@
 		protected TSNotSupportedException(SerializationInfo serializationInfo, StreamingContext streamingContext)
 			: base(serializationInfo, streamingContext)
 		{
+			try { min = (TaskCompatibility)serializationInfo.GetValue("min", typeof(TaskCompatibility)); }
+			catch { min = TaskCompatibility.V1; }
 		}

 		internal TSNotSupportedException(TaskCompatibility minComp)
@@ -75,6 +77,12 @@
 	[System.Diagnostics.DebuggerStepThrough, Serializable]
 	public class NotV1SupportedException : TSNotSupportedException
 	{
+		/// <summary>
+		/// Initializes a new instance of the <see cref="NotV1SupportedException" /> class.
+		/// </summary>
+		/// <param name="serializationInfo">The serialization information.</param>
+		/// <param name="streamingContext">The streaming context.</param>
+		protected NotV1SupportedException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) { }
 		internal NotV1SupportedException() : base(TaskCompatibility.V2) { }
 		internal NotV1SupportedException(string message) : base(message, TaskCompatibility.V2) { }
 		internal override string LibName => "Task Scheduler 1.0";
@@ -86,11 +94,16 @@
 	[System.Diagnostics.DebuggerStepThrough, Serializable]
 	public class NotV2SupportedException : TSNotSupportedException
 	{
+		/// <summary>
+		/// Initializes a new instance of the <see cref="NotV1SupportedException" /> class.
+		/// </summary>
+		/// <param name="serializationInfo">The serialization information.</param>
+		/// <param name="streamingContext">The streaming context.</param>
+		protected NotV2SupportedException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) { }
 		internal NotV2SupportedException() : base(TaskCompatibility.V1) { }
 		internal NotV2SupportedException(string message) : base(message, TaskCompatibility.V1) { }
 		internal override string LibName => "Task Scheduler 2.0 (1.2)";
 	}
-

 	/// <summary>
 	/// Thrown when the calling method is not supported by Task Scheduler versions prior to the one specified.
@@ -98,8 +111,13 @@
 	[System.Diagnostics.DebuggerStepThrough, Serializable]
 	public class NotSupportedPriorToException : TSNotSupportedException
 	{
+		/// <summary>
+		/// Initializes a new instance of the <see cref="NotV1SupportedException" /> class.
+		/// </summary>
+		/// <param name="serializationInfo">The serialization information.</param>
+		/// <param name="streamingContext">The streaming context.</param>
+		protected NotSupportedPriorToException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) { }
 		internal NotSupportedPriorToException(TaskCompatibility supportedVersion) : base(supportedVersion) { }
 		internal override string LibName => $"Task Scheduler versions prior to 2.{((int)min) - 2} (1.{(int)min})";
 	}
-
 }


Fix bug in VersionComparer class

Fix bug in VersionComparer class

--- src/SemanticVersion/VersionComparer.cs
+++ src/SemanticVersion/VersionComparer.cs
@@ -7,7 +7,7 @@
         /// <inheritdoc/>
         public bool Equals(SemanticVersion left, SemanticVersion right)
         {
-            return left.Compare(left, right) == 0;
+            return this.Compare(left, right) == 0;
         }

         /// <inheritdoc/>


chores: minor change

chores: minor change


Exclude hydrogen thrusts from power calculation

Hydrogen reports power but it's not real power consumption

--- BARABAS.cs
+++ BARABAS.cs
@@ -1756,6 +1756,11 @@
 }

 Decimal getBlockPowerUse(IMyTerminalBlock block) {
+	// Hydrogen thrusters don't use power but still report it
+	string typename = (block as IMyCubeBlock).BlockDefinition.ToString();
+	if (typename.Contains("HydrogenThrust")) {
+		return 0;
+	}
 	var power_regex = new System.Text.RegularExpressions.Regex("Max Required Input: ([\\d\\.]+) (\\w?)W");
 	var cur_regex = new System.Text.RegularExpressions.Regex("Current Input: ([\\d\\.]+) (\\w?)W");
 	var power_match = power_regex.Match(block.DetailedInfo);


Refactored test run results into a dedicated class TestRunResult

The intention is to move complex test verification logic into it later on

--- tests/FixieSpec.Tests/FixieSpecConventionTests.cs
+++ tests/FixieSpec.Tests/FixieSpecConventionTests.cs
@@ -18,47 +18,57 @@
         {
             var testRunResult = Run<SimpleSuccessfullSpecification>();

-            testRunResult.Count.ShouldBe(1);
-            testRunResult.OfType<PassResult>().Count().ShouldBe(1);
-            testRunResult.OfType<FailResult>().Count().ShouldBe(0);
+            testRunResult.CaseResults.Count.ShouldBe(1);
+            testRunResult.CaseResults.OfType<PassResult>().Count().ShouldBe(1);
+            testRunResult.CaseResults.OfType<FailResult>().Count().ShouldBe(0);
         }

         public void ShouldExecuteSimpleFailingSpecification()
         {
             var testRunResult = Run<SimpleFailingSpecification>();

-            testRunResult.Count.ShouldBe(1);
-            testRunResult.OfType<FailResult>().Count().ShouldBe(1);
-            testRunResult.OfType<PassResult>().Count().ShouldBe(0);
+            testRunResult.CaseResults.Count.ShouldBe(1);
+            testRunResult.CaseResults.OfType<FailResult>().Count().ShouldBe(1);
+            testRunResult.CaseResults.OfType<PassResult>().Count().ShouldBe(0);
         }

         public void ShouldExecuteSpecificationWithMultipleVerificationSteps()
         {
             var testRunResult = Run<MultipleVerificationStepsSpecification>();

-            testRunResult.Count.ShouldBe(2);
-            testRunResult.OfType<PassResult>().Count().ShouldBe(2);
-            testRunResult.OfType<FailResult>().Count().ShouldBe(0);
+            testRunResult.CaseResults.Count.ShouldBe(2);
+            testRunResult.CaseResults.OfType<PassResult>().Count().ShouldBe(2);
+            testRunResult.CaseResults.OfType<FailResult>().Count().ShouldBe(0);
         }

         public void ShouldExecuteMultipleVerificationStepsInOrder()
         {
             var testRunResult = Run<MultipleVerificationStepsSpecification>();

-            testRunResult.First().MethodGroup.Method.ShouldBe(
+            testRunResult.CaseResults.First().MethodGroup.Method.ShouldBe(
                 SymbolExtensions.GetMethodInfo<MultipleVerificationStepsSpecification>(c => c.Then_a_test_result_can_be_verified()).Name);

-            testRunResult.Last().MethodGroup.Method.ShouldBe(
+            testRunResult.CaseResults.Last().MethodGroup.Method.ShouldBe(
                 SymbolExtensions.GetMethodInfo<MultipleVerificationStepsSpecification>(c => c.Then_another_test_result_can_be_verified()).Name);
         }

-        static List<CaseResult> Run<TSampleTestClass>()
+        static TestRunResult Run<TSampleTestClass>()
         {
             var listener = new StubCaseResultListener();

             typeof(TSampleTestClass).Run(listener, new FixieSpecConvention());

-            return listener.Log;
+            return new TestRunResult(listener.Log);
+        }
+
+        class TestRunResult
+        {
+            public TestRunResult(List<CaseResult> caseResults)
+            {
+                CaseResults = caseResults;
+            }
+
+            public List<CaseResult> CaseResults { get; private set; }
         }

         class SimpleSuccessfullSpecification


don't load view when no inspector, makes binding expressions a bit nicer.

--- InspectR/Views/InspectR/Inspect.cshtml
+++ InspectR/Views/InspectR/Inspect.cshtml
@@ -6,14 +6,19 @@
 @section menu {
     <form class="nav navbar-form" action="@Url.InspectR().Log(Model.InspectorInfo.UniqueKey)">

-        <input id="logurl" class="span4" type="text" data-bind="value: '@Html.Raw(FullUrl)'.replace('xXx', Inspector().UniqueKey())" value="@FullUrl" readonly="readonly" id="inspectorurl" style="cursor: text">
+        <input id="inspectorurl" class="span4" type="text" data-bind="value: '@Html.Raw(FullUrl)'.replace('xXx', Inspector().UniqueKey())" value="@FullUrl" readonly="readonly" style="cursor: text">
         <button id="copyinspectorurl" class="btn" type="button">Copy</button>
-        Visit
+        Visit
         @*POST*@

     </form>
 }
-

+

+

+
Preparing HTTP Request interface...

+

+

+

Incoming HTTP requests

@@ -68,8 +73,8 @@

-

-
+

+


TestConsumerRequeueNoBackoff: update timing

--- NsqSharp.Tests/MockTest.cs
+++ NsqSharp.Tests/MockTest.cs
@@ -136,7 +136,7 @@
             bool timeout = false;
             Select
                 .CaseReceive(n.exitChan, o => { })
-                .CaseReceive(Time.After(TimeSpan.FromMilliseconds(2500)), o => { timeout = true; })
+                .CaseReceive(Time.After(TimeSpan.FromMilliseconds(3500)), o => { timeout = true; })
                 .NoDefault();

             Assert.IsFalse(timeout, "timeout");


Remove dead code and comment out debug code

--- src/SetupCustomActions/CustomAction.cs
+++ src/SetupCustomActions/CustomAction.cs
@@ -14,7 +14,8 @@
             string exceptionMessage = null;
             bool resetKeyboard = false;

-            MessageBox.Show("Custom Action", "Begin!");
+            // Uncomment for debugging
+            //MessageBox.Show("Custom Action", "Begin!");
             session.Log("Begin Data Science profile import action");

             string ideFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Microsoft Visual Studio 14.0\Common7\IDE\");
@@ -52,11 +53,5 @@
             session.Log("End Data Science profile import action");
             return actionResult;
         }
-
-        private static ActionResult RunVs(Session session, string ideFolder, string settingsFilePath) {
-            ActionResult result = ActionResult.Success;
-
-            return result;
-        }
     }
 }


fix: Fixed name of the entitlements file

--- Assets/Adjust/Editor/AdjustEditor.cs
+++ Assets/Adjust/Editor/AdjustEditor.cs
@@ -301,7 +301,7 @@

     private static void AddUniversalLinkDomains(PBXProject project, string xCodeProjectPath, string xCodeTarget)
     {
-        string entitlementsFileName = "entitlements_app.entitlements";
+        string entitlementsFileName = "Unity-iPhone.entitlements";
         string targetName = "Unity-iPhone";

         Debug.Log("[Adjust]: Adding associated domains to app_entitlements file.");


Kick off MSI Setup

Kick off MSI Setup

--- src/Shimmer.WiXUi/WixUiBootstrapper.cs
+++ src/Shimmer.WiXUi/WixUiBootstrapper.cs
@@ -162,6 +162,8 @@
             });

             wixEvents.ErrorObs.Subscribe(eventArgs => UserError.Throw("An installation error has occurred: " + eventArgs.ErrorMessage));
+
+            wixEvents.Engine.Detect();
         }

         UserError convertHResultToError(int status)


Pass sequence as an out var to blocking calls

--- IronSmarkets/Clients/SmarketsClient.cs
+++ IronSmarkets/Clients/SmarketsClient.cs
@@ -54,9 +54,9 @@
         ulong RequestOrdersForAccount();
         ulong RequestOrdersForMarket(Uuid market);

-        IEventMap RequestEvents(EventQuery query);
-        AccountState GetAccountState();
-        AccountState GetAccountState(Uuid account);
+        IEventMap RequestEvents(EventQuery query, out ulong sequence);
+        AccountState GetAccountState(out ulong sequence);
+        AccountState GetAccountState(Uuid account, out ulong sequence);
     }

     internal sealed class SyncRequest<T>
@@ -270,6 +270,12 @@

         public IEventMap RequestEvents(EventQuery query)
         {
+            ulong sequence;
+            return RequestEvents(query, out sequence);
+        }
+
+        public IEventMap RequestEvents(EventQuery query, out ulong sequence)
+        {
             if (IsDisposed)
                 throw new ObjectDisposedException(
                     "SmarketsClient",
@@ -281,23 +287,35 @@
             };

             SendPayload(payload);
-            var seq = payload.EtoPayload.Seq;
+            sequence = payload.EtoPayload.Seq;
             var req = new SyncRequest<Proto.Seto.Events>();
-            _eventsRequests[seq] = req;
+            _eventsRequests[sequence] = req;
             return EventMap.FromSeto(req.Response);
         }

         public AccountState GetAccountState()
         {
+            ulong sequence;
+            return GetAccountState(out sequence);
+        }
+
+        public AccountState GetAccountState(out ulong sequence)
+        {
             if (IsDisposed)
                 throw new ObjectDisposedException(
                     "SmarketsClient",
                     "Called GetAccount on disposed object");

-            return GetAccountState(new Proto.Seto.AccountStateRequest());
+            return GetAccountState(new Proto.Seto.AccountStateRequest(), out sequence);
         }

         public AccountState GetAccountState(Uuid account)
+        {
+            ulong sequence;
+            return GetAccountState(account, out sequence);
+        }
+
+        public AccountState GetAccountState(Uuid account, out ulong sequence)
         {
             if (IsDisposed)
                 throw new ObjectDisposedException(
@@ -307,19 +325,21 @@
             return GetAccountState(
                 new Proto.Seto.AccountStateRequest {
                     Account = account.ToUuid128()
-                });
-        }
-
-        private AccountState GetAccountState(Proto.Seto.AccountStateRequest request)
+                }, out sequence);
+        }
+
+        private AccountState GetAccountState(
+            Proto.Seto.AccountStateRequest request,
+            out ulong sequence)
         {
             var payload = new Proto.Seto.Payload {
                 Type = Proto.Seto.PayloadType.PAYLOADACCOUNTSTATEREQUEST,
                 AccountStateRequest = request
             };
             SendPayload(payload);
-            var seq = payload.EtoPayload.Seq;
+            sequence = payload.EtoPayload.Seq;
             var req = new SyncRequest<Proto.Seto.AccountState>();
-            _accountRequests[seq] = req;
+            _accountRequests[sequence] = req;
             return AccountState.FromSeto(req.Response);
         }


multiple

multiple

* Moved more language strings to TwitchPlaysSettings
* Removed /me from all language strings by default.

--- Assets/Scripts/TwitchPlaySettings.cs
+++ Assets/Scripts/TwitchPlaySettings.cs
@@ -56,30 +56,42 @@

     public string DoYouEvenPlayBro = "FailFish {0}, do you even play this game?";

-    public string TurnBombOnSolve = "/me Turning to the other side when Module {0} ({1}) is solved";
-    public string CancelBombTurn = "/me Bomb turn on Module {0} ({1}) solve cancelled";
-
-    public string ModuleClaimed = "/me {1} has claimed Module {0} ({2}).";
-    public string ModuleUnclaimed = "/me {1} has released Module {0} ({2}).";
-
-    public string AssignModule = "/me Module {0} ({3}) assigned to {1} by {2}";
-    public string ModuleReady = "/me {1} says module {0} ({2}) is ready to be submitted";
-
-    public string TakeModule = "/me @{0}, {1} wishes to take Module {2} ({3}). It will be freed up in one minute unless you type !{2} mine.";
-    public string TakeInProgress = "/me Sorry @{0}, There is already a takeover attempt for Module {1} ({2}) in progress.";
-    public string ModuleAbandoned = "/me {1} has released Module {0} ({2}).";
-    public string ModuleIsMine = "/me {0} confirms he/she is still working on {1} ({2})";
+    public string TurnBombOnSolve = "Turning to the other side when Module {0} ({1}) is solved";
+    public string CancelBombTurn = "Bomb turn on Module {0} ({1}) solve cancelled";
+
+    public string ModuleClaimed = "{1} has claimed Module {0} ({2}).";
+    public string ModuleUnclaimed = "{1} has released Module {0} ({2}).";
+
+    public string AssignModule = "Module {0} ({3}) assigned to {1} by {2}";
+    public string ModuleReady = "{1} says module {0} ({2}) is ready to be submitted";
+
+    public string TakeModule = "@{0}, {1} wishes to take Module {2} ({3}). It will be freed up in one minute unless you type !{2} mine.";
+    public string TakeInProgress = "Sorry @{0}, There is already a takeover attempt for Module {1} ({2}) in progress.";
+    public string ModuleAbandoned = "{1} has released Module {0} ({2}).";
+    public string ModuleIsMine = "{0} confirms he/she is still working on {1} ({2})";
     public string TooManyClaimed = "ItsBoshyTime Sorry, {0}, you may only have {1} claimed modules.";
-    public string ModulePlayer = "/me Module {0} ({2}) was claimed by {1}";
-    public string AlreadyClaimed = "/me Sorry @{2}, Module {0} ({3}) is currently claimed by {1}.  If you think they have abandoned it, you may type !{0} take to free it up.";
+    public string ModulePlayer = "Module {0} ({2}) was claimed by {1}";
+    public string AlreadyClaimed = "Sorry @{2}, Module {0} ({3}) is currently claimed by {1}.  If you think they have abandoned it, you may type !{0} take to free it up.";

     public string OwnedModule = "({0} - \"{1}\")";
-    public string OwnedModuleList = "/me @{0}, your claimed modules are {1}";
-    public string NoOwnedModules = "/me Sorry @{0}, you have no claimed modules.";
+    public string OwnedModuleList = "@{0}, your claimed modules are {1}";
+    public string NoOwnedModules = "Sorry @{0}, you have no claimed modules.";

     public string TwitchPlaysDisabled = "Sorry @{0}, Twitch plays is only enabled for Authorized defusers";
     public string MissionBinderDisabled = "Sorry @{0}, Only authorized users may access the mission binder";
     public string FreePlayDisabled = "Sorry @{0}, Only authorized user may access the freeplay briefcase";
+    public string RetryInactive = "Sorry, retry is inactive.  Returning to hallway instead.";
+
+    public string AddedUserPower = "Added {0} as {1}";
+    public string CantRemoveSelf = "Sorry @{0}, you Can't remove yourself as Super User.";
+    public string RemoveUserPower = "Removed {0} from {1}";
+
+    public string BombHelp = "The Bomb: !bomb hold [pick up] | !bomb drop | !bomb turn [turn to the other side] | !bomb edgework [show the widgets on the sides] | !bomb top [show one side; sides are Top/Bottom/Left/Right | !bomb time [time remaining] | !bomb timestamp [bomb start time]";
+    public string BlankBombEdgework = "Not set, use !edgework <edgework> to set!\nUse !bomb edgework or !bomb edgework 45 to view the bomb edges.";
+    public string BombEdgework = "Edgework: {0}";
+    public string BombTimeRemaining = "panicBasket [{0}] out of [{1}].";
+    public string BombTimeStamp = "The Date/Time this bomb started is {0:F}";
+    public string BombDetonateCommand = "panicBasket This bomb's gonna blow!";

     private bool ValidateString(ref string input, string def, int parameters)
     {
@@ -156,6 +168,18 @@
         valid &= ValidateString(ref TwitchPlaysDisabled, data.TwitchPlaysDisabled, 1);
         valid &= ValidateString(ref MissionBinderDisabled, data.MissionBinderDisabled, 1);
         valid &= ValidateString(ref FreePlayDisabled, data.FreePlayDisabled, 1);
+        valid &= ValidateString(ref RetryInactive, data.RetryInactive, 0);
+
+        valid &= ValidateString(ref AddedUserPower, data.AddedUserPower, 2);
+        valid &= ValidateString(ref CantRemoveSelf, data.CantRemoveSelf, 1);
+        valid &= ValidateString(ref RemoveUserPower, data.RemoveUserPower, 2);
+
+        valid &= ValidateString(ref BombHelp, data.BombHelp, 0);
+        valid &= ValidateString(ref BlankBombEdgework, data.BlankBombEdgework, 0);
+        valid &= ValidateString(ref BombEdgework, data.BombEdgework, 1);
+        valid &= ValidateString(ref BombTimeRemaining, data.BombTimeRemaining, 2);
+        valid &= ValidateString(ref BombTimeStamp, data.BombTimeStamp, 1);
+        valid &= ValidateString(ref BombDetonateCommand, data.BombDetonateCommand, 0);

         return valid;
     }
@@ -163,7 +187,7 @@

 public static class TwitchPlaySettings
 {
-    public static int SettingsVersion = 7;  //Bump this up each time a new setting is added.
+    public static int SettingsVersion = 8;  //Bump this up each time a new setting is added.
     public static TwitchPlaySettingsData data;

     private static List<string> Players = new List<string>();


Yet another to try to debug the CI

Yet another to try to debug the CI

--- src/SoapCore/SoapEndpointMiddleware.cs
+++ src/SoapCore/SoapEndpointMiddleware.cs
@@ -809,13 +809,12 @@
 				throw new Exception("xsd request must contain .xsd");
 			}

+			string path = System.IO.Directory.GetCurrentDirectory();
+			string safePath = path + Path.DirectorySeparatorChar + meta.XsdFolder + Path.DirectorySeparatorChar + xsdfile;
+			string xsd = meta.ReadLocalFile(safePath);
 			byte[] data2 = System.Text.Encoding.UTF8.GetBytes("TEST");
 			await httpContext.Response.Body.WriteAsync(data2, 0, data2.Length);
 			return;
-
-			string path = System.IO.Directory.GetCurrentDirectory();
-			string safePath = path + Path.DirectorySeparatorChar + meta.XsdFolder + Path.DirectorySeparatorChar + xsdfile;
-			string xsd = meta.ReadLocalFile(safePath);
 			string modifiedxsd = meta.ModifyXSDAddRightSchemaPath(xsd);

 			//we should use text/xml in wsdl page for browser compability.


Tidy up

Tidy up

--- JetBlack.Bloomberg/BloombergWrapper.cs
+++ JetBlack.Bloomberg/BloombergWrapper.cs
@@ -8,8 +8,6 @@
 {
     public class BloombergWrapper
     {
-        #region Events
-
         public event DataReceivedEventHandler OnDataReceived;
         public event HistoricalDataReceivedEventHandler OnHistoricalDataReceived;
         public event IntradayBarReceivedEventHandler OnIntradayBarReceived;
@@ -24,56 +22,16 @@
         public event AuthenticationEventHandler OnAuthenticationStatus;
         public event AuthenticationErrorEventHandler OnAuthorisationError;

-        #endregion
-
-        #region Private Fields
-
         private readonly Session _session;
         private Service _mktDataService, _refDataService;
         private readonly Dictionary<CorrelationID, ICollection<string>> _requestMap = new Dictionary<CorrelationID, ICollection<string>>();
         private readonly IAuthenticator _authenticator;
-        private string _uuid;

         private readonly Dictionary<CorrelationID, IList<IntradayTickData>> _intradayTickDataCache = new Dictionary<CorrelationID, IList<IntradayTickData>>();
         private readonly Dictionary<CorrelationID, IList<IntradayBar>> _intradayBarCache = new Dictionary<CorrelationID, IList<IntradayBar>>();

         private int _lastCorrelationId;

-        #endregion
-
-        #region Element Names
-
-        private static readonly Name Category = new Name("category");
-        private static readonly Name Code = new Name("code");
-        private static readonly Name Description = new Name("description");
-        private static readonly Name ErrorInfo = new Name("errorInfo");
-        private static readonly Name ErrorCode = new Name("errorCode");
-        private static readonly Name Exceptions = new Name("exceptions");
-        private static readonly Name FieldData = new Name("fieldData");
-        private static readonly Name FieldExceptions = new Name("fieldExceptions");
-        private static readonly Name FieldId = new Name("fieldId");
-        private static readonly Name Message = new Name("message");
-        private static readonly Name Reason = new Name("reason");
-        private static readonly Name ResponseError = new Name("responseError");
-        private static readonly Name Security = new Name("security");
-        private static readonly Name SecurityData = new Name("securityData");
-        private static readonly Name SecurityError = new Name("securityError");
-        private static readonly Name Source = new Name("source");
-        private static readonly Name SubCategory = new Name("subcategory");
-        private static readonly Name TickData = new Name("tickData");
-
-        private static readonly Name ReferenceDataResponse = new Name("ReferenceDataResponse");
-        private static readonly Name HistoricalDataResponse = new Name("HistoricalDataResponse");
-        private static readonly Name IntradayTickResponse = new Name("IntradayTickResponse");
-        private static readonly Name IntradayBarResponse = new Name("IntradayBarResponse");
-
-        private static readonly Name AuthorizationFailure = new Name("AuthorizationFailure");
-        private static readonly Name AuthorizationSuccess = new Name("AuthorizationSuccess");
-
-        #endregion
-
-        #region Constructors
-
         public BloombergWrapper()
             : this(null, 0, null, null)
         {
@@ -87,7 +45,7 @@
         public BloombergWrapper(string serverHostname, int serverPort, string clientHostname, string uuid)
         {
             var sessionOptions = new SessionOptions();
-            _uuid = uuid;
+
             if (serverHostname == null)
             {
                 sessionOptions.ClientMode = SessionOptions.ClientModeType.DAPI;
@@ -116,8 +74,6 @@

             _lastCorrelationId = 0;
         }
-
-        #endregion

         #region Public Methods

@@ -313,40 +269,33 @@
             }
         }

-        private void ProcessAuthorisationMessage(Message m)
-        {
-            if (m.MessageType.Equals(AuthorizationFailure))
-            {
+        private void ProcessAuthorisationMessage(Message message)
+        {
+            if (message.MessageType.Equals(ElementNames.AuthorizationFailure))
                 OnAuthenticationStatus(false);
-            }
-            else if (m.MessageType.Equals(AuthorizationSuccess))
-            {
+            else if (message.MessageType.Equals(ElementNames.AuthorizationSuccess))
                 OnAuthenticationStatus(true);
-            }
             else
-            {
                 OnAuthenticationStatus(false);
-            }
         }

         private void ProcessAdminMessage(Event e)
         {
-            if (e.IsValid)
-            {
-                foreach (var m in e.GetMessages())
-                {
-                    switch (m.MessageType.ToString())
-                    {
-                        case "SlowConsumerWarning":
-                            NotifyAdminStatus(AdminStatus.SlowConsumerWarning);
-                            break;
-                        case "SlowConsumerWarningCleared":
-                            NotifyAdminStatus(AdminStatus.SlowConsumerWarningCleared);
-                            break;
-                        default:
-                            Trace.TraceWarning("unknown message type {0}", m.MessageType);
-                            break;
-                    }
+            if (!e.IsValid) return;
+
+            foreach (var message in e.GetMessages())
+            {
+                switch (message.MessageType.ToString())
+                {
+                    case "SlowConsumerWarning":
+                        NotifyAdminStatus(AdminStatus.SlowConsumerWarning);
+                        break;
+                    case "SlowConsumerWarningCleared":
+                        NotifyAdminStatus(AdminStatus.SlowConsumerWarningCleared);
+                        break;
+                    default:
+                        Trace.TraceWarning("unknown message type {0}", message.MessageType);
+                        break;
                 }
             }
         }
@@ -361,15 +310,15 @@

             foreach (var m in e.GetMessages())
             {
-                if (m.MessageType.Equals(AuthorizationFailure) || m.MessageType.Equals(AuthorizationSuccess))
+                if (m.MessageType.Equals(ElementNames.AuthorizationFailure) || m.MessageType.Equals(ElementNames.AuthorizationSuccess))
                     ProcessAuthorisationMessage(m);
-                if (m.MessageType.Equals(IntradayBarResponse))
+                if (m.MessageType.Equals(ElementNames.IntradayBarResponse))
                     ProcessIntradayBarResponse(m, isPartialResponse);
-                else if (m.MessageType.Equals(IntradayTickResponse))
+                else if (m.MessageType.Equals(ElementNames.IntradayTickResponse))
                     ProcessIntradayTickResponse(m, isPartialResponse);
-                else if (m.MessageType.Equals(HistoricalDataResponse))
+                else if (m.MessageType.Equals(ElementNames.HistoricalDataResponse))
                     ProcessHistoricalDataResponse(m, isPartialResponse);
-                else if (m.MessageType.Equals(ReferenceDataResponse))
+                else if (m.MessageType.Equals(ElementNames.ReferenceDataResponse))
                     ProcessReferenceDataResponse(m, isPartialResponse);
             }
         }
@@ -397,12 +346,12 @@
             }
         }

-        private IList<int> ExtractEids(Element eidDataElement)
+        private static IList<int> ExtractEids(Element eidDataElement)
         {
             var eids = new List<int>();
-            for (int i = 0; i < eidDataElement.NumValues; ++i)
-            {
-                int eid = eidDataElement.GetValueAsInt32(i);
+            for (var i = 0; i < eidDataElement.NumValues; ++i)
+            {
+                var eid = eidDataElement.GetValueAsInt32(i);
                 eids.Add(eid);
             }
             return eids;
@@ -410,27 +359,27 @@

         private bool AssertResponseError(Message m, string name)
         {
-            if (!m.HasElement(ResponseError)) return false;
-            OnNotifyErrorResponse(name, m.MessageType.ToString(), string.Format("RESPONSE_ERROR: {0}", m.GetElement(ResponseError)));
+            if (!m.HasElement(ElementNames.ResponseError)) return false;
+            OnNotifyErrorResponse(name, m.MessageType.ToString(), string.Format("RESPONSE_ERROR: {0}", m.GetElement(ElementNames.ResponseError)));
             return true;
         }

-        private Element ExtractEidElement(Element parent)
+        private static Element ExtractEidElement(Element parent)
         {
             return parent.HasElement("eidData") ? parent.GetElement("eidData") : null;
         }

-        private void ProcessIntradayBarResponse(Message m, bool isPartialResponse)
-        {
-            var ticker = ExtractTicker(m.CorrelationID, isPartialResponse);
-            if (AssertResponseError(m, ticker)) return;
-
-            var barData = m.GetElement("barData");
+        private void ProcessIntradayBarResponse(Message message, bool isPartialResponse)
+        {
+            var ticker = ExtractTicker(message.CorrelationID, isPartialResponse);
+            if (AssertResponseError(message, ticker)) return;
+
+            var barData = message.GetElement("barData");
             var barTickData = barData.GetElement("barTickData");

-            if (!_intradayBarCache.ContainsKey(m.CorrelationID))
-                _intradayBarCache.Add(m.CorrelationID, new List<IntradayBar>());
-            var intradayBars = _intradayBarCache[m.CorrelationID];
+            if (!_intradayBarCache.ContainsKey(message.CorrelationID))
+                _intradayBarCache.Add(message.CorrelationID, new List<IntradayBar>());
+            var intradayBars = _intradayBarCache[message.CorrelationID];

             var eidDataElement = ExtractEidElement(barData);

@@ -452,11 +401,11 @@

             if (!isPartialResponse)
             {
-                _intradayBarCache.Remove(m.CorrelationID);
-                if (_authenticator.Permits(eidDataElement, m.Service))
+                _intradayBarCache.Remove(message.CorrelationID);
+                if (_authenticator.Permits(eidDataElement, message.Service))
                     NotifyIntradayBarReceived(ticker, intradayBars, ExtractEids(eidDataElement));
                 else
-                    NotifyAuthenticationError(ticker, m.MessageType.ToString(), ExtractEids(eidDataElement));
+                    NotifyAuthenticationError(ticker, message.MessageType.ToString(), ExtractEids(eidDataElement));
             }
         }

@@ -493,7 +442,6 @@
             if (!isPartialResponse)
             {
                 _intradayTickDataCache.Remove(m.CorrelationID);
-                var missingEntitlements = new List<int>();
                 if (_authenticator.Permits(eidDataElement, m.Service))
                     NotifyIntradayTickDataReceived(ticker, intradayTickData, ExtractEids(eidDataElement));
                 else
@@ -501,17 +449,17 @@
             }
         }

-        private void ProcessHistoricalDataResponse(Message m, bool isPartialResponse)
-        {
-            if (m.HasElement(ResponseError))
-            {
-                Trace.TraceInformation("RESPONSE_ERROR: {0}", m.GetElement(ResponseError));
+        private void ProcessHistoricalDataResponse(Message message, bool isPartialResponse)
+        {
+            if (message.HasElement(ElementNames.ResponseError))
+            {
+                Trace.TraceInformation("RESPONSE_ERROR: {0}", message.GetElement(ElementNames.ResponseError));
                 return;
             }

-            var securityDataArray = m.GetElement(SecurityData);
-
-            for (int i = 0; i < securityDataArray.NumValues; ++i)
+            var securityDataArray = message.GetElement(ElementNames.SecurityData);
+
+            for (var i = 0; i < securityDataArray.NumValues; ++i)
             {
                 var securityData = securityDataArray.GetElement(i);
                 var ticker = securityData.GetValueAsString();
@@ -522,15 +470,15 @@
                     NotifyResponseStatus(
                         ticker,
                         ResponseStatus.InvalidSecurity,
-                        securityError.GetElement(Source).GetValueAsString(),
-                        securityError.GetElement(Category).GetValueAsString(),
-                        securityError.GetElement(Code).GetValueAsInt32(),
-                        securityError.GetElement(SubCategory).GetValueAsString(),
-                        securityError.GetElement(Message).GetValueAsString());
+                        securityError.GetElement(ElementNames.Source).GetValueAsString(),
+                        securityError.GetElement(ElementNames.Category).GetValueAsString(),
+                        securityError.GetElement(ElementNames.Code).GetValueAsInt32(),
+                        securityError.GetElement(ElementNames.SubCategory).GetValueAsString(),
+                        securityError.GetElement(ElementNames.Message).GetValueAsString());
                     continue;
                 }

-                var fieldDataArray = securityDataArray.GetElement(FieldData);
+                var fieldDataArray = securityDataArray.GetElement(ElementNames.FieldData);

                 var historicalMessageWrapper = new Dictionary<DateTime, IDictionary<string, object>>();

@@ -564,34 +512,34 @@

         private void ProcessReferenceDataResponse(Message m, bool isPartialResponse)
         {
-            if (m.HasElement(ResponseError))
-            {
-                Trace.TraceInformation("RESPONSE_ERROR: {0}", m.GetElement(ResponseError));
+            if (m.HasElement(ElementNames.ResponseError))
+            {
+                Trace.TraceInformation("RESPONSE_ERROR: {0}", m.GetElement(ElementNames.ResponseError));
                 return;
             }

-            var securities = m.GetElement(SecurityData);
+            var securities = m.GetElement(ElementNames.SecurityData);
             for (var i = 0; i < securities.NumValues; ++i)
             {
                 var security = securities.GetValueAsElement(i);
-                var ticker = security.GetElementAsString(Security);
-
-                if (security.HasElement(SecurityError))
-                {
-                    var securityError = security.GetElement(SecurityError);
+                var ticker = security.GetElementAsString(ElementNames.Security);
+
+                if (security.HasElement(ElementNames.SecurityError))
+                {
+                    var securityError = security.GetElement(ElementNames.SecurityError);
                     NotifyResponseStatus(
                         ticker,
                         ResponseStatus.InvalidSecurity,
-                        securityError.GetElement(Source).GetValueAsString(),
-                        securityError.GetElement(Category).GetValueAsString(),
-                        securityError.GetElement(Code).GetValueAsInt32(),
-                        securityError.GetElement(SubCategory).GetValueAsString(),
-                        securityError.GetElement(Message).GetValueAsString());
+                        securityError.GetElement(ElementNames.Source).GetValueAsString(),
+                        securityError.GetElement(ElementNames.Category).GetValueAsString(),
+                        securityError.GetElement(ElementNames.Code).GetValueAsInt32(),
+                        securityError.GetElement(ElementNames.SubCategory).GetValueAsString(),
+                        securityError.GetElement(ElementNames.Message).GetValueAsString());
                     continue;
                 }

                 var messageWrapper = new Dictionary<string, object>();
-                var fields = security.GetElement(FieldData);
+                var fields = security.GetElement(ElementNames.FieldData);
                 for (var j = 0; j < fields.NumElements; ++j)
                 {
                     var field = fields.GetElement(j);
@@ -640,9 +588,9 @@
             {
                 foreach (var m in e.GetMessages())
                 {
-                    if (m.HasElement(Reason))
-                    {
-                        var reason = m.GetElement(Reason);
+                    if (m.HasElement(ElementNames.Reason))
+                    {
+                        var reason = m.GetElement(ElementNames.Reason);

                         var status = SubscriptionStatus.None;

@@ -669,14 +617,14 @@
                             NotifySubscriptionStatus(
                                 m.TopicName,
                                 status,
-                                reason.GetElement(Source).GetValueAsString(),
-                                reason.GetElement(Category).GetValueAsString(),
-                                reason.GetElement(ErrorCode).GetValueAsInt32(),
-                                reason.GetElement(Description).GetValueAsString());
+                                reason.GetElement(ElementNames.Source).GetValueAsString(),
+                                reason.GetElement(ElementNames.Category).GetValueAsString(),
+                                reason.GetElement(ElementNames.ErrorCode).GetValueAsInt32(),
+                                reason.GetElement(ElementNames.Description).GetValueAsString());
                         }
                     }

-                    if (m.HasElement(Exceptions))
+                    if (m.HasElement(ElementNames.Exceptions))
                     {
                         // Field subscription failures
                         var exceptions = m.GetElement("exceptions");
@@ -698,14 +646,14 @@
                             for (var i = 0; i < exceptions.NumValues; ++i)
                             {
                                 var exception = exceptions.GetValueAsElement(i);
-                                var fieldId = exception.GetElement(FieldId).GetValueAsString();
-                                var reason = exception.GetElement(Reason);
-                                var source = reason.GetElement(Source).GetValueAsString();
-                                var category = reason.GetElement(Category).GetValueAsString();
-                                var objSubCategory = reason.GetElement(SubCategory);
+                                var fieldId = exception.GetElement(ElementNames.FieldId).GetValueAsString();
+                                var reason = exception.GetElement(ElementNames.Reason);
+                                var source = reason.GetElement(ElementNames.Source).GetValueAsString();
+                                var category = reason.GetElement(ElementNames.Category).GetValueAsString();
+                                var objSubCategory = reason.GetElement(ElementNames.SubCategory);
                                 var subcategory = (objSubCategory != null ? objSubCategory.ToString() : string.Empty);
-                                var errorCode = reason.GetElement(ErrorCode).GetValueAsInt32();
-                                var desc = reason.GetElement(Description).GetValueAsString();
+                                var errorCode = reason.GetElement(ElementNames.ErrorCode).GetValueAsInt32();
+                                var desc = reason.GetElement(ElementNames.Description).GetValueAsString();

                                 NotifyFieldSubscriptionStatus(
                                     m.TopicName,
@@ -846,5 +794,35 @@
         }

         #endregion
+
+        static class ElementNames
+        {
+            public static readonly Name Category = new Name("category");
+            public static readonly Name Code = new Name("code");
+            public static readonly Name Description = new Name("description");
+            public static readonly Name ErrorInfo = new Name("errorInfo");
+            public static readonly Name ErrorCode = new Name("errorCode");
+            public static readonly Name Exceptions = new Name("exceptions");
+            public static readonly Name FieldData = new Name("fieldData");
+            public static readonly Name FieldExceptions = new Name("fieldExceptions");
+            public static readonly Name FieldId = new Name("fieldId");
+            public static readonly Name Message = new Name("message");
+            public static readonly Name Reason = new Name("reason");
+            public static readonly Name ResponseError = new Name("responseError");
+            public static readonly Name Security = new Name("security");
+            public static readonly Name SecurityData = new Name("securityData");
+            public static readonly Name SecurityError = new Name("securityError");
+            public static readonly Name Source = new Name("source");
+            public static readonly Name SubCategory = new Name("subcategory");
+            public static readonly Name TickData = new Name("tickData");
+
+            public static readonly Name ReferenceDataResponse = new Name("ReferenceDataResponse");
+            public static readonly Name HistoricalDataResponse = new Name("HistoricalDataResponse");
+            public static readonly Name IntradayTickResponse = new Name("IntradayTickResponse");
+            public static readonly Name IntradayBarResponse = new Name("IntradayBarResponse");
+
+            public static readonly Name AuthorizationFailure = new Name("AuthorizationFailure");
+            public static readonly Name AuthorizationSuccess = new Name("AuthorizationSuccess");
+        }
     }
 }


variable renamed because pattern is a filename pattern not a regex pattern

--- AudioAlign/BatchResampler/Program.cs
+++ AudioAlign/BatchResampler/Program.cs
@@ -26,10 +26,10 @@

             Dictionary<FileInfo, double> fileMapping = new Dictionary<FileInfo, double>();

-            foreach (string regex in mapping.Keys)
+            foreach (string fileNamePattern in mapping.Keys)
             {
-                double factor = mapping[regex];
-                foreach (FileInfo fileInfo in indir.EnumerateFiles(regex))
+                double factor = mapping[fileNamePattern];
+                foreach (FileInfo fileInfo in indir.EnumerateFiles(fileNamePattern))
                 {
                     fileMapping.Add(fileInfo, factor);
                 }


Do better at removing leading tabs/spaces.

--- src/SolidGui/Engine/SfmRecordReader.cs
+++ src/SolidGui/Engine/SfmRecordReader.cs
@@ -34,7 +34,7 @@
         private readonly List<char> _enders = new List<char> {' ', '\t', '\r', '\n', '\\', '\0'}; // All chars that end an SFM marker (SFM key)

         private static Regex ReggieLeading = new Regex(
-            @"^[ \t]+", RegexOptions.Multiline | RegexOptions.Compiled | RegexOptions.CultureInvariant);
+            @"^[ \t]+\\", RegexOptions.Compiled | RegexOptions.CultureInvariant);
         private static Regex ReggieTab = new Regex(
             @"\t", RegexOptions.Compiled | RegexOptions.CultureInvariant);
         private static Regex ReggieLx = new Regex(
@@ -424,7 +424,7 @@
             // Start with regex cleanup to remove tabs, and leading spaces -JMC 2013-09
             // JMC: Could also paste these two lines into a toolbar button method that does "plain-text copy" (includes inferred like \+sn but no formatting).
             //   Toolbar button and/or add Ctrl-C to SfmEditorView, _contentsBox_KeyDown .
-            string s = ReggieLeading.Replace(text, "");
+            string s = ReggieLeading.Replace(text, "\\");
             s = ReggieTab.Replace(s, " ");

             var stream = new StringReader(s);


Checkpoint

Checkpoint

Dropped Eai.Setup member because we are satisfied with it being a
dynamic property.

--- src/Splunk.Client/Splunk/Client/Eai.cs
+++ src/Splunk.Client/Splunk/Client/Eai.cs
@@ -55,14 +55,6 @@
             get { return this.GetValue("Attributes", EaiAttributes.Converter.Instance); }
         }

-        /// <summary>
-        ///
-        /// </summary>
-        public string Setup
-        {
-            get { return this.GetValue("Setup", StringConverter.Instance); }
-        }
-
         #endregion
     }
 }


formatting

formatting

--- BitSharp.Blockchain.Test/UtxoTest.cs
+++ BitSharp.Blockchain.Test/UtxoTest.cs
@@ -107,7 +107,6 @@
             Assert.IsFalse(canSpend);
         }

-
         [TestMethod]
         public void TestCanSpend_IndexOutOfRange()
         {