real analysis – Necessity of selecting value for $delta$ in $epsilon$-$delta$ proofs

I’ve been reviewing the epsilon-delta definition of a limit before beginning Analysis 1 and am slightly confused about the problems where $delta$ is selected from a minimum of two values.

For example, a problem in my textbook asks to prove $$lim_{x to 3} x^2 = 9$$

using epsilon-delta. The process is explained as follows:

$$|x^2-9|<epsilon$$

$$|x+3||x-3|<epsilon$$

$$text{Let } delta = 1, text{so } |x-3|<1$$

$$-1<x-3<1$$

$$5<x+3<7$$

$$therefore |x-3|<frac{epsilon}{7}$$

$$delta = min { 1, frac{epsilon}{7} }$$

I’m confused as to why we don’t leave delta as delta, and simply solve for delta in terms of epsilon (i.e. $delta = sqrt{epsilon+9}-3$). Are we able to simply pick a bound for $delta$ because epsilon-delta proofs only require that there exists a positive delta that will work, and that there an infinite number of positive deltas that exist in $left(0,1right)$, for example? Otherwise, the proof seems incomplete because it doesn’t take into account any $delta>1$.

unity – Box selection with Physics2D.BoxCastAll is mirrored when selecting in the bottom half of the screen

enter image description here

Using Physics2D.BoxCastAll based on rectangle is working fine when drawing is started on the top part of the screen, but when drawing is started on the bottom you can see this strange mirroring effect.

Code:

    void OnGUI()
{
    // LMB clicked
    if (Input.GetMouseButtonDown(0))
    {
        boxStartPosition = new Vector2(
            Input.mousePosition.x,
            Screen.height - Input.mousePosition.y
          );
    }

    // LMB drag
    if (Input.GetMouseButton(0))
    {
        boxEndPosition = new Vector2(
            Input.mousePosition.x,
            Screen.height - Input.mousePosition.y
        );

        rectangle = new Rect(
            boxStartPosition.x,
            boxStartPosition.y,
            boxEndPosition.x - boxStartPosition.x,
            boxEndPosition.y - boxStartPosition.y
        );

        GUI.DrawTexture(rectangle, RectangleTexture);

        float pixelsToWorld = Camera.main.orthographicSize / (Screen.height / 2f);

        Vector2 boxCenter = Camera.main.ScreenToWorldPoint(rectangle.center);

        boxCenter.y = Mathf.Abs(boxCenter.y);

        float boxWidth = Mathf.Abs(rectangle.size.x) * pixelsToWorld;
        float boxHeight = Mathf.Abs(rectangle.size.y) * pixelsToWorld;
        Vector2 boxSize = new Vector2(boxWidth, boxHeight);

        BoxCastDebug.DrawBoxCast2D(boxCenter, boxSize, 0f, Vector2.zero, 0f, Color.black);
        hits = Physics2D.BoxCastAll(boxCenter, boxSize, 0f, Vector2.zero, 0f);
    }

Can anyone help me to solve these issues? Is it directly connected with setup of my scene, camera or scripts?

programming practices – Selecting nonzero element from numeric array: alternative to For loop?

Basic question to you software developers.

Say I have an array with numeric elements, only one of which is nonzero at any given time.

I need to select just the one nonzero element.

Right now I do this with a For loop that iterates over the entire array, then outputs just the nonzero element.

But is this the best way to do this? And is there an alternative to iterative loops?

One option that comes to mind:

  1. Compare the array elements each to zero. The output would be an array of 1s and 0s, e.g., [1 0 0 0]. This can be done in a single operation without iterative loops in Octave.
  2. Use matrix multiplication to get the product of the original array with the second array. E.g., [2 0 0 0] * [1 0 0 0]’, where ‘ denotes the transpose. The results is 2*1 + 0 + 0 + 0 = 2.
  3. Output the result of the matrix product.

…Would this seem reasonable from a software devel standpoint? It seems more straightforward to implement than a For loop… But I’m not an expert in these things. Thoughts/alternatives?

sharepoint on prem – Problem when selecting a date in calendar overlay

I created a room booking system using a Sharepoint calendar which is overlayed by multiple lists in SP 2019 On Premise.
The users use the main calendar to see which rooms are booked for the day (day-view).
If they want to book a room in the future they go into the main calendar, click on the date in the top left corner and then choose a room. To book the room, they go into the room list via the navigation pane on the left.

Now the confusion: the date on the left resets to the current date which causes a lot of confusion.

Is there any way that the date gets transferred into the underlaying calendar or do you have any design tip to make this behaviour not so confusing?

Thank in advance!

array – Selecting elements of sublists or reshaping a list of lists

I have this list

{{{0.05792, 0.31744}, 0., 0., 0., 0., 
  0.}, {0., {0.28832, 0.49024}, {0.17173, 0.386393}, 0., 0., 
  0.}, {0., {0.17173, 0.386393}, {0.104, 0.352}, 0., 0., 0.}, {0., 0.,
   0., {0.30752, 0.38464}, {0.322232, 0.260264}, {0.214663, 
   0.107331}}, {0., 0., 
  0., {0.322232, 0.260264}, {0.392, 0.496}, {0.277128, 
   0.415692}}, {0., 0., 
  0., {0.214663, 0.107331}, {0.277128, 0.415692}, {0.2, 0.4}}}

or in the matrix form:
enter image description here

I would like to convert this list to a list of two matrices, each of the same size as the input matrix, i.e. 6 by 6, where the non-zero entries for the first matrix are given by the first element of the lists in the input matrix and the same for the second matrix.

If it helps I can also create a matrix where the zeros are replaced by a list of two zeros to match the dimension.

air travel – Can I see who I’m sitting next to while selecting my seat online?

I have in the past had a not-so-pleasant experience of sitting near some passengers with bad odour or who were too talkative. I was wondering if I could see who I’m sitting near when selecting my seats online before the flight?

I heard that KLM offered this.

ssrs – PL/SQL: Selecting multiple values from the same column

We have a table in which all kinds of different Words are stored with a unique id each. In other tables, certain fields which should contain words instead only contain the id of these words. Let’s look at an example.

This is our example “words” table:

+---------+--------+
| word_id |   word |
+---------+--------+
|       1 |  Apple |
|       2 |  Melon |
|       3 |    Car |
|       4 |   Boat |
+---------+--------+

In another table (example: “rows”), there are references to that table:

+--------+----------+------------+
| row_id | fruit_id | vehicle_id |
+--------+----------+------------+
|      1 |        1 |          4 |
|      2 |        2 |          3 |
|      3 |        1 |          3 |
|      4 |        2 |          4 |
+--------+----------+------------+

For my SSRS Report, I need to select many rows of the “words” table and insert the value of the “word” column into the report. For now I have solved it by creating a different SQL query for each field using report parameters to select the id, but I was wondering if I could make the report more efficient by cutting down the number of SQL queries.

How I did it for now using our example:

SELECT
    rows.id,
    words.word AS FRUIT
FROM
    rows
INNER JOIN
    words ON
    rows.fruit_id = words.word_id
WHERE
    words.word_id = :PRODUKTART_ID
----------------------------------------
SELECT
    rows.id,
    words.word AS VEHICLE
FROM
    rows
INNER JOIN
    words ON
    rows.vehicle_id = words.word_id
WHERE
    words.word_id = :VEHICLE_ID

The ideal output for row = 1 would be:

+--------+-------+---------+
| row_id | fruit | vehicle |
+--------+-------+---------+
|      1 | Apple |    Boat |
+--------+-------+---------+

Sadly, I have not found a way to select multiple values of the same column in just one SQL statement.

I would be very grateful for any ideas or solutions, Thanks!

sharepoint online – Selecting Document Library through PropertyPane in SPFX

Here is the description about web part:

Both web parts are same and only one ,only changed the heading and labels and their input’s ID through property pane.

One Webpart is working fine on a page ,but when uploading multiple webpart getting issues.

But on the click of first webpart input fields , getting the value on the second Webpart.

Selecting Different Input id for both webpart through propertyPane.

enter image description here

Here is the property pane of my webpart which is same for both webpart but selected different value for property pane of both webpart.

Getting Folders on the basis of DocumentLibrary selected in the property pane as well as documentType’s value is also getting from property pane.

I am getting value of folder as well as documentType on the double click on the folder’s input as well as documentType input respectively.

enter image description here

PostgreSQL not SELECTing by RETURNING value of INSERT

I have a query that’s supposed to insert a new row, then return it. Normally a RETURNING would suffice, but there’s a lot of other JOINed data must be added, so a SELECT seems to be necessary after the INSERT.

In this simplified example id is a SERIAL:

WITH new_row AS (
  INSERT INTO my_table (
    some_row,
    some_other_row
  ) VALUES (
    0,
    'whatever'
  ) RETURNING id
)

SELECT
   my_table.*,
   other_table.*
FROM my_table
LEFT JOIN other_table ON other_table.somekey = my_table.id

WHERE my_table.id = (SELECT id FROM new_row)

The result is an empty set. Apparently WHERE doesn’t work.

If I just do this:

WITH new_row AS (
  INSERT INTO my_table (
    some_row,
    some_other_row
  ) VALUES (
    0,
    'whatever'
  ) RETURNING id
)

SELECT id FROM new_row;

then I get the value of id correctly.

Why doesn’t it work in the WHERE condition?

Selecting a quantity from a list

I want to implement a function take_upto_n(A, n)
such that for e.g.

take_upto_n((1,2,3,4), 8) returns (1,2,3,2)
take_upto_n((1,2,4,3), 8) returns (1,2,4,1)
take_upto_n((1,2,3,4), 100) returns (1,2,3,4)
take_upto_n((1,2,3,4), 3) returns (1,2,0,0)

Assume A contains non-negative values only. n is also non-negative

This is straightforward with a loop

def take_upto_n(A, n):
    out = ()
    for x in A:
        if n > 0:
            out += (min(n, x))
            n -= min(n, x)
    return out

We can also do this with numpy, but this I.M.O. is fairly unreadable:

def take_upto_n(A, n):
    A = np.array(A)
    return np.clip(n + A - np.cumsum(A), 0, A)

Is there some standard function that does this – couldn’t find it myself (or didn’t know how to search)?

If there isn’t any such function, any advice on how to make it not look like "what is this?" (the n + A - np.cumsum(A) is the real killer)?