## Having problems joining table

I have the following tables and I want to know Jack’s dob, salary and the total score of that employee who who is also a player. The The relational schemas are:

Employee_Play(eid,pid,team) composite key is (eid,pid) Plays(pid, team, matchName, scores) composite key is (pid, team, matchName) Emp(empID, dob, salary) empID is pk  Players(pid, name, team) composite keys are (pid, team) 

The query that I wrote is this however I get an error because im using group by operator. Is there an alternate way that can work? Also Im not sure if im during the join right? I am not able to use the where clause as where name = ‘Jack’. It tells me ‘no column named Jack ‘

Select name, address, dob, sum(scores) From Emp e JOIN Emp_Players ep ON e.empID = ep.eid  JOIN Plays p ON p.pid = ep.pid Group by p.pid; 

I would really appreciate any help. Thanks.

## Problems With StreamPlot

I have the following vector functions:

$$E=\left\langle \cos\left[\frac{\pi x}{5}\right]\sin\left[\frac{\pi y}{4}\right], \sin\left[\frac{\pi x}{5}\right]\cos\left[\frac{\pi y}{4}\right], \sin\left[\frac{\pi x}{5}\right] \sin\left[\frac{\pi y}{4}\right] \right\rangle$$

$$B=\left\langle -\sin\left[\frac{\pi x}{5}\right]\cos\left[\frac{\pi y}{4}\right], \cos\left[\frac{\pi x}{5}\right]\sin\left[\frac{\pi y}{4}\right],0 \right\rangle$$

And I’d like to graph each of these in a different plane, so I want to know what they look like in the $$xy$$, $$xz$$, and $$yz$$ planes. Using stream plot I got a graph of the view in the $$xy$$ plane that I was happy with but with the other perspectives I’m finding them difficult to plot and I think it’s because I have to use $$x$$ and $$y$$ bounds for StreamPlot. So, I’m wondering if there is a way to graph these vector fields in the $$xz$$ and $$yz$$ plots so that I have functions that aren’t varying with respect to the $$z$$ axis? Because, for example, right now what I’m doing is just replacing the $$x$$ component with the $$z$$ component and graphing but since my $$z$$ component is in terms of $$x$$ it changes with the bounds which I don’t want it to do.

## Can Mathematica solve matrix-based parametric (convex or semidefinite) constrained optimization problems?

I have gone through Mathematica’s documentation and guides on ConvexOptimization, ParametricConvexOptimization and SemidefiniteOptimization. I am also running the latest version of Mathematica.

The kind of matrix-based, parametric, constrained optimization problems I want to solve is this:

$$$$\min_{X_j, \, L_{jk}} \text{Tr}(A L) \ \text{such that, } X_j \text{ and } L_{jk} \text{ are } 4\times4 \text{ Hermitian matrices} \ G_k \cdot X_j = \delta_{j k}\ L:=\begin{bmatrix}L_{11} &L_{12} &L_{13} \ L_{12} &L_{22} &L_{23} \ L_{13} &L_{23} &L_{33}\end{bmatrix} \succeq \begin{bmatrix} X_1 \ X_2 \ X_3 \end{bmatrix}\begin{bmatrix}X_1 &X_2 &X_3\end{bmatrix}$$$$ where the variables to be optimized over are $$X_j$$ and $$L_{jk}$$ ($$j$$ and $$k$$ run from 1 to 3), which are themselves matrices! The matrices $$G_k$$ and $$A$$ depend on some parameter $$\alpha$$ (and satisfy additional properties).

I have been able to run this kind of optimization in MATLAB, and also a much simpler version of this in Mathematica, where $$j, k=1$$ and the parameter value is fixed, using,

ConvexOptimization[   Tr[\[Rho]0 .      v11], {VectorGreaterEqual[{v11, x1}, "SemidefiniteCone"] &&       Tr[\[Rho]0 . x1] == 0  && Tr[\[Rho]1 . x1] == 1   &&      Element[x1, Matrices[{4, 4}, Complexes, Hermitian]] &&      Element[v11, Matrices[{4, 4}, Complexes, Hermitian]]} , {x1,     v11}]] 

However I simply can not get the full problem to run on Mathematica, using either ConvexOptimization[ ] (at fixed parameter values), ParametricConvexOptimization[ ], SemidefiniteOptimization[ ], or Minimize[ ].

ConvexOptimization[ ] at fixed parameter values for $$j, k = 1, 2$$ shows the warning ConvexOptimization::ctuc: The curvature (convexity or concavity) of the term X1.X2 in the constraint {{L11,L12},{L12,L22}}Underscript[\[VectorGreaterEqual], Subsuperscript[\[ScriptCapitalS], +, \[FilledSquare]]]{{X1.X1,X1.X2},{X1.X2,X2.X2}} could not be determined.

Minimize[ ] shows the error Minimize::vecin: Unable to resolve vector inequalities ...

And ParametricConvexOptimization[ ] and SemidefiniteOptimization[ ] simply return the input as output.

Has anyone got some experience with running such matrix-based optimizations in Mathematica? Thanks for your help.

EDIT 1: For the two-dimensional case ($$j, k=1, 2$$) I tried (with $$A$$ the identity matrix, and at fixed parameter value):

ConvexOptimization[  Tr[Tr[ArrayFlatten[{{L11, L12}, {L12,        L22}}]]], {VectorGreaterEqual[{ArrayFlatten[{{L11, L12}, {L12,          L22}}], ArrayFlatten[{{X1 . X1, X1 . X2}, {X1 . X2,          X2 . X2}}]}, "SemidefiniteCone"] &&  Tr[\[Rho]0 . X1] == 0  &&     Tr[\[Rho]0 . X2] == 0 && Tr[\[Rho]1 . X1] == 1  &&     Tr[\[Rho]1 . X2] == 0  && Tr[\[Rho]2 . X1] == 0  &&     Tr[\[Rho]2 . X2] == 1  &&     Element[X1, Matrices[{4, 4}, Complexes, Hermitian]] &&     Element[X2, Matrices[{4, 4}, Complexes, Hermitian]] &&     Element[L11, Matrices[{4, 4}, Complexes, Hermitian]] &&     Element[L12, Matrices[{4, 4}, Complexes, Hermitian]]  &&     Element[L22, Matrices[{4, 4}, Complexes, Hermitian]] }, {X1, X2,    L11, L12, L22}] 

and for the three-dimensional case ($$j, k = 1, 2, 3$$) with variable parameter value and $$A$$ the identity matrix, I tried

ParametricConvexOptimization[  Tr[Tr[ArrayFlatten[{{L11, L12, L13}, {L12, L22, L23}, {L13, L23,        L33}}]]], {VectorGreaterEqual[{ArrayFlatten[{{L11, L12,         L13}, {L12, L22, L23}, {L13, L23, L33}}],      ArrayFlatten[{{X1}, {X2}, {X3}}] .       Transpose[ArrayFlatten[{{X1}, {X2}, {X3}}]]},     "SemidefiniteCone"],  Tr[\[Rho]0 . X1] == 0 ,    Tr[\[Rho]0 . X2] == 0  , Tr[\[Rho]0 . X3] == 0 ,    Tr[\[Rho]1 . X1] == 1 , Tr[\[Rho]1 . X2] == 0  ,    Tr[\[Rho]1 . X3] == 0  , Tr[\[Rho]2 . X1] == 0 ,    Tr[\[Rho]2 . X2] == 1  , Tr[\[Rho]2 . X3] == 0 ,    Tr[\[Rho]3 . X1] == 0 , Tr[\[Rho]3 . X2] == 0  ,    Tr[\[Rho]3 . X3] == 1 }, {Element[X1,     Matrices[{4, 4}, Complexes, Hermitian]],    Element[X2, Matrices[{4, 4}, Complexes, Hermitian]],    Element[X3, Matrices[{4, 4}, Complexes, Hermitian]],    Element[L11, Matrices[{4, 4}, Complexes, Hermitian]],    Element[L12, Matrices[{4, 4}, Complexes, Hermitian]],    Element[L13, Matrices[{4, 4}, Complexes, Hermitian]],    Element[L22, Matrices[{4, 4}, Complexes, Hermitian]],    Element[L23, Matrices[{4, 4}, Complexes, Hermitian]],    Element[L33, Matrices[{4, 4}, Complexes, Hermitian]]}, {\[Alpha]}] 

Here, the $$\rho_{k}$$ matrices are the $$G_k$$ matrices.

## Problems with Dsolve[] and simple function

I’m trying to solve the following very simple differential equation, but it seems Mathematica cannot give me an answer,

FullSimplify[DSolve[{y''[x] == 2 A Sinh[B y[x]], y[0] == W, y[L] == W}, y[x], x]] 

Any thoughts? Thanks!

## Creation of failed links and problems with emails?

Hi everyone, I recently made a purchase for a premium list subscription, everything is automatically synced with dropbox. It’s all OK.
Approximately 2 days have passed and I cannot create links, the maximum that I have just created from those lists are only 4 links.
My updated filters to use the premium lists are:
See attached image

Now, yesterday I had had problems with the emails, in the registration panel it said: email verification failed, and when I go to check, see the following image a window appears that said: failed emails

and finally I am seeing a lot of failed registrations in wordpres articles.

In theory I should be creating many links, thanks to the help of the premium lists but something is missing or something is wrong in my configuration, could you help me find that fault?
I would like to see the full potential of GSA at work.

## Problems with MySQL Table ‘.\mysql\db’

Been having problems with MySQL, it wont launch at all, i just get error messages

Ive tried changing ports and deleting files etc. Nothing i try has worked at all Logs look normal but when i look at windows event viewer i get the following three messages

"mysqld.exe: Table ‘.\mysql\db’ is marked as crashed and last (automatic?) repair failed "

"Fatal error: Can’t open and lock privilege tables: Table ‘.\mysql\db’ is marked as crashed and last (automatic?) repair failed " "Aborting "

How would i fix this issue? All help is appreciated

## Problems arise when using a VBO compared to a uniform for mat4

I’ve been learning LWJGL and was originally using instancing and using a uniform to send all the mat4 data to the shader for the individual positions. I’m trying to switch to using a VBO for this since I had a batch size limitation of just 128, but have run into a problem with sending the data to the shader. I’ve spend a few days looking over the instancing sections of both https://learnopengl.com/ and https://lwjglgamedev.gitbooks.io/ but haven’t been able to find anything that could be the cause of this.

Nothing was changed aside from the code presented here, the creation of any needed variables, and the conversion from uniform to VBO in the shader itself.

This was the original code using the uniform that worked just fine. First is what was used to actually make the draw calls, and the second part is what was used to pass the mat4s to the shader:

// Prepare shader  GL40.glEnableVertexAttribArray(0); GL40.glBindBuffer(GL40.GL_ARRAY_BUFFER, vertexID); GL40.glVertexAttribPointer(0, 3, GL40.GL_FLOAT, false, 0, 0);  GL40.glEnableVertexAttribArray(1); GL40.glBindBuffer(GL40.GL_ARRAY_BUFFER, textureID); GL40.glVertexAttribPointer(1, 2, GL40.GL_FLOAT, false, 0, 0);  GL40.glEnableVertexAttribArray(2); GL40.glBindBuffer(GL40.GL_ARRAY_BUFFER, normalID); GL40.glVertexAttribPointer(2, 3, GL40.GL_FLOAT, false, 0, 0);  GL40.glEnableVertexAttribArray(3); GL40.glBindBuffer(GL40.GL_ARRAY_BUFFER, shadeID); GL40.glBufferData(GL40.GL_ARRAY_BUFFER, createFloatBuffer(shade.toArray(new Vector4f[shade.size()])), GL40.GL_STATIC_DRAW); GL40.glVertexAttribPointer(3, 4, GL40.GL_FLOAT, false, 0, 0); GL40.glVertexAttribDivisor(3, 1);  GL40.glBindBuffer(GL40.GL_ELEMENT_ARRAY_BUFFER, indexID); for(int i = 0; i < amount / 128 + 1; i++) {     int draws = Math.min(128, amount - i * 128);     for(int j = 0; j < draws; j ++) {         int loc = i * 128 + j;         shader.setUniform("model[" + j + "]", Matrix4f.transform(position.get(loc), rotation.get(loc), scale.get(loc)));     }     GL40.glDrawElementsInstanced(GL40.GL_TRIANGLES, drawCount, GL11.GL_UNSIGNED_INT, 0, draws); }  GL40.glBindBuffer(GL40.GL_ELEMENT_ARRAY_BUFFER, 0); GL40.glBindBuffer(GL40.GL_ARRAY_BUFFER, 0);  GL40.glDisableVertexAttribArray(0); GL40.glDisableVertexAttribArray(1); GL40.glDisableVertexAttribArray(2); GL40.glDisableVertexAttribArray(3); 

Setting the mat4 uniform:

public void setUniform(String name, Matrix4f value) {     int location = GL20.glGetUniformLocation(programID, name);     if (location != -1) {         try (MemoryStack stack = MemoryStack.stackPush()) {             final FloatBuffer matrixBuffer = stack.mallocFloat(16);             matrixBuffer.put(value.getAll()).flip();             GL20.glUniformMatrix4fv(location, true, matrixBuffer);         }     } } 

And this is the code that’s been causing issues:

// Prepare shader  GL40.glEnableVertexAttribArray(0); GL40.glBindBuffer(GL40.GL_ARRAY_BUFFER, vertexID); GL40.glVertexAttribPointer(0, 3, GL40.GL_FLOAT, false, 0, 0);  GL40.glEnableVertexAttribArray(1); GL40.glBindBuffer(GL40.GL_ARRAY_BUFFER, textureID); GL40.glVertexAttribPointer(1, 2, GL40.GL_FLOAT, false, 0, 0);  GL40.glEnableVertexAttribArray(2); GL40.glBindBuffer(GL40.GL_ARRAY_BUFFER, normalID); GL40.glVertexAttribPointer(2, 3, GL40.GL_FLOAT, false, 0, 0);  GL40.glEnableVertexAttribArray(3); GL40.glBindBuffer(GL40.GL_ARRAY_BUFFER, shadeID); GL40.glBufferData(GL40.GL_ARRAY_BUFFER, createFloatBuffer(shade.toArray(new Vector4f[shade.size()])),         GL40.GL_STATIC_DRAW); GL40.glVertexAttribPointer(3, 4, GL40.GL_FLOAT, false, 0, 0); GL40.glVertexAttribDivisor(3, 1);  GL40.glBindBuffer(GL40.GL_ARRAY_BUFFER, modelID); GL40.glBufferData(GL40.GL_ARRAY_BUFFER, createFloatBuffer(position.toArray(new Vector3f[position.size()]), rotation.toArray(new Vector3f[rotation.size()]), scale.toArray(new Vector3f[scale.size()])), GL40.GL_STATIC_DRAW);  int size = 4; for (int i = 0; i < 4; i++) {     GL40.glEnableVertexAttribArray(4 + i);     GL40.glVertexAttribPointer(4 + i, 4, GL40.GL_FLOAT, false, 4 * size, i * size);     GL40.glVertexAttribDivisor(4 + i, 1); }  GL40.glBindBuffer(GL40.GL_ELEMENT_ARRAY_BUFFER, indexID); GL40.glDrawElementsInstanced(GL40.GL_TRIANGLES, drawCount, GL11.GL_UNSIGNED_INT, 0, amount);  GL40.glBindBuffer(GL40.GL_ELEMENT_ARRAY_BUFFER, 0); GL40.glBindBuffer(GL40.GL_ARRAY_BUFFER, 0);  GL40.glDisableVertexAttribArray(0); GL40.glDisableVertexAttribArray(1); GL40.glDisableVertexAttribArray(2); GL40.glDisableVertexAttribArray(3); GL40.glDisableVertexAttribArray(4); GL40.glDisableVertexAttribArray(5); GL40.glDisableVertexAttribArray(6); GL40.glDisableVertexAttribArray(7); 

Storing the mat4s into the VBO:

public static FloatBuffer createFloatBuffer(Vector3f[] positions, Vector3f[] rotation, Vector3f[] scales {     FloatBuffer buffer = BufferUtils.createFloatBuffer(positions.length * 16);     for (int i = 0; i < positions.length; i++) {         buffer.put(Matrix4f.transform(positions[i], rotation[i], scales[i]).getAll());     }     buffer.flip();     return buffer; } 

I’ve messed around with this a ton over the past couple days which leads me to believe that it’s not a problem with the data being sent, but rather how the data itself is formatted. That doesn’t make much sense though, since both examples use Matrix4f.transform() to get the needed data. I tried transposing the matrices before adding them to the buffer but to no avail.

And just for reference, here is an example of what Matrix4f.getAll() produces:

[0.5, 0.0, 0.0, -40.0,

0.0, 0.5, 0.0, 12.0,

0.0, 0.0, 0.5, 88.0,

0.0, 0.0, 0.0, 1.0]

Here are two screen shots of what it’s suppose to look like and the results I’m getting from using the VBO approach:

## Hello, I’m trying to do the QR decomposition using Gram Schmidt but I’m having problems because I can’t find the R matrix. Could you help me?

First of all I don’t want to use the reflection method. Only Gram-Schmidt.

So here’s the program for Gram-Schidt:

GS[A_] := Module[{u = {}, col, e = {}, ae, t},   col = Transpose[A];(* list with the column vectors of A *)   u = Append[u, col[[1]]];   e = AppendTo[e, u[[1]]/Norm[u[[1]]]];   For[i = 2, i <= Length[A], i++, ae = 0; t = 1;    While[t <= i - 1, ae = ae - (col[[i]].e[[t]])*e[[t]]; t++];    u = AppendTo[u, col[[i]] + ae];    e = Append[e, u[[i]]/Norm[u[[i]]]]]; {u, e}] 

with this simple matrix:

B = {{1, 3, 1}, {2, 2, 1}, {3, 2, 3}}; 

gives

{{{1, 2, 3}, {29/14, 1/7, -(11/14)}, {14/69, -(49/69), 28/69}}, {{1/    Sqrt[14], Sqrt[2/7], 3/Sqrt[14]}, {29/Sqrt[966], Sqrt[2/    483], -(11/Sqrt[966])}, {2/Sqrt[69], -(7/Sqrt[69]), 4/Sqrt[69]}}} 

Now the code for QR decomposition is:

QR[A_] := Module[{Ak, i, Q, R = {}, a = {}, col, k},   Ak = FullSimplify[GS[A]];   col = Transpose[A];(* list with the column vectors of A *)   Q = MatrixForm[Transpose[Ak[[2]]]];   For[i = 1, i <= Length[Ak[[2]]], i++, a = {}; k == 1;    While[k <= Length[col], a = AppendTo[a, col[[k]]. Ak[[2]][[i]]];      k++];     R = AppendTo[R, a]];   R = UpperTriangularize[R]; {Q, R}] 

but I can’t find matrix R, once it’s giving me a list like this{{},{},{}} and I’m stuck. Please help me.Thanks!

## Are there problems with handwaving attunement for timebounded adventures?

I will be running Strahd Must Die Tonight! for 5e and in previous games of it, due to the real and in-game time constraints and lack of short rests, I have handwaved attunement and allowed attunement to magic items just before the climax.

Are there any rules that speed up attunement that should be considered? Are there any mechanics of attunement to take into account for one-shots? Are there any compelling reasons not to allow players attune to items pivotal to the game?

## Would allowing all Unearthed Arcana create rules problems?

I’m thinking of running a campaign where the players don’t have books and I wanted to recommend that they use the SRD until then, but also use any Unearthed Arcana material from Wizards’ site if they wanted.

Would allowing all Unearthed Arcana material create any balance problems or fundamental rule contradictions?

The main reasons being would be to allow players to use free material without worrying about buying books just yet, but also having available more interesting stuff to work with.