c ++ – New values ​​for the vector of const char * do not get push_back ()

I have a vector of cons char *. Which is actually a timestamp. Each time, I get the last value and convert it to an integer, increasing by 40. And then back to vector as const char *. My problem is that new values ​​do not get push_back (). Vector already contains a value.

I tried to create instances instead of doing it directly
Instead of

string is = to_string (y);
some_vector.push_back (is.c_str ());

I do

string is = to_string (y);
const char * temp = is.c_str ();
some_vector.push_back (is.c_str ());

My complete code is

vector Time restriction;
for (int i = 1; i <= 10; i ++)
{
const char * tx = TimeConstraint.back ();

int y;
string stream strval;

strval << tx;
        strval >> y;

y = y + 40;

string is = to_string (y);
const char * temp_pointer = is.c_str ();
TimeConstraint.push_back (temp_pointer);


} 

New values ​​are not added to the TimeConstraint vector

Each time, I must press the incremented value of the last element of the push_back () vector. Please help me
thank you in advance

export – Issue when exporting vector graphics (PDF) to Mathematica notebook front-end with remote kernel on Linux

I can not export vector graphic images (especially PDF) to a Mathematica notebook frontend in Windows 8.1 with a remote kernel on a Linux server.

However, I can easily export raster image formats.

Interestingly enough, when accessing the server directly from the ssh command line, the Mathematica kernel starts and runs export Command, it works fine.

Mathematica 11.3 is the version used on both computers.

Example of a Mathematica notebook:

Set directory["/home/results"]

plt = plot[x, {x, 0, 1}]

export["test.gif", plt]  (*Works well*)

export["test.jpg", plt]  (*Works well*)

export["test.png", plt]  (*Works well*)

export["test.pdf", plt]  (*It does not work*)

export["test.eps", plt]  (*It does not work*)

Differential Geometry – Can we always find a curve on the manifold whose tangent vector always belongs to a linear subspace?

Suppose we have a smooth manifold $ M $ and the tangential space of each point $ x in M ​​$ has a non-empty intersection with a given linear subspace. Could we find a curve? $ M $ so that the tangent vector of the point on that curve always belongs to this linear subspace?

$ textbf {my try:} $ If the dimension for the linear subspace is one or two, I think I can find the curve. But I do not know if the dimension is larger than two?

I will be glad for useful answers and comments

Vector analysis – Define the path integral if the scalar $ f $ and the curve $ mathbf {c} $ are in * curvilinear * coordinates

I'm currently doing a multivariable calculus course. I have seen path integrals in the Cartesian coordinate system as the following definition:

Definition.
The path integral of $ f (x, y, z) $ along the curve $ C $ is

$$ int_C f ds = int_a ^ bf ( mathbf {x} (u)) || mathbf {x} & # 39; (u) || you $$

from where $ mathbf {x}:[a,b] to mathbb R ^ 3 $ is the parametric representation of $ C $, The definition did not refer to the coordinate system.

Question.
Suppose that $ (x, y, z) = mathbf Phi ( xi_1, xi_2, xi_3) $ where the
transformation $ mathbf Phi: U to V $ is sufficiently differentiable and has one
inverse $ mathbf { Phi ^ {- 1}}: V to U $ from where $ U, V $ are open subsets of $ mathbb R ^ 3 $,

What would be the definition of a path all over $ C $ when $ f $ is a function of curvilinear
Coordinates ($ xi_1, xi_2, xi_3 $) and the curve has been parameterized
curvilinear coordinates as $ mathbf { xi} = mathbf { xi} (u) $ to the $ a le
> u le b $
?

Is the definition consistent with a regular "Cartesian" path? If so, can you derive from the above definition for Cartesian how you would obtain a path integral for a function in curvilinear coordinates?

ag.algebraic geometry – Each holomorphic vector bundle over a compact Riemann surface can be defined by only one transition function.

It is known that any holomorphic bundle of any order over a non-compact Riemann surface is trivial. A proof can be found in Forster's "Lectures on Riemann Surfaces," section 30.

To let $ E $ be a holomorphic vector bundle over a compact Riemann surface $ X $ with measuring device group $ G $, One consequence of the above sentence is the limitation $ E | _ {X – {p }} $ for every point $ p in X $ is a trivial bundle. Thus $ E $ can be restored by specifying the transition function $ g: D cap (X – {p }) rightarrow G $ from where $ D $ is a small disk with $ p $,

Is that correct? If not, could you give a counterexample? I am mainly interested in the modulo space of holomorphic bundles $ X $ in a concrete way, e.g. Use transition functions.

How can the presence of each element of a vector be checked line by line in an array in R?

Assuming I have a vector in the range of 1 to 10, I would like to check the binary shape for each element of the vector if it exists in the array row, where 0 is for non-presence and 1 for presence, regardless of that Element that I repeat I would count only 1, for example in the first line of the array I have that[1,]= c (1,5,2,2,1), I would have 0 for elements 3,4,6,7,8,9,10 and 1 for elements 1,2,5

Plotting – The gradient method in the vector field on the surface table does not work, the module is slow

For teaching purposes, I would like to create a vector field on a surface and visualize the path of the gradient method.

The surface and the gradient are generated with

f[x_, y_] : = Sin[x] cos[y];
GR[x_, y_] : = D[f[xx, yy], {{xx, yy}, 1}]/. {xx -> x, yy -> y};
a = 5;
xmin = -a; xmax = a;
ymin = -a; ymax = a;
nmax = 10;
mmax = 10;
dx = (xmax - xmin) / nmax;
dy = (ymax-ymin) / mmax;
grf = table[xi = xmin + i*dx; yj = ymin + j*dy;
   v = {xi, yj};
   w = v + Evaluate@gr[xi, yj];
arrow[{v, w}],
{i, 0, nmax}, {j, 0, mmax}];
pp = plot3D[f[x, y], {x, xmin, xmax}, {y, ymin, ymax}, Mesh -> None,
PlotStyle -> {Orange, Opacity[0.75]}]graphic[grf]

The gradient field is also converted into a tangent vector field

pp = plot3D[f[x, y], {x, xmin, xmax}, {y, ymin, ymax}, Mesh -> None,
PlotStyle -> {Orange, Opacity[0.75]}];
grfplt = table[xi = xmin + i*dx; yj = ymin + j*dy;
   v = {xi, yj, f[xi, yj]};
gg = gr[xi, yj];
w = v + {gg[[1]]gg[[2]]f[Xi+gg[Xi+gg[xi+gg[xi+gg[[1]], yy + gg[[2]]]};
Graphics3D[{Arrowheads[.01], Arrow[{v, w}]}],
{i, 0, nmax}, {j, 0, mmax}];
show[pp,grfplt]

The paths of the gradient method should be generated with

gradmeth[f_, x0_, y0_] : =
table[xa = x0; ya = y0; gg = gr[xa, ya]; xb = xa + gg[[1]];
yb = ya + gg[[2]]; v = {xa, ya, f[xa, ya]};
w = {xb, yb, f[xb, yb]};
xa = xb; ya = yb;
Graphics3D[{Red, Thick, Arrowheads[.05], Arrow[{v, w}]}],
{i, 0, 15}
];
gr1 = gradmeth[f, 2, 2];
gr2 = gradmeth[f, 2, 1];
show[pp, grfplt, gr1, gr2]

But obviously the statement xa = xb; ya = yb; overwrite w every time.

That's why I used a module

gradmeth[f_, x0_, y0_, col_] : = Module[{xa, xb, ya, yb, gg, v, w, ll}
xa = x0; ya = y0; ll = {};
To the[i = 0, i <= 10, i ++,
gg = gr[xa, ya]; xb = xa + gg[[1]]; yb = ya + gg[[2]];
v = {xa, ya, f[xa, ya]};
w = {xb, yb, f[xb, yb]};
(* Appendices[ll,Graphics3D[{Red,Thick,Arrowheads[.05],Arrow[{v,
   w}]}]]; *)
attach[ll, {col, Thick, Arrowheads[.05], Arrow[{v, w}]}];
xa = xb; ya = yb;
];
ll
]gr1 = Graphics3D[gradmeth[f, 2, 2, Red]];
gr2 = Graphics3D[gradmeth[f, -2, -1, Blue]];
show[pp, grfplt, gr1, gr2]

This is very slow!

Can I repair the table approach?

Can I speed up the module approach?

Any help would be helpful!