Remove leading and trailing whitespace from variable names in PlainText reader

Description
Resolves #17507

When variable names are read into the plaintext reader, they have their leading and trailing whitespace removed. So if visit needs to read a CSV file with spaces between columns in addition to commas (see the referenced issue), it will read the variable names correctly.
Type of change

[x] Bug fix
[ ] New feature
[ ] Documentation update
[ ] Other

How Has This Been Tested?

Tested on rztopaz by feeding visit multiple csv files with spaces around the variable names.
Checklist:

[x] I have followed the style guidelines of this project.~~
[x] I have performed a self-review of my own code.~~
[x] I have commented my code where applicable.~~
[ ] I have updated the release notes.~~
[ ] I have made corresponding changes to the documentation.
[ ] I have added debugging support to my changes.
[ ] I have added tests that prove my fix is effective or that my feature works.
[x] I have confirmed new and existing unit tests pass locally with my changes.~~
[ ] I have added new baselines for any new tests to the repo.
[x] I have NOT made any changes to protocol or public interfaces in an RC branch.~~
[x] I have assigned reviewers (see VisIt's PR procedures for more information).~~

Are there tests for the Plaintext Reader? Is this the kind of change that doesn't require a test to be added?
$ ls src/test/tests/databases/
ANALYZE.py          SPCTH.py          exodus.py           moab.py           silo.py
ANSYS.py            Velodyne.py       export_db.py        multi_format.py   silo_altdriver.py
CGNS.py             Xmdv.py           ffp.py              multi_format2.py  silo_datatypes.py
CMakeLists.txt      Xolotl.py         flash.py            netcdf.py         singlemulti.py
Cale.py             activesource.py   global_node_ids.py  obj.py            sw4.py
Chombo.py           avsucd.py         h5part.py           oldsilo.py        tecplot.py
EnSight.py          blueprint.py      history.py          openPMD.py        timesliders.py
FITS.py             bov.py            image.py            openexr.py        uintah.py
FMS.py              boxlib.py         imgvol.py           overlink.py       unv.py
Fluent.py           chgcar.py         kulllite.py         pdbdatabase.py    vtk.py
GDAL.py             claw.py           lata.py             pixie.py          wave_tv.py
NASTRAN.py          closedatabase.py  leos.py             rect.py           xdmf.py
OpenFOAM.py         correlation.py    lines.py            reopen.py         xform_precision.py
PATRAN.py           curve.py          metadata.py         sami.py           xyz.py
PLOT3D.py           ddcMD.py          mfem.py             samrai.py         zipwrapper.py
ProteinDataBank.py  diff.py           mili.py             scale_mesh.py
RAW.py              empty_db.py       miranda.py          shapefile.py

There is a test on develop. It was added just a week ago.

Also, what is up with the diff? Did I mess something up or is github just confused?

Updating release notes now

Can you cut-n-paste the result of git diff from your terminal command-line here?

Can you cut-n-paste the result of git diff from your terminal command-line here?

diff --git a/src/databases/PlainText/avtPlainTextFileFormat.C b/src/databases/PlainText/avtPlainTextFileFormat.C
index c85b6aa259..2f4add3765 100644
--- a/src/databases/PlainText/avtPlainTextFileFormat.C
+++ b/src/databases/PlainText/avtPlainTextFileFormat.C
@@ -1,633 +1,651 @@
-// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
-// Project developers.  See the top-level LICENSE file for dates and other
-// details.  No copyright assignment is required to contribute to VisIt.
-// ************************************************************************* //
-//                            avtPlainTextFileFormat.C                           //
-// ************************************************************************* //
-#include <avtPlainTextFileFormat.h>
-#include
-#include
-#include <vtkPointData.h>
-#include <vtkDoubleArray.h>
-#include <vtkRectilinearGrid.h>
-#include <vtkUnstructuredGrid.h>
-#include <vtkPolyData.h>
-#include <vtkCellArray.h>
-#include <vtkVisItUtility.h>
-#include <avtDatabaseMetaData.h>
-#include <DBOptionsAttributes.h>
-#include <Expression.h>
-#include <StringHelpers.h>
-#include "visit_gzstream.h"
-#include <InvalidVariableException.h>
-#include <InvalidFilesException.h>

-using     std::string;
-using     std::vector;
-// ****************************************************************************
-//  Method: avtPlainTextFileFormat constructor
-//
-//  Programmer: Jeremy Meredith
-//  Creation:   January 24, 2008
-//
-//  Modifications:
-//
-//    Mark C. Miller, Wed Oct 29 12:32:11 PDT 2008
-//    Made it possible for curves to have any column as the abscissa
-//
-//    Jeremy Meredith, Fri Apr 30 09:57:29 EDT 2010
-//    Changed data layout field to have a new default, and so I renamed
-//    it so it wouldn't conflict with the old values.
-//
-// ****************************************************************************
-avtPlainTextFileFormat::avtPlainTextFileFormat(const char *fn,

                                          const DBOptionsAttributes *readOpts)

: avtSTSDFileFormat(fn)
-{
fileRead = false;
filename = fn;
ncolumns = 0;
nrows = 0;

// Set the options from the DBOptionsAttributes
format = Grid;
firstRowIsHeader = false;
skipLines = 0;
xcol = -1;
ycol = -1;
zcol = -1;

if (readOpts &&

   readOpts->FindIndex("Data layout")>=0)

{

   int index = readOpts->GetEnum("Data layout");

   if (index==0) format = Columns;

   if (index==1) format = Grid;

}
if (readOpts &&

   readOpts->FindIndex("First row has variable names")>=0)

{

   firstRowIsHeader = readOpts->GetBool("First row has variable names");

}
if (readOpts &&

   readOpts->FindIndex("Lines to skip at beginning of file")>=0)

{

   skipLines = readOpts->GetInt("Lines to skip at beginning of file");

}
if (readOpts &&

   readOpts->FindIndex("Column for X coordinate (or -1 for none)")>=0)

{

   xcol = readOpts->GetInt("Column for X coordinate (or -1 for none)");

}
if (readOpts &&

   readOpts->FindIndex("Column for Y coordinate (or -1 for none)")>=0)

{

   ycol = readOpts->GetInt("Column for Y coordinate (or -1 for none)");

}
if (readOpts &&

   readOpts->FindIndex("Column for Z coordinate (or -1 for none)")>=0)

{

   zcol = readOpts->GetInt("Column for Z coordinate (or -1 for none)");

}

acol = -2; // abscissa column for curves
if (xcol<0 && ycol<0 && zcol<0)

   acol = -1;

else if (xcol>=0 && ycol<0  && zcol<0)

   acol = xcol;

else if (xcol<0  && ycol>=0 && zcol<0)

   acol = ycol;

else if (xcol<0  && ycol<0  && zcol>=0)

   acol = zcol;

-}

-// ****************************************************************************
-//  Method: avtPlainTextFileFormat::FreeUpResources
-//
-//  Purpose:
-//      When VisIt is done focusing on a particular timestep, it asks that
-//      timestep to free up any resources (memory, file descriptors) that
-//      it has associated with it.  This method is the mechanism for doing
-//      that.
-//
-//  Programmer: Jeremy Meredith
-//  Creation:   January 24, 2008
-//
-//  Modifications:
-//
-//    Hank Childs, Wed May 26 09:05:44 PDT 2010
-//    Fix memory bloat issue from STL.
-//
-//    Mark C. Miller, Tue Dec  1 13:07:23 PST 2020
-//    Switched to double precision data
-// ****************************************************************************
-void
-avtPlainTextFileFormat::FreeUpResources(void)
-{

variableNames.clear();
data.clear();
std::vector< std::vector > tmp;
data.swap(tmp); // this makes capacity() drop to 0, which is better than

               // what clear() does.

fileRead = false;
-}

-// ****************************************************************************
-//  Method: avtPlainTextFileFormat::PopulateDatabaseMetaData
-//
-//  Purpose:
-//      This database meta-data object is like a table of contents for the
-//      file.  By populating it, you are telling the rest of VisIt what
-//      information it can request from you.
-//
-//  Programmer: Jeremy Meredith
-//  Creation:   January 24, 2008
-//
-//  Modifications:
-//
-//    Mark C. Miller, Wed Oct 29 12:32:11 PDT 2008
-//    Made it possible for curves to have any column as the abscissa
-// ****************************************************************************
-void
-avtPlainTextFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
-{

ReadFile();

if (format == Grid)
{

   // rectilinear grid

   AddMeshToMetaData(md, "mesh", AVT_RECTILINEAR_MESH, NULL,

                     1,0, 2,2);

   AddScalarVarToMetaData(md, variableNames[0], "mesh", AVT_NODECENT);

}
else if (format == Columns)
{

   if (acol > -2)

   {

       // curves

       for (int i=0; i<ncolumns; i++)

       {

           if (i == acol)

               continue;

           avtCurveMetaData *curve = new avtCurveMetaData;

           curve->name = variableNames[i];

           md->Add(curve);

       }

   }

   else

   {

       // pointmesh

       int spatialdim = (zcol<0) ? 2 : 3;

       AddMeshToMetaData(md, "mesh", AVT_POINT_MESH, NULL,

                         1,0, spatialdim,1);

       // variables

       for (int i=0; i<ncolumns; i++)

       {

           AddScalarVarToMetaData(md, variableNames[i], "mesh",

                                  AVT_NODECENT);

       }

   }

}
-}

-// ****************************************************************************
-//  Method: avtPlainTextFileFormat::GetMesh
-//
-//  Purpose:
-//      Gets the mesh associated with this file.  The mesh is returned as a
-//      derived type of vtkDataSet (ie vtkRectilinearGrid, vtkStructuredGrid,
-//      vtkUnstructuredGrid, etc).
-//
-//  Arguments:
-//      meshname    The name of the mesh of interest.  This can be ignored if
-//                  there is only one mesh.
-//
-//  Programmer: Jeremy Meredith
-//  Creation:   January 24, 2008
-//
-//  Modifications:
-//    Jeremy Meredith, Thu Jun 26 17:26:22 EDT 2008
-//    Changed curves to be created as rectilinear grids instead of polydata
-//    (so that they work with expressions).
-//
-//    Mark C. Miller, Wed Oct 29 12:32:11 PDT 2008
-//    Made it possible for curves to have any column as the abscissa
-//
-//    Jeremy Meredith, Thu Jan 20 13:26:04 EST 2011
-//    Fixed a copy/paste bug with creating 1D/2D point meshes.  (3D was okay.)
-//
-//    Mark C. Miller, Tue Dec  1 13:05:46 PST 2020
-//    Switched to double precision for coords
-// ****************************************************************************
-vtkDataSet *
-avtPlainTextFileFormat::GetMesh(const char *meshname)
-{

ReadFile();
if (format == Grid)
{

   // rectilinear grid

   vtkRectilinearGrid   *rgrid   = vtkRectilinearGrid::New();

   vtkDoubleArray *coords[3];

   int dims[3] = {ncolumns, nrows, 1};

   for (int i = 0 ; i < 3 ; i++)

   {

       coords[i] = vtkDoubleArray::New();

       coords[i]->SetNumberOfTuples(dims[i]);

       for (int j = 0 ; j < dims[i] ; j++)

       {

           coords[i]->SetComponent(j, 0, j);

       }

   }

   rgrid->SetDimensions(dims);

   rgrid->SetXCoordinates(coords[0]);

   rgrid->SetYCoordinates(coords[1]);

   rgrid->SetZCoordinates(coords[2]);

   coords[0]->Delete();

   coords[1]->Delete();

   coords[2]->Delete();

   return rgrid;

}
else if (format == Columns)
{

   if (acol > -2)

   {

       // curves

       int index = -1;

       for (int i=0; i< (int)variableNames.size(); i++)

       {

           if (meshname == variableNames[i])

               index = i;

       }

       if (index < 0)

           EXCEPTION1(InvalidVariableException, meshname);

       vtkDoubleArray *vals = vtkDoubleArray::New();

       vals->SetNumberOfComponents(1);

       vals->SetNumberOfTuples(nrows);

       vals->SetName(meshname);

       vtkRectilinearGrid *rg =

           vtkVisItUtility::Create1DRGrid(nrows,VTK_DOUBLE);

       rg->GetPointData()->SetScalars(vals);

       vtkDataArray *xc = rg->GetXCoordinates();

       for (int j = 0 ; j < nrows ; j++)

       {

           if (acol == -1)

               xc->SetComponent(j, 0, j);

           else

               xc->SetComponent(j, 0, data[j][acol]);

           vals->SetValue(j, data[j][index]);

       }

       vals->Delete();

       return rg;

   }

   else

   {

       // pointmesh

       vtkPolyData *pd  = vtkPolyData::New();

       vtkPoints   *pts = vtkPoints::New();

       pts->SetNumberOfPoints(nrows);

       pd->SetPoints(pts);

       pts->Delete();

       for (int j = 0 ; j < nrows ; j++)

       {

           double x = (xcol<0 || xcol>=ncolumns) ? 0 : data[j][xcol];

           double y = (ycol<0 || ycol>=ncolumns) ? 0 : data[j][ycol];

           double z = (zcol<0 || zcol>=ncolumns) ? 0 : data[j][zcol];

           pts->SetPoint(j, x, y, z);

       }

       vtkCellArray *verts = vtkCellArray::New();

       pd->SetVerts(verts);

       verts->Delete();

       for (int k = 0 ; k < nrows ; k++)

       {

           verts->InsertNextCell(1);

           verts->InsertCellPoint(k);

       }

       return pd;

   }

}

return NULL;
-}

-// ****************************************************************************
-//  Method: avtPlainTextFileFormat::GetVar
-//
-//  Purpose:
-//      Gets a scalar variable associated with this file.  Although VTK has
-//      support for many different types, the best bet is vtkFloatArray, since
-//      that is supported everywhere through VisIt.
-//
-//  Arguments:
-//      varname    The name of the variable requested.
-//
-//  Programmer: Jeremy Meredith
-//  Creation:   January 24, 2008
-//
-//  Mark C. Miller, Tue Dec  1 13:06:00 PST 2020
-//  Switched to double precision for data
-// ****************************************************************************
-vtkDataArray *
-avtPlainTextFileFormat::GetVar(const char *varname)
-{

ReadFile();

if (format == Grid)
{

   // just one var; do it blindly

   vtkDoubleArray *values = vtkDoubleArray::New();

   values->SetNumberOfTuples(nrows*ncolumns);

   int ctr = 0;

   for (int i=0; i<nrows; i++)

   {

       for (int j=0; j<ncolumns; j++)

       {

           values->SetComponent(ctr, 0, data[i][j]);

           ctr++;

       }

   }

   return values;

}
else if (format == Columns)
{

   int index = -1;

   for (int i=0; i<(int)variableNames.size(); i++)

   {

       if (varname == variableNames[i])

           index = i;

   }

   if (index < 0)

       EXCEPTION1(InvalidVariableException, varname);

   vtkDoubleArray *values = vtkDoubleArray::New();

   values->SetNumberOfTuples(nrows);

   int ctr = 0;

   for (int i=0; i<nrows; i++)

   {

       values->SetComponent(ctr, 0, data[i][index]);

       ctr++;

   }

   return values;

}

return NULL;
-}

-// ****************************************************************************
-//  Method: avtPlainTextFileFormat::GetVectorVar
-//
-//  Purpose:
-//      Gets a vector variable associated with this file.  Although VTK has
-//      support for many different types, the best bet is vtkFloatArray, since
-//      that is supported everywhere through VisIt.
-//
-//  Arguments:
-//      varname    The name of the variable requested.
-//
-//  Programmer: Jeremy Meredith
-//  Creation:   January 24, 2008
-//
-// ****************************************************************************
-vtkDataArray *
-avtPlainTextFileFormat::GetVectorVar(const char *varname)
-{

return NULL;
-}

-// ****************************************************************************
-//  Method: avtPlainTextFileFormat::ReadFile
-//
-//  Purpose:
-//      Read the file if it's not already been read.
-//
-//  Note: the mdserver will shortcut out once it reads the first few rows.
-//
-//  Arguments:
-//      none
-//
-//  Programmer: Jeremy Meredith
-//  Creation:   January 24, 2008
-//
-//  Modifications:
-//    Jeremy Meredith, Fri Jan 25 17:53:13 EST 2008
-//    Support both CSV and whitespace-delimited files.  Sped up
-//    parsing as well.
-//
-//    Brad Whitlock, Mon Apr 27 09:00:52 PDT 2009
-//    I increased the line length from 4K to 32K.
-//
-//    Jeremy Meredith, Wed Jan  6 13:26:52 EST 2010
-//    Check for an ASCII file or empty data.
-//
-//    Hank Childs, Mon Feb  4 10:52:01 PST 2013
-//    Improve logic for files with variable names.
-//
-//    Mark C. Miller, Tue Dec  1 13:06:57 PST 2020
-//    Switched to double precision for rows of data
-// ****************************************************************************
-void
-avtPlainTextFileFormat::ReadFile()
-{

if (fileRead)

   return;

visit_ifstream in(filename.c_str());
if (!in())

   EXCEPTION1(InvalidFilesException, filename.c_str());

// skip the first lines if asked
int linelen = 32768;
char *buff = new char[linelen];
memset(buff, 0, sizeof(char) * linelen);
for (int l=0; l<skipLines; l++)
{

   in().getline(buff, linelen);

   if (!StringHelpers::IsPureASCII(buff, linelen))

       EXCEPTION2(InvalidFilesException, filename.c_str(), "Not ASCII.");

}

// actually read the data; one vector per row
ncolumns = 0;
nrows = 0;
bool firstRow = true;
in().getline(buff, linelen);
if (!StringHelpers::IsPureASCII(buff, linelen))

   EXCEPTION2(InvalidFilesException, filename.c_str(), "Not ASCII.");

bool comma = false;
for (char *p=buff; *p!='\0'; p++)

   if (*p == ',')

       comma = true;

while (in())
{

   int len = (int)strlen(buff);

   char *start = buff;

   vector<double> row;

   if (comma)

   {

       while ((start-buff)<=len)

       {

           char *end = start;

           while (*end != '\0' && (end-buff)<=len &&

                  !(*end == ','))

           {

               end++;

           }

           *end = '\0';

           if (firstRowIsHeader && firstRow)

           {

               variableNames.push_back(start);

           }

           else

           {

               double value = atof(start);

               row.push_back(value);

           }

           start = end+1;

       }

   }

   else

   {

       while (*start != '\0' && (start-buff)<=len &&

              (*start == ' ' || *start == '\t'))

       {

           start++;

       }

       while ((start-buff)<=len)

       {

           char *end = start;

           while (*end != '\0' && (end-buff)<=len &&

                  !(*end == ' ' || *end == '\t'))

           {

               end++;

           }

           *end = '\0';

           while (*(end+1) != '\0' && (end+1-buff)<=len &&

                  (*(end+1) == ' ' || *(end+1) == '\t'))

           {

               end++;

               *end = '\0';

           }

           if (start != end)

           {

               if (firstRowIsHeader && firstRow)

               {

                   variableNames.push_back(start);

               }

               else

               {

                   double value = atof(start);

                   row.push_back(value);

               }

           }

           start = end+1;

       }

   }

   int rowlen = (firstRowIsHeader && firstRow) ?(int) variableNames.size() : (int)row.size();

   if (firstRow)

   {

       ncolumns = rowlen;

   }

   else if (rowlen != ncolumns)

   {

       break;

   }

   if (!(firstRowIsHeader && firstRow))

   {

       data.push_back(row);

       nrows++;

   }

   firstRow = false;

   in().getline(buff, linelen);

   if (nrows < 5)

   {

       // Check the first several rows to make sure it's ASCII.

       if (!StringHelpers::IsPureASCII(buff, linelen))

           EXCEPTION2(InvalidFilesException, filename.c_str(), "Not ASCII.");

   }

   else

   {

-#ifdef MDSERVER

       // We don't need to know how many rows there are in the

       // MDServer, nor do we need to read all the data.  We do

       // want to make sure there's at least one row of data,

       // though, because if not, its probably not even a plain

       // text file.  And we probably don't want to break out

       // until we've got a good clue this file is truly ASCII.

       break;

-#endif

   }

}
delete [] buff;

if (ncolumns == 0 || (!firstRowIsHeader && nrows == 0))
{

   EXCEPTION2(InvalidFilesException, filename.c_str(),

              "Couldn't parse anything meaningful from the file.");

}

// fix up variable names
if (format == Grid)
{

   // we need exactly one variable name for 2D grid files

   if (variableNames.size() > 1)

       variableNames.resize(1);

   if (variableNames.size() == 0)

       variableNames.push_back("var");

}
else if (format == Columns)
{

   // If we didn't get enough variable names, fill it out with

   // generic values; and if it's too much, trim it

   for (int i=(int)variableNames.size(); i<ncolumns; i++)

   {

       char str[20];

       sprintf(str, "var%02d", i);

       variableNames.push_back(str);

   }

   if (variableNames.size() > (size_t)ncolumns)

       variableNames.resize(ncolumns);

}

//in().close();
fileRead = true;
-}
+// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
+// Project developers.  See the top-level LICENSE file for dates and other
+// details.  No copyright assignment is required to contribute to VisIt.

+// ************************************************************************* //
+//                            avtPlainTextFileFormat.C                           //
+// ************************************************************************* //
+
+#include <avtPlainTextFileFormat.h>
+
+#include
+#include
+
+#include <vtkPointData.h>
+#include <vtkDoubleArray.h>
+#include <vtkRectilinearGrid.h>
+#include <vtkUnstructuredGrid.h>
+#include <vtkPolyData.h>
+#include <vtkCellArray.h>
+#include <vtkVisItUtility.h>
+
+#include <avtDatabaseMetaData.h>
+
+#include <DBOptionsAttributes.h>
+#include <Expression.h>
+#include <StringHelpers.h>
+
+#include "visit_gzstream.h"
+
+#include <InvalidVariableException.h>
+#include <InvalidFilesException.h>
+
+
+using     std::string;
+using     std::vector;
+
+string
+TrimLeadingandTrailingSpaces(string str)
+{

auto start = str.find_first_not_of(" ");
if (start == string::npos)

   return "";

auto end = str.find_last_not_of(" ");
return str.substr(start, end - start + 1);
+}

+// ****************************************************************************
+//  Method: avtPlainTextFileFormat constructor
+//
+//  Programmer: Jeremy Meredith
+//  Creation:   January 24, 2008
+//
+//  Modifications:
+//
+//    Mark C. Miller, Wed Oct 29 12:32:11 PDT 2008
+//    Made it possible for curves to have any column as the abscissa
+//
+//    Jeremy Meredith, Fri Apr 30 09:57:29 EDT 2010
+//    Changed data layout field to have a new default, and so I renamed
+//    it so it wouldn't conflict with the old values.
+//
+// ****************************************************************************
+
+avtPlainTextFileFormat::avtPlainTextFileFormat(const char *fn,

                                          const DBOptionsAttributes *readOpts)

: avtSTSDFileFormat(fn)
+{
fileRead = false;
filename = fn;
ncolumns = 0;
nrows = 0;

// Set the options from the DBOptionsAttributes
format = Grid;
firstRowIsHeader = false;
skipLines = 0;
xcol = -1;
ycol = -1;
zcol = -1;

if (readOpts &&

   readOpts->FindIndex("Data layout")>=0)

{

   int index = readOpts->GetEnum("Data layout");

   if (index==0) format = Columns;

   if (index==1) format = Grid;

}
if (readOpts &&

   readOpts->FindIndex("First row has variable names")>=0)

{

   firstRowIsHeader = readOpts->GetBool("First row has variable names");

}
if (readOpts &&

   readOpts->FindIndex("Lines to skip at beginning of file")>=0)

{

   skipLines = readOpts->GetInt("Lines to skip at beginning of file");

}
if (readOpts &&

   readOpts->FindIndex("Column for X coordinate (or -1 for none)")>=0)

{

   xcol = readOpts->GetInt("Column for X coordinate (or -1 for none)");

}
if (readOpts &&

   readOpts->FindIndex("Column for Y coordinate (or -1 for none)")>=0)

{

   ycol = readOpts->GetInt("Column for Y coordinate (or -1 for none)");

}
if (readOpts &&

   readOpts->FindIndex("Column for Z coordinate (or -1 for none)")>=0)

{

   zcol = readOpts->GetInt("Column for Z coordinate (or -1 for none)");

}

acol = -2; // abscissa column for curves
if (xcol<0 && ycol<0 && zcol<0)

   acol = -1;

else if (xcol>=0 && ycol<0  && zcol<0)

   acol = xcol;

else if (xcol<0  && ycol>=0 && zcol<0)

   acol = ycol;

else if (xcol<0  && ycol<0  && zcol>=0)

   acol = zcol;

+}
+
+
+// ****************************************************************************
+//  Method: avtPlainTextFileFormat::FreeUpResources
+//
+//  Purpose:
+//      When VisIt is done focusing on a particular timestep, it asks that
+//      timestep to free up any resources (memory, file descriptors) that
+//      it has associated with it.  This method is the mechanism for doing
+//      that.
+//
+//  Programmer: Jeremy Meredith
+//  Creation:   January 24, 2008
+//
+//  Modifications:
+//
+//    Hank Childs, Wed May 26 09:05:44 PDT 2010
+//    Fix memory bloat issue from STL.
+//
+//    Mark C. Miller, Tue Dec  1 13:07:23 PST 2020
+//    Switched to double precision data
+// ****************************************************************************
+
+void
+avtPlainTextFileFormat::FreeUpResources(void)
+{

variableNames.clear();
data.clear();
std::vector< std::vector > tmp;
data.swap(tmp); // this makes capacity() drop to 0, which is better than

               // what clear() does.

fileRead = false;
+}

+// ****************************************************************************
+//  Method: avtPlainTextFileFormat::PopulateDatabaseMetaData
+//
+//  Purpose:
+//      This database meta-data object is like a table of contents for the
+//      file.  By populating it, you are telling the rest of VisIt what
+//      information it can request from you.
+//
+//  Programmer: Jeremy Meredith
+//  Creation:   January 24, 2008
+//
+//  Modifications:
+//
+//    Mark C. Miller, Wed Oct 29 12:32:11 PDT 2008
+//    Made it possible for curves to have any column as the abscissa
+// ****************************************************************************
+
+void
+avtPlainTextFileFormat::PopulateDatabaseMetaData(avtDatabaseMetaData *md)
+{

ReadFile();

if (format == Grid)
{

   // rectilinear grid

   AddMeshToMetaData(md, "mesh", AVT_RECTILINEAR_MESH, NULL,

                     1,0, 2,2);

   AddScalarVarToMetaData(md, variableNames[0], "mesh", AVT_NODECENT);

}
else if (format == Columns)
{

   if (acol > -2)

   {

       // curves

       for (int i=0; i<ncolumns; i++)

       {

           if (i == acol)

               continue;

           avtCurveMetaData *curve = new avtCurveMetaData;

           curve->name = variableNames[i];

           md->Add(curve);

       }

   }

   else

   {

       // pointmesh

       int spatialdim = (zcol<0) ? 2 : 3;

       AddMeshToMetaData(md, "mesh", AVT_POINT_MESH, NULL,

                         1,0, spatialdim,1);

       // variables

       for (int i=0; i<ncolumns; i++)

       {

           AddScalarVarToMetaData(md, variableNames[i], "mesh",

                                  AVT_NODECENT);

       }

   }

}
+}

+// ****************************************************************************
+//  Method: avtPlainTextFileFormat::GetMesh
+//
+//  Purpose:
+//      Gets the mesh associated with this file.  The mesh is returned as a
+//      derived type of vtkDataSet (ie vtkRectilinearGrid, vtkStructuredGrid,
+//      vtkUnstructuredGrid, etc).
+//
+//  Arguments:
+//      meshname    The name of the mesh of interest.  This can be ignored if
+//                  there is only one mesh.
+//
+//  Programmer: Jeremy Meredith
+//  Creation:   January 24, 2008
+//
+//  Modifications:
+//    Jeremy Meredith, Thu Jun 26 17:26:22 EDT 2008
+//    Changed curves to be created as rectilinear grids instead of polydata
+//    (so that they work with expressions).
+//
+//    Mark C. Miller, Wed Oct 29 12:32:11 PDT 2008
+//    Made it possible for curves to have any column as the abscissa
+//
+//    Jeremy Meredith, Thu Jan 20 13:26:04 EST 2011
+//    Fixed a copy/paste bug with creating 1D/2D point meshes.  (3D was okay.)
+//
+//    Mark C. Miller, Tue Dec  1 13:05:46 PST 2020
+//    Switched to double precision for coords
+// ****************************************************************************
+
+vtkDataSet *
+avtPlainTextFileFormat::GetMesh(const char *meshname)
+{

ReadFile();
if (format == Grid)
{

   // rectilinear grid

   vtkRectilinearGrid   *rgrid   = vtkRectilinearGrid::New();

   vtkDoubleArray *coords[3];

   int dims[3] = {ncolumns, nrows, 1};

   for (int i = 0 ; i < 3 ; i++)

   {

       coords[i] = vtkDoubleArray::New();

       coords[i]->SetNumberOfTuples(dims[i]);

       for (int j = 0 ; j < dims[i] ; j++)

       {

           coords[i]->SetComponent(j, 0, j);

       }

   }

   rgrid->SetDimensions(dims);

   rgrid->SetXCoordinates(coords[0]);

   rgrid->SetYCoordinates(coords[1]);

   rgrid->SetZCoordinates(coords[2]);

   coords[0]->Delete();

   coords[1]->Delete();

   coords[2]->Delete();

   return rgrid;

}
else if (format == Columns)
{

   if (acol > -2)

   {

       // curves

       int index = -1;

       for (int i=0; i< (int)variableNames.size(); i++)

       {

           if (meshname == variableNames[i])

               index = i;

       }

       if (index < 0)

           EXCEPTION1(InvalidVariableException, meshname);

       vtkDoubleArray *vals = vtkDoubleArray::New();

       vals->SetNumberOfComponents(1);

       vals->SetNumberOfTuples(nrows);

       vals->SetName(meshname);

       vtkRectilinearGrid *rg =

           vtkVisItUtility::Create1DRGrid(nrows,VTK_DOUBLE);

       rg->GetPointData()->SetScalars(vals);

       vtkDataArray *xc = rg->GetXCoordinates();

       for (int j = 0 ; j < nrows ; j++)

       {

           if (acol == -1)

               xc->SetComponent(j, 0, j);

           else

               xc->SetComponent(j, 0, data[j][acol]);

           vals->SetValue(j, data[j][index]);

       }

       vals->Delete();

       return rg;

   }

   else

   {

       // pointmesh

       vtkPolyData *pd  = vtkPolyData::New();

       vtkPoints   *pts = vtkPoints::New();

       pts->SetNumberOfPoints(nrows);

       pd->SetPoints(pts);

       pts->Delete();

       for (int j = 0 ; j < nrows ; j++)

       {

           double x = (xcol<0 || xcol>=ncolumns) ? 0 : data[j][xcol];

           double y = (ycol<0 || ycol>=ncolumns) ? 0 : data[j][ycol];

           double z = (zcol<0 || zcol>=ncolumns) ? 0 : data[j][zcol];

           pts->SetPoint(j, x, y, z);

       }

       vtkCellArray *verts = vtkCellArray::New();

       pd->SetVerts(verts);

       verts->Delete();

       for (int k = 0 ; k < nrows ; k++)

       {

           verts->InsertNextCell(1);

           verts->InsertCellPoint(k);

       }

       return pd;

   }

}

return NULL;
+}

+// ****************************************************************************
+//  Method: avtPlainTextFileFormat::GetVar
+//
+//  Purpose:
+//      Gets a scalar variable associated with this file.  Although VTK has
+//      support for many different types, the best bet is vtkFloatArray, since
+//      that is supported everywhere through VisIt.
+//
+//  Arguments:
+//      varname    The name of the variable requested.
+//
+//  Programmer: Jeremy Meredith
+//  Creation:   January 24, 2008
+//
+//  Mark C. Miller, Tue Dec  1 13:06:00 PST 2020
+//  Switched to double precision for data
+// ****************************************************************************
+
+vtkDataArray *
+avtPlainTextFileFormat::GetVar(const char *varname)
+{

ReadFile();

if (format == Grid)
{

   // just one var; do it blindly

   vtkDoubleArray *values = vtkDoubleArray::New();

   values->SetNumberOfTuples(nrows*ncolumns);

   int ctr = 0;

   for (int i=0; i<nrows; i++)

   {

       for (int j=0; j<ncolumns; j++)

       {

           values->SetComponent(ctr, 0, data[i][j]);

           ctr++;

       }

   }

   return values;

}
else if (format == Columns)
{

   int index = -1;

   for (int i=0; i<(int)variableNames.size(); i++)

   {

       if (varname == variableNames[i])

           index = i;

   }

   if (index < 0)

       EXCEPTION1(InvalidVariableException, varname);

   vtkDoubleArray *values = vtkDoubleArray::New();

   values->SetNumberOfTuples(nrows);

   int ctr = 0;

   for (int i=0; i<nrows; i++)

   {

       values->SetComponent(ctr, 0, data[i][index]);

       ctr++;

   }

   return values;

}

return NULL;
+}

+// ****************************************************************************
+//  Method: avtPlainTextFileFormat::GetVectorVar
+//
+//  Purpose:
+//      Gets a vector variable associated with this file.  Although VTK has
+//      support for many different types, the best bet is vtkFloatArray, since
+//      that is supported everywhere through VisIt.
+//
+//  Arguments:
+//      varname    The name of the variable requested.
+//
+//  Programmer: Jeremy Meredith
+//  Creation:   January 24, 2008
+//
+// ****************************************************************************
+
+vtkDataArray *
+avtPlainTextFileFormat::GetVectorVar(const char *varname)
+{

return NULL;
+}

+// ****************************************************************************
+//  Method: avtPlainTextFileFormat::ReadFile
+//
+//  Purpose:
+//      Read the file if it's not already been read.
+//
+//  Note: the mdserver will shortcut out once it reads the first few rows.
+//
+//  Arguments:
+//      none
+//
+//  Programmer: Jeremy Meredith
+//  Creation:   January 24, 2008
+//
+//  Modifications:
+//    Jeremy Meredith, Fri Jan 25 17:53:13 EST 2008
+//    Support both CSV and whitespace-delimited files.  Sped up
+//    parsing as well.
+//
+//    Brad Whitlock, Mon Apr 27 09:00:52 PDT 2009
+//    I increased the line length from 4K to 32K.
+//
+//    Jeremy Meredith, Wed Jan  6 13:26:52 EST 2010
+//    Check for an ASCII file or empty data.
+//
+//    Hank Childs, Mon Feb  4 10:52:01 PST 2013
+//    Improve logic for files with variable names.
+//
+//    Mark C. Miller, Tue Dec  1 13:06:57 PST 2020
+//    Switched to double precision for rows of data
+//
+//    Justin Privitera, Fri Apr  1 11:18:38 PDT 2022
+//    Added TrimLeadingandTrailingSpaces function
+//    to remove whitespace from variable names
+//    as they are read.
+//
+// ****************************************************************************
+
+void
+avtPlainTextFileFormat::ReadFile()
+{

if (fileRead)

   return;

visit_ifstream in(filename.c_str());
if (!in())

   EXCEPTION1(InvalidFilesException, filename.c_str());

// skip the first lines if asked
int linelen = 32768;
char *buff = new char[linelen];
memset(buff, 0, sizeof(char) * linelen);
for (int l=0; l<skipLines; l++)
{

   in().getline(buff, linelen);

   if (!StringHelpers::IsPureASCII(buff, linelen))

       EXCEPTION2(InvalidFilesException, filename.c_str(), "Not ASCII.");

}

// actually read the data; one vector per row
ncolumns = 0;
nrows = 0;
bool firstRow = true;
in().getline(buff, linelen);
if (!StringHelpers::IsPureASCII(buff, linelen))

   EXCEPTION2(InvalidFilesException, filename.c_str(), "Not ASCII.");

bool comma = false;
for (char *p=buff; *p!='\0'; p++)

   if (*p == ',')

       comma = true;

while (in())
{

   int len = (int)strlen(buff);

   char *start = buff;

   vector<double> row;

   if (comma)

   {

       while ((start-buff)<=len)

       {

           char *end = start;

           while (*end != '\0' && (end-buff)<=len &&

                  !(*end == ','))

           {

               end++;

           }

           *end = '\0';

           if (firstRowIsHeader && firstRow)

           {

               variableNames.push_back(

                   TrimLeadingandTrailingSpaces(start));

           }

           else

           {

               double value = atof(start);

               row.push_back(value);

           }

           start = end+1;

       }

   }

   else

   {

       while (*start != '\0' && (start-buff)<=len &&

              (*start == ' ' || *start == '\t'))

       {

           start++;

       }

       while ((start-buff)<=len)

       {

           char *end = start;

           while (*end != '\0' && (end-buff)<=len &&

                  !(*end == ' ' || *end == '\t'))

           {

               end++;

           }

           *end = '\0';

           while (*(end+1) != '\0' && (end+1-buff)<=len &&

                  (*(end+1) == ' ' || *(end+1) == '\t'))

           {

               end++;

               *end = '\0';

           }

           if (start != end)

           {

               if (firstRowIsHeader && firstRow)

               {

                   variableNames.push_back(

                       TrimLeadingandTrailingSpaces(start));

               }

               else

               {

                   double value = atof(start);

                   row.push_back(value);

               }

           }

           start = end+1;

       }

   }

   int rowlen = (firstRowIsHeader && firstRow) ?(int) variableNames.size() : (int)row.size();

   if (firstRow)

   {

       ncolumns = rowlen;

   }

   else if (rowlen != ncolumns)

   {

       break;

   }

   if (!(firstRowIsHeader && firstRow))

   {

       data.push_back(row);

       nrows++;

   }

   firstRow = false;

   in().getline(buff, linelen);

   if (nrows < 5)

   {

       // Check the first several rows to make sure it's ASCII.

       if (!StringHelpers::IsPureASCII(buff, linelen))

           EXCEPTION2(InvalidFilesException, filename.c_str(), "Not ASCII.");

   }

   else

   {

+#ifdef MDSERVER

       // We don't need to know how many rows there are in the

       // MDServer, nor do we need to read all the data.  We do

       // want to make sure there's at least one row of data,

       // though, because if not, its probably not even a plain

       // text file.  And we probably don't want to break out

       // until we've got a good clue this file is truly ASCII.

       break;

+#endif

   }

}
delete [] buff;

if (ncolumns == 0 || (!firstRowIsHeader && nrows == 0))
{

   EXCEPTION2(InvalidFilesException, filename.c_str(),

              "Couldn't parse anything meaningful from the file.");

}

// fix up variable names
if (format == Grid)
{

   // we need exactly one variable name for 2D grid files

   if (variableNames.size() > 1)

       variableNames.resize(1);

   if (variableNames.size() == 0)

       variableNames.push_back("var");

}
else if (format == Columns)
{

   // If we didn't get enough variable names, fill it out with

   // generic values; and if it's too much, trim it

   for (int i=(int)variableNames.size(); i<ncolumns; i++)

   {

       char str[20];

       sprintf(str, "var%02d", i);

       variableNames.push_back(str);

   }

   if (variableNames.size() > (size_t)ncolumns)

       variableNames.resize(ncolumns);

}

//in().close();
fileRead = true;
+}
diff --git a/src/resources/help/en_US/relnotes3.2.3.html b/src/resources/help/en_US/relnotes3.2.3.html
index 8e64eb357d..b8a5f45431 100644
--- a/src/resources/help/en_US/relnotes3.2.3.html
+++ b/src/resources/help/en_US/relnotes3.2.3.html
@@ -22,6 +22,7 @@ enhancements and bug-fixes that were added to this release.

Bugs fixed in version 3.2.3

Fixed a bug with expression insert-function for constant expressions, so usage is clearer.
+  Fixed a bug with the Plaintext Reader. Previously, when reading CSV data, if the column names had leading or trailing whitespace, the plugin would fail to parse them correctly, and would keep the whitespace as part of the names. This has now been fixed.

But again, if you go to the "Files Changed" settings and toggle to hide whitespace, it looks correct.

Ok, so your cut-n-pasted git diff on your local terminal results here concern me.

I was thinking it was only browser issues but I worry something else is wrong here.
Git seems to think you've deleted the entire contents of the file and re-added.
Do you have any funky line-ending or UTF character encoding going on?
Can you checkout 3.2RC and make a copy of that file somewhere else and then use non-git diff tools to compare it with your current file?
You sure you branched directly from 3.2RC for this?
I think we need to understand this diff before we go further.

@visit-dav/visit-developers any thoughts on what could be going wrong here?

FYI...I've downloaded the file via View file and copy raw contens (can't vouch for how that process might handle line endings or funky UTF character encoding) and then diffed the file with develop and 3.2RC and see only the  lines you changed. Very weird!! 😮

@JustinPrivitera can you gzip the file from your machine and attach it here? I wanna make sure I am seeing verbatim what you have at your end and not something filtered through git or github.

Do you have any funky line-ending or UTF character encoding going on?

Ahhh. That explains it. I didn't think of this until seeing your message.
I am working from home in a different location this week and don't have access to fast enough internet to make working on the LC feasible, so I've been editing everything on my lab windows laptop. My text editor replaced all the line endings with windows line endings, messing up the whole file. That should be mitigated now as of the latest commit.
Sorry for all the confusion and thanks for all the help!

That should be mitigated now as of the latest commit.

Did you already push that commit? FYI...the latest I am seeing still has the problem.

Did you already push that commit? FYI...the latest I am seeing still has the problem.

hmmm, strange. This is the result of git diff on my terminal:
diff --git a/src/databases/PlainText/avtPlainTextFileFormat.C b/src/databases/PlainText/avtPlainTextFileFormat.C
index c85b6aa259..131fb4eee3 100644
--- a/src/databases/PlainText/avtPlainTextFileFormat.C
+++ b/src/databases/PlainText/avtPlainTextFileFormat.C
@@ -34,6 +34,16 @@
 using     std::string;
 using     std::vector;

+string
+TrimLeadingandTrailingSpaces(string str)
+{
+    auto start = str.find_first_not_of(" ");
+    if (start == string::npos)
+        return "";
+    auto end = str.find_last_not_of(" ");
+    return str.substr(start, end - start + 1);
+}
+
 // ****************************************************************************
 //  Method: avtPlainTextFileFormat constructor
 //
@@ -457,6 +467,12 @@ avtPlainTextFileFormat::GetVectorVar(const char *varname)
 //
 //    Mark C. Miller, Tue Dec  1 13:06:57 PST 2020
 //    Switched to double precision for rows of data
+//
+//    Justin Privitera, Fri Apr  1 11:18:38 PDT 2022
+//    Added TrimLeadingandTrailingSpaces function
+//    to remove whitespace from variable names
+//    as they are read.
+//
 // ****************************************************************************

 void
@@ -513,7 +529,8 @@ avtPlainTextFileFormat::ReadFile()
                 *end = '\0';
                 if (firstRowIsHeader && firstRow)
                 {
-                    variableNames.push_back(start);
+                    variableNames.push_back(
+                        TrimLeadingandTrailingSpaces(start));
                 }
                 else
                 {
@@ -549,7 +566,8 @@ avtPlainTextFileFormat::ReadFile()
                 {
                     if (firstRowIsHeader && firstRow)
                     {
-                        variableNames.push_back(start);
+                        variableNames.push_back(
+                            TrimLeadingandTrailingSpaces(start));
                     }
                     else
                     {
diff --git a/src/resources/help/en_US/relnotes3.2.3.html b/src/resources/help/en_US/relnotes3.2.3.html
index 8e64eb357d..b8a5f45431 100644
--- a/src/resources/help/en_US/relnotes3.2.3.html
+++ b/src/resources/help/en_US/relnotes3.2.3.html
@@ -22,6 +22,7 @@ enhancements and bug-fixes that were added to this release.</p>
 <p><b><font size="4">Bugs fixed in version 3.2.3</font></b></p>
 <ul>
   <li>Fixed a bug with expression insert-function for constant expressions, so usage is clearer. </li>
+  <li>Fixed a bug with the Plaintext Reader. Previously, when reading CSV data, if the column names had leading or trailing whitespace, the plugin would fail to parse them correctly, and would keep the whitespace as part of the names. This has now been fixed.</li>
 </ul>

 <a name="Enhancements"></a>

Ok, it looks fine now. Maybe GitHub was just slow to update after your last commit.

I am working from home in a different location this week and don't have access to fast enough internet to make working on the LC feasible, so I've been editing everything on my lab windows laptop. My text editor replaced all the line endings with windows line endings, messing up the whole file. That should be mitigated now as of the latest commit.

It may be that the files were automatically converted to windows- style line endings on checkout.
For future reference, I have this in my .gitconfig on Windows:
[core]
        autocrlf = input

That way all the files should be checked out unix-style endings.  You'd still have to check if your editor automatically converts, I use gvim and it doesn't convert.  Some of our auto-generator tools may be writing files out with native line endings.
As an extra-check, GithubDesktop tells me which files have switched line-endings in my 'Changed' list before I commit, and if I pay attention to that notice, I know I need to fix the line endings.

In subversion days, we had a hook for this, check_dos.sh.
We can resurrect but people have to know and agree to install hooks.
We can make part of CI too.
Maybe we should make an effort to reinstate all the hook functionality we lost as CI.

+1 to re-instating the lost functionality in the CI.

merged into develop in #17540


Memory management

I have very large neural network. I instantiate all layers (CLConvolutionLayers, CLPoolingLayers, CLActivationLayers), weight and bias tensors, and input and output tensors for each layer. I try to run it on Samsung Galaxy S7 and somewhere in the middle of the configuration part of the neural network, the application crashes. I can't see any warning or error log. Is it possible that mobile phone's GPU is full, so it just silently kills the application?
Edit: This error occurs: E/OpenGLRenderer:   saveGfxinfoFileDisabled enabled

Yes, it's possible that your phone runs out of memory.
You should have some messages in dmesg and logcat though which tell you your application was killed.
We're working on improving memory management so that you don't need to allocate an entire network upfront anymore which hopefully will solve your issue.


Rename rwmh to rmh

The implementation is general and not limited to random walks, so @AdrienCorenflos was right in naming the algorithm mh (for Metropolis-Hasting).
As the story goes, the "Metropolis algorithm" was also developed by Arianna Rosenbluth whose name is little known. I thus suggest we rename the algorithm rmh for Rosenbluth-Metropolis-Hastings.
I understand this goes against previous conventions, and it may need some getting used to for users. But if no one ever does it...

Remember to change the file header to reflect the choice of name convention

One design choice is to have mh being a general kernel, and have random-walk MH and hmc both call mh. This is what TFP is doing.

The implementation of mh is already very general here, so this would be possible with very little change.
Any drawback to that design that you know of?

It will actually be a bit of work to use it in hmc and especially nuts. Do we want that for the next release or later?
I suggest to start with the name change up to the gaussian_rwrmh algorithm as someone is working on an example notebook.

+1 starting with name change - how about just gaussian_rmh? gaussian is the kernel and i always consider random walk here being not a very good description (ie it shouldn't be a random walk)

I always consider random walk here being not a very good description (ie it shouldn't be a random walk)

That is a good point, but how do we call a file that contains gaussian_rmh and lognormal_rmh? Random walk kind of makes sense when you oppose it to deterministic HMC proposals.


[tests-only] skip tests that are tagged @skipOnOcis-OC-Storage

skip tests tagged with the new tag in https://github.com/owncloud/core/pull/37554

@phil-davis after CI passed with that specific branch I now reverted the last commit and make it run on master again


Reading file inside generated exe

Hi all, I wanted to know if there is a way to read a file inside the generated exe. I have some files that i need to read in my source code. but when i generate the final exe the program doesn't find them; Any help please ?

Try changing the location of the file to root and read from there. Then build exe and try. It worked for me.


Functional updates - unsure about modyfing previous state docs

In this example https://reactjs.org/docs/hooks-reference.html#functional-updates we're told that update objects are not merged. It is not clear, however, that returning a modified version of prevState won't work.
I find it a bit confusing and I believe that it should be made clear, that a new object or array has to be returned.
I tried to do something similar to the code below and it obviously didn't work ;)
import React, {useState} from 'react'
import {render, fireEvent} from '@testing-library/react'

function Child({foo}) {
  if (foo.something) {
    return
something is true!

  } else {
    return
something is false!

  }
}

function Parent() {
  const [foo, setFoo] = useState({something: false})

  function flipFoo() {
    setFoo(previousState => {
      previousState.something = !previousState.something
      return previousState
    })
  }

  return (
    <>
      <button type="button" onClick={() => flipFoo()}>
        Toggle
      </button>

        <Child foo={foo} />

    </>
  )
}

test('should change falsy to truthy', () => {
  const {getByTestId, getByText} = render(<Parent />)
  expect(getByTestId('content').textContent).toBe('something is true!')
  fireEvent.click(getByText('Toggle'))
  expect(getByTestId('content').textContent).toBe('something is false!')
})

you should never modify previous state directly


vscode-extensions.ms-python.python: fix failing autoPatchelfHook

Motivation for this change
Fix auto-patching:
autoPatchelfHook could not satisfy dependency liblttng-ust.so.0 wanted by /nix/store/zzkbmv6s9vxc2sx6455yca90izcili5k-vscode-extension-ms-python-python-2021.5.829140558/share/vscode/extensions/ms-python.python/languageServer.0.5.30/libcoreclrtraceptprovider.so

Things done

Built on platform(s)

[X] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
21.11 Release Notes (or backporting 21.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[X] Fits CONTRIBUTING.md.

@rhoriguchi: See #140564. liblttng-ust.so had a major update in its so version from 0 to 1. This might fix the build but this seems a risky move as the lib author mentioned this .1 update was binary incompatible with previous .0.

I just wanted it to build. Since I had it comment in my config for a while. I'll close my PR since #140564 makes a lot more sense.


Mantine 7

Draft PR for Mantine 7 migration.

General things done in the migration:

Replace position="apart" with justify="space-between" on all Stack/Group
Replace spacing= with gap= on all Stack/Group (may also occur elsewhere)
Replace position="right" with justify="flex-end" on all Stack/Group (may also occur in Tooltip)
Replace noWrap with wrap="nowrap" on all Stack/Group
Replace position="center" with justify="center" on all Stack/Group
Search for compact and replace it with size="compact-sm" or the appropriate size (sm is default)

do this manually and check if there are already size attributes and change to correct size

Replace align= with ta= on all Text
Replace sx with style on all elements, but make sure

There are no inline selectors, hover styles etc
If there are, try to migrate them using css modules or emotion css

Replace weight="bold" with fw="bold" on all Text (and all other weight variations)
Remove withinPortal on all Elements

withinPortal is true by default now and not needed for most elements like Tooltip, only leave it if it says withinPortal="false"


Reordering explicitly imported names and wildcard may introduce compilation error

Reported by @olafurpg in this tweet.
Affected versions
<= v0.3.0-RC1
Description
Although an explicitly imported name should take higher precedence than those imported via a wildcard (see here), the following snippet does not compile:
package a

import b.foo
import c._

object b { implicit def foo = 42 }
object c { implicit def foo = 43 }

class Imports {
  def x()(implicit n: Int) = println(n)

  def main() = x()
}

This could be a Scala compiler bug. To scalac, it seems that both b.foos and c.foo have the same precedence:
Test.scala:12: error: could not find implicit value for parameter n: Int
  def main() = x()
                ^

However, we still need to make sure that OrganizeImports does not produce broken code that doesn't compile. This means we cannot freely reorder wildcard imports and explicitly imported names.
One possible solution is to make importsOrder defaults to SymbolsFirst, which moves wildcard imports and grouped imports with braces before others.

One possible solution is to make importsOrder defaults to SymbolsFirst, which moves wildcard imports and grouped imports with braces before others.

How does this work across different groups?
import b.foo // group 1
import b.bar.x

import c._ // group 2
import c.bar.x

Another possible solution would be to move named imports on implicit symbols to a separate group at the bottom. I think it would be nice for readability to separate explicitly imported implicits from other imports and it would avoid the situation where we sort a named implicit import above a wildcard import.

@olafurpg, thanks, you're right about the case across different groups.
Moving explicitly imported implicits into the last group seems to be a feasible direction. The only problem is that I've already reserved the last group for relative imports (when expandRelative is  false). Need to double think about how these two cases may interact with each other.


Vique added

Thanks! Looks like the start of a really cool app.
Btw, the magnet link that's preloaded in the app didn't work for me. Is it seeded? If you want, you're free to use the the Sintel (creative-commons licensed) torrrent.
The magnet link is: magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=sintel.mp4&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.webtorrent.io&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel-1024-surround.mp4
Also, it appears that when a torrent is stuck and doesn't start playing, that there's no way to skip to the next torrent in the list. Am I missing something? That would be cool to add!

Yeah... The magnet links are posted by users, sadly zero seeders for most of them...
My hope is/was that sharing users video in the queue will increase the number of valid webtorrent magnet links.
The Sintel is in the queue but it's not the first.
It's a great idea, I'll add the skip button ASAP!

@andreapaiola Cool, let me know once you've added it! I want to check it out :)

Hi Feross,

added a GO link in the "next video area"
added a SKIP link in the "waiting area"
updated webtorrent version to 0.74.2 here and in the Niagara Project

Stats: 20 days online, 60 magnet links in the queue (and Sintel is the fourth https://andreapaiola.name/vique/?v=6a9759bffd5c0af65319979fb7832189f4f3c35d  )

Nice, seems to work great!


pull: fix status code check in check_bintray_mirror

Fix an issue in #2252. Report by @ilovezfs:
Josephs-MacBook-Pro:~ joe$ brew pull https://github.com/Homebrew/homebrew-core/pull/12969
==> Fetching patch
Patch: https://github.com/Homebrew/homebrew-core/pull/12969.patch
==> Applying patch
Applying: openssl: remove support for universal build
Warning: The Bintray mirror https://dl.bintray.com/homebrew/mirror/openssl-1.0.2k.tar.gz is not reachable (HTTP status code 200).

The status code of the last redirect should be 2xx to be deemed successful. I don't remember why I was checking for 3xx; most likely a typo.

Makes sense, thanks again @zmwangx!


Add ProGuard instructions to repo

As mentioned in #140 user's may run into issues with ProGuard and that hasn't been tested.

Moved to internal tracker: https://filestack.atlassian.net/browse/FS-3354


Bug breaking elevenlabslib

I tried to run a trivial example use, found here. That fails due to the following error:
/elevenlabslib/helpers.py", line 52, in _pretty_print_POST
    req = res.requests
AttributeError: 'PreparedRequest' object has no attribute 'requests'

Whoops. Fixed and uploaded v0.4.1 with the fix to pypi.


Support aggregate operations on nested keypaths

Can I use the .sum on realm results to sum values embedded lists?
Object1 -> has a list of Object2, Object2 has a number value X
I have a result list of Object1 and want the sum of x.  results.sum("object2.x") does not work. Is this possible now or should this be a feature request?

Unfortunately this is not currently supported, but we're now tracking adding support for that functionality in this ticket, so you'll be notified of any progress we make on this front.
In the meantime, you could get all the X values and sum them outside Realm:
import RealmSwift

class Object1: Object {
    let object2s = List<Object2>()
}

class Object2: Object {
    dynamic var x = 0
}

let realm = try! Realm()

try! realm.write {
    for i in 0..<5 {
        realm.create(Object2.self, value: [i])
    }
    realm.create(Object1.self, value: [realm.objects(Object2)])
}

let xValues = realm.objects(Object1).valueForKeyPath("object2s.x") as! [[Int]]
let xSum = xValues.flatMap({ $0 }).reduce(0, combine: +)
xSum // => 10

Thanks!!!

@dltlr Yes. Int64 comforms to AddableType. See https://github.com/realm/realm-cocoa/blob/master/RealmSwift-swift2.0/Results.swift#L45


Accessing the macOS clipboard from within tmux sessions (tmux 3.1)

I can't seem to get my copy buffer contents copied to my OS.
I have a fresh installation except for:
set -g mouse on
tmux_conf_copy_to_os_clipboard=true

I've also tried with and without reattach-to-user-namespace (installed via brew).
CTRL + B, [ enables mouse selection copy and copies to the tmux buffer - I can see the buffer contents with CTRL + B, ] or CTRL + B, B. Pasting outside of tmux with Command + V does not show the contents from within tmux though.
tmux list-keys |grep -e 'copy-selection\|copy-pipe' gives the following output:
bind-key    -T copy-mode    C-w                  send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key    -T copy-mode    MouseDragEnd1Pane    send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key    -T copy-mode    M-w                  send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key    -T copy-mode-vi C-j                  send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key    -T copy-mode-vi Enter                send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key    -T copy-mode-vi y                    send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"
bind-key    -T copy-mode-vi MouseDragEnd1Pane    send-keys -X copy-pipe-and-cancel "xclip -i -selection clipboard > /dev/null 2>&1"

If I set tmux_conf_copy_to_os_clipboard =false then the above output is instead
bind-key    -T copy-mode    C-w                  send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode    MouseDragEnd1Pane    send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode    M-w                  send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode-vi C-j                  send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode-vi Enter                send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode-vi y                    send-keys -X copy-selection-and-cancel
bind-key    -T copy-mode-vi MouseDragEnd1Pane    send-keys -X copy-selection-and-cancel

It looks like it should be working, however it's not - am I doing something wrong?

Hello @TomWright 👋
So you're on macOS and have xclip installed. That's what confuses Oh my tmux!
Can you please try the gh-459 branch?

Hey @gpakosz,
Thanks for getting back to me so quickly!
After:

checkout out gh-459
disabling clipboard support
enabling clipboard support

I now get this output:
bind-key    -T copy-mode    C-w                  send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key    -T copy-mode    MouseDragEnd1Pane    send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key    -T copy-mode    M-w                  send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key    -T copy-mode-vi C-j                  send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key    -T copy-mode-vi Enter                send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key    -T copy-mode-vi y                    send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key    -T copy-mode-vi MouseDragEnd1Pane    send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"

I also copied that straight from tmux and can confirm it's working as expected 🎉

So you likely don't need reattach-to-user-namespace these days.
If you uninstall it you need to reload the tmux configuration, e.g. with <prefix> + r


Revise nuclear cost structure

This issue can be closed when nuclear power's cost represents the capital cost escalation (introduction here - http://www.world-nuclear.org/information-library/economic-aspects/economics-of-nuclear-power.aspx#ECSArticleLink1) and the construction time/delays that are more common today

Data incorporated from table 2 of https://www.eia.gov/outlooks/aeo/assumptions/pdf/table_8.2.pdf. Data is US-specific.


Resizing glist when running bustools count

https://github.com/BUStools/bustools/blob/f0350e7ac61489485b60d53b6961a25596c333fa/src/Common.cpp#L204-L206
Hey, thanks a lot for a great tool!
I've been experiencing some problems running bustools count: for some of our data, it results in almost empty gene (or transcript) count matrices.
So I've stumbled upon this part of the code while debugging the transcript quantification part of our pipeline.
Aren't we supposed to grow the vector (i.e. if (k >= n)) at this part of the code? It seems that it rather shrinks the vector, which might explain the problems I've encountered.
I have checked that this change would give a slightly different, though quite a similar, gene.mtx file for the getting started tutorial compared to the current master (or devel) branch.
Would be happy to hear your comments!

The code is correct (basically all the things that belong to the intersection have been moved up front). If you are running into problems you can use the mailing list for help.


Removed extra comma in package.json example

There's an extra comma in package.json on WritingTests example recipe page that would cause some of the npm commands to fail

Thanks!


Request Content-Type mismatch, multipart/form-data instead of application/json

Describe the bug
I am getting a content-type mismatch. Altair is sending content-type request header of application/json, but the request payload looks like multipart with one part being JSON:
-----------------------------1072613986120862800957582454 Content-Disposition: form-data; name="operations" {"query":"[...]
I resent the request originally from Altair manually with a Content-Type request header being multipart/form-data; boundary=---------------------------1072613986120862800957582454 instead of application/json and that works.
I did some more digging and found that it has to do with the file uploads. I should mention that I have the files section populated, but after a reload all the associated files are gone, which is ok, because I am not using them often, but I like to keep the empty params so that I don't have to lookup the variable names every time I do use them. I guess this makes my issue an edge case.
To Reproduce
Steps to reproduce the behavior:

In Altair open the network pane
Enter any query
Click add files, enter a the variable name for the file but don't select a file
Submit

Expected behavior
Either (1) a Content-Type request header application/json and JSON request payload, or (2) Content-Type multipart/form-data; boundary=... and multipart payload
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):

OS: Ubuntu 18.04
Browser: FF71
Platform: mozilla addon
Version: 2.4.3

Additional context
none

Right. So if I understand you correctly, if you provide a file data along with the file name, everything works fine, but if you only provide the file name without the file data, it tries to send the request with a multipart body buy application/json header.

sweet, cheers


After installing hhvm-newrelic-ext - getting error

Uncaught exception: Could not open extension /usr/lib/x86_64-linux-gnu/hhvm/extensions/newrelic.so: /usr/lib/x86_64-linux-gnu/hhvm/extensions/newrelic.so: cannot open shared object file: No such file or directory

I'm receiving the same error. HHVM version info below. The box is an AWS EC2 Amazon Linux m3.medium instance.
HipHop VM 3.3.5-dev (rel)
Compiler:<PHONE_NUMBER>_954070912
Repo schema: 954835134_1425439999

I solved this problem with a
sudo ln -s 20150212/newrelic.so

in the extensions folder.


Taxon list error

I clicked on a dot in Navigator and got a list of taxa. When I clicked on one of the clickable taxa, I got the error below. I'm not really sure what it is supposed to do, but this is definitely not it!

This is not broken on training. I am trying to figure out what's wrong with it on phylum.

Yes it is broken on training. It is just broken differently. In Training, it does nothing when you click on the taxon. It should be doing SOMETHING.

@markuhen - are you experiencing this when you click on all collections or just certain ones?

This happens on all the ones I have tried.

From what I can tell, it only seems to happen when you click on a genus or species - anything higher and it seems to work. My guess is that there is an issue in the template, because the data service request that fires off is missing the nam parameter - https://paleobiodb.org/data1.2/taxa/list.json?name=&show=seq

@markuhen, that's weird, what browser are you using? Because when I click the taxon name in the occurrences tab on training, it correctly adds a taxon filter and closes the modal (this is in Chrome). And that includes the exact example in your screenshot.
@jczaplew, taxa/list is hit only at line 1635 of navMap.js (in navMap.filterByTaxon), and when I add a console.log to that line it reports correctly. Again, though, this is the version on training, and is hitting the dev version of the data service on teststrata.

I am seein this in Safari Version 10.1.2 (12603.3.8)

I need someone with Safari to test this for me, then, as I don't have anything that runs OS X anymore.

@jczaplew, I'm testing this again and I can't replicate the missing name parameter error. When I do exactly what Mark describes in the original report (on the Aro locality, in the Neogene right on top of Lagos), the taxa/list call I get is correctly formed: https://paleobiodb.org/data1.2/taxa/list.json?name=Carcharocles%20megalodon&show=seq
Can you test this on Safari for me if you have a minute?

I just tested this. It is now working properly on Training, but I get the error on the main server.
Thus, I think this is fixed and just needs to be pushed to the live site next time we do a push!


Better secrets handling in system tests

Need something like this: https://github.com/GoogleCloudPlatform/google-auth-library-python/blob/master/scripts/decrypt-secrets.sh

#67


Curl to Rust problem

when creating the form, it should be
let form = multipart::Form::new()
instead of multipart::From::new()

@cf512 quick fix?


Ability to disable message from NPC

What does your feature do?
Disables a message that doesn't need to pop up under certain circumstances.
We'd request the ability to disable this: https://lukemango.com/mZCXO.png
How would people use it?
In the config preferably, toggle it with true or false.

Could you explain further what those “certain circumstances” are? Generally speaking, the player should receive feedback as to whether or not a quest was previously available.

Could you explain further what those “certain circumstances” are? Generally speaking, the player should receive feedback as to whether or not a quest was previously available.

We're using NPC's that are essentialls Vendors (have GUIs not associated with quests) in our spawn that are linked to quests, and everytime a player wants to use the NPC, that message will appear.

You can prevent that in stage instead talking to NPC. Just set-up reach location infront of NPC +- 3 blocks radius. And it would work the same without using the NPC's

I've thought about this some, and I really can't imagine a positive experience for players whom forget they've already taken a quest to not receive feedback. This situation is more easily remedied by the idea from @DeadlykillOfficial or by simply having a separate NPC for the quest - perhaps a shopkeeper's assistant or pet animal.

@itslukemango Use https://www.spigotmc.org/resources/message-editor.82154/ It allows you to change or remove unchangeable text.


[request] Zooming

Love this tool so far, but the one thing that I'd love to see is a way to zoom the chat. I would love to be able to make it tiny. :)

Since this app is simply an electron wrapper around Google's web app experience (https://allo.google.com/web), if you'd like to zoom in or zoom out, you would provide the same keyboard shortcuts and commands as you would for your browser.
So if you want to do it in the app, you can do the following:
For Mac:

Zoom in: [ctrl + +] (Windows & Linux) or  [cmd + +] (Mac)
Zoom out: [ctrl +  - ]

For Windows or Linux

Zoom in: [cmd + +]
Zoom out: [cmd +  - ]

or simply click on the toolbar, click View -> Zoom In or Zoom Out
Hope this helps!


Philip gai/133364 file explorer copy name

This PR fixes #133364

[x] code is up-to-date with the main branch

This allows developers to right-click and select "Copy Name" (or use keybinding CtrlCmd+Alt+N) on files/folders in the Explore to get the file/base name (extension included).
This will save time in many developers' workflows, as most people are currently hitting Enter on a single file at a time to highlight the root name, then moving the highlight over the extension, and they have to do this one file at a time and risk accidentally changing the file name.
I also did a little nit renaming of the method used for getting the full and relative paths.
Testing

Open up VS Code and open any folder
In the Explorer:

Right-click, select "Copy Name" and paste the result.
Select multiple files/folders from the Explorer, right-click, "Copy Name" and paste the result.
Try the keybinding! Select files/folders in the explorer and do CtrlCmd+Alt+N (N for name). Paste the result.

Demo
https://user-images.githubusercontent.com/17363579/133879078-6a94988a-0ce1-40e3-8d63-62551496bb5b.mov

Closing due to extension candidacy as mentioned in original issue.


Fix .size longjmp in the linux port of jerry-libc

Fixing a typo, which resulted in an undefined (but harmless) symbol
in jerry-asm.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss<EMAIL_ADDRESS>

LGTM

LGTM


JavaScript Troubleshooting Tutorial: InternalError: too much recursion

Write a short tutorial on JavaScript's InternalError: too much recursion error message, following the "How to troubleshoot Python ZeroDivisionError" example tutorial.
The tutorial should be organized as follows:
---
title: How to troubleshoot JavaScript InternalError too much recursion
author: your name
tags: [tutorial, JavaScript, troubleshooting]
publicationDate: today's date
description: Learn how to error handle JavaScript InternalError too much recursion
image: https://storage.googleapis.com/sourcegraph-assets/learn/headers/sourcegraph-learn-header.png
imageAlt: Sourcegraph Learn
browserTitle: InternalError: too much recursion in JavaScript error handling
type: posts
---

Introduction with the error message

## Reproducing the error

Show how the error can be created.

## Solution 1

Provide a possible solution.

## Solution 2

Provide another solution.

## (optional) Solution 3

Optionally provide a third solution.

## Learn more

Search across open source JavaScript repositories that have the `InternalError` to understand the message more.

<SourcegraphSearch query="InternalError: too much recursion" patternType="literal"/>

Check out more Sourcegraph Learn tutorials on [JavaScript](https://learn.sourcegraph.com/tags/javascript).

If this seems like a tutorial that you can write effectively for the developer community, please follow our Hacktoberfest 2021 contributor guidelines to proceed.

Hey I would like to work on this ticket


message_controls: Prevent clicks via visibility & not pointer-events.

Partially fixes: #13642 (see "Second bug" heading).
The commit message here is really long... Should I just delete the Trivia and History stuff?
Testing Plan:
Manually tested this on my mobile device.
GIFs or Screenshots:
Before:

After:

I added a bit more content to the commit message, removed the partially fixes: # which would have closed the issue and was about to merge, but then I had the question: Should we remove the opacity as well?  I'm pretty sure it's redundant with visibility here.

I opened https://github.com/zulip/zulip/issues/15501 from something I noticed while testing this.

I'm pretty sure it's redundant with visibility here.

It would be, except visibility doesn't get animated by transition (binary setting, not continuous value).
So we keep the opacity so that we can animate it.

Great!  Merged as a4f5b0c635fc286f9fb95e0ab5b679bfecbf95fd, after adding a comment explaining that detail, thanks @YashRE42!


JOIN- ERROR- please provide ID Can't get past login/sign up page

Trying to go in to check on the bug 107-  but I can't get past this page, keep getting the ERROR to provide and ID

@monicakarnes This was because the BBOK product was disabled this morning --we were testing the issue when the product is still purchase-able even though it was disabled in BigCommerce. Try testing it again, it's now working for me.

@jsmnglng-w  Thank you, yes its working now- closing this


UI support for the new features in version 2.2

I see the development focus here is on the EPANET engine. Will the UI support for the new features
(e.g. pressure dependent demand options) be through the legacy EPANET GUI or the re-engineered python GUI (https://github.com/USEPA/SWMM-EPANET_User_Interface) or both?
Hailiang

US EPA sent out a beta test version of the legacy UI with support added for the new v2.2 features to an invited group of reviewers about two months ago. I'm not sure when an official release will be made on EPA's EPANET web site but assume it will be shortly after this OWA project promotes the v2.2 engine code to the master branch of this repo. I don't know what their plans are for the new PyQt GUI.

I'm not sure anyone here can say definitively. Perhaps post the question to the forum at community.wateranalytics.org
I imagine EPA representatives would be happy to bring some clarity ;)


added shell command to generate python types for latest protocol version

Feature:

update-cdp.sh for protocol class generation

minors:

generated requirements.txt
updated CDP classes

@HMaker check it.
also dont foreget to bump version

I made changes to the update-cdp.sh script to it uses the pycdp/gen/generate.py script. Thanks.


BraintreeDropIn is undefined

Hello,
I've tried the basic example in my app.
With this in my component
import BraintreeDropIn from 'react-native-braintree-payments-drop-in';
And this
BraintreeDropIn.show({
      clientToken: token,
    })
    .then(result => console.log(result))
    .catch((error) => {
      if (error.code === 'USER_CANCELLATION') {
        // update your UI to handle cancellation
      } else {
        // update your UI to handle other errors
      }
    });

In iOS I've the error
Cannot read property 'show' of undefined

I've setup all my project like the readme explain, but I can't have the BraintreeDropIn class included, it's always undefined!!!
But the file are present in node_modules and the path are correct!
What am I doing wrong?!
Please help, I'm stuck too long on this :(
Thanks!

@mrigo have you found the solution?

Hi,
yes I linked manually the libraries because the react-native link and the pod install commands doesn't work.
Now I'm able to use the Drop In!

Thank you for your answer!
can you please specify how did you link it all manually?
I try to but it doesn't work...

I've tried only in iOS, I've added the project in node_module/dropin/ios/ with "add files to" in XCode and then in "build phases" added the dropin library.

This Component will be update?

@alleniver There's no need to update it AFAIK, those are configuration problems.

hey @Minishlink I'm using the version 1.2.1 of the library on react 0.60.6, but I can't get it to work on iOS. I have followed the steps in the readme. Im getting the error as well.

@Minishlink never mind, I got it running by reinstalling my pods. Thanks!


MQTT  with SSL/TLS

I,m done with mqtt with 1883 port its going good, now  want to connect mqtt with port 8883 for security point of view so did you try that I'm facing problem like Client not connected (Error code -2) don't know what is  going wrong way ...I'm working on Arduino ESP8266 or nodemcu

What network client are you using with the PubSubClient? Is it one that supports SSL?

trying to send data in Azure cloud

That's nice, but not what I was asking.
Have you modified your ESP code to use a network client that supports SSL?
The example sketch this library provides uses WiFiClient - https://github.com/knolleary/pubsubclient/blob/master/examples/mqtt_esp8266/mqtt_esp8266.ino#L35
To use SSL you'll need to change that for WifiClientSecure - http://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/client-secure-class.html

Thank @knolleary  for your replay, I will try to get that all way and hope this time I'll found my destination

Is there a full-fledged example for this? I'm not seeing how the WifiClientSecure relates to the MQTT connection, since that's a different layer. I'm very interested in connecting to my MQTT instance over TLS, I'm just not sure what the tradeoffs are regarding CPU usage, memory, etc.

Is there a full-fledged example for this? I'm not seeing how the WifiClientSecure relates to the MQTT connection, since that's a different layer. I'm very interested in connecting to my MQTT instance over TLS, I'm just not sure what the tradeoffs are regarding CPU usage, memory, etc.

I have the same question. Can someone clarify this topic?

While I don't have a full-fledged example I can publish, here is a gist.
I might extract a full working version from my project sometime:
BearSSL::WiFiClientSecure espClient;

// Set x509 CA root (must match server cert)
const char *x509CA PROGMEM = R"EOF("
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----
")EOF";
BearSSLX509List x509(x509CA);
espClient.setTrustAnchors(&x509);

// Set current time (otherwise certs won't work)
now = [...]
espClient.setX509Time(now);

client = PubSubClient(espClient);
client.setServer("mqtt.[...]", 8883);
// client.connect([...])

I am using the Time library in order to get the current time via NTP.
The whole process does not work reliably on my ESP8266. Sometimes it does not boot up correctly because it is out of memory (I believe). This probably happens because the SSL library has high resource requirements. SSL/TLS calculations are maxing out the ESP8266 capabilities, it seems.

Not sure if it helps but I'm using "TinyGsmClientSecure" for SIM800 with ESP32 (T-Call board from TTGO) with a signed&trusted certificate from "Let's encrypt". In this case it simply works and no additional hacks are needed. Whenever possible I try to prevent self-signed certs in production.

Not sure if it helps but I'm using "TinyGsmClientSecure" for SIM800 with ESP32 (T-Call board from TTGO) with a signed&trusted certificate from "Let's encrypt". In this case it simply works and no additional hacks are needed. Whenever possible I try to prevent self-signed certs in production.

HI,
Can you share your code because I am lost trying to connect to Azure IOT Hub.
Regards,

UPDATE: You can use the Let's encrypt root CA certificate in the example above. So the client will be able to connect to any MQTT server with a LE certificate.

This doesn't seem to be the case anymore, I was using the CA and it was working fine then it just stopped working, I can only connect to my broker using the fingerprint now.

Hello everyone - I stumbled across this while debugging a similar issue - you may find a more-or-less full fledged example in my repository ESP8266_MQTT

Hello everyone - I stumbled across this while debugging a similar issue - you may find a more-or-less full fledged example in my repository ESP8266_MQTT

@slavino Can you share code which you have implemented SSL part.

Not sure if it helps but I'm using "TinyGsmClientSecure" for SIM800 with ESP32 (T-Call board from TTGO) with a signed&trusted certificate from "Let's encrypt". In this case it simply works and no additional hacks are needed. Whenever possible I try to prevent self-signed certs in production.

@slavino Can you share code which you have implemented mqtt over SSL with sim800.

Not sure if it helps but I'm using "TinyGsmClientSecure" for SIM800 with ESP32 (T-Call board from TTGO) with a signed&trusted certificate from "Let's encrypt". In this case it simply works and no additional hacks are needed. Whenever possible I try to prevent self-signed certs in production.

Hey, I need help. How did you set certificate with tinyGsmClientSecure. could you share some code or something

Not sure if it helps but I'm using "TinyGsmClientSecure" for SIM800 with ESP32 (T-Call board from TTGO) with a signed&trusted certificate from "Let's encrypt". In this case it simply works and no additional hacks are needed. Whenever possible I try to prevent self-signed certs in production.

Hey, I need help. How did you set certificate with tinyGsmClientSecure. could you share some code or something

Hi!
I use SSLClient as a "wrapper" and it works for WiFi, TinyGSM and Ethernet on esp32.
I made a ConnectionService class that provides a Client to the PubSubClient that is the SSLClient and depending on the configuration on the device it could be one of the 3 different types of connections. I had to make some small changes in SSLClient just to get the correct buffersizes for the different clienttypes but other than that it works like a charm.

While I don't have a full-fledged example I can publish, here is a gist. I might extract a working version from my project sometime:
BearSSL::WiFiClientSecure espClient;

// Set x509 CA root (must match server cert)
const char *x509CA PROGMEM = R"EOF("
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----
")EOF";
BearSSLX509List x509(x509CA);
espClient.setTrustAnchors(&x509);

// Set current time (otherwise certs won't work)
now = [...]
espClient.setX509Time(now);

client = PubSubClient(espClient);
client.setServer("mqtt.[...]", 8883);
// client.connect([...])

I am using the Time library in order to get the current time via NTP.
The whole process does not work reliably on my ESP8266. Sometimes it does not boot up correctly because it is out of memory (I believe). This probably happens because the SSL library has high resource requirements. SSL/TLS calculations are maxing out the ESP8266 capabilities, it seems.
UPDATE: You can use the Let's encrypt root CA certificate in the example above. So the client will be able to connect to any MQTT server with a LE certificate.

Hi,
Do you have any code that could submit the client certificates to the MQTT server?
I tried
`BearSSL::WiFiClientSecure wifiClient;
PubSubClient client(wifiClient);
wifiClient.setClientRSACert(&certList, &privateKey);
client.setServer(mqtt_server, mqtt_port);`
But, this didn't sent certificates


Clappr not working with CEF (Java Chromium Embedded)

Browser: CEF Version = 119.4.7
OS: Mac OS 14.2.1 (23C71)
Clappr Version: 0.5.0
Steps to reproduce:

I Loaded clappr jsfiddle directly into this example code KCEF (Kotlin CEF)
The player screen remains black and doesn't play anything. It works fine in browsers but not in CEF.

To consider:

Did you try to reproduce this issue at http://cdn.clappr.io/?

Yes not worked but it is showing error: Your Browser does not support the playback of this video. Please try using a different browser.

After testing my CEF with https://html5test.opensuse.org/, I found that there are only two differences compared to my Google Chrome browser: the CEF browser does not support Web Notifications and Push Messages. Except for these two features, everything else was the same.
ps: Please, attach images, logs or whatever you think might be helpful.

Hi, I found the problem. CEF doesn't support HLS because of licensing issues. Thanks.


add snake water gun game

Description
Add a new game Snake Water Gun
Fixes:  #2306

Type of change

[X] New feature (non-breaking change which adds functionality)

Checklist:

[X] I have made this from my own
[X] I have taken help from some online resourses
[X] My code follows the style guidelines of this project
[X] I have performed a self-review of my own code
[X] I have commented my code, particularly in hard-to-understand areas
[X] I have made corresponding changes to the documentation
[X] My changes generate no new warnings

ATTACH SCREEN-SHOTS / DEPLOYMENT LINK

@Sulagna-Dutta-Roy please review once and merge my pr


Problem using the model in Ollama

"Your program is very well developed, and it will be a great piece of work. However, I still have some questions to raise. For instance, in the current version, after selecting the model in Ollama, it doesn't work properly like Claude. It keeps asking for the project directory, regardless of whether you're already in an empty directory or whether you've told it to create a new one—none of these work. I am using the Qwen 2.5 model from Ollama. I'm not sure what causes this issue, and while I don't care much about the reason, you should provide a solution or update it in the next version. Thank you very much, and I hope your work continues to improve."

having the exact same issue over here

the same here

Could we get some specific API logs?

Claude Dev doesnt work great with most local models unfortunately. I originally made the extension to only work with claude 3.5 sonnet since that was the only model i found reliable enough to do both tool calling and autonomous loop prompts–even asking other large models like mistral didnt work out great. So it's expected local quantized models wont work the best, but ive found most success with llama3.1 70b although it struggles if you dont give it a clear and specific prompt. Hopefully local models keep getting the same attention and we have claude 3.5 sonnet level models on ollama in a few years. For now not much I can do this about though, I am sorry

ollama run hhao/deepseek-coder-v2-lite-tool
you can run this model  with Claude Dev.

ollama run hhao/qwen2.5-coder-toolsollama 运行 hhao/qwen2.5-coder-tools
you can run this model with Claude Dev.您可以使用 Claude Dev 运行此模型。

thx, how did you fine-tune the model that can work with Cline? awesome!

@hhao any chance you could share your fine tuning process? Updated model weights just came out today:
https://www.reddit.com/r/LocalLLaMA/comments/1glfzyl/qwen_25_coder_7b_15b_instruct_models_just/

@hhao any chance you could share your fine tuning process? Updated model weights just came out today:
https://www.reddit.com/r/LocalLLaMA/comments/1glfzyl/qwen_25_coder_7b_15b_instruct_models_just/

Look at this: #95
Qwen2.5 is more powerful than deepseek-coder-v2-lite

Ah! I assumed there was fine tuning involved. It's a custom prompt but the original weights? Also I agree, I've found Qwen2.5 is better than deepseek-coder-v2-lite.


[Web Portal] responsive job table

Coverage remained the same at 51.62% when pulling 3a33736f45408f35b855100e0e163bd4d36584a6 on qinsu/responsive into 50bd3d74c1a41141815eb25c1322b434a9f91ff8 on master.


OK to include in the letsblock.it project?

Hello @quenhus,
I am the maintainer of https://letsblock.it, a uBlock Origin list generator that allows users to pick and customize filter templates to filter out low-value content. The most requested feature so far is to extend the hide websites from search results template with presets to hide Github and Stackoverflow copycats. Instead of duplicating work, I'd love to reuse the data from your project and import it as user-selectable presets.
I am currently working on the implementation PR: https://github.com/xvello/letsblockit/pull/64 and will deploy a staging version when the frontend is ready. I'd love to have your input on it, whether that's questions, ideas or concerns.

Hello,
Thanks for your work for a better Web experience. Use my work as much as you need.
To ensure the list is kept up to date, I suggest you append a link to this project along with the checkbox to activate presets. Maybe a tiny GitHub icon, or something more visible. This way, users will be able to contribute and suggest new copycats.
However, as the license indicates, you don't have to give credit to this project, if you don't want to.
I didn't have time to look at it, but maybe we could work together to improve performance of our filters, and add support for other search-engines.
Nice work! 🎉🇫🇷

Merci!
Of course I am linking back to the source! Here's a screenshot of the work in progress:

Feel free to take the Kagi.com support, Searx would be harder with your model, as there are plenty of instances on different domains.

Great work!
Will take a look for Kagi.

It's online on https://staging.letsblock.it/filters/search-results if you want to give it a try!
I'll review and merge it tomorrow.

Merged and deployed, thanks for agreeing to this!
I'll watch the repo and sync the values, but don't hesitate to give me a heads up if breaking changes were to occur.


Make everything more clear and concise

@flash76 : Thanks for your contribution! The author, @gewarren, has been notified to review your proposed change.


Tizen Build Issue

Hello,
I'm not able to create build for tizen. I tried creating a production build but it was not working. I also made changes in the build for tizen, replacing some files with that of webos build and it worked but
I need to execute my application on Tizen web simulator using run command which fails as it is not able to find the simulator or the default emulator provided in .rnv/renative.json.
How can I provide the current instance of tizen simulator as the target device for command rnv run -p tizen -t <TARGET_DEVICE> so the application build gets executed on web simulator.

Having the same issue. Whenever I try to run the Tizen TV app on the Tizen emulator, I get the following error:

I have also followed all steps which are mentioned in https://renative.org/docs/platform-tizen

to run with the tizen simulator:
npx rnv run -p tizen --hosted

to run the emulator:
npx rnv run -p tizen -t <emulator_name>

before  you have to check that the emulator can run, start the emulator manager and launch the <emulator_name> (create it if not). I got issue on the emulator config (HW: CPU-vt was OFF) when I had issue with rnv run -p tizen....

same here its open the emulator but not working (HW: CPU-vt was ON)