WORKAROUND Oracle: workaround for a bug in Microsoft's OracleClient (latest .NET 3.5 SP1) autocommitting transactions. Set runtime configuration value sooda.oracleClientAutoCommitBugWorkaround to true to enable this workaround.


trying to repair AppVeyor's test runner

trying to repair AppVeyor's test runner

--- tests/OpenMcdf.Test/AssetDeployer.cs
+++ tests/OpenMcdf.Test/AssetDeployer.cs
@@ -1,3 +1,4 @@
+using System;
 using System.IO;
 using NUnit.Framework;

@@ -11,13 +12,17 @@
         {
             Directory.SetCurrentDirectory(TestContext.CurrentContext.WorkDirectory);

+            Console.WriteLine($"Test context working directory: {TestContext.CurrentContext.WorkDirectory}");
+            Console.WriteLine($"Test context test directory: {TestContext.CurrentContext.TestDirectory}");
+
             var codeBaseDir = new DirectoryInfo(TestContext.CurrentContext.TestDirectory);
-            var assetsDir = Path.Combine(codeBaseDir.FullName, "assets");
+            var testAssets = Path.Combine("tests", "assets");
+            var assetsDir = Path.Combine(codeBaseDir.FullName, testAssets);
             while (!Directory.Exists(assetsDir) &&
                    !Path.GetPathRoot(codeBaseDir.FullName).Equals(codeBaseDir.FullName))
             {
                 codeBaseDir = codeBaseDir.Parent;
-                assetsDir = Path.Combine(codeBaseDir.FullName, "assets");
+                assetsDir = Path.Combine(codeBaseDir.FullName, testAssets);
             }

             foreach (var assetPath in Directory.GetFiles(assetsDir))


Format the code

Format the code

--- osu.Game.Rulesets.Osu/Skinning/OsuLegacySkinTransformer.cs
+++ osu.Game.Rulesets.Osu/Skinning/OsuLegacySkinTransformer.cs
@@ -136,7 +136,7 @@
                         case OsuSkinConfiguration.HitCircleOverlayAboveNumber:
                             // Quote from https://osu.ppy.sh/help/wiki/Skinning/skin.ini#%5Bgeneral%5D
                             // Old command: HitCircleOverlayAboveNumer (with typo) still works for legacy support
-                            return source.GetConfig<OsuSkinConfiguration, TValue>(OsuSkinConfiguration.HitCircleOverlayAboveNumber) ?? source.GetConfig<OsuSkinConfiguration, TValue>(OsuSkinConfiguration.HitCircleOverlayAboveNumer);
+                            return source.GetConfig<OsuSkinConfiguration, TValue>(OsuSkinConfiguration.HitCircleOverlayAboveNumber) ?? source.GetConfig<OsuSkinConfiguration, TValue>(OsuSkinConfiguration.HitCircleOverlayAboveNumer);
                     }

                     break;


Fix code inspection

Fix code inspection

--- osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonCirclePiece.cs
+++ osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonCirclePiece.cs
@@ -52,7 +52,7 @@

             EarlyActivationMilliseconds = pre_beat_transition_time;

-            AddRangeInternal(new Drawable[]
+            AddRangeInternal(new[]
             {
                 new Circle
                 {


React to auth changes

React to auth changes

--- test/MusicStore.Test/ManageControllerTest.cs
+++ test/MusicStore.Test/ManageControllerTest.cs
@@ -83,11 +83,11 @@

         private class TestHttpContext : DefaultHttpContext
         {
-            public override Task<IEnumerable<AuthenticationResult>>
-                AuthenticateAsync(IEnumerable<string> authenticationTypes)
+            public override Task<AuthenticationResult>
+                AuthenticateAsync(string authenticationScheme)
             {
                 return
-                    Task.FromResult(new AuthenticateContext(authenticationTypes).Results);
+                    Task.FromResult(new AuthenticateContext(authenticationScheme).Result);
             }
         }
     }


Initial implementation of OBJ exporting of meshes http://i.imgur.com/SIlU30G.png

--- GUI/MainForm.cs
+++ GUI/MainForm.cs
@@ -372,6 +372,7 @@
                             break;
                         }

+                        Invoke(new ExportDel(AddToExport), $"Export {Path.GetFileName(fileName)} as OBJ", fileName, resource);
                         var meshTab = new TabPage("MESH");
                         var mv = new Renderer(mainTabs, fileName, currentPackage);
                         mv.AddMeshObject(new MeshObject { Resource = resource });
@@ -739,6 +740,9 @@
                 case ResourceType.PanoramaStyle:
                     extensions = new[] { "css", "vcss" };
                     break;
+                case ResourceType.Mesh:
+                    extensions = new[] { "obj" };
+                    break;
             }

             //Did we find a format we like?
@@ -794,10 +798,51 @@
                                 var panoramaData = ((Panorama)resource.Blocks[BlockType.DATA]).Data;
                                 stream.Write(panoramaData, 0, panoramaData.Length);
                                 break;
-                        }
-                    }
-                }
-            }
+                            case ResourceType.Mesh:
+                                var mesh = (VBIB)resource.Blocks[BlockType.VBIB];
+                                using (var objStream = new StreamWriter(stream))
+                                {
+                                    objStream.WriteLine($"# vertex buffers {mesh.VertexBuffers.Count}");
+                                    for (var i = 0; i < mesh.VertexBuffers.Count; i++)
+                                    {
+                                        var vertexBuffer = mesh.VertexBuffers[i];
+                                        objStream.WriteLine($"# Vertex Buffer {i}. Count: {vertexBuffer.Count}, Size: {vertexBuffer.Size}");
+                                        for (uint j = 0; j < vertexBuffer.Count; j++)
+                                        {
+                                            foreach (var attribute in vertexBuffer.Attributes)
+                                            {
+                                                switch (attribute.Name)
+                                                {
+                                                    case "POSITION":
+                                                        var posArray = new float[3];
+                                                        Buffer.BlockCopy(vertexBuffer.Buffer, (int)(j * vertexBuffer.Size) + (int)attribute.Offset, posArray, 0, 12);
+                                                        objStream.WriteLine($"v {posArray[0]} {posArray[1]} {posArray[2]}");
+                                                        break;
+                                                }
+                                            }
+                                        }
+                                    }
+
+                                    objStream.WriteLine($"# index buffers {mesh.IndexBuffers.Count}");
+                                    for (var i = 0; i < mesh.IndexBuffers.Count; i++)
+                                    {
+                                        var indexBuffer = mesh.IndexBuffers[i];
+                                        objStream.WriteLine($"# Index Buffer {i}. Count: {indexBuffer.Count}, Size: {indexBuffer.Size}");
+                                        var indexArray = new ushort[indexBuffer.Count];
+                                        Buffer.BlockCopy(indexBuffer.Buffer, 0, indexArray, 0, indexBuffer.Buffer.Length);
+                                        for (var j = 0; j < indexBuffer.Count; j += 3)
+                                        {
+                                            objStream.WriteLine($"f {indexArray[j] + 1} {indexArray[j + 1] + 1} {indexArray[j + 2] + 1}");
+                                        }
+                                    }
+                                }
+
+                                break;
+                        }
+                    }
+                }
+            }
+            Console.WriteLine($"Export requested for {fileName} Complete");
         }
     }
 }


Un-Ignore Skip & Slice tests

Un-Ignore Skip & Slice tests

--- rethinkdb-net-test/MultiObjectTests.cs
+++ rethinkdb-net-test/MultiObjectTests.cs
@@ -402,7 +402,6 @@
         }

         [Test]
-        [Ignore("Causes RethinkDB segfault, issue rethinkdb/rethinkdb#522")]
         public void Skip()
         {
             DoSkip().Wait();
@@ -445,7 +444,6 @@
         }

         [Test]
-        [Ignore("Causes RethinkDB segfault, issue rethinkdb/rethinkdb#522")]
         public void Slice()
         {
             DoSlice().Wait();
@@ -461,12 +459,12 @@
                 if (!await enumerable.MoveNext())
                     break;
                 ++count;
-            }
-            Assert.That(count, Is.EqualTo(1));
-        }
-
-        [Test]
-        [Ignore("Causes RethinkDB segfault, issue rethinkdb/rethinkdb#522")]
+                Assert.That(enumerable.Current.SomeNumber, Is.EqualTo(count + 1));
+            }
+            Assert.That(count, Is.EqualTo(2));
+        }
+
+        [Test]
         public void SliceStartOnly()
         {
             DoSliceStartOnly().Wait();


Removed old unused class IPv4EndPoint

Removed old unused class IPv4EndPoint

--- IPv4EndPoint.cs
+++ IPv4EndPoint.cs
@@ -1,112 +0,0 @@
-#if NETFX_CORE
-using System;
-using Windows.Networking;
-
-namespace FalconUDP
-{
-    /// <summary>
-    /// Replacement for IPEndPoint which is lacking in NETFX_CORE.
-    /// </summary>
-    public class IPv4EndPoint : IEquatable<IPv4EndPoint>
-    {
-        private HostName hostName;
-        private string portAsString;
-        private uint ip;
-        private ushort port;
-        private int hash;
-        private string asString;
-
-        public HostName Address { get { return hostName; } }    //} NETFX_CORE expects these types
-        public string Port { get { return portAsString; } }     //}
-
-        public IPv4EndPoint(string addr, string port)
-        {
-            // Currently we only accept the real deal - raw IPv4 address and port as numbers,
-            // I'm not going to waste flipping time trying to connect to DNS and resolve the
-            // IP. But when we do get around to it: http://msdn.microsoft.com/en-us/library/windows/apps/hh701245.aspx
-            // though that should be done outside this class.
-
-            if (!UInt16.TryParse(port, out this.port))
-            {
-                throw new ArgumentException("Port must be a number between 0 - 65535");
-            }
-
-            if (!TryParseIPv4Address(addr, out this.ip))
-            {
-                throw new ArgumentException("Invalid IPv4 adrress: " + addr);
-            }
-
-            this.hostName = new HostName(addr);
-            this.portAsString = port;
-
-            // Since address and port cannot be modified, i.e. IPv4EndPoint is immutable, calc
-            // the hash and string now and always return those when asked for.
-
-            this.hash = unchecked((int)this.ip) ^ this.port;
-            this.asString = String.Format("{0}:{1}", hostName.CanonicalName, port);
-        }
-
-        public static bool TryParse(string addr, string port, out IPv4EndPoint endPoint)
-        {
-            ushort portNum;
-            if (!UInt16.TryParse(port, out portNum))
-            {
-                endPoint = null;
-                return false;
-            }
-
-            uint ip;
-            if (!TryParseIPv4Address(addr, out ip))
-            {
-                endPoint = null;
-                return false;
-            }
-
-            endPoint = new IPv4EndPoint(addr, port);
-
-            return true;
-        }
-
-        public static bool TryParseIPv4Address(string addr, out uint ip)
-        {
-            ip = 0;
-
-            if (String.IsNullOrWhiteSpace(addr))
-                return false;
-
-            string[] octets = addr.Split('.');
-
-            if (octets.Length != 4)
-                return false;
-
-            byte octet;
-            for (int i = 0; i < 4; i++)
-            {
-                if (!Byte.TryParse(octets[i], out octet))
-                    return false;
-
-                ip |= (uint)(octet << (8*(3-i)));
-            }
-
-            return true;
-        }
-
-        public override int GetHashCode()
-        {
-            return hash;
-        }
-
-        public override string ToString()
-        {
-            return asString;
-        }
-
-        public bool Equals(IPv4EndPoint other)
-        {
-            return this.ip == other.ip && this.port == other.port;
-        }
-
-        // NOTE: We have not overridden Object.Equal(), so that will still be used.
-    }
-}
-#endif


refactor equality comparison into virtual method

--- src/Abp/Runtime/Caching/AbpCacheBase.cs
+++ src/Abp/Runtime/Caching/AbpCacheBase.cs
@@ -45,7 +45,7 @@
                 }

                 var generatedValue = factory(key);
-                if (!EqualityComparer<TValue>.Default.Equals(generatedValue, default))
+                if (!IsDefaultValue(generatedValue))
                 {
                     try
                     {
@@ -99,7 +99,7 @@
                         {
                             var key = keys[i];
                             var generatedValue = factory(key);
-                            if (!EqualityComparer<TValue>.Default.Equals(generatedValue, default))
+                            if (!IsDefaultValue(generatedValue))
                             {
                                 generated.Add(new KeyValuePair<TKey, TValue>(key, generatedValue));
                             }
@@ -122,6 +122,11 @@
             }

             return results.Select(result => result.Value).ToArray();
+        }
+
+        protected virtual bool IsDefaultValue(TValue value)
+        {
+            return EqualityComparer<TValue>.Default.Equals(value, default);
         }

         public virtual async Task<TValue> GetAsync(TKey key, Func<TKey, Task<TValue>> factory)


Skip cuboids until turning one on

Skip cuboids until turning one on

Ignore off cuboids until there's one that's on.

--- src/AdventOfCode/Puzzles/Y2021/Day22.cs
+++ src/AdventOfCode/Puzzles/Y2021/Day22.cs
@@ -35,7 +35,12 @@

         foreach (string instruction in instructions)
         {
-            cuboids.Add(Parse(instruction));
+            var parsed = Parse(instruction);
+
+            if (parsed.TurnOn || cuboids.Count > 0)
+            {
+                cuboids.Add(Parse(instruction));
+            }
         }

         return initialize ? Initialize(cuboids) : Reboot(cuboids);
@@ -217,6 +222,10 @@
             return result;
         }

+        public readonly HashSet<Point3D> ToHashSet() => new(this);
+
+        public readonly long Volume() => (long)Length.X * Length.Y * Length.Z;
+
         public readonly IEnumerator<Point3D> GetEnumerator()
         {
             return Points(this).GetEnumerator();
@@ -241,10 +250,6 @@
         }

         IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
-
-        public readonly HashSet<Point3D> ToHashSet() => new(this);
-
-        public readonly long Volume() => (long)Length.X * Length.Y * Length.Z;

         private readonly IEnumerable<Point3D> Verticies()
         {


Added interaction logic between "Evolve" button and checkboxes in Tab 2

--- src/Biomorpher/BiomorpherWindow.xaml.cs
+++ src/Biomorpher/BiomorpherWindow.xaml.cs
@@ -57,8 +57,8 @@
         //A dictionary, which contains the controls that need to be accessible from other methods after their creation
         private Dictionary<string, FrameworkElement> controls;

-        bool addParents;
-        List<int> selectedParentsIndexes;
+        bool evolve;
+        List<int> selectedParentIndexes;

         // Constructor
@@ -91,8 +91,8 @@
             //UI properties
             parentCount = 0;
             controls = new Dictionary<string, FrameworkElement>();
-            addParents = false;
-            selectedParentsIndexes = new List<int>();
+            evolve = false;
+            selectedParentIndexes = new List<int>();

             //Tab 2: Designs
@@ -207,6 +207,7 @@

                 //Add dockpanel to controls dictionary in order to access and update meshes afterwards (and not recreate the entire grid with checkboxes)
                 controls.Add(dp_name, dp);
+                controls.Add(cb_name, cb);

                 //Set the dockpanel as the child of the border element
                 border.Child = dp;
@@ -320,7 +321,7 @@
             Border border4 = new Border();
             border4.Margin = new Thickness(margin_w, margin_h, margin_w, 0);

-            Button button = createButton("b_tab2_AddParents", "Add parent(s)", Tab2_secondary.Width * 0.5, new RoutedEventHandler(tab2_AddParents_Click));
+            Button button = createButton("b_tab2_Evolve", "Evolve", Tab2_secondary.Width * 0.5, new RoutedEventHandler(tab2_Evolve_Click));

             border4.Child = button;
             sp.Children.Add(border4);
@@ -403,14 +404,45 @@

         //Handle event when the "Add parents" button is clicked in tab 2
-        public void tab2_AddParents_Click(object sender, RoutedEventArgs e)
+        public void tab2_Evolve_Click(object sender, RoutedEventArgs e)
         {
             Button b_clicked = (Button) sender;

-            //To do: Extract indexes from names of checked boxes
-
-            //change toggle
-            addParents = true;
+            //Test if minimum one parent is selected
+            if(ParentCount < 1)
+            {
+                MessageBoxResult message = MessageBox.Show(this, "Select minimum one parent via the checkboxes");
+            }
+            else
+            {
+                //Clear list of selected parent indexes
+                selectedParentIndexes = new List<int>();
+
+                //Extract indexes from names of checked boxes and uncheck all
+                for (int i=0; i<12; i++)
+                {
+                    //The name of the checkbox control
+                    string cb_name = "cb_tab2_" + i;
+
+                    //Get this control from the dictionary
+                    CheckBox cb = (CheckBox) controls[cb_name];
+
+                    if(cb.IsChecked == true)
+                    {
+                        selectedParentIndexes.Add(i);
+                        cb.IsChecked = false;
+                    }
+                }
+
+                //Set parent count to zero
+                ParentCount = 0;
+
+                //Change toggle status
+                evolve = true;
+            }
+
+
+
         }


Integrated current population into performance plots

--- src/Biomorpher/BiomorpherWindow.xaml.cs
+++ src/Biomorpher/BiomorpherWindow.xaml.cs
@@ -1877,7 +1877,32 @@
             PlotCanvas.Children.Clear();
             PlotCanvas2.Children.Clear();

-            int totalGenerations = BioBranches[biobranchID].PopTwigs.Count;
+            // Include existing population
+            int totalGenerations = BioBranches[biobranchID].PopTwigs.Count + 1;
+
+
+            // Find the min and maximums from both current and historic populations
+            List<double> miniP = new List<double>();
+            List<double> maxiP = new List<double>();
+
+            for (int p = 0; p < performanceCount; p++)
+            {
+                miniP.Add(population.Performance_Minimums[p]);
+                maxiP.Add(population.Performance_Maximums[p]);
+
+                if (BioBranches[biobranchID].PopTwigs.Count > 0)
+                {
+                    if (BioBranches[biobranchID].minPerformanceValues[p] < miniP[p])
+                        miniP[p] = BioBranches[biobranchID].minPerformanceValues[p];
+                    if (BioBranches[biobranchID].maxPerformanceValues[p] > maxiP[p])
+                        maxiP[p] = BioBranches[biobranchID].maxPerformanceValues[p];
+
+                }
+
+                // Avoid division by zero
+                if (miniP[p] == maxiP[p]) maxiP[p]++;
+            }
+

             // Set up IDs for performance count
             ComboBox myComboX = (ComboBox)controls["MYCOMBOX"];
@@ -1892,16 +1917,13 @@
                 this.Plot2XName.Text = myComboX.SelectedItem.ToString();
                 this.Plot2YName.Text = myComboY.SelectedItem.ToString();

-                // Check there is anything in there. If this is generation 0 there will not be anything.
-                if (BioBranches[biobranchID].PopTwigs.Count > 0)
-                {
-                    this.MinXName.Text = Friends.AxisLabelText(BioBranches[biobranchID].minPerformanceValues[ParetoXID]);
-                    this.MaxXName.Text = Friends.AxisLabelText(BioBranches[biobranchID].maxPerformanceValues[ParetoXID]);
-
-                    this.MinYName.Text = Friends.AxisLabelText(BioBranches[biobranchID].minPerformanceValues[ParetoYID]);
-                    this.MaxYName.Text = Friends.AxisLabelText(BioBranches[biobranchID].maxPerformanceValues[ParetoYID]);
-                }
-            }
+                this.MinXName.Text = Friends.AxisLabelText(miniP[ParetoXID]);
+                this.MaxXName.Text = Friends.AxisLabelText(maxiP[ParetoXID]);
+
+                this.MinYName.Text = Friends.AxisLabelText(miniP[ParetoYID]);
+                this.MaxYName.Text = Friends.AxisLabelText(maxiP[ParetoYID]);
+            }
+

             // Could be an array, but potentially more risky in case of early events.
             // Set up points for a polyline for each performance measure
@@ -1914,41 +1936,34 @@
                     PlotCanvas.Children.Add(myPoly[p]);
             }

+
+            // 1. Add the historic populations first.
             // j indicates generation
             for (int j = 0; j < BioBranches[biobranchID].PopTwigs.Count; j++)
             {

-                double xPos = (Convert.ToDouble(j) / totalGenerations) * PlotCanvas.Width + 5;
+                double xPos = (Convert.ToDouble(j) / (totalGenerations)) * (PlotCanvas.Width-10) + 5;

                 // k indicates chromosome (design)
                 for (int k = 0; k < BioBranches[biobranchID].PopTwigs[j].chromosomes.Length; k++)
                 {
                     Chromosome thisDesign = BioBranches[biobranchID].PopTwigs[j].chromosomes[k];
-
-                    List<double> myPerforms = thisDesign.GetPerformas();
-
-                    // Let's keep this for the time being
+
                     if (thisDesign.isRepresentative || thisDesign.isMinimum || thisDesign.isMaximum || thisDesign.isOptimal)
                     {
+                        List<double> myPerforms = thisDesign.GetPerformas();
+
                         // Note that manual selection does not run performance measures for all population, so we have to avoid this
                         if (myPerforms != null)
                         {
-                            for (int p = 0; p < myPerforms.Count; p++)
+                            for (int p = 0; p < performanceCount; p++)
                             {
-
                                 CheckBox checkBox = (CheckBox)controls["PLOTCHECKBOX" + p];
                                 if ((bool)checkBox.IsChecked)
                                 {
-
-                                    // Get min and max values for this performance criteria
-                                    double minP = BioBranches[biobranchID].minPerformanceValues[p];
-                                    double maxP = BioBranches[biobranchID].maxPerformanceValues[p];
-
-                                    // Avoid division by zero
-                                    if (minP == maxP) maxP++;

                                     // Includes some margins
-                                    double yPos = PlotCanvas.Height - ((myPerforms[p] - minP) * Math.Abs((PlotCanvas.Height - 10)) / (maxP - minP) + 5);
+                                    double yPos = PlotCanvas.Height - ((myPerforms[p] - miniP[p]) * Math.Abs((PlotCanvas.Height - 10)) / (maxiP[p] - miniP[p]) + 5);

                                     // Draw the circle
                                     System.Windows.Shapes.Path myCircle = new System.Windows.Shapes.Path();
@@ -1963,17 +1978,14 @@

                             // Now for the Pareto graph, which has to have minimum 2 performance values to work
                             // If index is -1, then combobox has not been selected yet
-                            if (myPerforms.Count > 1 && ParetoXID !=-1 && ParetoYID !=-1)
+                            if (performanceCount > 1 && ParetoXID !=-1 && ParetoYID !=-1)
                             {

-                                double minXP = BioBranches[biobranchID].minPerformanceValues[ParetoXID];
-                                double maxXP = BioBranches[biobranchID].maxPerformanceValues[ParetoXID];
-                                double minYP = BioBranches[biobranchID].minPerformanceValues[ParetoYID];
-                                double maxYP = BioBranches[biobranchID].maxPerformanceValues[ParetoYID];
-
-                                // Avoid division by zero
-                                if (minXP == maxXP) maxXP++;
-                                if (minYP == maxYP) maxYP++;
+                                // Avoidance of division by zero has already been circumnavigated
+                                double minXP = miniP[ParetoXID];
+                                double maxXP = maxiP[ParetoXID];
+                                double minYP = miniP[ParetoYID];
+                                double maxYP = maxiP[ParetoYID];

                                 // Includes margin
                                 double paretoX = (myPerforms[ParetoXID] - minXP) * Math.Abs(PlotCanvas2.Width-10) / (maxXP - minXP) +5;
@@ -1983,25 +1995,9 @@
                                 System.Windows.Shapes.Path myCircle2 = new System.Windows.Shapes.Path();
                                 double alpha = (double)(j + 1) / BioBranches[biobranchID].PopTwigs.Count;

-                                double radius = 0;
-
-                                if (j == BioBranches[biobranchID].PopTwigs.Count - 1)
-                                {
-                                    radius = 4;
-                                    myCircle2.StrokeThickness = 1;
-                                    myCircle2.Stroke = Brushes.White;
-                                    myCircle2.Fill = Brushes.Black;
-                                    myCircle2.ToolTip = thisDesign.clusterId;
-                                }
-
-                                else
-                                {
-                                    myCircle2.Fill = new SolidColorBrush(Color.FromArgb((byte)(int)(255 * alpha), 0, 0, 0));
-                                    radius = 3;
-                                }
-
-                                myCircle2.Data = new EllipseGeometry(new System.Windows.Point(paretoX, paretoY), radius, radius);
-                                myCircle2.MouseDown += new MouseButtonEventHandler(ScatterCircleClick);
+                                myCircle2.Fill = new SolidColorBrush(Color.FromArgb((byte)(int)(255 * alpha), 0, 0, 0));
+                                myCircle2.Data = new EllipseGeometry(new System.Windows.Point(paretoX, paretoY), 3, 3);
+                                //myCircle2.MouseDown += new MouseButtonEventHandler(ScatterCircleClick);

                                 PlotCanvas2.Children.Add(myCircle2);
                             }
@@ -2017,55 +2013,142 @@
                     CheckBox checkBox = (CheckBox)controls["PLOTCHECKBOX" + p];
                     if ((bool)checkBox.IsChecked)
                     {
-                        double minP = BioBranches[biobranchID].minPerformanceValues[p];
-                        double maxP = BioBranches[biobranchID].maxPerformanceValues[p];
-
-                        // Avoid division by zero
-                        if (minP == maxP) maxP++;
-
-                        double yPos = PlotCanvas.Height - ((BioBranches[biobranchID].PopTwigs[j].Performance_Averages[p] - minP) * Math.Abs((PlotCanvas.Height - 10)) / (maxP - minP) + 5);
+
+                        double yPos = PlotCanvas.Height - ((BioBranches[biobranchID].PopTwigs[j].Performance_Averages[p] - miniP[p]) * Math.Abs((PlotCanvas.Height - 10)) / (maxiP[p] - miniP[p]) + 5);

                         myPoly[p].Points.Add(new System.Windows.Point(xPos, yPos));

-                        System.Windows.Shapes.Path myCircle = new System.Windows.Shapes.Path();
-                        myCircle.Fill = Brushes.White;
-                        myCircle.StrokeThickness = 1.5;
-                        myCircle.Stroke = new SolidColorBrush(rgb_performance[p % 8]);// 8 colours max
-                        myCircle.Data = new EllipseGeometry(new System.Windows.Point(xPos, yPos), 4, 4);
-                        myCircle.ToolTip = "pop average = " + BioBranches[biobranchID].PopTwigs[j].Performance_Averages[p];
+                        System.Windows.Shapes.Path myCircle = new System.Windows.Shapes.Path
+                        {
+                            Fill = Brushes.White,
+                            StrokeThickness = 1.5,
+                            Stroke = new SolidColorBrush(rgb_performance[p % 8]),// 8 colours max
+                            Data = new EllipseGeometry(new System.Windows.Point(xPos, yPos), 4, 4),
+                            ToolTip = "pop average = " + BioBranches[biobranchID].PopTwigs[j].Performance_Averages[p]
+                        };
+
                         PlotCanvas.Children.Add(myCircle);

                     }
                 }

-                MinGraphLabels.Children.Clear();
-                MaxGraphLabels.Children.Clear();
-
-                // Now for the legend
-                for (int p = 0; p < performanceCount; p++)
-                {
-                    CheckBox checkBox = (CheckBox)controls["PLOTCHECKBOX" + p];
-                    if ((bool)checkBox.IsChecked)
+            }
+
+
+            // 2. Add the current population
+            for (int p = 0; p < performanceCount; p++)
+            {
+                CheckBox checkBox = (CheckBox)controls["PLOTCHECKBOX" + p];
+                if ((bool)checkBox.IsChecked)
+                {
+
+                    double xPos = ((totalGenerations - 1) * (PlotCanvas.Width - 10) / totalGenerations) + 5;
+
+                    for (int j = 0; j < population.chromosomes.Length; j++)
                     {
-
-                        TextBlock myTextBlock = new TextBlock();
-                        myTextBlock.Foreground = new SolidColorBrush(rgb_performance[p % 8]);
-                        myTextBlock.Text = Friends.AxisLabelText(BioBranches[biobranchID].maxPerformanceValues[p]);
-                        myTextBlock.UseLayoutRounding = true;
-                        myTextBlock.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
-                        MaxGraphLabels.Children.Add(myTextBlock);
-
-                        TextBlock myTextBlock2 = new TextBlock();
-                        myTextBlock2.Foreground = new SolidColorBrush(rgb_performance[p % 8]);
-                        myTextBlock2.Text = Friends.AxisLabelText(BioBranches[biobranchID].minPerformanceValues[p]);
-                        myTextBlock2.UseLayoutRounding = true;
-                        myTextBlock2.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
-                        MinGraphLabels.Children.Add(myTextBlock2);
+                        if (population.chromosomes[j].isRepresentative)
+                        {
+
+                            // Includes some margins
+                            double yPos = PlotCanvas.Height - ((population.chromosomes[j].GetPerformas()[p] - miniP[p]) * Math.Abs((PlotCanvas.Height - 10)) / (maxiP[p] - miniP[p]) + 5);
+
+                            // Draw the circle
+                            System.Windows.Shapes.Path myCircle = new System.Windows.Shapes.Path();
+                            myCircle.Fill = new SolidColorBrush(rgb_performance[p % 8]); // 8 colours max
+                            myCircle.Data = new EllipseGeometry(new System.Windows.Point(xPos, yPos), 3, 3);
+
+                            PlotCanvas.Children.Add(myCircle);
+
+                        }
                     }
-                }
-
-
-            }
+
+
+                    double yAve = PlotCanvas.Height - ((population.Performance_Averages[p] - miniP[p]) * Math.Abs((PlotCanvas.Height - 10)) / (maxiP[p] - miniP[p]) + 5);
+
+                    myPoly[p].Points.Add(new System.Windows.Point(xPos, yAve));
+
+                    System.Windows.Shapes.Path aveCircle = new System.Windows.Shapes.Path
+                    {
+                        Fill = Brushes.White,
+                        StrokeThickness = 1.5,
+                        Stroke = new SolidColorBrush(rgb_performance[p % 8]),// 8 colours max
+                        Data = new EllipseGeometry(new System.Windows.Point(xPos, yAve), 4, 4),
+                        ToolTip = "pop average = " + population.Performance_Averages[p]
+                    };
+
+                    PlotCanvas.Children.Add(aveCircle);
+
+                }
+            }
+
+            // This is essentially the same but with the current population
+            if (performanceCount > 1 && ParetoXID != -1 && ParetoYID != -1)
+            {
+
+                // Avoidance of division by zero has already been circumnavigated
+                double minXP = miniP[ParetoXID];
+                double maxXP = maxiP[ParetoXID];
+                double minYP = miniP[ParetoYID];
+                double maxYP = maxiP[ParetoYID];
+
+                // Includes margin
+                for (int j = 0; j < population.chromosomes.Length; j++)
+                {
+                    if (population.chromosomes[j].isRepresentative)
+                    {
+                        double xx = population.chromosomes[j].GetPerformas()[ParetoXID];
+                        double yy = population.chromosomes[j].GetPerformas()[ParetoYID];
+
+                        double paretoX = (xx - minXP) * Math.Abs(PlotCanvas2.Width - 10) / (maxXP - minXP) + 5;
+                        double paretoY = PlotCanvas2.Height - ((yy - minYP) * Math.Abs((PlotCanvas2.Height - 10)) / (maxYP - minYP) + 5);
+
+                        // Draw the circle
+                        System.Windows.Shapes.Path myCircle2 = new System.Windows.Shapes.Path
+                        {
+                            StrokeThickness = 1,
+                            Stroke = Brushes.White,
+                            Fill = Brushes.Black,
+                            ToolTip = population.chromosomes[j].clusterId,
+                            Data = new EllipseGeometry(new System.Windows.Point(paretoX, paretoY), 4, 4)
+                        };
+                        //myCircle2.MouseDown += new MouseButtonEventHandler(ScatterCircleClick);
+
+                        PlotCanvas2.Children.Add(myCircle2);
+                    }
+                }
+            }
+
+
+            // 3. Finally the legend
+            MinGraphLabels.Children.Clear();
+            MaxGraphLabels.Children.Clear();
+
+            for (int p = 0; p < performanceCount; p++)
+            {
+                CheckBox checkBox = (CheckBox)controls["PLOTCHECKBOX" + p];
+                if ((bool)checkBox.IsChecked)
+                {
+
+                    TextBlock myTextBlock = new TextBlock
+                    {
+                        Foreground = new SolidColorBrush(rgb_performance[p % 8]),
+                        Text = Friends.AxisLabelText(maxiP[p]),
+                        UseLayoutRounding = true,
+                        HorizontalAlignment = System.Windows.HorizontalAlignment.Right
+                    };
+                    MaxGraphLabels.Children.Add(myTextBlock);
+
+                    TextBlock myTextBlock2 = new TextBlock
+                    {
+                        Foreground = new SolidColorBrush(rgb_performance[p % 8]),
+                        Text = Friends.AxisLabelText(miniP[p]),
+                        UseLayoutRounding = true,
+                        HorizontalAlignment = System.Windows.HorizontalAlignment.Right
+                    };
+                    MinGraphLabels.Children.Add(myTextBlock2);
+                }
+            }
+
         }

@@ -2246,7 +2329,7 @@
             txt_dcl2.TextWrapping = TextWrapping.Wrap;
             txt_dcl2.FontSize = 12;
             txt_dcl2.Inlines.Add("\nInteractive Evolutionary Algorithms (IEAs) allow designers to engage with the process of evolutionary development. This gives rise to an involved experience, helping to explore the wide combinatorial space of parametric models without always knowing where you are headed. ");
-            txt_dcl2.Inlines.Add("\n\nInspired by Richard Dawkins' Biomorphs from 1986, who borrowed the term from the surrealist painter Desmond Morris.");
+            txt_dcl2.Inlines.Add("\n\nInspired by Richard Dawkins' Biomorphs from 1986, who borrowed the term from the surrealist painter Desmond Morris. Everything you do is a balloon.");
             txt_dcl2.Inlines.Add("\n\nDevelopment:\tJohn Harding & Cecilie Brandt-Olsen");
             txt_dcl2.Inlines.Add("\nCopyright:\t2020 John Harding");
             txt_dcl2.Inlines.Add("\nContact:\t\tjohnharding@fastmail.fm");


add dns ip settings to HFTRuntimeOptions for server

--- hft-server/hft-server/HFTRuntimeOptions.cs
+++ hft-server/hft-server/HFTRuntimeOptions.cs
@@ -21,6 +21,8 @@
         public bool captivePortal;
         public string serverPort = "";
         public string rendezvousUrl;
+        public string ipv4DnsAddress = "";
+        public string ipv6DnsAddress = "";

         public string args;
     }


Comment out [Fact] on SecurityTests so they have to be done manually.

--- src/Coalesce.Web.Tests/SecurityTests.cs
+++ src/Coalesce.Web.Tests/SecurityTests.cs
@@ -35,8 +35,8 @@
                             .ToList();
         }

-        //[Fact(Skip = "Run Explicitly By Removing Skip", DisplayName = "Security Tests: Remove Skip To Run")]
-        [Fact]
+        [Fact(Skip = "Run Explicitly By Removing Skip", DisplayName = "Security Tests: Remove Skip To Run")]
+        //[Fact]
         public async Task AllTests()
         {
             using (var output = new StreamWriter("output.txt"))


Fix obsolete logging bits

Fix obsolete logging bits

--- samples/Samples.AspNetCore2/Startup.cs
+++ samples/Samples.AspNetCore2/Startup.cs
@@ -70,14 +70,18 @@
                 // Optionally disable "Connection Open()", "Connection Close()" (and async variants).
                 //options.TrackConnectionOpenClose = false;
             }).AddEntityFramework();
+
+            services.AddLogging(builder =>
+            {
+                builder.AddConfiguration(Configuration.GetSection("Logging"));
+                builder.AddConsole();
+                builder.AddDebug();
+            });
         }

         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
         public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
         {
-            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
-            loggerFactory.AddDebug();
-
             if (env.IsDevelopment())
             {
                 app.UseDeveloperExceptionPage();


Added ShowTopicPosted.

Added ShowTopicPosted.

--- yafsrc/YAF.Controls/TopicLine.cs
+++ yafsrc/YAF.Controls/TopicLine.cs
@@ -56,6 +56,27 @@
     #region Properties

     /// <summary>
+    /// Gets or sets a value indicating whether ShowTopicPosted.
+    /// </summary>
+    public bool ShowTopicPosted
+    {
+      get
+      {
+        if (ViewState["ShowTopicPosted"] == null)
+        {
+          return true;
+        }
+
+        return (bool)ViewState["ShowTopicPosted"];
+      }
+
+      set
+      {
+        ViewState["ShowTopicPosted"] = value;
+      }
+    }
+
+    /// <summary>
     ///   Gets or sets Alt.
     /// </summary>
     [NotNull]
@@ -402,7 +423,14 @@

       this.RenderTopicStarter(writer);

-      this.RenderPosted(writer);
+      if (this.ShowTopicPosted)
+      {
+        writer.WriteBeginTag("span");
+        writer.WriteAttribute("class", "topicStarterPostedSeparator");
+        writer.Write(",");
+        writer.WriteEndTag("span");
+        this.RenderPosted(writer);
+      }

       this.RenderPostPager(writer, actualPostCount);

@@ -663,8 +691,6 @@
       // this.WriteBeginTD(writer, "topicStarter");
       topicStarterLink.RenderControl(writer);

-      writer.Write(",");
-
       writer.WriteEndTag("span");
       writer.WriteLine();
     }


Group the built in modded modules by author.

--- Assets/Scripts/ComponentSolvers/Helpers/ComponentSolverFactory.cs
+++ Assets/Scripts/ComponentSolvers/Helpers/ComponentSolverFactory.cs
@@ -18,13 +18,14 @@
     static ComponentSolverFactory()
     {
         ModComponentSolverCreators = new Dictionary<string, ModComponentSolverDelegate>();
+
+        //Hexi Modules
         ModComponentSolverCreators["MemoryV2"] = (bombCommander, bombComponent, ircConnection, canceller) => new ForgetMeNotComponentSolver(bombCommander, bombComponent, ircConnection, canceller);
         ModComponentSolverCreators["KeypadV2"] = (bombCommander, bombComponent, ircConnection, canceller) => new RoundKeypadComponentSolver(bombCommander, bombComponent, ircConnection, canceller);
         ModComponentSolverCreators["ButtonV2"] = (bombCommander, bombComponent, ircConnection, canceller) => new SquareButtonComponentSolver(bombCommander, bombComponent, ircConnection, canceller);
         ModComponentSolverCreators["SimonV2"] = (bombCommander, bombComponent, ircConnection, canceller) => new SimonStatesComponentSolver(bombCommander, bombComponent, ircConnection, canceller);
         ModComponentSolverCreators["PasswordV2"] = (bombCommander, bombComponent, ircConnection, canceller) => new SafetySafeComponentSolver(bombCommander, bombComponent, ircConnection, canceller);
         ModComponentSolverCreators["NeedyVentV2"] = (bombCommander, bombComponent, ircConnection, canceller) => new NeedyQuizComponentSolver(bombCommander, bombComponent, ircConnection, canceller);
-        ModComponentSolverCreators["TwoBits"] = (bombCommander, bombComponent, ircConnection, canceller) => new TwoBitsComponentSolver(bombCommander, bombComponent, ircConnection, canceller);
 		ModComponentSolverCreators["NeedyKnobV2"] = (bombCommander, bombComponent, ircConnection, canceller) => new NeedyRotaryPhoneComponentSolver(bombCommander, bombComponent, ircConnection, canceller);

         //Perky Modules  (Silly Slots is maintained by Timwi, and as such its handler lives there.)
@@ -36,6 +37,9 @@
         ModComponentSolverCreators["Probing"] = (bombCommander, bombComponent, ircConnection, canceller) => new ProbingComponentSolver(bombCommander, bombComponent, ircConnection, canceller);
         ModComponentSolverCreators["TurnTheKey"] = (bombCommander, bombComponent, ircConnection, canceller) => new TurnTheKeyComponentSolver(bombCommander, bombComponent, ircConnection, canceller);
         ModComponentSolverCreators["TurnTheKeyAdvanced"] = (bombCommander, bombComponent, ircConnection, canceller) => new TurnTheKeyAdvancedComponentSolver(bombCommander, bombComponent, ircConnection, canceller);
+
+        //Kaneb Modules
+        ModComponentSolverCreators["TwoBits"] = (bombCommander, bombComponent, ircConnection, canceller) => new TwoBitsComponentSolver(bombCommander, bombComponent, ircConnection, canceller);

     }


replace mathi/mathd with math (suggested by vijay)

--- microj.cs
+++ microj.cs
@@ -367,7 +367,7 @@
     }

     public class Conjunctions {
-        public static string[] Words = new string[] { "\"" };
+        public static string[] Words = new string[] { "\"", "!:" };
         public Verbs Verbs;

         public Conjunctions(Verbs verbs) {
@@ -651,25 +651,8 @@
             return (T) ((dynamic)a+((T)(dynamic)b));
         }

-        //lambdas add about 3% overhead based upon tests of 100 times, for now worth it for code clarity
-        public A<long> mathi(A<long> x, A<long> y, Func<long, long, long> op) {
-            var z = new A<long>(y.Ravel.Length, y.Shape);
-
-            //split out for performance reasons/otherwise rank was evaluated in the loop
-            if (x.Rank == 0) {
-                for(var i = 0; i < y.Ravel.Length; i++) {
-                    z.Ravel[i] = op(x.Ravel[0], y.Ravel[i]);
-                }
-            }
-            else {
-                for(var i = 0; i < y.Ravel.Length; i++) {
-                    z.Ravel[i] = op(x.Ravel[i], y.Ravel[i]);
-                }
-            }
-            return z;
-        }
-        public A<double> mathd(A<double> x, A<double> y, Func<double, double, double> op) {
-            var z = new A<double>(y.Ravel.Length, y.Shape);
+        public A<T> math<T>(A<T> x, A<T> y, Func<T, T, T> op) where T : struct {
+            var z = new A<T>(y.Ravel.Length, y.Shape);
             if (x.Rank == 0) {
                 for(var i = 0; i < y.Ravel.Length; i++) {
                     z.Ravel[i] = op(x.Ravel[0], y.Ravel[i]);
@@ -889,10 +872,10 @@

             if (op == "+") {
                 if (x.GetType() == typeof(A<long>) && y.GetType() == typeof(A<long>)) {
-                    return mathi((A<long>)x,(A<long>)y, (a,b)=>a+b);
+                    return math((A<long>)x,(A<long>)y, (a,b)=>a+b);
                 }
                 else if (x.GetType() == typeof(A<double>) && y.GetType() == typeof(A<double>)) {
-                    return mathd((A<double>)x,(A<double>)y, (a,b)=>a+b);
+                    return math((A<double>)x,(A<double>)y, (a,b)=>a+b);
                 }
                 else if (x.GetType() == typeof(A<long>) && y.GetType() == typeof(A<double>)) {
                     return mathmixed((A<long>)x,(A<double>)y, (a,b)=>a+b);
@@ -904,10 +887,10 @@
             }
             else if (op == "-") {
                 if (x.GetType() == typeof(A<long>) && y.GetType() == typeof(A<long>)) {
-                    return mathi((A<long>)x,(A<long>)y, (a,b)=>a-b);
+                    return math((A<long>)x,(A<long>)y, (a,b)=>a-b);
                 }
                 else if (x.GetType() == typeof(A<double>) && y.GetType() == typeof(A<double>)) {
-                    return mathd((A<double>)x,(A<double>)y, (a,b)=>a-b);
+                    return math((A<double>)x,(A<double>)y, (a,b)=>a-b);
                 }
                 else if (x.GetType() == typeof(A<long>) && y.GetType() == typeof(A<double>)) {
                     return mathmixed((A<long>)x,(A<double>)y, (a,b)=>a-b);
@@ -918,10 +901,10 @@
             }
             else if (op == "*") {
                 if (x.GetType() == typeof(A<long>) && y.GetType() == typeof(A<long>)) {
-                    return mathi((A<long>)x,(A<long>)y, (a,b)=>a*b);
+                    return math((A<long>)x,(A<long>)y, (a,b)=>a*b);
                 }
                 else if (x.GetType() == typeof(A<double>) && y.GetType() == typeof(A<double>)) {
-                    return mathd((A<double>)x,(A<double>)y, (a,b)=>a*b);
+                    return math((A<double>)x,(A<double>)y, (a,b)=>a*b);
                 }
                 else if (x.GetType() == typeof(A<long>) && y.GetType() == typeof(A<double>)) {
                     return mathmixed((A<long>)x,(A<double>)y, (a,b)=>a*b);
@@ -933,7 +916,7 @@
             else if (op == "%") {
                 var a2 = x.ConvertDouble();
                 var b2 = y.ConvertDouble();
-                return mathd(a2,b2, (a,b)=>a/b);
+                return math(a2,b2, (a,b)=>a/b);
             }
             else if (op == "$") {
                 if (x.GetType() == typeof(A<long>)) {
@@ -1137,7 +1120,7 @@
                 else if (isEdgeOrNotConj(w1) && (isNoun(w2) || isVerb(w2)) && isAdverb(w3) && true) { step = 3; } //adverb
                 else if (isEdgeOrNotConj(w1) && (isNoun(w2) || isVerb(w2)) && isConj(w3) &&  (isNoun(w2) || isVerb(w2))) { step = 4; }
                 else if ((isNoun(w1) || isName(w1)) && (w2.word == "=:" || w2.word == "=.") && true && true) { step = 7; }
-                else if (w1.word == "(" && isNoun(w2) && w3.word == ")" && true) { step = 8; }
+                else if (w1.word == "(" && (isNoun(w2) || isVerb(w2)) && w3.word == ")" && true) { step = 8; }

                 //Console.WriteLine(step);
                 if (step >= 0) {
@@ -1186,7 +1169,11 @@
                         var rhs = stack.Pop();
                         var z = new A<Verb>(0);
                         //todo handle conjunction returning noun
-                        z.Ravel[0] = ((A<Verb>)lhs.val).Ravel[0];
+                        if (isVerb(lhs)) {
+                            z.Ravel[0] = ((A<Verb>)lhs.val).Ravel[0];
+                        } else {
+                            z.Ravel[0].op = lhs.word;
+                        }
                         z.Ravel[0].conj = conj.word;
                         z.Ravel[0].rhs = rhs.word;
                         stack.Push(new Token { val = z });
@@ -1287,6 +1274,7 @@
             tests["names with number"] = () => equals(toWords("a1b =: 1"), new string[] { "a1b", "=:", "1" });
             tests["names with underscore"] = () => equals(toWords("a_b =: 1"), new string[] { "a_b", "=:", "1" });
             tests["is with no parens"] = () => equals(toWords("i.3-:3"), new string[] { "i.", "3", "-:", "3" });
+            tests["foreign conjunction"] = () => equals(toWords("(15!:0) 'abc'"), new string[] { "15", "!:", "0", "'abc'" });

             tests["verb assignment"] =() => {
                 var parser = new Parser();


table default  val & pickfrom box

table default  val & pickfrom box

--- microj.cs
+++ microj.cs
@@ -151,13 +151,16 @@
         public abstract void SetVal(long n, object val);
         public abstract object GetVal(long n);
         public abstract AType GetValA(long n);
-        public abstract AType FromIndices(long[] indices, bool flattenStrings = true, bool allRows = false);
+        public abstract AType FromIndices(long[] indices, bool flattenStrings = true, bool allRows = false, AType missingVal = null);
         public abstract AType FromIndices(long[] indices, long count);
+        public abstract AType Clone(long extra=0);
+
         public abstract AType TryConvertLong(Parser parse);
         public abstract bool IsAtom();
         public abstract long GetLong(int n);
         public abstract bool CanBeInt();
-
+        public abstract AType PickFromBox(int[] which,A<Box> vals);
+
         public JString GetCharJString(long n) {
             return new JString { str = GetChar(n) };
         }
@@ -587,7 +590,7 @@
         }
         public long RowCount {
             get {
-                if (Rows.Length == 0) { return 0; }
+                if (Rows == null || Rows.Length == 0) { return 0; }
                 if (indices == null) {
                     //return Rows[0].val.Shape[0];
                     return Rows[0].val.GetCount();
@@ -649,8 +652,7 @@
                 FooterExpressions = FooterExpressions,
                 Key = Key,
                 UniqueKeys = UniqueKeys,
-                Symbols = Symbols,
-                Calculations = Calculations
+                Symbols = Symbols
             };
         }

@@ -711,8 +713,8 @@
                 footer++;
             }

-            if (ttake > Parser.OUTPUT_MAX_ROWS) {
-                ttake = Parser.OUTPUT_MAX_ROWS;
+            if (ttake > maxRows) {
+                ttake = maxRows;
             }
             var newShape = new long[] {ttake+1+footer , Columns.Length};
             var formatter = new Formatter(newShape, "");
@@ -725,7 +727,7 @@
             }

             var newIndices = new List<long>();
-            for (var i = offset; i < (offset+ttake) && i < ct && i < Parser.OUTPUT_MAX_ROWS; i++) {
+            for (var i = offset; i < (offset+ttake) && i < ct && i < maxRows; i++) {
                 if (indices == null) {
                     newIndices.Add(i);
                 }
@@ -923,6 +925,17 @@
             return new A<T>(0) { Ravel = new T[] { Ravel[n] } };
         }

+        public override AType Clone(long extra=0) {
+            var len = Ravel.Length;
+            A<T> v = new A<T>(len+extra);
+            v.Shape = ShapeCopy();
+            v.Shape[0] = len + extra;
+            for(var i = 0; i < len;i++) {
+                v.Ravel[i] = Ravel[i];
+            }
+
+            return v;
+        }
         public override AType FromIndices(long[] indices, long length) {
             A<T> v = null;
             v = new A<T>(length);
@@ -931,7 +944,7 @@
             }
             return v;
         }
-        public override AType FromIndices(long[] indices, bool flattenStrings = true, bool allRows = false) {
+        public override AType FromIndices(long[] indices, bool flattenStrings = true, bool allRows = false, AType missingVal = null) {

             A<T> v = null;
             if (typeof(T) == typeof(JString) && !flattenStrings) {
@@ -962,8 +975,11 @@
                     v.Ravel[i] = Ravel[indices[i]];
                 }
                 else {
-                    //todo speed up
-                    if (typeof(T) == typeof(JString)) {
+                    //todo speed up
+                    if (missingVal != null) {
+                        v.Ravel[i] = (T) (object) missingVal.GetVal(0);
+                    }
+                    else if (typeof(T) == typeof(JString)) {
                         v.Ravel[i] = (T) (object) new JString { str = "" };
                     }
                     else {
@@ -1161,6 +1177,31 @@
             }
             return z;
         }
+
+        public override AType PickFromBox(int[] which, A<Box> options) {
+            long[] shape;
+            if (typeof(T) == typeof(JString)) {
+                shape = new long[2] { which.Length, 1};
+            } else {
+                shape = new long[1] { which.Length };
+            }
+            A<T> result = new A<T>(shape);
+            try {
+                for(var i = 0; i < which.Length; i++) {
+                    var choice = (options.Ravel[which[i]].val as A<T>);
+                    if (choice.Count == 1) {
+                        result.Ravel[i] = choice.Ravel[0];
+                    }
+                    else {
+                        result.Ravel[i] = choice.Ravel[i];
+                    }
+                }
+            }
+            catch (Exception e) {
+                throw new ApplicationException("PickFromBox error -- mostly likely incorrect types", e);
+            }
+            return result;
+        }
     }

     public class AHelper {
@@ -1178,7 +1219,7 @@
     public class Parser {

         public static bool ThrowError = true;
-        public static int OUTPUT_MAX_ROWS = 10000;
+        public static int OUTPUT_MAX_ROWS = 500;

         public bool UseDecimal = false;
         public static int MAX_DECIMAL = -1;
@@ -1272,9 +1313,8 @@
             bool inDouble = false;
             for (var ci = 0; ci < w.Length; ci++ ) {
                 var c = w[ci];
-                if (!inQuote && c == '\'') { emit(); currentWord.Append(c); inQuote = true; }
+                if (!inQuote && c == '\'') { emit(); currentWord.Append(c); inQuote = true;  }
                 else if (inQuote && c == '\'' && (ci < w.Length-1 && w[ci+1] != '\'' && w[ci-1] != '\'')) { currentWord.Append(c); emit(); inQuote = !inQuote; }
-                //else if (inQuote) { /*if (ci >= w.Length -1 || !(c == '\'' && w[ci-1] == '\'')) {*/ currentWord.Append(c); /*}*/  }
                 else if (inQuote) { if (ci >= w.Length - 1 || !(c == '\'' && w[ci - 1] == '\'') || inDouble) { currentWord.Append(c); inDouble = false; } else { inDouble = true; } }
                 else {

@@ -1290,6 +1330,7 @@
                     else if ((isSymbol(p) || isSymbolPrefix(p)) && isDigit(c)) { emit(); currentWord.Append(c); } //1+2
                     else if (isSymbol(c) && !isSymbol(p)) { emit(); currentWord.Append(c); }
                     else currentWord.Append(c);
+
                 }
                 p = c;
             }
@@ -1623,8 +1664,8 @@
                 watch.Start();
             }

-        }
 #endif
+        }
     }

     //todo could use some cleanup... primarily interested in getting tests to pass for now


- corrected Lesson03 -> Lesson04

- corrected Lesson03 -> Lesson04

svn path=/trunk/gtkglarea-sharp/; revision=54339

--- examples/NeHe/Lesson04/Lesson04.cs
+++ examples/NeHe/Lesson04/Lesson04.cs
@@ -14,9 +14,9 @@

 // This code is based on work from Alp Toker and the NeHe lesson here:
 // http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=01
-namespace NeHe.Lesson03
+namespace NeHe.Lesson04
 {
-	public class Lesson03
+	public class Lesson04
 	{
 		/* GlArea is the widget defined in the GtkGL namespace and is a
 		 * specialized GtkDrawingArea with GL cow powers.
@@ -146,7 +146,7 @@

 			System.Timers.Timer t = new System.Timers.Timer();

-			Lesson03 l = new Lesson03();
+			Lesson04 l = new Lesson04();

 			GLib.Timeout.Add (50, new GLib.TimeoutHandler (l.RotateObjects));

@@ -169,7 +169,7 @@
 			return true;
 		}

-		public Lesson03()
+		public Lesson04()
 		{
 			// Create a new GLArea widget and request a size
 			glarea = new GLArea (attrlist);
@@ -188,7 +188,7 @@
 			vb.PackStart (glarea, true, true, 0);

 			// Create a new window and name it appropriately
-			Window win = new Window ("NeHe Lesson03");
+			Window win = new Window ("NeHe Lesson04");

 			// Pack the VBox into the window
 			win.Add (vb);