Bash delete inside of a line

If I had an output of lines like:

First name, Last name, 123456789(9 digits)
GPA
Class
Major
University

How can I write a code to only use the 3 lines but the first line i only need the id number I used head, grep and cut but i did not managed to only match the first three lines without removing the first and last name

microsoft excel – Stacked Area Line Chart with Overlapping Values

I’m trying to create an attendance chart. Previously, there was only 1 time slot, so I used a line chart. However, now there are 2 time slots. So, I’d like to do a stacked area line chart to summarize both individual and total attendance between both time slots. The problem is that some attend both time slots. I don’t want the total attendance for the day to be skewed (i.e. total number of people in attendance), nor do I want the attendance for each time slot to be skewed.

How can I track the attendance accurately and represent it on the chart? Is there some way I can specify an “overlap” in attendance (i.e. 100 at time 1, 100 at time 2, 25 at both, for a total of 175 for the day)?

How do you find the vector equation for the line of intersection of two planes when only given their distances from the origin?

If given two non parallel planes with unit normals n and m and their closest distance from origin are 3 and 7 respectively, how does one find their line of intersection?

I’m just looking for any hints toward finding the answer.

Thanks

Update of X-code terminal line is not installing

Even though I have agreed and downloaded the update its not installing,
Here trickest thing it not even showning any error for not installing.

I am current in MACOS x 11.2.3

Can any one please help me to solve this

enter image description here

javascript – Breaking a line segment into two where it encounters a rectangle

var ctx = document.querySelector("canvas").getContext("2d");

function drawSegments(segments) {
  for (let seg of segments) {
    ctx.beginPath();
    ctx.moveTo(seg.x1, seg.y1);
    ctx.lineTo(seg.x2, seg.y2);
    ctx.stroke();
  }
}

function drawRectangles(rectangles) {
  for (let r of rectangles) {
    ctx.beginPath();
    ctx.rect(r.x, r.y, r.w, r.h);
    ctx.stroke();
  }
}

// Returns the point (x, y) where two line segments intersect
function getLineIntersection(p0_x, p0_y, p1_x, p1_y, p2_x, p2_y, p3_x, p3_y) {
  let s1_x = p1_x - p0_x;
  let s1_y = p1_y - p0_y;
  let s2_x = p3_x - p2_x;
  let s2_y = p3_y - p2_y;

  let s = (-s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) / (-s2_x * s1_y + s1_x * s2_y);
  let t = ( s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) / (-s2_x * s1_y + s1_x * s2_y);

  if (s >= 0 && s <= 1 && t >= 0 && t <= 1) { 
    return { x: p0_x + (t * s1_x), y: p0_y + (t * s1_y) };
  }

  return false;
}

function breakSegments(segments, rect) {
  let rLeft = rect.x;
  let rTop = rect.y;
  let rRight = rect.x + rect.w;
  let rBot = rect.y + rect.h;

  for (let i = 0; i < segments.length; i++) {
    let s = segments(i);

    let nIntersection = getLineIntersection(s.x1, s.y1, s.x2, s.y2, rLeft, rTop, rRight, rTop);
    let wIntersection = getLineIntersection(s.x1, s.y1, s.x2, s.y2, rLeft, rTop, rLeft, rBot);
    let eIntersection = getLineIntersection(s.x1, s.y1, s.x2, s.y2, rRight, rTop, rRight, rBot);
    let sIntersection = getLineIntersection(s.x1, s.y1, s.x2, s.y2, rLeft, rBot, rRight, rBot);

    var closeIntersection, farIntersection;

    if (nIntersection && sIntersection) {
      let nXDelta = nIntersection.x - s.x1;
      let nYDelta = nIntersection.y - s.y1;

      let sXDelta = sIntersection.x - s.x1;
      let sYDelta = sIntersection.y - s.y1;

      if (nXDelta * nXDelta + nYDelta * nYDelta < sXDelta * sXDelta + sYDelta * sYDelta) {
        closeIntersection = nIntersection;
        farIntersection = sIntersection;
      } else {
        closeIntersection = sIntersection;
        farIntersection = nIntersection;
      }
    } else if (wIntersection && eIntersection) {
      let wXDelta = wIntersection.x - s.x1;
      let wYDelta = wIntersection.y - s.y1;

      let eXDelta = eIntersection.x - s.x1;
      let eYDelta = eIntersection.y - s.y1;

      if (wXDelta * wXDelta + wYDelta * wYDelta < eXDelta * eXDelta + eYDelta * eYDelta) {
        closeIntersection = wIntersection;
        farIntersection = eIntersection;
      } else {
        closeIntersection = eIntersection;
        farIntersection = wIntersection;
      }
    } else {
      continue;
    }

    segments.splice(i + 1, 0, { x1: farIntersection.x, y1: farIntersection.y, x2: s.x2, y2: s.y2 });

    s.x2 = closeIntersection.x; 
    s.y2 = closeIntersection.y;

    break;
  }
}


let lineSegments = (
  { x1: 0, y1: 50, x2: 250, y2: 50 },
  { x1: 250, y1: 50, x2: 250, y2: 250 },
  { x1: 250, y1: 250, x2: 100, y2: 250 },
  { x1: 100, y1: 250, x2: 80, y2: 75 },
  { x1: 400, y1: 550, x2: 525, y2: 550 },
  { x1: 525, y1: 550, x2: 550, y2: 350 },
  { x1: 550, y1: 350, x2: 300, y2: 350 },
);

let rects = (
  { x: 200, y: 240, w: 16, h: 16 },
  { x: 500, y: 340, w: 16, h: 16 }
)

breakSegments(lineSegments, rects(0));
breakSegments(lineSegments, rects(1));

drawSegments(lineSegments);
drawRectangles(rects);
<canvas width="800" height="800">

Scanning multiple strings in one line to a pointers array in C

I’m trying to write a code for a function that takes an empty array of pointers and its length n.
And scans n strings of max length of MAX_LEN (a defined constant) until a new line is given by the user.
The strings are separated by one space.

int scan_strings(char * words(), int n) {
    char current = getchar(); // to make sure that there is no new line
    int i = 0, j = 0, on = 1;
    while (scanf("%c",&current) == 1 && (current != 'n' || on)) {
        char str(MAX_LEN); // a defined constant
        on = 0;
        if (current != ' ') {
            str(i) = current;
            i++;
        }
        else {
            str(i) = 0;
            i = 0;
            *(words+j) = &str;
            j++;
        }
    }
    return 1;
}

For some reason, the array after writing “foxes are red”
is just:

0x002b8f0c “red”
0x002b8f0c “red”
“ERROR READING CHARACTERS”
“ERROR READING CHARACTERS”
“ERROR READING CHARACTERS”

How can I fix this?

command line – How to rename many files, using a prefix ID?

I have 103 directories, those directories are named PJA_XXX, where XXX is number from 71 to 174. Inside each PJA_XXX folder I have a File under the next path: PJA_XXX/results/variants/variants.vcf

I want to rename the variants.vcf file adding the prefix of the PJA_XXX directory that contain it. So the expected result would be PJA_XXX_variants.vcf

I think I could do it with a shell loop, but I don’t know how to take the name of the PJA_XXX folder to rename the file

SQLite command line shell stuck on …> , CTRL+D not working

I’ve just started learning Databases, and the instructor is teaching SQLite with the command line shell. I downloaded sqlite-tools-win32-x86-3350400.zip from sqlite.org/download

When I enter false commands, like the first two you can see, I get the correct error messages. But when I enter a syntax error: (“Steve, 87654) for example, it’s stuck on …> waiting for more input.
After searching on the internet, users suggested the solution “CTRL+D”, but it doesn’t work for me. CTRL+C however just exits sqlite3.

My question: How do I get out of …> to continue with my commands? Why CTRL+D doesn’t work for me, to get out of the …> because of the syntax error or other possible causes? How do I fix my problem?

C:UsersmyUser>sqlite3 test.db
SQLite version 3.35.4 2021-04-02 15:20:15
Enter ".help" for usage hints.
sqlite> SELECT * FROM contacts;
Tim|654321|tim@email.com
Brian|1234|brian@mygmail.com
sqlite> INSERT INTO contacts VALUES("Steve", 87654);
Error: table contacts has 3 columns but 2 values were supplied
sqlite> INSERT INTO contacts VALUES(Steve, 87654);
Error: no such column: Steve
sqlite> INSERT INTO contacts VALUES("Steve, 87654);  // Intentional for demonstration //
   ...> ^D  // Entered CTRL+D //
   ...> ;
   ...>     // Entered CTRL+C //
Error: unrecognized token: ""Steve, 87654)"

C:UsersmyUser>

What is the request line for HTTP/2?

For HTTP/0.9:

GET /

For HTTP/1.0:

GET / HTTP/1.0

For HTTP/1.1:

GET / HTTP/1.1
Host: example.com

What is the request line for HTTP/2?
Is it something like:

GET / HTTP/2.0

Or HTTP/2?

Notice: Array to string conversion in vendor/magento/framework/Escaper.php on line 261 in magento 2.4.1

I am facing this issue when I create a custom theme under my Magento 2.4.1.
The product displaying hides automatically showing this error.