How to calculate the CR of innate spellcasting dragons (and how that affects their highest spell level)

I have a rough understanding of how to calculate expected challenge rating, but I’m not sure how it works in the case of the innate spellcasting dragons variant.

Consider an Ancient Gold Dragon:

Without innate spellcasting, an Ancient Gold Dragon is CR 24. By my calculations, it has a Defensive Challenge Rating of 25, meaning its Offensive Challenge Rating must be 23 to average out to 24. At CR 24, if you used the innate spellcasting variant, it could learn up to level 8 spells. However, depending on which spells it has, that might raise its CR. In order to be eligible to learn level 9 spells, it would need to be CR 27. One way to do this would be to increase its OCR to 29, which corresponds to average damage of 267 per round for three rounds (after accounting for the dragon’s higher than average spell save DC).

I don’t know if that’s possible, but let’s say it is. That would bump the dragon up to CR 27. Would it then be possible for the dragon to learn level 9 spells?

Calculate price and display on woocommerce product single page under price (simple price, variable price)

I am planing to show a new price on my woo-commerce product page for all products. This is the installment price per month. I need to show this below the normal price (variable price and simple price) something like this.

0% interest installments starting from Rs.3,093

where Rs.3,093 is the new price.

this is the calculation i tried on W3 schools, and i got the calculation correct.

whereas 60000 is the price of the product multiplied by this number 5.15464 divided by 100

answer is 3,093 (answer should be rounded off to the nearest integer)

I need a custom function for this where i can add to my functions.php

<script>var x = myFunction(60000, 5.15464, 100); function myFunction(a, b, c) { return Math.round (a * b / c);}</script> 

I want to calculate date and time differences using power apps

RoundDown(DateDiff(DateValue1.SelectedDate,DateValue2.SelectedDate, Days) / 7, 0) * 5 + Mod(5 + Weekday(DateValue2.SelectedDate) - Weekday(DateValue1.SelectedDate), 5) - CountIf(Table1, Date >= DateValue1.SelectedDate, Date <= DateValue2.SelectedDate) 

This is my formula.

I used it to count days excluding weekend and holidays. Now I want to count time also.

If the start date is 5/8 and 8 am, end date is 5/8 and 12 pm I want to show it is as 1/2 day.

Or I can just show if 5/8, AM – 5/8 PM is 1/2 day.

How can I calculate the distribution of “roll 4d6, reroll 1s and 2s, and drop the lowest die” in AnyDice?

I am joining a D&D group. To generate each ability score, the DM has us roll 4d6, reroll any 1 or 2, and then drop the lowest die. If the reroll is a 1 or 2, then reroll again and again until the result is 3 or higher.

I am curious about the distribution, and wonder if AnyDice could do it. How can I calculate the distribution of this ability score generation method in AnyDice?

efficiently calculate nearest common ancestor in a family tree (each person has two parents)

I’m well aware of ways to efficiently calculate the lowest common ancestor in a tree of nodes which converge to a single root (ie, each node has only one parent). Just iterate back to root for each person, then walk back from root tossing off anything common.

In a matriarchal society, for example, this could be used to quickly calculate how any two people are related as long as only the mothers are considered.

But if both parents are considered, eg mother AND father, then the algorithm just described breaks down.

So I wondered is there an algorithm to tell two people how they are related in a family tree where both parents are considered? For example, see the Icelandic genealogy app ( which does precisely that. How’s it done, algorithmically speaking?

Using IP to calculate Tax

I understand that if I sell things online, I need to calculate Taxes based on customer location. Can I use IP to locate customer or should I ask them explicitly?

If it is fine to use IP to identify customer’s Country, is it fine to locate customer State/Province.

I need it because Canada has different taxes in different Provinces.

Calculate minimum and maximum Ethernet (IEEE 802.3) frame size from frame format

enter image description here

According the frame format of Ethernet

Minimum Frame Size should be : $ 7 Byte + 1Byte+6Bytes+6Bytse+2Bytes+46Bytes+4Bytes=72Bytes$

Maximum Frame Size should be : $ 7 Byte + 1Byte+6Bytes+6Bytse+2Bytes+1500Bytes+4Bytes=1526Bytes$

But it is said that the minimum frame size is $ 64Bytes$ while the maximum frame size is $ 1518 Bytes$ .

How the frame sizes are calculated ?

Calculate Meant Time Between Failures ( SRE Metrics) in Java Stack

We are currently trying to capture / calculate Mean Time Between Failures for all our services running in production. We use K8s and Prometheus to monitor the same. MBTR = Total Uptime / Number of failures How to get total uptime in prometheus ? Is it possible to use JVM Metrics , is it a good idea to use ps -eo ? Also how to get number of failures ?