ParSesquilinearForm and MixedCrossCurlIntegrator

Can the MixedCrossCurlIntegrator be used with a ParSesquilinearForm?  When I try it, I [not unexpectedly] get this error:
Assertion failed: (this->VerifyFiniteElementTypes(trial_fe, test_fe)) is false:
--> MixedCrossCurlIntegrator:  Trial space must be a vector field in 3D with a curl and the test space must be a vector field
... in function: virtual void mfem::MixedVectorIntegrator::AssembleElementMatrix2(const mfem::FiniteElement&, const mfem::FiniteElement&, mfem::ElementTransformation&, mfem::DenseMatrix&)
... in file: fem/bilininteg.cpp:485
Since MixedCrossCurlIntegrator is a mixed operator, I expect that it would require a MixedBilinearForm object, but I do not see a "ParMixedSesquilinearForm".
I successfully use ParSesquilinearForm with CurlCurlIntegrator and VectorFEMassIntegrator in a 3D problem.  I am using VectorFEMassIntegrator in an approximate boundary condition, but I need to upgrade it to MixedCrossCurlIntegrator, and that is where I am running into the problem.  For reference, I am using the version of MFEM in mfem-submesh-nd-dev to enable SubMesh functionality with ND spaces for implementing 2D ports on a 3D space.

Hi, @M8kmyday,
The MixedCrossCurlIntegrator must act on an HCurl field but it's range can be either HCurl or HDiv. If you're range is HCurl you should be able to use this integrator with ParSesquilinearForm. If you need to use HDiv you'll need a ParMixedBilinearForm. You are correct that we do not currently have a ParMixedSesquilinearForm (unless @psocratis has added it in some branch and I have forgotten). However, these sesquilinear form classes are little more than wrappers around their real-valued counterparts so I'm sure you could write some custom code to produce an equivalent object.
Best wishes,
Mark

Got it.  Thank you.

I thought it would be straightforward, but I'm still having issues.  Here is the gist of it in a few lines:
VectorConstantCoefficient vecNormal(normal);   // normal is a Vec(3)
ConstantCoefficient one(1.0);

ND_FECollection *fec_ND_test=new ND_FECollection(1,pmesh->Dimension());       // pmesh is a 3D mesh
ParFiniteElementSpace *fespace_ND_test=new ParFiniteElementSpace(pmesh,fec_ND_test);

ParMixedBilinearForm *pmblfTest=new ParMixedBilinearForm(fespace_ND_test,fespace_ND_test);
pmblfTest->AddBoundaryIntegrator(new MixedCrossCurlIntegrator(*vccNormal),*border_attributes);     // (test 1) fails at Assemble
//   pmblfTest->AddBoundaryIntegrator(new CurlCurlIntegrator(one),*border_attributes);                  // (test 2) runs
//   pmblfTest->AddBoundaryIntegrator(new VectorFEMassIntegrator(*vccNormal),*border_attributes);       // (test 3) runs
pmblfTest->Assemble();

Three AddBoundaryIntegrator tests are tried, two of which work.  The one that fails produces the error at Assembly:
Assertion failed: (this->VerifyFiniteElementTypes(trial_fe, test_fe)) is false:
--> MixedCrossCurlIntegrator:  Trial space must be a vector field in 3D with a curl and the test space must be a vector field
... in function: virtual void mfem::MixedVectorIntegrator::AssembleElementMatrix2(const mfem::FiniteElement&, const mfem::FiniteElement&, mfem::ElementTransformation&, mfem::DenseMatrix&)
... in file: fem/bilininteg.cpp:485
All three integrators indicate that the range and domain is ND at https://mfem.org/bilininteg/, so I can't figure out why test 1 fails.  Isn't ND a vector field?

HI, @M8kmyday,
It fails because it's being used on a boundary where the reference space is not 3D.  I doubt that integrator was designed to work on boundaries. What boundary condition are you hoping to implement?
Best wishes,
Mark

The boundary condition I need is the surface integral in:

My thought is to follow your guidance in #2261; hence, the MixedCrossCurlIntegrator attempt.

HI @M8kmyday,
You might find this useful. This implements impedance BC for Maxwell.
Best,
Socratis

Hi Socratis,
With Z=E/H and the FEM solution in E, the impedance calculation needs curl(E) to get H.  Roughly, the code appears to manually implement curl(E) through VectorFunctionCoefficients, then applies boundary integrators on the VectorFunctionCoefficients.  If this assessment is near the mark, then I should be able to adapt that code to implement the boundary condition I need since it also requires curl(E) and my FEM solution is in E.  If none of the existing BilinearForm Operators can be arm-twisted into implementing the needed boundary condition, then I can probably make this manual approach work.  I'm hoping to hear from Mark that there is a way to use an existing BilinearForm operator.
Thanks for the link.
Brian

Hi, @M8kmyday,
Unfortunately, that surface integral cannot be computed as a bilinear form applied to E. The reason is that we only have the boundary degrees of freedom of E to work with. What I mean is that we can compute the tangential derivatives of the tangential E field.  However, that integral requires the tangential derivatives of the normal component of E and the normal derivative of the tangential components of E neither of which are available.
This boundary integral is usually handled by supplying a known function in place of n x Curl E i.e. a surface current, or as @psocratis suggests, some known relationship between E and H i.e. an impedance relation.
Best wishes,
Mark

Thanks for the background.  Is the limitation in applying the surface integral a limitation of the architecture of MFEM or fundamental to the finite element method in general?

If you really need to implement such boundary bilinear term, you should be able to implement it as a BilinearFormIntegrator that implements the method:
   virtual void AssembleFaceMatrix(const FiniteElement &el1,
                                   const FiniteElement &el2,
                                   FaceElementTransformations &Trans,
                                   DenseMatrix &elmat);

You can add such BilinearFormIntegrator to your BilinearForm with the method BilinearForm::AddBdrFaceIntegrator.

Hi @M8kmyday,
I watched earlier today your talk at the FEM seminar (I missed it originally due to a conflict) and decided to implement the boundary term you need for more general boundary conditions, as posted above and mentioned in your talk.
Note that I have not tested the code below, so let me know if you encounter any issues.
/** @brief The boundary bilinear form: \int_S Q(x)(n x curl(u)).v dS in 3D where
    both the trial, u, and the test, v, functions are in H(curl). */
/** This integrator should be added to the BilinearForm with the method
    BilinearForm::AddBdrFaceIntegrator(). */
class NCrossCurlBoundaryIntegrator : BilinearFormIntegrator
{
protected:
   Coefficient *Q;

public:
   /// If @a q is NULL, the coefficient is 1.
   NCrossCurlBoundaryIntegrator(Coefficient *q = nullptr)
      : Q(q) { }

   void AssembleFaceMatrix(const FiniteElement &el1,
                           const FiniteElement &el2,
                           FaceElementTransformations &Trans,
                           DenseMatrix &elmat) override;
};

void NCrossCurlBoundaryIntegrator::AssembleFaceMatrix(
   const FiniteElement &el1,
   const FiniteElement &el2,
   FaceElementTransformations &Trans,
   DenseMatrix &elmat)
{
   // Assuming 3D mesh; integrating over a boundary face.
   MFEM_VERIFY(el1.GetDim() == 3, "this integrator works only in 3D!");
   MFEM_VERIFY(Trans.Elem2No < 0, "interior faces are not supported!");
   MFEM_CONTRACT_VAR(el2);

   int nd = el1.GetDof();

   elmat.SetSize(nd);

   Vector n(3);
   DenseMatrix vshape(nd, 3), curl_shape(nd, 3), n_cross_curl(nd, 3);

   const IntegrationRule *ir = IntRule;
   if (ir == nullptr)
   {
      const int ir_order = 2*el1.GetOrder();
      ir = &IntRules.Get(Trans.GetGeometryType(), ir_order);
   }

   elmat = 0.0;
   for (int i = 0; i < ir->GetNPoints(); i++)
   {
      const IntegrationPoint &ip = ir->IntPoint(i);
      Trans.SetAllIntPoints(&ip);
      el1.CalcPhysVShape(*Trans.Elem1, vshape);
      el1.CalcPhysCurlShape(*Trans.Elem1, curl_shape);
      CalcOrtho(Trans.Jacobian(), n);
      real_t w = ip.weight;  // n is already scaled with the surface weight
      if (Q)
      {
         // evaluate Q through element 1
         w *= Q->Eval(*Trans.Elem1, Trans.GetElement1IntPoint());
      }
      n *= w;
      for (int j = 0; j < nd; j++)
      {
         real_t c[3] = { curl_shape(j,0), curl_shape(j,1), curl_shape(j,2) };
         n_cross_curl(j,0) = n[1]*c[2] - n[2]*c[1];
         n_cross_curl(j,1) = n[2]*c[0] - n[0]*c[2];
         n_cross_curl(j,2) = n[0]*c[1] - n[1]*c[0];
      }
      AddMultABt(vshape, n_cross_curl, elmat);
   }
}

Maybe I misunderstood the actual terms you need to impose the b.c. at the ports -- I assumed you needed the bilinear form
$$\int_S Q(x) [\vec{n} \times (\nabla \times \vec{E})] \cdot \vec{W}\, dS,$$ however, after looking at the talk more and reading some of the discussion here, I'm not so sure anymore.
My current understanding is that you want to apply the condition $$-\frac{\partial \vec{E}_t}{\partial \vec{n}}=\gamma \vec{E}_t$$ on the subset of the boundary corresponding to the ports, and therefore, after using the identity $$\vec{n} \times (\nabla \times \vec{E}) = -\frac{\partial \vec{E}_t}{\partial \vec{n}} + \nabla_t \vec{E}_n,$$ you need the bilinear form $$\int_S Q(x) \nabla_t \vec{E}_n \cdot \vec{W}\,dS.$$ Is this correct?

Hi Veselin,
The bilinear form $$\int_S Q(x) [\vec{n} \times (\nabla \times \vec{E})] \cdot \vec{W}, dS,$$ is the most general formulation needed to complete the construction of the boundary value problem.  It would be applied to all ports, then the DOFs at the driving port would be set to values pulled from 2D port simulations.  I will give the class NCrossCurlBoundaryIntegrator : BilinearFormIntegrator from you prior email a try and let you know how it goes.
Given the prior lack of a bilinear form to implement $$\int_S Q(x) [\vec{n} \times (\nabla \times \vec{E})] \cdot \vec{W}, dS,$$ I have been using the identity $$\vec{n} \times (\nabla \times \vec{E}) = -\frac{\partial \vec{E}_t}{\partial \vec{n}} + \nabla_t \vec{E}_n,$$ to instead implement $$\vec{n} \times (\nabla \times \vec{E}) = \gamma\vec{E}_t + \nabla_t \vec{E}_n.$$  The problem with this substitution is that $\nabla_t \vec{E}_n$ is not directly implementable with MFEM.  However, I did find a way to implement this by solving the 2D wave equation on the port with boundary integrators with $$\gamma\overline{E}t+\nabla_t E_n=\frac{1}{\gamma}(\nabla_t \times \frac{1}{\mu_r} \nabla_t \times \overline{E}t – k{\circ}^2 \epsilon{cr} \overline{E}_t).$$  This resolves the issue with $\nabla_t \vec{E}_n$, and discussion in my presentation on the slide “On the Neglected Gradient Term” no longer applies and there are no longer issues with TM modes.  This was a very big improvement.
There remains the issue of $\gamma$ appearing in the boundary condition, and this leads to an impedance mismatch for any other modes present on the port, such as for differential pairs, when the mode propagation constants are not equal.  I am currently working on that by a more general formulation for S-parameter extraction than I have used so far.  However, the new class NCrossCurlBoundaryIntegrator : BilinearFormIntegrator may address this problem more fundamentally by eliminating $\gamma$ from the boundary condition.
Thanks for the new class.  I will try it out.
Best Regards,
Brian
From: Veselin Dobrev @.>
Sent: Sunday, July 7, 2024 10:19 PM
To: mfem/mfem @.>
Cc: M8kmyday @.>; Mention @.>
Subject: Re: [mfem/mfem] ParSesquilinearForm and MixedCrossCurlIntegrator (Issue #3610)
Maybe I misunderstood the actual terms you need to impose the b.c. at the ports -- I assumed you needed the bilinear form
$$\int_S Q(x) [\vec{n} \times (\nabla \times \vec{E})] \cdot \vec{W}, dS,$$ however, after looking at the talk more and reading some of the discussion here, I'm not so sure anymore.
My current understanding is that you want to apply the condition $$-\frac{\partial \vec{E}_t}{\partial \vec{n}}=\gamma \vec{E}_t$$ on the subset of the boundary corresponding to the ports, and therefore, after using the identity $$\vec{n} \times (\nabla \times \vec{E}) = -\frac{\partial \vec{E}_t}{\partial \vec{n}} + \nabla_t \vec{E}_n,$$ you need the bilinear form $$\int_S Q(x) \nabla_t \vec{E}_n \cdot \vec{W},dS.$$ Is this correct?
—
Reply to this email directly, view it on GitHub https://github.com/mfem/mfem/issues/3610#issuecomment-2212909309 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AVSFWC56R6HDMGGY53FD5SLZLIAKHAVCNFSM6AAAAABKP4IGTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJSHEYDSMZQHE .
You are receiving this because you were mentioned.  https://github.com/notifications/beacon/AVSFWCY4GBVNYCDQJFNLOZ3ZLIAKHA5CNFSM6AAAAABKP4IGTGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUD4ZIP2.gif Message ID: @.*** @.***> >

Hi Veselin,
No success on a first try.  I copied your code into my source file and swapped out my boundary integrator, then I get an error on compilation:
port.cpp:5685:20: error: class mfem::ParMixedBilinearForm’ has no member named AddBdrFaceIntegrator’; did you mean `AddTraceFaceIntegrator’?
5685 | if (isReal) pmblf->AddBdrFaceIntegrator(new NCrossCurlBoundaryIntegrator(),*border_attributes);
  |                    ^~~~~~~~~~~~~~~~~~~~

  |                    AddTraceFaceIntegrator

I do not know what a Trace is, but I made the change to
if (isReal) pmblf->AddBdrTraceFaceIntegrator(new NCrossCurlBoundaryIntegrator(),*border_attributes);
Compiling again, I get the error:
port.cpp:5686:99: error: mfem::BilinearFormIntegrator’ is an inaccessible base of NCrossCurlBoundaryIntegrator’
5686 | if (isReal) pmblf->AddBdrTraceFaceIntegrator(new NCrossCurlBoundaryIntegrator(),*border_attributes);
I added “public” to the class definition:
class NCrossCurlBoundaryIntegrator : public BilinearFormIntegrator
and then everything compiles fine.  On execution, I get the run-time error:
MFEM abort: AssembleFaceMatrix (mixed form) is not implemented for this Integrator class.
... in function: virtual void mfem::BilinearFormIntegrator::AssembleFaceMatrix(const mfem::FiniteElement&, const mfem::FiniteElement&, const mfem::FiniteElement&, mfem::FaceElementTransformations&, mfem::DenseMatrix&)
... in file: fem/bilininteg.cpp:178
I am using ParMixedBilinearForm, so perhaps that is a source of problems.
Is there anything else I can try?
Brian
From: @.*** @.>
Sent: Monday, July 8, 2024 8:56 AM
To: 'mfem/mfem' @.>; 'mfem/mfem' @.***>
Subject: RE: [mfem/mfem] ParSesquilinearForm and MixedCrossCurlIntegrator (Issue #3610)
Hi Veselin,
The bilinear form $$\int_S Q(x) [\vec{n} \times (\nabla \times \vec{E})] \cdot \vec{W}, dS,$$ is the most general formulation needed to complete the construction of the boundary value problem.  It would be applied to all ports, then the DOFs at the driving port would be set to values pulled from 2D port simulations.  I will give the class NCrossCurlBoundaryIntegrator : BilinearFormIntegrator from you prior email a try and let you know how it goes.
Given the prior lack of a bilinear form to implement $$\int_S Q(x) [\vec{n} \times (\nabla \times \vec{E})] \cdot \vec{W}, dS,$$ I have been using the identity $$\vec{n} \times (\nabla \times \vec{E}) = -\frac{\partial \vec{E}_t}{\partial \vec{n}} + \nabla_t \vec{E}_n,$$ to instead implement $$\vec{n} \times (\nabla \times \vec{E}) = \gamma\vec{E}_t + \nabla_t \vec{E}_n.$$  The problem with this substitution is that $\nabla_t \vec{E}_n$ is not directly implementable with MFEM.  However, I did find a way to implement this by solving the 2D wave equation on the port with boundary integrators with $$\gamma\overline{E}t+\nabla_t E_n=\frac{1}{\gamma}(\nabla_t \times \frac{1}{\mu_r} \nabla_t \times \overline{E}t – k{\circ}^2 \epsilon{cr} \overline{E}_t).$$  This resolves the issue with $\nabla_t \vec{E}_n$, and discussion in my presentation on the slide “On the Neglected Gradient Term” no longer applies and there are no longer issues with TM modes.  This was a very big improvement.
There remains the issue of $\gamma$ appearing in the boundary condition, and this leads to an impedance mismatch for any other modes present on the port, such as for differential pairs, when the mode propagation constants are not equal.  I am currently working on that by a more general formulation for S-parameter extraction than I have used so far.  However, the new class NCrossCurlBoundaryIntegrator : BilinearFormIntegrator may address this problem more fundamentally by eliminating $\gamma$ from the boundary condition.
Thanks for the new class.  I will try it out.
Best Regards,
Brian
From: Veselin Dobrev @.*** @.> >
Sent: Sunday, July 7, 2024 10:19 PM
To: mfem/mfem @. @.> >
Cc: M8kmyday @. @.> >; Mention @. @.***> >
Subject: Re: [mfem/mfem] ParSesquilinearForm and MixedCrossCurlIntegrator (Issue #3610)
Maybe I misunderstood the actual terms you need to impose the b.c. at the ports -- I assumed you needed the bilinear form
$$\int_S Q(x) [\vec{n} \times (\nabla \times \vec{E})] \cdot \vec{W}, dS,$$ however, after looking at the talk more and reading some of the discussion here, I'm not so sure anymore.
My current understanding is that you want to apply the condition $$-\frac{\partial \vec{E}_t}{\partial \vec{n}}=\gamma \vec{E}_t$$ on the subset of the boundary corresponding to the ports, and therefore, after using the identity $$\vec{n} \times (\nabla \times \vec{E}) = -\frac{\partial \vec{E}_t}{\partial \vec{n}} + \nabla_t \vec{E}_n,$$ you need the bilinear form $$\int_S Q(x) \nabla_t \vec{E}_n \cdot \vec{W},dS.$$ Is this correct?
—
Reply to this email directly, view it on GitHub https://github.com/mfem/mfem/issues/3610#issuecomment-2212909309 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AVSFWC56R6HDMGGY53FD5SLZLIAKHAVCNFSM6AAAAABKP4IGTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJSHEYDSMZQHE .
You are receiving this because you were mentioned.  https://github.com/notifications/beacon/AVSFWCY4GBVNYCDQJFNLOZ3ZLIAKHA5CNFSM6AAAAABKP4IGTGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUD4ZIP2.gif Message ID: @.*** @.***> >

Hi Brian,
I was assuming that you are using ParBilinearForm, however, the error message you posted shows that you are using ParMixedBilinearForm. Does that mean that your trial (for $\vec{E}$) and test (for $\vec{W}$) spaces are different? I assumed that they are both H-curl conforming, i.e. Nedelec. If that is not the case, what spaces are you using for $\vec{E}$ and $\vec{W}$?

Something pushed me to ParMixedBilinearForm, but I do not remember what that is.  Maybe it was an experiment that I didn’t completely back out.  I’ll have to look to see if I can go back to ParBilinearForm.
Brian
From: Veselin Dobrev @.>
Sent: Monday, July 8, 2024 9:46 PM
To: mfem/mfem @.>
Cc: M8kmyday @.>; Mention @.>
Subject: Re: [mfem/mfem] ParSesquilinearForm and MixedCrossCurlIntegrator (Issue #3610)
Hi Brian,
I was assuming that you are using ParBilinearForm, however, the error message you posted shows that you are using ParMixedBilinearForm. Does that mean that your trial (for $\vec{E}$) and test (for $\vec{W}$) spaces are different? I assumed that they are both H-curl conforming, i.e. Nedelec. If that is not the case, what spaces are you using for $\vec{E}$ and $\vec{W}$?
—
Reply to this email directly, view it on GitHub https://github.com/mfem/mfem/issues/3610#issuecomment-2216300931 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AVSFWCYIZM3EJ3UFGPGNLE3ZLNFILAVCNFSM6AAAAABKP4IGTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJWGMYDAOJTGE .
You are receiving this because you were mentioned.  https://github.com/notifications/beacon/AVSFWCZTCWBM5PLUKC2DOXLZLNFILA5CNFSM6AAAAABKP4IGTGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUEDIIYG.gif Message ID: @.*** @.***> >

I swapped ParBilinearForm for ParMixedBilinearForm, and everything works fine.  I still have to add “public” to the class definition for NCrossCurlBoundaryIntegrator.
Running a straight section of rectangular waveguide, I get convergence difficulties for the 3D E-field solution.  Setting the convergence criteria very loose, I get a solution that shows the new boundary with NCrossCurlBoundaryIntegrator producing a non-physical field that results in a 100% reflection.  The attached screen shots show field plots for the new boundary and the existing boundary using the 2D wave equation solution described earlier.
I can think of three scenarios for the result:

Incorrect usage of NCrossCurlBoundaryIntegrator in my code.  It is a very simple substitution to take out the existing boundary integrators and add the new one.  Seems hard to mess up, but possible.
The new NCrossCurlBoundaryIntegrator is not a sufficient boundary condition to solve the problem.  This seems like a real possibility.  The current boundary condition forces the fields to a 2D configuration, while NCrossCurlBoundaryIntegrator does not.  For this problem, the fields in the 3D space are already in 2D configuration since there is no discontinuity, and NCrossCurlBoundaryIntegrator should just continue and support that.  This may be a bad assumption.
There is a problem with NCrossCurlBoundaryIntegrator.  I can’t check that, but the code seems straightforward and compact.  Maybe the attached field plots will give a hint if there is a problem.

Brian
From: @.*** @.>
Sent: Tuesday, July 9, 2024 8:34 AM
To: 'mfem/mfem' @.>; 'mfem/mfem' @.>
Cc: 'Mention' @.>
Subject: RE: [mfem/mfem] ParSesquilinearForm and MixedCrossCurlIntegrator (Issue #3610)
Something pushed me to ParMixedBilinearForm, but I do not remember what that is.  Maybe it was an experiment that I didn’t completely back out.  I’ll have to look to see if I can go back to ParBilinearForm.
Brian
From: Veselin Dobrev @.*** @.> >
Sent: Monday, July 8, 2024 9:46 PM
To: mfem/mfem @. @.> >
Cc: M8kmyday @. @.> >; Mention @. @.***> >
Subject: Re: [mfem/mfem] ParSesquilinearForm and MixedCrossCurlIntegrator (Issue #3610)
Hi Brian,
I was assuming that you are using ParBilinearForm, however, the error message you posted shows that you are using ParMixedBilinearForm. Does that mean that your trial (for $\vec{E}$) and test (for $\vec{W}$) spaces are different? I assumed that they are both H-curl conforming, i.e. Nedelec. If that is not the case, what spaces are you using for $\vec{E}$ and $\vec{W}$?
—
Reply to this email directly, view it on GitHub https://github.com/mfem/mfem/issues/3610#issuecomment-2216300931 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AVSFWCYIZM3EJ3UFGPGNLE3ZLNFILAVCNFSM6AAAAABKP4IGTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJWGMYDAOJTGE .
You are receiving this because you were mentioned.  https://github.com/notifications/beacon/AVSFWCZTCWBM5PLUKC2DOXLZLNFILA5CNFSM6AAAAABKP4IGTGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUEDIIYG.gif Message ID: @.*** @.***> >

Hi Brian, I don't see any attached plots on GitHub -- maybe you need to copy-paste them directly on GitHub?

My internet is down, so I will post the screenshots when it comes up.BrianOn Jul 9, 2024, at 3:32 PM, Veselin Dobrev @.***> wrote:
Hi Brian, I don't see any attached plots on GitHub -- maybe you need to copy-paste them directly on GitHub?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Here are the two plots I mentioned.
Current boundary condition using the 2D wave equation boundary:

Boundary condition using the NCrossCurlBoundaryIntegrator:

Those plots are of |E| with 6th order elements.

Hi Brian,
I'm trying to understand what boundary condition you want to impose on the port boundary. The boundary condition types that I understand how to impose all result in a weak formulation where the term $B$: $$B(\vec{E},\vec{W}) = \int_S Q(x) [\vec{n} \times (\nabla \times \vec{E})] \cdot \vec{W}\, dS$$ is not needed. The b.c. types I'm referring to are:

Essential ("Dirichlet"-like) boundary condition: $\vec{E}_t = \vec{E}^{ext}_t$, where $\vec{E}^{ext}$ (or just its tangential component $\vec{E}^{ext}_t$) is given on a subset of the boundary $\Gamma_0 \subset \partial\Omega$. In this case, the test functions, $\vec{W}$, need to be taken to satisfy $\vec{W}_t = \vec{0}$ on $\Gamma_0$, so the term $B(\vec{E},\vec{W})$ is zero and does not appear in the weak formulation. In MFEM, this type of b.c. is imposed by modifying the matrix and the r.h.s. vector -- this is done automatically by one of the FormLinearSystem method, e.g. https://github.com/mfem/mfem/blob/988439f60a9902e29572b83dcb2a142eb8da3dbd/fem/bilinearform.hpp#L521-L523
where the essential boundary data is provided by the boundary dofs in the Vector x.

Natural ("Neumann"-like) boundary condition: $\vec{n} \times (\nabla \times \vec{E}) = \vec{F}_t$ where $\vec{F}$ (or just $\vec{F}_t$) is given on part of the boundary $\Gamma_1 \subset \partial\Omega$. The data $\vec{F}_t$ can also be given in the form $\vec{F}_t = \vec{n}\times\vec{G}$. In this case the term $B(\vec{E},\vec{W})$ is known and is moved to the r.h.s. of the weak formulation:

$$B(\vec{E},\vec{W}) = \int_{\Gamma_1} Q(x) \vec{F}_t \cdot \vec{W}\, dS.$$

Mixed ("Robin"-like) boundary condition: $\vec{n} \times (\nabla \times \vec{E}) = \alpha\vec{E}_t + \vec{F}_t$ on part of the boundary $\Gamma_2\subset\partial\Omega$ where $\vec{F}_t$ is a given tangential field. In this case $B(\vec{E},\vec{W})$ is split into two terms, one goes on the l.h.s. and contributes to the matrix and the second one goes to the r.h.s:

$$B(\vec{E},\vec{W}) = \int_{\Gamma_2} Q(x) \alpha \vec{E}_t \cdot \vec{W}\, dS + ~$$
$$ + \int_{\Gamma_2} Q(x) \vec{F}_t \cdot \vec{W}\, dS$$
If the port boundary condition that you want to impose does not fall into one of these types, what does it look like on PDE level?

By assuming a transmission line or waveguide mode with a dependence of $e^{-\gamma n}$, then with the help of a vector identity
$$\hat{n}\times\nabla\times\overline{E}=-\frac{\partial\overline{E}_t}{\partial{n}}+\nabla_t E_n=\gamma \overline{E}_t + \nabla_t E_n.$$
The tangential part of the 2D wave equation at the port is
$$\nabla_t \times \frac{1}{\mu_r} \nabla_t \times \overline{E}_t - \gamma^2\overline{E}_t-\gamma\nabla_t E_n=k_{\circ}^2 \epsilon_{cr} \overline{E}_t,$$
so substituting yields an absorbing boundary condition for the port as
$$\gamma \overline{E}_t + \nabla_t E_n=\frac{1}{\gamma}(\nabla_t \times \frac{1}{\mu_r} \nabla_t \times \overline{E}_t - k_{\circ}^2 \epsilon_{cr} \overline{E}_t).$$
This is in the form of a mixed boundary condition, and I find that it works quite well as long as all modes at the boundary have the same $\gamma$.  I am trying to eliminate $\gamma$ from the absorbing boundary condition so that it is equally effective for any mode.

Let me see if I understand you correctly: is it true then that (A) you impose natural boundary condition (2 in my list above) given by $\vec{n} \times (\nabla \times \vec{E}) = \vec{F}_t$ on the port where $\vec{F}_t$ is computed by differentiating (on the boundary) a previously computed (somehow, I'm not sure how) $\vec{E}_t$:
$$\vec{F}_t = \frac{1}{\gamma}\left(\nabla_t \times \frac{1}{\mu_r}\nabla_t \times \vec{E}_t - k_{\circ}^2 \epsilon_{cr} \vec{E}_t \right)?$$
Or, is it true that (B) you impose the boundary condition
$$\vec{n} \times (\nabla \times \vec{E}) = \frac{1}{\gamma}\left(\nabla_t \times \frac{1}{\mu_r}\nabla_t \times \vec{E}_t - k_{\circ}^2 \epsilon_{cr} \vec{E}_t \right)$$
where the r.h.s. uses the tangential component of the unknown $\vec{E}$? I suppose in this case, this b.c. leads to a contribution to the bilinear form and the system matrix, however, I'm not sure how the term $(\nabla_t \times \nabla_t \times)$ is treated on the boundary.

I am doing (B).  The r.h.s is implemented with a CurlCurlIntegrator and a VectorFEMassIntegrator on the ParBilinearForm with the AddBoundaryIntegrator method.


fix: Fix contact options

Fixes issue #2384 by removing telegram from the available support options when user taps "Need help".  Instead I've added a "Join the community" option on the main settings menu which also includes a link to mattermost.  I've utilised the existing supportChannelsToHide prop on the ContactModal to show/hide either 1:1 support options or community options.  I also changed the ContactModal which is available through the ContactSupportButton which is currently only used on the PhoneInput.
Example screenshots below:
1:1 Support options

Community options

that's a great message improvement. thanks!


Fix mapColumnToSchema

This pr fixes the todos of the mapColumnToSchema function.
It also formats some stuff.
Helps with drizzle-team/drizzle-orm#2481.

@fabian-hiller Any thoughts on this PR and/or how else the community can help to move the original drizzle PR forward? Been running into compat issues with valibot stuck on an old version for drizzle and other repos (like @hookform/resolvers) on a new version.

I am so sorry. I totally missed this PR. I will take a look.

That looks good to me. The main problem seems to be that the Drizzel team is busy with other things and hasn't responded to my PR yet.


winget not installing/found (did it through store)

Description
Long story short- saw the twitter post retweeted by Jon Galloway.
It's great.  I had to install it by the Store.  Winget was my preferred option, but I guess it isn't reg'd yet.
Awesome work, I have to explore it a bit more than 3 min of toying around ;)
All the best
Steps To Reproduce
winget search DevToys
winget install DevToys
( In PowerShell/Windows Term, 2 diff boxes)
Expected behavior
Well, an install that I can export when I have to rebuild this darn dev machine ;)
Again thanks for all the work, I'm sure it's a WinGet issue.
DevToys Version
Version <IP_ADDRESS> | X64 | RELEASE | ef783c8 | ef783c8
Relevant Assets/Logs

We made a PR here that should allow WinGet to install DevToys without requiring a Microsoft account: https://github.com/microsoft/winget-pkgs/pull/43996/files

Hello,
Thanks to @rlm96 , DevToys is now available on Chocolatey. This isn't WinGet (we're facing challenges with this one), but it may help unblocking you. Would you be able to give it a try, please?
See: https://github.com/veler/DevToys#chocolatey
Thank you !


Feature/feature/assignments performance optimizations r3

Stability fixes after endurance test:
-	Fix for ConcurrentModificationExcpetion while accessing BucketList
-	More efficient way of refreshing Assignment metadata cache to avoid frequent spike.
-	Added a limit of 2gb on the metadata cache
-	Make ehcache.xml part of conf directory
-	Added exception handling at AssignmentResource level to log any uncaught exception.
-	Some relevant assignment metadata cache logging changes.

Looks good 👍  :shipit:

Looks good after incorporating the feedback. :shipit:


dask dataframe drop_duplicates support?

The original df is a dask dataframe
This works:
df = df.compute()
columns=['a','b','c']
df = df.drop_duplicates(columns)

This does not, is there a better approach?
columns=['a','b','c']
(Pdb) df = df.drop_duplicates(columns)
*** TypeError: unorderable types: list() < int()

Can you show a reproducible example? The following works for me:
In [19]: df = pd.DataFrame({"A": [1, 2] * 4, "B": [1] * 4 + [2] * 4})

In [20]: a = dd.from_pandas(df, 2)

In [21]: a.drop_duplicates(subset=['A']).compute()
Out[21]:
   A  B
0  1  1
1  2  1

Ah, keep in mind that the signature isn't identical. http://dask.pydata.org/en/latest/dataframe-api.html#dask.dataframe.DataFrame.drop_duplicates vs https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.drop_duplicates.html
We should probably deprecate dask's version to match pandas.

The subset arg would be indeed useful (also documentation of the dask-specific args would be handy)

It seems in @dsevero example drop_duplicates throws a non-relevant error when subset= isn't explicitly declared. @TomAugspurger is this intentional, or should we resolve with a PR?
import dask.dataframe as dd
import pandas as pd
df = dd.from_pandas(pd.DataFrame({'a': [0, 0, 1], 'b': range(3)}), npartitions=1)

df.drop_duplicates(['a']).compute()
TypeError: '<' not supported between instances of 'list' and 'int'

Probably not intentional.
The fix is to add subset=None as the first keyword to DataFrame.drop_duplicate. That will fix the documentation issue as well.
Then update references like subset in kwargs inside drop_duplicates.

I updated the original post with hopefully clear instructions on fixing, in case anyone is interested in contributing a fix.

Interested.

I think this issue can be closed? I thought the fixes keyword in #5410 would close this issue on merge, but I guess not?

Yep, you're correct. Maybe it has to be in the first post.


The best accuracy of training results is very low for the Image classification + Azure environment.

System Information (please complete the following information):

Windows OS: Windows-10-Enterprise-21H1
ML.Net Model Builder (Preview): <IP_ADDRESS>6604 (Main Branch)
Microsoft Visual Studio Enterprise 2019: 16.10.3
.Net: 5.0.302

Test Matrix:
https://testpass.blob.core.windows.net/test-pass-data/weather.zip (Weather folder)
Describe the bug

On which step of the process did you run into an issue: Train completed
Clear description of the problem: With the same test matrix, the previous best accuracy of training results is high to 99%.

To Reproduce
Steps to reproduce the behavior:

Select Create a new project from the Visual Studio 2019 start window;
Choose the C# Console App (.NET Core) project template with .Net 5.0;
Add model builder by right click on the project;
Select Image classification scenario and Azure environment;
After training complete, found that the Best accuracy is very low, only have 0.98%.
Click Train again, the accuracy is also low.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.

@vzhuqin Can you include the link to the run? I'm wondering if we are reporting with the wrong decimal place (is this supposed to be 98%?).

@beccamc I got the same score on latest main build: <IP_ADDRESS>7701

But the Primary metric score is 0.98222 from run link in Azure portal:

Run link in Azure portal:
https://ml.azure.com/experiments/id/891078f2-635b-4e43-849b-f5129264b1fa/runs/AutoML_e4cfa9bd-aba5-4464-9448-2eb18b1a540d?wsid=/subscriptions/83635e26-687a-4333-a2a0-33e3cd1f573a/resourceGroups/FullTestPass/providers/Microsoft.MachineLearningServices/workspaces/FullTestPass&tid=72f988bf-86f1-41af-91ab-2d7cd011db47
Output:
https://app.zenhub.com/files/186917455/e8bf2949-b030-4014-8b5f-52b978007fc8/download

Thanks Qin! The Azure run accuracy should be .98 out of 1. We should be reporting in model builder as 98% instead of the Azure form. Good catch!
@zewditu I think you just did some work on displaying these values? Can you change the Azure value to show xx% instead of the decimal value?

@beccamc  @zewditu I found the score in .mbconfig file has issue for Object detection scenario, could you help to take a look together?
I think the scores show on Train page and Azure portal is correct, but it shows 0.01 in mbconfig file.

decimal still wrong for object detection

This issue is fixed on main build: <IP_ADDRESS>3102
Object detection:

Image Classification:


Make all labels CSS defined (Requirement 6)

All UI Labels should be defined in the CSS, so users can choose the language and all labels and tooltips are automatically replaced.

[x] Sidebar Titles
[x] Sidebar Category Tooltips
[x] Sidebar SDG Tooltips
[x] QueryBox tooltips
[x] QueryBox Error messages
[x] QueryBox Press Return to add-button
[x] Toolbar Tooltips
[x] Result Record Titles (move into the correct CSS)

completed for German and English in scss/_labels_en.scss and scss/_labels_de.scss


Allow Config Function To Return Promise

Is your feature request related to a problem? Please describe.
Yes, I can't do something asynchronous in my config function.
Describe the solution you'd like
Allow the config function to return a promise, e.g.
module.exports = async (config, options) => {
  return config;
}

Additional context
@angular-builders/custom-webpack v7.4.3

Reasonable request, will do.

Just took a look at the source code, I think BrowserBuilder#buildWebpackConfig would need to be updated to allow returning a Promise in the @angular-devkit/build-angular package.

Yep, you're right, and it won't happen (not in the way you imagine). They are rewriting it completely now
and with the new Angular CLI 8 which is supposed to be out mid April it would be a piece of cake.
Version 8 of custom-webpack builder will be released at the same time so if you don't mind to wait it will be available pretty soon. You can catch a glimpse of the new implementation here.

So in version 8 there will be a config transform function that returns an Observable?

In a nutshell, yes.

I'm not clear on the status of this issue - is this functionality implemented in the latest version? Anyways, here is what I'm trying to do:
Version info:
"@angular-builders/custom-webpack": "^8.2.0"
"@angular/cli": "^8.3.8",

I'd like to use this builder to replace a string during the build process of my angular app.
My extra-webpack.config.js:
var StringReplacePlugin = require("string-replace-webpack-plugin");
const nbgv = require('nerdbank-gitversioning');

const configPromise = async function() {
  const currentVersion = await nbgv.getVersion();
  return {
    module: {
      rules: [{
        exclude: /node_modules/,
        use: StringReplacePlugin.replace({
          replacements: [{
            pattern: /<%CURRENT_VERSION_HERE%>/,
            replacement: function (match, p1, offset, string) {
              return currentVersion.simpleVersion
            }
          }]
        })
      }]
    },
    plugins: [
      new StringReplacePlugin()
    ]
  };
};

module.exports = configPromise

Unfortunately the build fails with:
><EMAIL_ADDRESS>build C:\Path\to\my\project\src\My.Project\ClientApp
> ng build

C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\@angular-devkit\build-angular\src\angular-cli-files\utilities\stats.js:43
    const colors = statsConfig.colors;
                               ^

TypeError: Cannot read property 'colors' of undefined
    at Object.statsToString (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\@angular-devkit\build-angular\src\angular-cli-files\utilities\stats.js:43:32)
    at C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\@angular-devkit\build-angular\src\browser\index.js:43:33
    at callback (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\@angular-devkit\build-webpack\src\webpack\index.js:33:13)
    at finalCallback (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\webpack\lib\Compiler.js:257:39)
    at hooks.done.callAsync.err (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\webpack\lib\Compiler.js:273:13)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\tapable\lib\Hook.js:154:20)
    at onCompiled (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\webpack\lib\Compiler.js:271:21)
    at hooks.afterCompile.callAsync.err (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\webpack\lib\Compiler.js:671:15)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\tapable\lib\Hook.js:154:20)
    at compilation.seal.err (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\webpack\lib\Compiler.js:668:31)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\tapable\lib\Hook.js:154:20)
    at hooks.optimizeAssets.callAsync.err (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\webpack\lib\Compilation.js:1385:35)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Path\to\my\project\src\My.Project\ClientApp\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:9:1)

It is not implemented yet, therefore the error I believe. I plan to add it soon but as always PRs are welcome.


isNavbarCollapsed is used in template and need to be public

Story / Bug id: N/A
Reference person: @magul
Description:
isNavbarCollapsed is used in template and need to be public
New imports / dependencies:

N/A

Unit Tests:

N/A

Codecov Report

Merging #627 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #627   +/-   ##
=======================================
  Coverage   92.11%   92.11%
=======================================
  Files          80       80
  Lines        2651     2651
  Branches        2        2
=======================================
  Hits         2442     2442
  Misses        207      207
  Partials        2        2

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91029ef...b7b32cf. Read the comment docs.


Use ydiff as a script instead of a module

Ydiff is not supposed to be used as a module, the recent new option --theme breaks the usage of markup_to_pager as described in https://github.com/ymattw/ydiff/issues/124.
It would be nice to move away from the current usage to pipe the texts to diff to the script directly.
The program is installed as part of the requirements.txt of patroni, so it must be available in $PATH same as patroni (usually installed in /usr/local/bin).

Hi @ymattw, thank you for a suggestion.
Unfortunately it doesn't work for us, because at least Debian/Ubuntu don't have python3-ydiff package, and they use python3-cdiff as drop-in replacement.
Last time I just forgot to modify requirements.txt and limit the upper version to avoid future problems like this one. Now it will be addressed in #3216.
However, there is yet another problem with ydiff.
You publish it as it is supporting python>=3.3: https://github.com/ymattw/ydiff/blob/2616f39f0764fa68afa8c0e5f2cfbec4ad4d2fd7/setup.py#L34
But, it doesn't work even with python 3.7, because of: https://github.com/ymattw/ydiff/blob/2616f39f0764fa68afa8c0e5f2cfbec4ad4d2fd7/ydiff.py#L439
The sum() function could be used with the start argument as a keyword only starting from python 3.8.

Hi! I don't understand, since ydiff is imported by ctl.py, whatever environment the ctl.py script runs must already contain ydiff as a dependency. Did I miss something?
Also thanks for pointing out the sum() compatibility issue, I will fix it and release a patch version.

Deb packages are not relying on requirements.txt and maintain their own dependencies.
The way it currently works - if import of ydiff fails, we are making an attempt to import cdiff: https://github.com/patroni/patroni/pull/3214/files#diff-9dada8f509128404d7027246ac9622d2484fc77758c6a4af9dc7cc8c081d9fffL54

Thanks for the explanation.  I think the long term solution is still migrating away from using ydiff as a library.  Every time ydiff releases a version with a new CLI option will break patroni. I will file an issue in your repo to track it.
FYI ydiff-1.4.2 is just released with the compatibility fix for Python 3.3.


Delete old events

Delete old events from this page:
https://github.com/alinebastos/women-dev-conferences/blob/master/FutureEvents.md

Would it be ok if I looked at this one?

Of course :)

Could you assign yourself to this issue?

I don't think I can as I'm not a maintainer: https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/

That's no problem :)


Use TRAVIS_OTP_RELEASE for accurate full version

Instead of the calculated ERLANG_VERSION, use TRAVIS_OTP_RELEASE when on travis - this is a more complete version since the version numbering scheme change (eg 17.x vs 17).
ping @joedevivo

I laughed! I cried! It was better than 'Cats'! :+1:


Switch to named HttpClients for all outgoing HTTP traffic (instead of typed ones)

too many problems with typed clients...

PR merged


BED 4126: Fix issue that haslaps enabled for Computer target node wasnt showing correct helptext for GenericAll edge

Description
This fixes that the correct help text shows up for windows abuse for genericAll edge with computer target node. Also in this PR the call to get entity properties was abstracted to a custom hook and test were created for it.
Motivation and Context
This PR addresses: BED-4126
Why is this change required? What problem does it solve?
It gets the properties for a node, so if it has properties like haslaps enabled it will lead to the expected ui outcome in the entity or edge panel.
How Has This Been Tested?
It was tested manually and by including a test suite.
Screenshots (optional):

Types of changes

Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)

Checklist:

[x] I have met the contributing prerequisites

Assigned myself to this PR
Added the appropriate labels
Associated an issue: https://github.com/SpecterOps/BloodHound/issues/672
Read the Contributing guide: https://github.com/SpecterOps/BloodHound/wiki/Contributing

[x] I have ensured that related documentation is up-to-date

Open API docs
Code comments (GoDocs / JSDocs)

[x] I have followed proper test practices

Added/updated tests to cover my changes
All new and existing tests passed

I would like to see a new test added for EdgeInfoContent that asserts we see the expected text when a computer has (or does not have) the expected haslaps property.

I would like to see a new test added for EdgeInfoContent that asserts we see the expected text when a computer has (or does not have) the expected haslaps property.

Makes total, just added it to the MR.

One comment on the enterprise side, otherwise the code changes (plus @elikmiller suggestions) look good and its functioning well for me!

Thanks man good catch MR updated


Cloudformation Templates to create and initialize Senzing database stack

Database CFT:

BYO-VPC or new VPC
initialize database
installs senzing configuration
one or 3 databases
conform to Amazon security requirements...

cidr block
security roles
???

This ticket has been broken out into multiple tickets:  #8, #9, and tickets in basic.


Remove "The play() request was interrupted by a call to pause()"

The pull request is addressed to close the issue raised here
On Chrome, the play() method on an HTML Media Element returns a promise.
Since, the play method is asynchronous, if pause() method is called/triggered while a call to play() is in progress, Chrome throws an error stating
The play() request was interrupted by a call to pause()
The error thrown by Chrome doesn't break anything, it is just logged on the console.
On Browsers that return a promise, we can chain the play promise to catch any errors and ignore them.

Deployed to: http://staging.quran.com:32929

Heads up @naveed-ahmad @mannanali413 i am doing a little rewrite of audioplayer. going to push soon


Bug when fetching BPLvl from a private account

When I try to use client.fetch_battlepass_level() from an account which is set to Private I get an internal error instead of Forbidden
Error:
raceback (most recent call last):
  File "/red32/lib/python3.8/site-packages/redbot/core/dev_commands.py", line 192, in _eval
    result = await func()
  File "<string>", line 4, in func
  File "/bot-configs/bot2/cogs/Downloader/lib/fortnitepy/client.py", line 2151, in fetch_battlepass_level
    return data[user_id]
KeyError: '369644c6224d4845aa2b00e63b60241d'

Thanks for reporting. A fix will be published with the next release :)

This also breaks with fetch_multiple. It didn't include the user in the dict.

This has been fixed in 2.0. Thanks for reporting :)


Classic - Project 22: locationManager(_ didChangeAuthorization status: CLAuthorizationStatus) was deprecated in iOS 14.0

Classic - Project 22: Detect a Beacon.
I see alerts:

locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) was deprecated in iOS 14.0

locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) was deprecated in iOS 13.0

Maybe need to update below functions in HackingWithSwift/Classic/project22/Project22/ViewController.swift

func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
  if status == .authorizedAlways {
	  if CLLocationManager.isMonitoringAvailable(for: CLBeaconRegion.self) {
		  if CLLocationManager.isRangingAvailable() {
			  startScanning()
		  }
	  }
  }
}

func locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) {
    if beacons.count > 0 {
	    let beacon = beacons[0]
	    update(distance: beacon.proximity)
    } else {
	    update(distance: .unknown)
    }
}

to

func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
    if manager.authorizationStatus == .authorizedAlways {
        if CLLocationManager.isMonitoringAvailable(for: CLBeaconRegion.self) {
		if CLLocationManager.isRangingAvailable() {
			startScanning()
		}
	}
    }
}

func locationManager(_ manager: CLLocationManager, didRange beacons: [CLBeacon], satisfying beaconConstraint: CLBeaconIdentityConstraint) {
    if beacons.count > 0 {
        let beacon = beacons[0]
        update(distance: beacon.proximity)
    } else {
        update(distance: .unknown)
    }
}

Im trying change functions in https://github.com/twostraws/HackingWithSwift/pull/68


Wasting 100MB by Standard.Image library

I've just checked sizes of various libraries inside of Enso distribution:
enso/built-distribution/enso-engine-*/enso-*/lib/Standard$ du -s * | sort -n
164     Geo
196     Searcher
324     Examples
2616    Visualization
4052    Microsoft
4464    Test
16732   Tableau
25272   AWS
44120   Google_Api
46848   Database
48392   Table
63616   Base
72004   Snowflake
118976  Image

e.g. the Standard.Image library occupies 118MB! Why? Because its opencv.jar internally contains various ~10MB huge binaries for each supported platform.
Standard$ unzip -l Image/0.0.0-dev/polyglot/java/opencv-4.7.0-0.jar | grep nu.*opencv.*470
 20426616  2023-03-28 02:41   nu/pattern/opencv/linux/ARMv7/libopencv_java470.so
 28689512  2023-03-28 02:41   nu/pattern/opencv/linux/ARMv8/libopencv_java470.so
 64297552  2023-03-28 02:41   nu/pattern/opencv/linux/x86_64/libopencv_java470.so
 22088596  2023-03-28 02:41   nu/pattern/opencv/osx/ARMv8/libopencv_java470.dylib
 54792848  2023-03-28 02:41   nu/pattern/opencv/osx/x86_64/libopencv_java470.dylib
 69675008  2023-03-28 02:41   nu/pattern/opencv/windows/x86_32/opencv_java470.dll
108318208  2023-03-28 02:41   nu/pattern/opencv/windows/x86_64/opencv_java470.dll

If we, remove these native libraries and keep just a single one for the platform we build the distribution for we:

save bunch of disk space
save CPU time while starting (wasted by extracting these libs to temporary directory)
extract at build time rather than during runtime
make it easier for native image to link to such extracted library

Extracting anything from a jar archive during build time can be (easily) managed by setting various assembly sbt settings. I believe that I would be able to define build settings/tasks to do any kind of transformation for the jar. Once you know how should the resulting jar look like, which files should be removed from it, just let me know and I will create a patch of build.sbt that achieves that.

HostClassLoader will just search native libraries in all the projects

+1, there already is work on class loader/layer per library in #10714


chore - push workaround and a lint rule for https://github.com/evanw/esbuild/issues/3823

Failing monaco checks

That required deep drilling...


More struct and deflate-related cleanups and optimizations

This PR is a little all over the place, since I was hunting warnings all over, and it represents about 2 full days of testing and tweaking.
I did have to give up on shrinking s->heap, and also on getting rid of all of the bi_valid warnings, after numerous attemtpts from scratch, all resulting in incorrect deflate output data for unknown reasons (I have theories, but don't know exactly where the errors happen).
I don't know how many warnings got fixed and/or silenced, but I'd estimate 20 (when excluding duplicates), still lots more (and quite a lot of them false due to a GCC bug, makes it hard to spot the real ones).
This shrinks the deflate internal_state struct by 8 bytes. Before:
        /* size: 5984, cachelines: 94, members: 57 */
        /* sum members: 5972, holes: 3, sum holes: 8 */
        /* padding: 4 */
        /* last cacheline: 32 bytes */

After:
        /* size: 5976, cachelines: 94, members: 56 */
        /* sum members: 5967, holes: 2, sum holes: 5 */
        /* padding: 4 */
        /* last cacheline: 24 bytes */

PS: To review this, please look at each commit separately, otherwise it'll be very difficult to get an overview of what is happening.

I noticed that you removed the UNLIKELY macro in longest_match. Did you notice any improvements when you removed it?

Baseline 6264b5a58d7470333a64d69b247a2bd561bbbe68
   text    data     bss     dec     hex filename
  95243    1232      32   96507   178fb libz-ng.so.1

 Level   Comp   Comptime min/avg/max/stddev  Decomptime min/avg/max/stddev  Compressed size
 1     57.781%      1.320/1.339/1.348/0.008        0.875/0.888/0.898/0.008      127,296,397
 2     43.874%      1.265/1.279/1.288/0.007        0.443/0.464/0.473/0.007       48,329,132
 3     42.490%      1.319/1.332/1.339/0.006        0.372/0.384/0.392/0.005       40,118,068
 4     41.472%      1.304/1.313/1.319/0.004        0.296/0.313/0.322/0.006       32,630,864
 5     41.212%      1.392/1.407/1.415/0.006        0.300/0.311/0.317/0.005       32,425,995
 6     41.037%      1.314/1.332/1.339/0.006        0.236/0.249/0.253/0.004       25,831,160
 7     40.784%      1.289/1.297/1.302/0.004        0.172/0.186/0.192/0.005       19,253,737
 8     40.706%      1.108/1.115/1.118/0.003        0.109/0.123/0.129/0.004       12,811,166
 9     40.695%      1.227/1.237/1.240/0.003        0.115/0.121/0.126/0.003       12,807,941

 avg1  43.339%                        1.295                          0.338
 tot                                349.546                         91.177      351,504,460

PR #740 254c3e70fa9a8d48da3138afffcc1cbc3a937d2e
   text    data     bss     dec     hex filename
  95547    1232      32   96811   17a2b libz-ng.so.1

 Level   Comp   Comptime min/avg/max/stddev  Decomptime min/avg/max/stddev  Compressed size
 1     57.781%      1.291/1.337/1.349/0.013        0.858/0.884/0.895/0.010      127,296,397
 2     43.874%      1.244/1.267/1.276/0.009        0.423/0.465/0.473/0.011       48,329,132
 3     42.490%      1.317/1.328/1.335/0.005        0.369/0.388/0.395/0.006       40,118,068
 4     41.472%      1.291/1.301/1.309/0.005        0.301/0.313/0.319/0.005       32,630,864
 5     41.212%      1.392/1.404/1.411/0.005        0.297/0.312/0.320/0.005       32,425,995
 6     41.037%      1.318/1.329/1.334/0.005        0.240/0.249/0.253/0.004       25,831,160
 7     40.784%      1.282/1.295/1.301/0.005        0.175/0.183/0.189/0.005       19,253,737
 8     40.706%      1.103/1.111/1.116/0.003        0.109/0.121/0.126/0.004       12,811,166
 9     40.695%      1.218/1.232/1.237/0.004        0.105/0.121/0.126/0.004       12,807,941

 avg1  43.339%                        1.289                          0.337
 tot                                348.143                         91.034      351,504,460

 Level   Comp   Comptime min/avg/max/stddev  Decomptime min/avg/max/stddev  Compressed size
 1     57.781%      1.298/1.333/1.345/0.011        0.865/0.884/0.898/0.008      127,296,397
 2     43.874%      1.256/1.268/1.274/0.005        0.443/0.461/0.469/0.008       48,329,132
 3     42.490%      1.317/1.329/1.334/0.005        0.366/0.385/0.396/0.008       40,118,068
 4     41.472%      1.287/1.302/1.309/0.006        0.301/0.314/0.322/0.006       32,630,864
 5     41.212%      1.386/1.406/1.414/0.006        0.300/0.312/0.320/0.005       32,425,995
 6     41.037%      1.319/1.329/1.335/0.004        0.232/0.247/0.253/0.005       25,831,160
 7     40.784%      1.287/1.296/1.302/0.004        0.175/0.185/0.192/0.005       19,253,737
 8     40.706%      1.104/1.112/1.116/0.003        0.109/0.120/0.126/0.004       12,811,166
 9     40.695%      1.219/1.229/1.234/0.004        0.109/0.121/0.126/0.004       12,807,941

 avg1  43.339%                        1.289                          0.337
 tot                                348.097                         90.880      351,504,460

About 0.4% faster on average.
Speed increase seems to be more or less even across the algorithms.
Compiled code size (text) increases by 0.32% or 304 bytes. (the first few commits decrease size, but the last few increase size)

I noticed that you removed the UNLIKELY macro in longest_match. Did you notice any improvements when you removed it?

Yes, that is actually what made most of the speed increase.
The thing about UNLIKELY is that it not only puts the unlikely branch outside the function code block, but it also lets the compiler optimize it for size rather than speed. So even though those only hit about 30% of the time, it is faster if we don't do that.

I wonder if the compiler can better optimize if returning len from the compare functions instead of 258 and if it is faster or not. My initial tests at the time showed so, but I don't place much faith in those tests since it was before deflatebench.

@nmoinvaz Normally return value is in register, so if you return a variable, compiler can optimize the code, so same register is used across the whole function. This implies that the function doesn't call other functions. I don't think loading constant to register is much slower as compiler can zero- or sign extend constants more easily than variables. In most cases the compiler also knows it doesn't need to spill the previous contents of EAX/RAX register.

@mtl1979 Ah ok so it probably doesn't really matter.

@nmoinvaz Unless there is a lot of other memory loads close to the return of constant, optimizer most likely can mask the difference by reordering so that the load happens without a pipeline stall. There is obviously limit of how many memory loads can happen in one block of code (it depends on processor architecture, but safe is less than 5), so this doesn't apply to using constants in any other part of code.

I pushed another commit that cleans up some annoying if block inconsistencies in deflate.c, please review if you have the time.
@nmoinvaz @mtl1979

Removing {} around macros is usually bad idea.
Right, at least if the macros don't have them themselves. =/

@Dead2 In most cases macro itself shouldn't have {} around the actual code, but a lot of people use dummy do or while block to avoid mysterious errors when including the macro in places where only a single code line is expected. Only when the macro declares new variables, it requires explicit {}.
Some older compilers did actually have maximum limit for nested block scopes, for example old Linaro ARM compiler.

Rebased to fix merge conflicts with #735
Ran another benchmark too
 Tool: minigzip   Levels: 1-9
 Runs: 70         Trim worst: 40

 Level   Comp   Comptime min/avg/max/stddev  Decomptime min/avg/max/stddev  Compressed size
 1     57.781%      1.309/1.336/1.350/0.011        0.862/0.882/0.892/0.008      127,296,397
 2     43.874%      1.250/1.270/1.276/0.006        0.446/0.464/0.473/0.008       48,329,132
 3     42.490%      1.308/1.329/1.336/0.007        0.372/0.386/0.395/0.005       40,118,068
 4     41.472%      1.285/1.299/1.305/0.005        0.305/0.314/0.319/0.005       32,630,864
 5     41.212%      1.390/1.405/1.411/0.006        0.303/0.314/0.320/0.005       32,425,995
 6     41.037%      1.317/1.328/1.335/0.005        0.226/0.247/0.253/0.006       25,831,160
 7     40.784%      1.275/1.290/1.298/0.006        0.172/0.186/0.189/0.004       19,253,737
 8     40.706%      1.097/1.108/1.113/0.005        0.116/0.124/0.126/0.003       12,811,166
 9     40.695%      1.210/1.226/1.231/0.004        0.113/0.121/0.126/0.003       12,807,941

 avg1  43.339%                        1.288                          0.338
 tot                                347.739                         91.126      351,504,460

Actually slightly better than the previous two tests, but still within test-to-test variance.
But always nice with another confirmation that it performs better.


[Bridge] Deallocating memory when popping ViewController that contains React Native component

I'm using React Native inside an existing app. I create a RCTBridge in didFinishLaunchingWithOptions, which I use to initialize ReactRootViews in certain ViewControllers (who's only purpose is to show the ReactRootView).
I've create a RCTReactViewManager, which lets me pop out of those React Views through some View Controller gymnastics (this was the best way I could figure out how to do it).
@implementation RCTReactViewManager

RCT_EXPORT_MODULE(RCTReactViewManager);
RCT_EXPORT_METHOD(returnFromReactView) {
    UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
    UIViewController *mainViewController = keyWindow.rootViewController.childViewControllers[0];
    dispatch_async(dispatch_get_main_queue(), ^{
        [mainViewController.navigationController popViewControllerAnimated:true];
    });
}

@end

The problem: when I pop out of the React View Controllers, large chunks of memory are stuck in the VM: JS Garbage Collector and never deallocated.

I'm guessing this is because I am using the RCTBridge, which is holding the execution context across the whole app, so I'm curious whether there's any manual way to deallocate that memory that is consumed.
Thanks for all of y'alls help :)

I worked around this problem by instantiating a bridge for every viewController, although you have to pay the startup cost every time

Aked the same here: http://stackoverflow.com/questions/34168314/unload-release-remove-react-native-view-from-runtime
How to do this? Thanks!

@JohnyDays I have the same problem even though I do initialize my view with a bridge (instantiated by my view controller) and release the bridge in the viewDidDisappear of my view controller. Is that what you did?
@jessepollak  When I use instruments to inspect my memory usage, I do see the memory increasing but I'm not able to see an item "VM: JS garbage collector".  How did you manage to have this line show up?
Thanks!

@jnak this was a while ago, so I imagine the implementation has changed such that the "VM: JS garbage collector" no longer is there, sorry!

@jessepollak thanks for your answer. Yes that makes sense. Did you end solving your memory leak? It's only a few mb for simple views but when I load a map, my app is leaking +100Mb. It's very very concerning to me ;)

I believe that we now recreate the RCTBridge every time we pop on a new React view controller.

Actually I'm not able to reproduce the leak. It might have been cause by the new relic sdk that keeps some objects around in some cases.
Anyway if we are all good, let's close the ticket for now?

@facebook-github-bot close

@jsierles tells me to close this issue. If you think it should still be opened let us know why.


Co-authored-by: Marie-Hermine Schneider<EMAIL_ADDRESS>

…com>
Co-authored-by: Julien Richard [RMT - JS] Wild Code School<EMAIL_ADDRESS>

ok


请添加segment-anything2-medical-evaluation这个抠图功能更好的插件——https://github.com/mazurowski-lab/segment-anything2-medical-evaluation.git

ComfyUI Node Repository
Please provide the repository URL of the ComfyUI node you are referring to:

Repository URL: [e.g., https://github.com/user/repo]

Node Description and Use Case
Describe the purpose of the node and the scenarios in which it is used:

Node Description: [e.g., This node is used for generating high-quality images from textual descriptions.]
Use Case: [e.g., Ideal for graphic designers looking to quickly prototype designs using text inputs.]

Workflow Details (optional)
Please provide details about the workflow, including links, screenshots, or JSON files:

Workflow Link: [e.g., https://example.com/workflow]
Screenshots: [If applicable, please attach screenshots here.]
JSON File: [If applicable, please attach the JSON file or provide a link to it.]

Additional Context (optional)
Add any other context or information about the feature request here.

https://github.com/mazurowski-lab/segment-anything2-medical-evaluation.git这是插件网址

segment anything 2 的优势，更体现在视频抠图上。我们在未来支持视频节点后，再做相关的工作。


Add extraPodLabels to buildbuddy-executor chart

Add an "extraPodLabels" field to values, to make it possible to add custom labels. We use this to add a "team" label to all our pods.

Thanks again @mortenmj!


api module

refactor(flake): extract systemSpecificOutputs
feat: api module

https://github.com/NixOS/nixpkgs/issues/254552

Commenting so that some other PRs are the least recently updated. They are used as test fixtures.


[BUGFIX] IndexError: tuple index out of range in shap.plots.bar #2832

This PR fixes the following IndexError due to large cohorts (cohorts > 10). Closes #2832

hatch=patterns[i], edgecolor=(1,1,1,0.8), label=f"{cohort_labels[i]} [{cohort_sizes[i] if i < len(cohort_sizes) else None}]"
204     )
206 # draw the yticks (the 1e-8 is so matplotlib 3.3 doesn't try and collapse the ticks)
207 pl.yticks(list(y_pos) + list(y_pos + 1e-8), yticklabels + [l.split('=')[-1] for l in yticklabels], fontsize=13)
IndexError: tuple index out of range

This fix reuses concatenation of an existing hatch pattern when cohorts is larger than len(patterns).
When cohort index is multiple of 0 (i.e. '') a concatenation of '|' pattern is used.
e.g.

>>> i=19
>>> patterns[i%len(patterns)]*(i//len(patterns)+1)
'--'

@yonashub I had a brief look at this, actually the results don't look that pleasing with 10+ bars/cohorts. (I'm also curious, what's the use case to have to compare 10+ cohorts against each other.)
Could you show an example output of your plot (after your PR changes)?


Issue with Wait-RSjob

Perhaps I am just misunderstanding the way this should work.  This is basically what my code looks like:
       $datatable = Invoke-Sqlcmd2 -ServerInstance MyServer -Database MyDatabase -Query @" SELECT ID, SourceServer, DbName, DestinationServer FROM myTable WHERE ID in (1,2,3,4,5) "@     [void]$(($datatable.Rows)|Start-RSJob -Name {"$($_.ID)-$($_.DbName)"} -Throttle 10 -ScriptBlock {      #Really long complicated script block which restores, manipulates and backups up databases     })     [void] $(Get-RSJob | Wait-RSJob)     [void] $(Get-RSJob | Stop-RSJob)     [void] $(Get-RSJob | Remove-RSJob)     $MailMessage = new-object System.Net.Mail.MailMessage     $MailMessage... #Fill in appropriate properties for the mail message object     $smpt = new-object Net.Mail.SmtpClient("smtp.server.com")     $smtp.Send($MailMessage)
When I run my code from PS ISE, it runs all of the jobs for each of the 5 databases I feed it before sending the email which includes information on the success/failure of each job.  When I run this script from a SQL Agent job as either a powershell or a call from the Operating System (CmdExec), it only waits for the first job to complete/error before sending the email which shows one job finished and 4 running.  The server only shows one powershell instance running, but none of the other jobs ever finish.  The same thing happens when run from a Scheduled Task.  Any clue why Wait-RSJob does not get respected by TaskScheduler or SQLAgent?

Did you try to just { write-host "number $_" } instead of you long scriptblock ?
may be there is some exception inside ?

Good call MVKozlov.     I was checking for encryption status but not the existence of a database key.  Apparently, you can't restore an unencrypted database without the certificate if the database key exists.


Fix issue #2456: arrays not growing beyond 2000

This PR fixes issue #2456

Closing this PR since these changes are there in PR #2492


Control: Clippy View

This needs to exist:
https://twitter.com/jessfraz/status/962034432541519873

Well, given that tweet no longer exists, I think this can be closed?

Good lord, what is wrong with folks deleting old tweets.


All Graph Algorithms in one place[GSSoC'23]

Hi @aaryahjolia
I want to contribute by adding graph algorithms which are imp from interview perspective like Topological sort, Dijkstra algo, Bellman Ford, and Floyd warshall algo. Their code and proper explanation with diagrams will be added along with video and leetcode questions to practice.
Please assign me this issue under GSSoC'23.

Please assign this to me as a GSSOC contibutor.


Inconsistent tag revision

The package on npm is listed as 3.32.1 but you have no tag/release matching that on Github

https://github.com/algolia/algoliasearch-client-javascript/releases/tag/3.32.1 -> 404

what are you using these tags for by the way, I'd love to see the use case. Normally npm publish is linked to a git hash already, even if there wasn't a tag

We usually recommend putting the “/npm” url not to rely on GitHub tags


Typescript support

Are there @types packages provided

Are there @types packages provided

Not currently. We do not use typescript in our projects at Zillow, so we don't currently have a need for it. If somebody would like to submit a PR, I'd be happy to review and merge!

fyi: while there's no types for react-slider, you can use //@ts-ignore right before the module import to use the package without typechecking:
//@ts-ignore
import ReactSlider from 'react-slider';

Types are available, but need to be updated and generics added: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-slider
Alternatively, I'd be happy and would prefer to rewrite this in typescript to future proof it.
Which would you prefer @mpowaga?

I just submitted a thick PR to DefinitelyTyped: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/40094
I used the prop types, assuming they're in date.

@stonebk

@waynevanson, thanks for looking into this! Yes, the prop types should be up to date. Forgive my ignorance, does anything need to happen within this project, or do people just pull the definitions directly from definitelytyped?

@waynevanson, thanks for looking into this! Yes, the prop types should be up to date. Forgive my ignorance, does anything need to happen within this project, or do people just pull the definitions directly from definitelytyped?

People pull the definitions by running yarn add -D @types/react-slider :)

@waynevanson does this make sense? https://github.com/zillow/react-slider/pull/155

@stonebk yes it does!

@stonebk My pull got rejected, so all credit goes to:

@jsonunger
@bjorgvin


selectable property on text component is not working on oppo and samsung devices.

Description
I have tested it on other real devices and emulators, and Selectable is working fine on it. whereas when I tried to tap and hold to select the text it didn't work on Oppo and Samsung devices.
React Native Version
0.71.11
Output of npx react-native info
System:
OS: macOS 13.3
CPU: (8) x64 Apple M1
Memory: 22.56 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.3.1 - /usr/local/bin/node
Yarn: 1.22.19 - ~/Desktop/myProject/node_modules/.bin/yarn
npm: 9.6.7 - /usr/local/bin/npm
Watchman: 2<IP_ADDRESS> - /usr/local/bin/watchman
Managers:
CocoaPods: 1.12.1 - /Users/neosoft/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9619390
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
Languages:
Java: 11.0.19 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.11 => 0.71.11
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
add a selectable true text component
You can select me
Snack, screenshot, or link to a repository
.

Snack, screenshot, or link to a repository

Reproducers are mandatory. Can you please provide it?

Do you still experience this issue?
I have four years of experience maintaining facebook/react-native and I specialize in the Text and TextInput components. I currently have 58 facebook/react-native PRs.
If you still experience this issue, I will prepare a patched release with the fix.
Thanks a lot


Add encryption

In order to avoid the server being able to read the content of the scene, this PR implements local encryption and decryption. This implements the algorithm described in #610.
Right now the server doesn't support uploading binary files. I mocked the server with comments. @lipis, could you add support on the server and update this PR? I added a bunch of TODO: that tell you where to comment/uncomment in order to get the server flow going.
To test locally right now:

Import: Open http://localhost:3000/#json=1234,5oYVOnGpWYPPTz19-PMYYw and see a square
Export: Click the export link and see the right url with the private key + the encrypted binary in the console

Fixes #610

The backend supports storing plain text data in version 2: https://json.excalidraw.com

Ad gzip: We could manually compress before encrypting (with some caveats).

@lipis it seems like v2 is not whitelisted for CORS :(
Access to fetch at 'https://json.excalidraw.com/api/v2/post/' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
data.ts:130 POST https://json.excalidraw.com/api/v2/post/ net::ERR_FAILED

@lipis if you want to test it out, I updated the PR.
Repro:

Go to https://excalidraw-re7oki8g8.now.sh/
draw a rectangle
open the export menu
click export
See that it throws on const json = await response.json();
If you change it to .text(), you'll see that the text response is empty
On the network tool, the response says it's 200 OK and the response length is 91

But can't show the response:

For some reason it doesn't respond with the JSON..  same behaviour locally, so I'll investigate a bit more after work.

It works with the RestMan but not with this PR.. strange

I got a response, by removing these two lines from the commit suggestions.

The entire flow is working!
You can try with those two scenes:

#json=5725470830100480,i21D-alTzlc_yTrPjRFVrg
?id=5746640992337920

The list of recently loaded scenes is broken though.. also when there is only one entry it doesn't reload it.

Oops, I didn't test the recent list, thanks, I'll look into it

I can't reproduce, it seems to be loading the scenes correctly for me.


Remove trace preview feature

Many may recall we had a trace preview feature in the search results screen. This I believe was an idea borrowed from jaeger. As discussed with @tacigar this is probably not a worthwhile feature.
For example, it appears to solve the trace comparison use case but it doesn't. For example, it is unlikely you will have two traces near each-other in the results and even if you did, the scrolling up and down wildly through expanded traces thing isn't that effective.
Moreover, there's recent work in the UI to share data between the trace list and the trace view page, which obviates network calls. In other words, as long as navigation such as "back" works properly, there's no reason to overload the screen, especially for performance reasons.
This should buy back code and complexity for better purposes. For example, right now no screen is ideal for comparing multiple traces. However, we could build a compare screen and let people select into it.
cc @openzipkin/ui @narayaruna

Ex the part to remove is the expansion here. You'll notice it is only luck that the traces of interest (expanded) are with only one trace between them. In simple traces like from zipkin server, only 4-7 spans, this looks benign, but you could imagine LINE and others have 800 span traces, so expanding them inline is not that useful.

cc also @bulicekj

+1 because less screen overload.


Bump cloudevents/sdk-go/v2 to RC3

Changes

/cc @afrittoli @dibyom @sbwsg @mattmoor
Carrying #2357 with RC3 :angel:
Closes #2357
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:

[ ] Includes tests (if functionality changed/added)
[ ] Includes docs (if user facing)
[x] Commit messages follow commit message best practices

See the contribution guide for more details.
Double check this list of stuff that's easy to miss:

If you are adding a new binary/image to the cmd dir, please update
the release Task to build and release this image.

Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes
Bump cloudevents/sdk-go/v2 to v2.0.0-RC3

/test pull-tekton-pipeline-integration-tests

/approve

/lgtm

/test pull-tekton-pipeline-integration-tests


extendParams auth logic seems incorrect

Great work on this library! It's been really useful so far.
I flipped the logic in extendParams and made use of authReq in UserApi.Get().
I also ran go fmt with default parameters, let me know if you prefer a different formatting!
Thanks,
Kevin

Thanks for the PR! (a year late :-1:)


[Port] Fix notebook saving issue with Jupyter extension

This PR fixes https://github.com/microsoft/azuredatastudio/issues/19554
PR in main: https://github.com/microsoft/azuredatastudio/pull/19678

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

1 of 1 (100.0%)  changed or added relevant line in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.0007%) to 41.947%

Totals

Change from base Build<PHONE_NUMBER>:
0.0007%

Covered Lines:
27929

Relevant Lines:
62116

💛  - Coveralls


SNOW-730238: SNOW-697912: The SQL simplifier may generate a bad SQL when renaming a column to an existing column

Please answer these questions before submitting your issue. Thanks!

What version of Python are you using?
Python 3.8.11 (default, Aug  6 2021, 08:56:27)
[Clang 10.0.0 ]

What operating system and processor architecture are you using?
macOS-10.16-x86_64-i386-64bit

What are the component versions in the environment (pip freeze)?
snowflake-snowpark-python 1.0.0

What did you do?

    session.sql_simplifier_enabled = True
    df1 = session.create_dataframe([[1]], schema=["a"])
    df2 = session.create_dataframe([[1]], schema=["a"])
    df3 = df1.join(df2, df1["a"] == df2["a"])
    df4 = df3.select(df1["a"].as_("a"))
    df1_converted = df1.select(df1["a"])
    df5 = df1_converted.join(df4, df1_converted["a"] == df4["a"])

    session.sql_simplifier_enabled = True
    df1 = session.create_dataframe([[1, 2, 3]], schema=["a", "b", "c"])
    df3 = df1.withColumn("a", df1["c"])
    df4 = df3.withColumn("b", sql_expr("1"))

What did you expect to see?

No SQL error. It should work correctly.

It's fixed with PR #649 .  To be release with snowflake-snowpark-python 1.1.0.


Consider passing through escaped non-escape sequences

Prometheus is currently very strict about escaped characters if these are not an escape sequence.
This requires characters in regular expressions to be double escaped.
This makes it bit more inconvenient to escape meta characters in regular expressions. More problematic though, it is an issue with Grafana among others, which escapes all kinds of characters by default https://github.com/grafana/grafana/issues/2918.
If we just ignore such cases, we should make it easier for people to escape meta characters in regular expressions. It should be backwards compatible, as a currently escaped backslash will continue to work.

Trying to do magic with escaping is risky, as it makes it unclear exactly which layer is interpreting which escape sequences. It gets to be even more fun if a layer changes the escape sequences it knows about.
I'm for keeping a strict definition of escaping. Letting our users be lax in how many backslashes they must provide is likely to cause more problems than it solves in the long run.

This makes it bit more inconvenient to escape meta characters in regular expressions.

That's completely normal. If we want to avoid that in a sane way we'd have to look at something like Python's r string literal modifier - which we already pretty much have via backticks.

Oh, to be honest, I didn't know about the backtick behavior. So instead of changing the behavior of the backslash, we'd need to ask users to use backticks in such situations? This sounds reasonable to me.

Backticks can't handle backticks inside them, so to be fully generic a client would have to support our escaping.


Create a single repo for all the testing solutions related to Styled Components

This project forked an older version of jest-styled-components and provides some of the same functionalities with different APIs, which generates confusion for the users.
Why don't we "merge" the projects (under the org I guess) and create a single repo for all the testing solutions related to Styled Components?
We could use Lerna to manage dependencies and packages.
Let me know if you are interested.

Hi Michele,
yes, I think that this is a good idea, also, the org is the right place to put the repo. I haven't used Lerna before, but I'll start studying it as soon as possible.
I'd like to maintain the same concept under styled-components-test-utils: make the APIs compatible with jest but also with expect and others libraries.
What do you think about that?

Sure, the new package (or packages) is going to have all the same features (and potentially more).
The goal is to provide consistent APIs and share the code.
We should agree on the signature of toHaveStyleRule, because I believe the extra params (e.g. options) should be passed to the matcher rather than expect.
Also, we have to find a cool name (something related to 💅, like polished - what about nailed?) and a logo :)

Cool :tada:, Testing styled components would be more awesome!

Sure, the new package (or packages) is going to have all the same features (and potentially more).
The goal is to provide consistent APIs and share the code.

Awesome! Maybe we could solve #1 directly in the new package?

We should agree on the signature of toHaveStyleRule, because I believe the extra params (e.g. options) should be passed to the matcher rather than expect.

I thought a little about it and that makes sense, it is semantically correct to pass options to the matcher. So, we might have a signature like:
expect(tree).toHaveStyleRule(selector, value, { modifier, media })

Also, if we want to test css API, do you think that a signature like this might be ok?
expect(css).toHaveStyleRule(selector, value, { props, media, modifier })

I'm not totally sure about the last one... But I have no other ideas at the moment.

Also, we have to find a cool name (something related to 💅, like polished - what about nailed?) and a logo :)

Yeah, I totally agree with you, it gives the package a kind of personality. nailed is great 😄
P.S.
A small organizational note:
Unfortunately, I'll be on vacation in a few days and I'll not be able to develop without my computer. However I can answer to the this issue to define signatures and so on using the phone. I'll come back home the 10th of august

@mbasso enjoy your vacation and let's talk about this when you are back.
@yanawaro it'd be awesome to get you involved in this project.

I'm glad to help.
@mbasso I love that right now this repo has many features supported for modifiers, media, pseudos already! I understand that https://github.com/mbasso/styled-components-test-utils already supports using toHaveStyleRule with enzyme's api or not? as seen in https://github.com/mbasso/styled-components-test-utils/blob/master/src/matchers/toHaveStyleRule.js#L23 (but docs says not 😂 ). I've seen you used the component's state.generatedClassName as I did with my own utility before.
I think combining modifier, media as one object should be more easier to add new things.
@MicheleBertoli Right now, If creating enhancements for https://github.com/styled-components/jest-styled-components how would it be aligned in the end?
I'll follow up this topic and see what I can do. 👍

@yanawaro I'd try to avoid using Enzyme's internals (e.g. generatedClassName) as much as I can.
For now, I'd just add new features on both packages and then we'll figure out how to merge the libraries providing the best experience to the users.

@yanawaro I'd try to avoid using Enzyme's internals (e.g. generatedClassName) as much as I can.
For now, I'd just add new features on both packages and then we'll figure out how to merge the libraries providing the best experience to the users.
Thank you very much!

@yanawaro Thank you! I'm happy that we'll work together on this project 😄
styled-components-test-utils works fine with react-test-renderer, react-test-renderer/shallow and enzyme's shallow.
I've written that enzyme's mount is not supported yet because, for some reasons that I have to understand (probably because I'm using internals, and I agree with the comment of Michele for this reason), tests fail. As you can see here some lines are not covered. So, I'm not sure that I can say otherwise at the moment.
@MicheleBertoli thank you, I'll write to you the 10th of august!

@MicheleBertoli I'm back, we can talk about the project :)

Welcome back @mbasso, I hope you enjoyed your holidays.

Thank you! Yeah, I really needed them.
What do you think about this?

I totally agree with you, @yanawaro recently added the third options parameter as well.
I think that's the way to go.
Next things I'd like to do:

figure out exactly what's going to be the surface of the package (APIs, supported environments/libs, serializers, matchers, single VS multiple packages, and so on)
setup a simple boilerplate with Lerna so that we can start coding

Unfortunately, I'm a bit busy until the end of the month because I'm preparing a talk, but let's keep discussing and sharing ideas.

I'll try to write my thoughts, let me know what do you think
supported environments/libs
At the moment styled-components-test-utils supports jest, expect, chai and jasmine. I'd like to add ava but it seems that it cannot be extended at the moment, the same for tape.
I'd like to render components using react-test-renderer, react-test-renderer/shallow, enzime's shallow and enzyme's mount.
Would you like to add other libraries?
APIs, matchers
Starting from our 2 libs, here is the list of matchers:
// test styled components: https://www.styled-components.com/docs/api#styled
expect(tree: reactElement).toHaveStyleRule(selector: string, value: string | number | RegExp, options?: {
  modifier?: string,
  media?: string | object,
});

// test css api: https://www.styled-components.com/docs/api#css
expect(css).toHaveStyleRule(selector: string, value: string | number | RegExp, options?: {
  modifier?: string,
  media?: string | object,
  props?: object,
});

// test keyframes api: https://www.styled-components.com/docs/api#keyframes
expect(keyframe: string).toHaveKeyframeRule(keyframeSelector: string, selector: string, value: string);

// test injectGlobal api: https://www.styled-components.com/docs/api#injectglobal
expect(style: string).toBeAGlobalStyle();

// snapshot
expect(tree: reactElement).toMatchSnapshot();

// examples

// toHaveStyleRule

const Example = styled.div`
  padding: 2em 1em;
  background: papayawhip;

  &:hover {
    background: palevioletred;
  }

  @media (max-width: 600px) {
    background: tomato;

    &:hover {
      background: yellow;
    }
  }

  > p {
    text-decoration: underline;
  }

  html.test & {
    display: none;
  }
`;
const component = renderer.create(<Example />);
expect(component).toHaveStyleRule('background', 'papayawhip');

// pseudo selectors
expect(component).toHaveStyleRule('background', 'palevioletred', {
  modifier: ':hover', // or '&:hover'
});

// descendant-selectors
expect(component).toHaveStyleRule('text-decoration', 'underline', {
  modifier: '> p',
});

// contextual selectors
expect(component).toHaveStyleRule('display', 'none', {
  modifier: 'html.test &',
});

// media as string
expect(component).toHaveStyleRule('background', 'tomato', {
  media: '(max-width: 600px)',
});

// media as object
// it should be thought of as if it is the current state of a device/browser.
// a type value must be specified, and it can not be "all".
// The returned rule is the one applied under those conditions
expect(component).toHaveStyleRule('background', 'tomato', {
  media: {
    type: 'screen',
    width: '700px',
  },
});
expect(component).toHaveStyleRule('background', 'papayawhip', {
  media: {
    type: 'screen',
    width: '400px',
  },
});

const style = css`
  color: ${props => props.primary ? props.primary : 'white'}
`;
expect(style).toHaveStyleRule('color', 'black', {
  props: {
    primary: 'black',
  },
});

// toHaveKeyframeRule

const fadeIn = keyframes`
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
`;
expect(fadeIn).toHaveKeyframeRule('0%', 'opacity', '0');

// toBeAGlobalStyle

injectGlobal`
  input {
    font-family: Roboto;
  }
`;
expect(`
  input {
    font-family: Roboto;
  }
`).toBeAGlobalStyle();

// toMatchSnapshot

const tree = renderer.create(<MyComponent />).toJSON();
expect(tree).toMatchSnapshot();

I have only one problem with theme, I don't know how we can avoid to do this in each test:
const component = <Button theme={theme} />;

single VS multiple packages
I think that a single package might look like this library, users have to do something like:
import 'styled-components-test-utils/jest';
// or, for example, import 'styled-components-test-utils/chai';

With multiple packages the repo will be better organized and less confusing for users, they will be able to install directly the right package.
In addition, each package can contain its own installation guide, in this way we can keep the main README clean.
Maybe we might have a structure like this:
nailed
│
└───packages
|   |   nailed-jest
|   |   nailed-expect
|   |   nailed-chai
|   |   nailed-jasmine
│   │   nailed-matchers
│   │   nailed-serializers
|

setup
Will you create the repo (nailed) under the org? Can we also setup and use travis and coveralls? I think that we can use the MIT license and the Contributor Covenant Code of Conduct

This is awesome, thanks @mbasso.
It's exactly what I had in mind as a starting point.
Also, my presentation is almost ready and I'll be ready to start working on this soon.
Thank you very much!

Awesome! Let me know when you are ready 😄

I'm so so so sorry but I just realized I don't have the capacity to start a new project anytime soon.
I've got another talk next week, and I barely find the time to keep up with the issues on my repos.
It would have been great to work together and I can see how merging the packages would be beneficial for the community.
I'm going to close this for now but I promise I'll ping you as soon as I'll be ready to start for real.
Thank you very much!


[QUESTION] How to make dynamic WORKERS_PER_CORE value

Description
How can I make value to WORKERS_PER_CORE dynamic
docker run -d -p 80:80 -e WORKERS_PER_CORE="3" myimage
so that when I really need to speed I can increase performance to 10, but at other times
set to 0.5 when idling?

A bash script that relaunches your container? Dynamic based on what exactly?
It's an interesting question but the answer revolves greatly on your particular problem.
I usually set it as cpu_count*2+1 or if its a shared server just cpu_count (see multiprocessing) in the Gunicorn settings (or as an env var). Adding more workers will not solve anything as the server becomes congested. You need to grow either horizontally (adding more servers) or vertically (adding more cores and ram).

Yep, what @HacKanCuBa said 👆


Programmatic usage: attach from within Java

Hi,
I was wondering if it would be possible to attach the profiler to the running JVM from within Java.
The purpose would be to choose when to start and stop profiling just for some parts of the application without having to do it manually from outside but just by calling some Java API :)

In the binaries you have a JAR lib async-profiler.jar that contains the Java API.
You can also get it from maven central::
<dependency>
  <groupId>tools.profiler</groupId>
  <artifactId>async-profiler</artifactId>
  <version>1.8.3</version>
</dependency>

As an example, here's the clojure wrapper for Async Profiler: https://github.com/clojure-goes-fast/clj-async-profiler

That was fast! And it seems everything is already available for it :)
Thank you to both of you, I think I have everything I need then, I will close the ticket.

Ah unfortunately, the latest version is 2.8.3 but the latest available on maven is 1.8.3.
Any idea who should we ask to get the latest version on maven?

I believe it is compatible with newest async-profiler. I used it with 2.x line.
If it is not you can:

just copy those classes https://github.com/jvm-profiling-tools/async-profiler/tree/master/src/api/one/profiler to your project.
create an issue for lack of compatible java API in maven

Sounds good, thank you!


Multi-GPU models loading and training

Hello,
I came across your work, and was wondering whether loading and training models on multiple GPUs was possible.
I saw in the YOLOv7 repo that it was possible with the following command line:
# train p5 models
python -m torch.distributed.launch --nproc_per_node 4 --master_port 9527 train.py --workers 8 --device 0,1,2,3 --sync-bn --batch-size 128 --data data/coco.yaml --img 640 640 --cfg cfg/training/yolov7.yaml --weights '' --name yolov7 --hyp data/hyp.scratch.p5.yaml

# train p6 models
python -m torch.distributed.launch --nproc_per_node 8 --master_port 9527 train_aux.py --workers 8 --device 0,1,2,3,4,5,6,7 --sync-bn --batch-size 128 --data data/coco.yaml --img 1280 1280 --cfg cfg/training/yolov7-w6.yaml --weights '' --name yolov7-w6 --hyp data/hyp.scratch.p6.yaml

I managed to use your code to train the model on a single GPU, but not on several GPUs. Have you managed to do it and have you any tip to do this multi-GPU training in a script ?
Thank you

I haven't tried for training. I developed the prediction codes.
@jrtwolski It can help you.


Speed up the verifiedQueryClient using goroutines

Currently, the verifiedQueryClient makes a ABCI query based on the latest block, and wait for the next block (= latest + 1) for light client verification.
But, there are some cases where we need to query multiple values from the chain. For example, we need to fetch a deal, a certificate, and an account for handling GET /v0/.../secret-key.
To speed up it, use goroutines.
There are two ways, in general. We should decide about it.

Spawning goroutines whenever you want.
Limiting the max number of goroutines for a verifiedQueryClient (similar as a thread pool).

It depends on the rate limiting of the chain node.

I think we have a way to achieve the same effect as goroutines.

We get lastBlockHeight before searching.
And we use this height for all out queryies.

Theoretically, we can run multiple queries in 0 to 6 seconds.

Good idea. Let's migrate this discussion to #47 since it's related more with queryHeight rather than goroutines.


New version: AffineInvariantMCMC v0.6.0

Registering package: AffineInvariantMCMC
Repository: https://github.com/madsjulia/AffineInvariantMCMC.jl
Created by: @montyvesselinov
Version: v0.6.0
Commit: 14b7df6c8733292ac284c4fc55922e240040e149
Git reference: master
Release notes:

version

Your new version pull request met all of the guidelines for automatic merging.
I will automatically merge this pull request during the next cron job.
If you want to prevent this pull request from being auto-merged, simply leave a comment.
(If you want to post a comment without blocking auto-merging, you must include the text [noblock] in your comment.)

On a separate note, I see that you are registering a release with a version number of the form v0.X.Y.
Does your package have a stable public API? If so, then it's time for you to register version v1.0.0 of your package. (This is not a requirement. It's just a recommendation.)
If your package does not yet have a stable public API, then of course you are not yet ready to release version v1.0.0.

[noblock]


[2.0.0-6] RN - Unexpected token type: word error

Updated<EMAIL_ADDRESS>project to<EMAIL_ADDRESS>and started getting this error during initial boot of the app:
Not entirely sure what the cause is yet, going through the changelog

You were right with issue 20. Although thinking about it, we need better errors!