## How can a creature’s maximum hp be determined?

Is it possible to determine a creature’s maximum hit points through a Knowledge skill check or another means?

Related: What check to use for finding out current hit points?

## Flow to modify columns on dynamically determined Sharepoint library

I have a flow through Power Automate and one of its functions is to modify metadata of a file stored in a Sharepoint library based on certain criteria. The metadata is stored in custom columns and the document may be located in a number of libraries, depending on its country.

At the moment, I read the country from the file, this I feed into the Switch control and for each case, I have Update File Properties action, which modifies the metadata. This works perfectly, however it feels very inelegant because for each newly supported country, I have to add a case into the Switch control and define the steps (and if I decide to implement a change, I will need to do so again for each case). I can input the library name dynamically as `"DL_" & File.Country`, however in that case the action does not offer me the custom columns because it does not know which library it will access before run time.

Is there a way around this limitation that would allow me to remove the Switch/Case controls? The columns with metadata are the same in each of the document libraries (they are built from the same template), so I am essentially looking for a way to do it dynamically.

(moved here from Super User forum)

## When is an object determined by the number of maps from the other objects?

Let $$C$$ be a category with finite hom-sets.
Suppose that $$X$$ and $$Y$$ are objects in $$C$$ such that $$C(Z,X)cong C(Z,Y)$$ for any Z (with no naturality condition).
For which categories $$C$$ does it follows that $$X cong Y$$?
(Of course, it is true for posets).

A somewhat related question is the following.

Let $$C$$ be a symmetric monoidal closed category.
Suppose that $$X$$ and $$Y$$ are objects in $$C$$ such that $$(X,Z)cong (Y,Z)$$ for any Z (with no naturality condition).
For which categories $$C$$ does it follows that $$X cong Y$$?

## How to build a graph of people where node connections are determined by name and age?

I was given the following question (please don’t mind the programming language semantics, it’s a language-agnostic question):

Given a list of `Pesron`s, and two arbitrary `Person`s out of that list, we need to find the minimum nth-degree relationship between them.

Here are the definitions of `Person` and a “relationship”:

• A `Person` is defined as having 2 properties: `Name` and `Age`:

``````class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
``````
• A relationship between two `Person`s is defined as follows:

1. Two `Person`s are considered to be in a 1st-degree relationship if they have either the same name or the same age.
2. Two `Person`s are considered to be in a nth-degree relationship if they have n people of 1st-degree connecting them.

Example input:

Given the following list of `Person`s:

``````persons = ({ Name = "John", Age = 60 }, { Name = "John", Age = 50 }, { Name = "Ted", Age = 50 })
``````

Then:

1. The two `John`s have a 1st degree relationship (because they have the same name).
2. The second `John` and `Ted` have a 1st degree relationship (because they have the same age).
3. Hence, the first `John` and `Ted` have a 2nd degree relationship (because the second `John` connects them).

Now, I understand that it’s a simple Dijkstra’s algorithm question, but what I don’t know is how should we build the graph of `Person`s?

## transactions – How is the UTXOs of each partially-spent TxIn determined?

My current understanding of a transaction is as follows:

1. a transaction (Tx) can have multiple inputs (which are previous unspent transactions = UTXOs), let’s call them the TxIn
2. a Tx can have multiple outputs (which thus become UTXOs before they will themselves become spent by being used as TxIn), let’s call them the TxOut
3. the TxOut have a specific order N in the transaction: TxOut(0), TxOut(1), etc.
4. each TxIn references the number N which corresponds to the index of the TxOut referred to in point 3 above, so this makes the link between a specific TxIn and a specific TxOut
5. each TxOut specifies a specific bitcoin amount (which represents the UTXO amount that can be later spent)
6. each TxOut references one or multiple (in the case of MultiSig) bitcoin addresses (public keys) that can spend the amount
7. however, and this is what I don’t understand, the TxIn does NOT specify the amount of bitcoins that are used

If the TxIn does not specify the amount that is used, how do we determine the spent amount for each TxIn, and thus the UTXO of the part of the TxIn that remains unspent?

Example, a transaction with 2 inputs and one output (assuming no fees):

• TxIn(0) whose UTXO before spending is 1 BTC
• TxIn(1) whose UTXO before spending is 1 BTC
• TxOut(0) whose value is 1.5 BTC

How do we know which TxIn, and how much of which, was spent?

• was it TxIn(0) for 0.75 and TxIn(1) for 0.75?
• was it TxIn(0) for 0.5 and TxIn(1) for 1?

What am I missing? Because given the above, it is not possible to determine the spent proportion of each input.

## stochastic processes – M/M/1 queue with operating cost determined by number of customers in the system

Consider an M/M/1 queue and suppose that for each $$x geq 0$$ we accrue operating costs
at rate $$a + bx^2$$ whenever there are $$x$$ customers in the system. Suppose that each
customer pays us $$c$$ upon arriving to the system. What is largest value of $$b$$ at which
we do not lose money in the long run?

I think if average earning rate $$geq$$ average operating rate, then we will not lose money.
Then assumer the arrival rate is $$lambda$$ and service rate is $$mu$$ and define $$rho = frac{lambda}{mu}$$, long-run steady probabilities $$pi_i=$$ probability that there are $$i$$ customers in the system.
average earning rate = $$lambda c$$;

average operatig rate = $$sumlimits_{i=0}^{infty}(a+bi^2)pi_i = sumlimits_{i=0}^{infty}(a+bi^2)rho^i(1-rho) = a + bfrac{rho^2 + rho}{(1-rho)^2}$$.

But I am not sure if I am right since I do not consider the time that $$i$$ customers in the system.

## How is explosives damage determined in Shadowrun 2nd Edition?

In Shadowrun 2nd Edition, damage for grenades decreases from `10S` in power level by 1 per meter for offensive grenades and by 1 per half meter for defensive grenades. The book gives an example to illustrate this on page 97 saying

a target standing three meters away from an offensive grenade blast would be subject to a base 7S damage, while a target standing six meters away would be subject to a base 4S damage.

Blast effects for other kinds of explosives aren’t described on this page.

The ratings for Plastic explosives is listed on page 257

Damage for Plastic explosives is described on page 242 as being the rating of the explosive with a severity of `D` so for example 1kg of Plastic, Compound XII would have a damage of `12D`.

The Damage Code is (Rating)D per kilogram.

The page goes on to explain how the damage is reduced the further from the explosion the target is.

The Power of the blast is reduced by the base Rating per meter.

Does this mean that 1 meter away from detonating 1kg of Plastic Compound XII the damage is `12D` and 2 meters away it’s `0D`? This seems unlikely given how different “-12 per meter” is from the “-1 per meter” for grenades.

How do you calculate damage from Plastic explosives at a given distance from the explosion in Shadowrun 2nd Edition (2e)?

## legal – has data been lost if it is subsequently determined that the data has never been lost?

Data on external media was misplaced and all protocols to report it as lost were followed.

The media was discovered a few months later. It never left the safe place.

In view of the fact that data was never lost, how should the case be submitted in compliance with GDPR and DPO legislation?

Precedents that I can refer to would be of great help.

Thanks a lot

## Can it be determined whether a purchased phone has a new battery?

I recently bought a Samsung phone that is listed as "factory refurbished". Something I found on the Samsung website says that a new battery will be installed on factory-refurbished phones. However, this particular phone was sold by a third party. I would therefore like to check whether the battery is actually new when the phone arrives so that I can use the return window if necessary.

Is it possible to determine whether the battery is new using built-in functions or a third-party program, or to get information that provides evidence in one way or another?

## Applescript – How is the number of words in a string determined?

Given the text set on a variable:

``````set textual to "the quick brown fox jumps over the lazy dog"
``````

In this case, I try to count the number of times a word exists `the`

I tried, but it returns zero:

``````return do shell script "grep -ow 'the' " & quoted form of textual & " | wc -l"
``````

and:

``````return do shell script "grep -o 'the' " & quoted form of textual & "| wc -l"
``````

if i try:

``````return do shell script "echo " & quoted form of textual & "grep -ow 'the' | wc -l"
``````

I get a return from `1` instead of `2`

In an AppleScript `do shell` How can I determine how often a substring occurs in a passed string? When I search to see if this is asked, I only get the character count back. My ultimate goal is to create this as a handler so that I can pass the word and string so that I can count the occurrence of certain words.