## Turning Mysql values row into columns by form_id and entry_id

I would like to understand how I can turn these rows into columns in MySql

This is how the DB is saved:

id form_id entry_id meta_value
1 7 18 Name
2 7 18 Date
3 7 18 Phone
4 7 18 Email
5 7 18 Status
6 8 19 DOB
8 8 19 Post Code
9 8 19 Country
0 8 19 Notes
11 7 20 Name
12 7 20 Date
13 7 20 Phone
14 7 20 Email
15 7 20 Status
16 8 21 DOB
18 8 21 Post Code
19 8 21 Country
20 8 21 Notes

That is how the table is currently, the idea is combining both form_id (7 & 8) and as a row:

column 1 column 2 column 3 column 4 column 5 column 6 column 7 column 8 column 9 column 10
Name Date Phone Email Status DOB Address Post Code Country Notes
Name Date Phone Email Status DOB Address Post Code Country Notes

I have tried with INNER JOIN and Pivot but I stuck all day on that. If you guys could help would be amazing.

## pseudo 3D camera turning html canvas javascript [closed]

I am trying to learn to make 3D games in JavaScript using HTML 2D canvas. I was following this post about it and I made a simple scene that you can move around in.

What I need help with is figuring out how to make the effect of the player turning their head, to look side to side and behind them.

Here is what I have:

Code (also on codepen)

html:

``<html lang="en"> <head>     <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>3d test</title> </head> <body>     <canvas id="canv"></canvas> </body> </html> ``

javascript

``//use arrow keys to move around  var canvas = document.getElementById("canv"); var c = canvas.getContext("2d");  canvas.width = canvas.height = 800;  var crateImg = new Image();  class Entity {     constructor(x, y, z, w, h) {         this.x = x;         this.y = y;         this.z = z;         this.w = w;         this.h = h;         this.rx = 0;         this.ry = 0;         this.rs = 0;     }     render() {         //c.fillStyle = 'red';         //c.fillRect(this.rx, this.ry, this.rs*this.w, this.rs*this.h);         c.drawImage(crateImg, this.rx, this.ry, this.rs*this.w, this.rs*this.h);     }     update() {         //project to 3d         this.rs = 400/(400+this.z);         this.rx = ((this.x*this.rs) + 400);         this.ry = (this.y*this.rs) + 400;           //move         this.x += camera.xSpeed;         this.y += camera.ySpeed;         this.z += camera.zSpeed;     } }  var camera = {     xSpeed: 0,     ySpeed: 0,     zSpeed: 0, }  var entities = [];  function random(min, max) {     return Math.floor(Math.random() * (max - min) + min); }  window.onload = function() {     start();     update(); }  function start() {     crateImg.src = "https://i.imgur.com/O9ForWS_d.webp?maxwidth=760&amp;fidelity=grand";     for(let i = 0; i < 100; i++) {         entities.push(new Entity(random(-800, 800), 0, i*10, 50, 50));     } }  function render() {     //fill background     c.fillStyle = 'skyblue';     c.fillRect(0, 0, 800, 800);     //draw flooor     c.fillStyle = 'green';     c.fillRect(0, 400, 800, 400);     //draw entities     for(let i = 0; i < entities.length; i++) {         if(entities[i].z > -400) {             entities[i].render();         }     } }  function update() {     //updatre entities     for(let i = 0; i < entities.length; i++) {         entities[i].update();     }     entities.sort(function(i, i2) {         return i2.z - i.z;     })     //redraw current frame     render();     requestAnimationFrame(update); }   function keyDown(e) {     switch(e.keyCode) {         case 39:             camera.xSpeed = -5;             break;         case 37:             camera.xSpeed = 5;             break;         case 38:             camera.zSpeed = -5;             break;         case 40:             camera.zSpeed = 5;             break;     } }  function keyUp(e) {     switch(e.keyCode) {         case 39:         case 37:             camera.xSpeed = 0;             break;         case 38:         case 40:             camera.zSpeed = 0;             break;     } }  document.onkeydown = keyDown; document.onkeyup = keyUp; $$```$$ ``

## Turning off approximations for Pi

I am very new to Mathematica. I am trying to do some manipulations using mathematica, I am solving functions using FullSimplify function of Mathematica. It gives me unpleasant approximations of Pi Whereas in my friends laptop It gives exact things like . How can set my mathematics to not to approximate Pi/2 as 1.5708 and give numbers O(1.e-16) as zero. Simply How can I configure my mathematica to get same behaviour.

## Clipping speed when turning without using aggressive drag

I have an Unity project in which i want to control a player in a similar way to Source games, and so far i am clipping each input to the speed in the player’s coordinates, by using

``transform.InverseTransformDirection( GetComponent<Rigidbody>().velocity ) ``

after which i pass each of the player input vector direction through this function :

``private float FLSMF ( float aInputVelocity, float aMaximumVelocityOnAxis, float aSpeedOnAxis ) {     if ( Mod( aSpeedOnAxis ) >= aMaximumVelocityOnAxis ) {         if( Sign( aSpeedOnAxis ) != Sign ( aInputVelocity ) ) {             if ( Mod( aSpeedOnAxis + aInputVelocity ) > aMaximumVelocityOnAxis ) {                 return Sign ( aInputVelocity ) * ( aMaximumVelocityOnAxis + Mod( aSpeedOnAxis ) );             }             return aInputVelocity;         }         return 0;     }     if( Mod( aSpeedOnAxis + aInputVelocity ) > aMaximumVelocityOnAxis ) {         return Sign( aInputVelocity ) * ( aMaximumVelocityOnAxis - Mod( aSpeedOnAxis ) );     }     return aInputVelocity; } ``

There is only one problem : whenever i turn and strafe and walk forwards or backwards, the speed increases dramatically. I tried solving it by comparing each processed velocity axis to the velocity rotated by the difference in the rotations between the last 2 FixedUpdate’s. So far nothing worked, aside from driving the drag factor through the roof.

My best guess is that when turning, the unclipped X axis of the vector bleeds into the Z axis when turning, which can’t add anything, but cant stop the X axis from interfering because the forward key is pressed.

There is no issue when only one of the input axis are used, the speed remaining consistent when turning.

I tried to implement this function especially so i dont have to use any drag, to allow the player to be flung by other things, like grapples and explosions ( this issues is present irrespective of said external factors )

If you want to, i will share the entire code, but its messy and i dont think it would help.

Any ideeas how to solve it?

Edit : yes, i have normalized the input vector. The speed increases to more than triple of the maximum, in as few as 2 turns.

## Does turning around count as moving for triggering Brace?

My fighter took Superior Technique as Fighting Style. This gives me the the Combat Maneuver Brace, from Unearthed Arcana, which says (emphasis mine):

When a creature you can see moves into the reach you have with the melee weapon you’re wielding, you can use your reaction to expend one superiority die and make one attack against the creature, using that weapon. If the attack hits, add the superiority die to the weapon’s damage roll.

The wording of a similar mechanic in the Polearm Master feat differs slightly:

While you are wielding a glaive, halberd, pike, quarterstaff, or spear, other creatures provoke an opportunity attack from you when they enter the reach you have with that weapon.

The word "enter" makes it very clear to me that the opponent needs to enter the reach for the trigger to happen, but "moving into" is less clear to me. It could be that they are semantically the same, but both my DM and I are unsure.

So, for example, if the opponent is already within my reach and it turns around to attack someone else: does turning around count as moving for triggering Brace?

## Turning mud to solid ground

What cantrip, if any, would be able to turn mud into solid ground? Would mold earth work? Would shape water?

Context: I’m making a homebrew race who live in an area of bog, and I thought it would be interesting to have them making their own homes with racial spellcasting.

## Turning off browser autofill/autocomplete

I love how browsers can save form data to make filling in forms quicker & easier – and reduce the chance of typos.

However… I have an admin system where my admin users login and maintain a stack of data and I want to have my own autocomplete options and suppress the browser from suggesting the user's personal data.

Most of the "data entry" is done by people signing up and all the admins are doing is confirming and then generating content. When they do have to do "data entry" I want it…

Turning off browser autofill/autocomplete

## Turning columns result set into independant rows in MySQL

I am pretty new to this and have been struggling over one issue.

I have a result set which for each Opportunity in a table (id as primary key), provides a date for a first cashflow (DFCFW) as a column and the 10 following columns (CFW1, CFW2, …., CFW10) being the 10 possible cashflows for each of the 10 following years, expected as anniversary dates of the first cashflow.

I would like to create a view which displays, for all the opportunities, three columns: opportunity.id, date of the cashflow, cashflow; there should be 10 records for each opportunity.

Any suggestion how to achieve this ?

Thank you so much

Fred

## Speedup with multi-head turning machine

What sort of speedup can a Turing machine with more than one head give vs a one-headed machine (I do not mean multiple tapes, I mean multiple heads operating on the same string at the same time making concurrent edits on different parts of the tape)?

ie. what is the overhead, worst-case, for a one-head Turing Machine to simulate a multi-head Turing Machine as the number of heads grow?