How does one calculate effects of damage over time if one is taking a long rest?

In a particular adventure, the air in the lower levels is poisoned, causing 1d6 poison dmg every hour.

If a party take a long rest in such an environment, how do you calculate the cumulative effects of the poison air damage over time in combination with the restorative effects of the long rest?

PHB pg 186 At the end of a long rest, a character regains all hit points.

Does this mean, RAW, the characters take 8d6 damage during the long rest, but then ‘wake up’ at full HP? If after the nth hour, they drop to 0HP and start rolling Death Saves, if they save, and make it to 8hr, they wake up full HP?

Seems like it shouldn’t work that way but I can’t find any suggestion in the books it would be otherwise.

Calculate min number of moves (no path involved)

I’m looking to implement an algorithm that will calculate the minimum number of moves based on the rules below.

Let’s say that we have a grid (NxM), as exampled in the image below.

enter image description here

Each cell will be the sum based on the row and column and I can subtract 1 unit from one cell and add it to a neighbour. For example, on the image above, the minimum number of moves on Initial will be 2 and on Initial – 2 will be 4.

Pls how do I setup a from and to address and allow my UPS integrated solution calculate shipping based off the two addresses? [closed]

So, I am setting up a website to handle shipping services similar to DHL and UPS, but I am also using UPS services to handle the shipping cost through their API to my specific users, and I want to be able to calculate shipping by allowing users to enter a from and to shipping address, and calculate the shipping based on the distance. Any help would be much appreciated.

How is it possible that mathematica can’t calculate the eigenvectors and eigenvalues of this?

How is it possible that mathematica can’t calculate the eigenvectors and eigenvalues of this:

Code:

$  Assumptions = f \[Element] Reals ; \[CapitalNu] = (1/(4*Cosh[f]^3))*{{Exp[f]*(Cosh[f])^2, Exp[f],      Cosh[f], Cosh[f]}, {Exp[f], Exp[f]*(Cosh[f])^2, Cosh[f],      Cosh[f]}, {Cosh[f], Cosh[f], Exp[-f]*(Cosh[f])^2,      Exp[-f]}, {Cosh[f], Cosh[f], Exp[-f], Exp[-f]*(Cosh[f])^2}} Eigensystem[N]  

Image:

enter image description here

It is not very hard on paper(I ‘ve done it) but it has too many calculations. I ‘ve seen mathematica doing way harder things but it just failed on this one…

Where is my mistake?

cumulatively calculate the distance along a line

I am using Postgis to:

  • calculate the cumulative distance in metres along the line
  • store the cumulative distance in "m"

I have a table with points on this line and each row holds lat and lon coordinates. The "m" value is 0 for all rows.

The following code nicely gets me the distance between the first point and the next.

SELECT a.geom FLOOR( ST_Distance(ST_Transform(a.geom, 3857), ST_Transform(b.geom, 3857)) * cosd(42.3521)) AS dist FROM line a LEFT JOIN line b ON a.id = b.id + 1 

however, it does not add up to a total nor does it update the "m" value yet.

I tried a set of permutations of the following, but none of them store a cumulative sum of the previous row’s value for "m" plus the calculation of the distance between this point and the previous.

WITH next AS (     SELECT     ST_Distance(ST_Transform(a.geom, 3857), ST_Transform(b.geom, 3857)) * cosd(42.3521)     AS dist,     a.id AS rowid,     FROM line a     JOIN line b     ON a.id = b.id + 1 ) UPDATE line a SET m = FLOOR(next.m + next.dist) FROM next WHERE a.id = next.rowid RETURNING a.m, next.dist; 

or

update line a     set m = FLOOR(a.m + prev.dist)      from (select             l.*,             ST_Distance(ST_Transform(                 lag(geom) over (order by l.id asc)             , 3857), ST_Transform(geom, 3857)) * cosd(42.3521) as dist             from line l           ) AS prev     where prev.id = a.id - 1     returning prev.m, prev.dist, a.m 

Any ideas?