Vector Erase Access Violation

I am getting an Access Violation on erasing the vector in the below code. I tried to see where exactly the exception occurred in erase function of vector.h and could identify that _Move throws an access violation. Could you please help me how can I resolve this issue.

STDMETHODIMP SomeFunction(…) { vector<shared_ptr> f_Commands;

vector<shared_ptr >::iterator it = g_commands.begin();

while (it != g_commands.end()) {     if (SpecificConditionIsTrue)     {         it++;         continue;     }      f_Commands.push_back(*it);     it = g_commands.erase(it); }  finishedCommands.clear(); return S_OK; 

} class ATL_NO_VTABLE IRsi { protected:
vector<shared_ptr > g_commands; }; Exception at "_Move" call in vector

iterator erase(const_iterator _Where)     {   // erase element at where     _Move(_VIPTR(_Where) + 1, this->_Mylast,         _VIPTR(_Where));     _Destroy(this->_Mylast - 1, this->_Mylast);     --this->_Mylast;     return (_Make_iter(_Where));     } 

How to add the vector symbol on a letter?

Ho to add the vector symbol on a letter like this: $ \vec{r}$ ?

Consider the following code:

k0 = Graphics[{Text[      Style["\!\(\*SubscriptBox[\(K\), \(0\)]\)", 12], {0.5, -0.05}],      Thick, Arrow[{{0, 0}, {1, 0}}]}]; k1 = Graphics[{Text[      Style["\!\(\*SubscriptBox[\(K\), \(0\)]\)-q", 12], {0.5, 0.2}],      Thick, Arrow[{{0, 0}, {0.8, 0.2}}]}]; q = Graphics[{Text[Style["q", 12], {0.9, 0.15}], Thick,      Arrow[{{0.8, 0.2}, {1, 0}}]}]; l = Graphics[{Text[Style["\[Theta]", 12], {0.2, 0.03}], Thick,      Line[{{0, 0}, {0.2, 0}}]}]; Show[k0, k1, q, l, Boxed -> False] 

Given a row sum vector and a column sum vector, determine if they can form a boolean matrix

For example, for a boolean matrix of size $ 3×4$ , the row sum vector $ R = (3, 3, 0, 0)$ and the column sum vector $ C = (2, 2, 2)$ form a match because I can construct the boolean matrix:

$ $ \begin{matrix} & \begin{bmatrix} 1 & 1 & 0 & 0\ 1 & 1 & 0 & 0\ 1 & 1 & 0 & 0 \end{bmatrix} & \begin{pmatrix} 2\2\2 \end{pmatrix} = C \ R = &\begin{pmatrix} 2 & 2 & 0 & 0 \end{pmatrix} \end{matrix} $ $

However, the column vector $ C’ = (4, 1, 1)$ doesn’t form a match with $ R$ .

So given two vectors whose values are sorted in descending order $ R_{1, w}$ and $ C_{h, 1}$ , and whose accumulated sum is the same, $ T = \sum_jR[1, j] = \sum_iC[i, 1]$ , how can I polynomically check if $ R$ and $ C$ form a matching because I can form a matrix $ M_{h,w}$ having $ R$ and $ C$ as row and column sum vectors?

More specifically, in case it can help to make the check algorithm faster, in my specific case, R and C has the following properties:

  • $ h \leq w$
  • The number of positive values of $ R$ and $ C$ is $ > w$ . For example, $ R$ , in the example, has two positive values and $ C$ has three positive values, and it happens that $ 2 + 3 > w = 4$ .

How to compute a vector V when N points are given and V satisfies given properties

We are given N points P1,P2,…,PN in a 2D plane(All points are distinct and N is as large as 10^5). For each valid i, the coordinates of the point Pi are (xi,yi). Help me to find a vector V = (a, b) ( where |a|, |b| <= 1e9) such that the following holds:

For each i (1 ≤ i ≤ N), let Si= dot(V, G(Pi, Pi+1)). lets assume PN+1=P1. where G(v1, v2) = ((v2(x) – v1(x)), (v2(y) – v1(y)) and dot(V1, V2) denotes dot product of two vectors

How to choose V such that It is possible to find two integers l and r (1 ≤ l ≤ r ≤ N) such that:

Si < 0 if(i <= r and i >= l) and Si > 0 otherwise

(or)

Si > 0 if(i <= r and i >= l) and Si < 0 otherwise

I need to know if there is a way of choosing vector (a, b) to satisfy the above conditions(If the solution is possible)

find the vector v

Chef John is given N points P1,P2,…,PN in a plane. For each valid i, the coordinates of the point Pi are (xi,yi). Help him find a vector v→=(xv,yv) such that the following holds:

For each i (1≤i≤N), let Si=v→⋅PiPi+1. Here, we define Pn+1=P1. The coordinates xv and yv are integers and |xv|,|yv|≤2⋅109. It is possible to find three integers w, l and r (1≤l≤r≤N) such that: For each i (l≤i≤r), Siw>0. For each other valid i, Siw<0. If there are multiple solutions, you may find any one. If there are no solutions, let’s define xv=yv=0. (Note that the vector v→=(0,0) cannot be a valid solution.)

calculate the flux of a vector field through a surface

How to calculate the flux of a vector field through a surface in mathematica? I’ve this field:

F = (x, x^2 * y, y^2 * z)  

and this surface:

S = { (x,y,z) ∈ R^3 | 2 * Sqrt[x^2+y^2] <= z <= 1 + x^2 + y^2} 

So, I’m trying:

region = ImplicitRegion[2 * Sqrt[x^2+y^2] <= z <= 1 + x^2 + y^2, {x, y, z}];  Integrate[#, {x,y,z} ∈ region]& /@ ({x, x^2 * y, y^2 * z} . {x, y, z}) 

I expect Pi/30 as a result, but it comes out "Infinity"…

Using slot and application to variable length vector

I have a list of 2D coordinates with a maximum length of 3, e.g.

peakdatAB {{1007.81, 8.64842}, {1008.38, 8.19264}} 

I need to generate something like this

({PointSize[0.01], Blue, Point[#1], Red, Point[#2], Black, Point[#3]}) & @@ peakdatAB 

but here the problem is the variable length of peakdatAB as when there is say no third point, it returns an error. How can I fix this?

Solving integral involving absolute value of a vector

I am trying to integrate the following in mathematica:
$ \int_0^r \frac{exp(-k_d(|\vec{r}-\vec{r_j}|+|\vec{r}-\vec{r_i}|)}{|\vec{r}-\vec{r_j}|\times|\vec{r}-\vec{r_i}|}r^2dr$ .
I have first defined, the following functions,
$ \vec p(x,y,z)= (x-x_j)\hat i + (y-y_j)\hat j+(z-z_j)\hat k$
Similarly,
$ \vec q(x,y,z)= (x-x_i)\hat i + (y-y_i)\hat j+(z-z_i)\hat k$ .
And,
$ \vec r(x,y,z)=x\hat i + y\hat j+z\hat k $
Then I clicked the integration symbol in the classroom assistant panel and typed the integrand in the $ expr$ portion. While typing this, I have used $ Abs$ to take modulus of the functions $ \vec p(x,y,z)$ and $ \vec q(x,y,z)$ . I have included the limits as $ 0$ to $ Abs(r)$ and the $ var$ as $ r$ in the integration symbol. But when I press( Shift + Enter ) no output value is shown . Can anyone tell me where I have made mistake ?

Setoolkit phishing website attack vector problems [closed]

I tried to use phishing methods in setoolkit and everything was fine when apache2 started and I was given an IP address to send.

The victim was out of the city and they were not able to open that link and when they clicked it, it started loading but they got "Page not found".

  1. Does phishing only work with the same wifi device connected because only I was able to open that link?

  2. How can I do phishing and send that IP address link to anyone and trap them?