equation solving – Why isn’t this expression returning true to being positive when it is clearly positive?


Expre10 = (B^2/C + 2 B + B^2/D + (B C)/D + (B D)/C) + 
   1 (C + D) - (A (Beta) (Sigma))/(B C D) (C + D);
Assuming({A > 0, B > 0, C > 0, 
  D > 0, (Beta) > 0, (Sigma) > 0, (A (Beta) (Sigma))/(B C D) <=  
   1}, Simplify(Expre10 > 0))

Returns the inequality:

B (B + C) (B + D) > A (Beta) (Sigma)

But we clearly see if (A (Beta) (Sigma))/(B C D) <= 1 holds then our inequality will always be true, so why am I getting the wrong output?

mysql – Is it true or just a myth that executing SQL Codes in the Database is the fastest in the entire web based application?

My Manager, who has been a DBA for like 20 years, told me that I should make maximum use of a database , because it is the fastest component in a web server. So, if I am using FrontEnd, PHP (Frameworks) and MySQL,

  • if I were to write a select statement, I should use stored procedure, where the Select statement is written, rather than writing raw Select queries in PHP

  • instead of joining two tables using join query in PHP, I should create a view using create view, where the required tables are joined, and then show the required data from this view.

  • if I need to add data to a different table after inserting or updating the main table, I should use a trigger rather than using a different select statement in the Stored Procedure.

Are these just myths ? If not, then why are databases the fastest, and how does using database queries in the database, faster than that using PHP?

Is $h(n) = Omega(f(n))$ true?

I have $f(n) = O(g(n))$ and $g(n) = O(h(n))$.

Is $h(n) = Omega(f(n))$ true, and if so, what constants would make it true?

I was thinking that since $f(n) = O(g(n))$ and $g(n) = O(h(n))$ are true, then $f(n) = O(h(n))$.

I can state $h(n) = Omega(O(h(n)))$ but I don’t know what to do from here. Any pointers?

dnd 5e – What does ‘kind of creature’ mean in the description of the True Polymorph spell?

It appears to be an informal catergorisation of monsters—and possibly more.

Much of this answer comes from the content of this answer to a different question, which has been rephrased to be appropriate to this question.

Current examples of the term ‘kind of creature’ (or similar) include:

  • Antipathy/sympathy (PHB p. 214):

    a kind of intelligent creature, such as red dragons, goblins, or vampires

  • Locate creature (PHB p. 256):

    creature of a specific kind (such as a human or a unicorn)

  • The Protector special purpose of a sentient magic item (DMG p. 216):

    a particular race or kind of creature, such as elves or druids

  • Wand of Orcus (DMG p. 227):

    any kind of undead, not just skeletons and zombies

All emphasis mine.

From these examples, we can deduce the following:

  • Since ‘intelligent’ is pretty clearly a description of a creature, as opposed to part of ‘intelligent creature’ as a distinct term from ‘creature’, it follows that red dragons, goblins, and vampires and each a kind of creature.

  • Since ‘undead’ is a creature type, skeletons and zombies should therefore, under a less specific label, each be a kind of creature.

  • Similarly, the phasing of ‘creature of a specific kind’ suggests the same, if not a similar, meaning: thereofre, humans and unicorns are each a kind of creature (albeit potentially more specific).

However, at this point, we run into a problem: up until the last bullet point, every example mentioned only includes names which match closely to monster names—the series of red dragons of different ages; goblin; vampire; unicorn—but now, we have a much broader term: human. There is currently no monster entry with the name ‘Human’, but this example could still apply to a category of monsters. However, there are at least 46 which fit this description, not including specific adventure NPCs, so this would be a lot less sound a presumption—and this is despite the fact that this is supposed to be a ‘specific’ kind of creature!

We have a different problem with ‘druid’—which can reasonably be taken to be a ‘kind of creature’, since ‘elf’ (a race) is included in the pair of examples comprising both a ‘race’ and ‘kind’ of creature—whereby ‘druid’ can either refer to a monster of the same name or a creature with levels in the character class, which also potentially expands ‘kind of creature’ to refer to player characters.

However, no matter how we interpret the terms, it is clear that every listed example could solely apply to named monster descriptions. For example, ‘unicorn’ has a unique listing that it could refer to. We then have one possible consistent interpretation:

‘Kind of creature’ may refer to a category of monsters.

In any interpretation, we must have the following restriction, in response to the question about how this term interacts with a character’s options when casting the spell, in order to remain consistent with the examples listed so far:

A goblin target may not be turned into another creature which is a goblin.

This is necessary because ‘goblin’ is listed as a ‘kind of (intelligent) creature’. One could reasonably use this example to extrapolate that the target of a true polymorph spell may not be turned into a creature of the same race.

Aside from that, not much is clear.

The most general qualification to the descriptions listed in the various examples must unify race, class (if any), and whatever property being a zombie or skeleton could be.

For the purposes of differences to other transformations, they do not have the restrictions listed, while that allowed by true polymorph does.

The spells and features listed lack this restriction, with the only restrictions listed being CR or creature type. Thus, while the shapechange spell would be able to turn a goblin caster into the form of its goblin ally which has a lower level or CR, the true polymorph spell would not.

dnd 5e – What does ‘kind of creature’ mean in description of the True Polymorph spell?

The true polymorph spell states:

Choose one creature or nonmagical object that you can see within range. You transform the creature into a different creature, the creature into an object, or the object into a creature (the object must be neither worn nor carried by another creature).

If you turn a creature into another kind of creature, the new form can be any kind you choose whose challenge rating is equal to or less than the target’s (or its level, if the target doesn’t have a challenge rating). The target’s game statistics, including mental ability scores, are replaced by the statistics of the new form. It retains its alignment and personality.

How should this be treated in the context of the rules, and how should it be treated differently (if at all) from other kinds of transformation, such as the polymorph and shapechange spells, and the Druid’s Wild Shape feature, all of which only use the phrasings “a beast”; “any beast”; “any creature”? Is there any creature (or beast) which this spell would therefore be unable to produce which the other transformations would, or is it redundant?

What is a kind of creature, and how do I determine what options a player has when he tries to use this spell?

javascript – Pegar valor true ou false função isNaN para uma variável

Boa tarde!
estou tentando jogar o valor true ou false para uma variável ‘resultado’
mas só retorna undefined.

onde estou errando?
e se não for possível jogar o valor true ou false da função isNaN diretamente
para que ela serve então?

var soma = 'num123' + 5;

var resultado = console.log(isNaN(soma));

dnd 5e – Why would I ever cast True Strike?

Two Words: Arcane Trickster

TLDR: An Arcane Trickster build can get more damage by casting True Strike to trigger a Sneak Attack than by either attacking two rounds, using a damaging cantrip and then attacking, or casting a damaging cantrip both rounds. Also, certain feats can combine with True Strike to trigger Super Advantage (3d20) or even limited Ultra Advantage (4d20) on an attack roll.

Damage Comparison: True Strike vs Attacking

Because Rogues are restricted to using a Finesse Weapon to get their Sneak Attack damage, most make one their weapon of choice. Finesse Weapons (as presented in the PHB) all deal 1d8 or less damage as their base. For the purposes of this example, let’s assume our Rogue is using a 1d8 Rapier and has a Dexterity modifier of +3, making their base weapon damage with a non-magical Rapier 1d8+3.

By the time this Rogue can become an Arcane Trickster at level 3, they get an additional 2d6 damage if they can Sneak Attack. If this Arcane Trickster takes True Strike as one of their cantrips, then, in the event that they do not have another condition that will give them an opportunity to use their Sneak Attack, they can potentially trade 2d8+6(14) (assuming 2 successful attacks, one on each turn) for 1d8+2d6+3(13) if neither roll is a critical hit, so they average out to be pretty similar. If either of your attacks is a critical hit, without True Strike granting you the Sneak Attack damage, the trade at level 3 is 3d8+6(18) vs 2d8+4d6+3(23) with it.

Tempted yet? I’m only getting warmed up.

As time goes by, this trade becomes better and better, eventually capping out at level 19 when it would be trading 2d8+6(14) for 1d8+10d6+3(37) without a critical hit and 3d8+6(18) without the spell vs a whopping 2d8+20d6+3(71) with the spell if one of the rolls is a crit!

Double critical hits are rare enough that it’s not worth comparing.

Because it takes a while for the return to be worth it casting it often (whenever you can’t gain Sneak Attack from another source) it may be best not to pick True Strike as one of your Cantrips at level 3, but the only other chance you will get is when you get your fourth and final Cantrip pick at level 10.

It is also good to take into account that a Rogue is also the most likely character to make an attack roll before initiative is actually rolled. If you attack from hiding, you already get Advantage, and therefore, Sneak Attack, but what if you are in a conversation and decide that someone needs to be stabbed? A Dexterity(Slight of Hand) skill check to hide the fact that you just cast True Strike (no verbal component) could be a great way to still get to open with a Sneak Attack. Depending on your DM, you could probably get Advantage on your attack just by a successful Dexterity(Slight of Hand) roll to conceal that you are readying a dagger, and which of the two checks would be harder will change from DM to DM as well, but using the Slight of Hand check for the spell may be a good way to get to use your rapier instead of a dagger.

Damage Comparison: True Strike vs Damaging Cantrips

The most common argument against True Strike I have seen compares casting a damaging Cantrip instead of attacking the first round, so let’s look at that comparison as well, using our Arcane Trickster and the Fire Bolt spell (improves at levels 5, 11, and 17) as our damaging Cantrip.

text{Level} & text{Fire Bolt (avg. damage)} & text{True Strike (avg. damage)} \
3 & 1text{d}10+1text{d}8+3 ; (12) & 1text{d}8+2text{d}6+3 ; (13) ; star \
5 & star ; 2text{d}10+1text{d}8+3 ; (17) & 1text{d}8+3text{d}6+3 ; (16) \
7 & 2text{d}10+1text{d}8+3 ; (17) & 1text{d}8+4text{d}6+3 ; (19) ; star \
9 & 2text{d}10+1text{d}8+3 ; (17) & 1text{d}8+5text{d}6+3 ; (22) ; star \
11 & 3text{d}10+1text{d}8+3 ; (22) & 1text{d}8+6text{d}6+3 ; (25) ; star \
13 & 3text{d}10+1text{d}8+3 ; (22) & 1text{d}8+7text{d}6+3 ; (29) ; star \
15 & 3text{d}10+1text{d}8+3 ; (21) & 1text{d}8+8text{d}6+3 ; (31) ; star \
17 & 4text{d}10+1text{d}8+3 ; (27) & 1text{d}8+9text{d}6+3 ; (34) ; star \
19 & 4text{d}10+1text{d}8+3 ; (27) & 1text{d}8+10text{d}6+3 ; (37) ; star \
end{array} \
text{(}startext{ marks larger damage source for that level)}

As you can see, the True Strike spell will often get more damage per round for a Rogue than the Fire Bolt spell, especially at higher levels, and that doesn’t even account for doubling your Sneak Attack with a critical hit!

The fact that you could also crit with your damaging Cantrip is valid, however the comparison becomes difficult since if one of your attack rolls is a crit, you don’t get to choose which one it is, so if it was the Fire Bolt roll you could get as much as 8d10+1d8+3(47) vs 2d8+20d6+3(71) with True Strike at level 19, but if the crit was the attack, then it would be 4d10+2d8+3(31). In both cases the True Strike spell provides the superior damage output.

Finally, it is important to remember that your Arcane Trickster could also spam Fire Bolt both rounds instead of using a Rapier or other finesse weapon on one of the rounds, in which case, at level 19 the trade would be 8d10(40) vs 1d8+10d6+3(37) without a crit or 12d10(60) vs 2d8+20d6+3(71). As you can see, in this scenario, the Fire Bolt spell is more competitive and when you should choose one over the other is really situational. Luckily, if they want to, an Arcane Trickster can have both of these spells at their disposal and make good use of each one.

It’s not all strawberry fields, however, since you still have to worry about the problems that come with delaying your attack a round: the enemy gets to act before taking damage, something could change that makes you not get to attack on your next turn, etc. Also, remember that this spell is only for those times when you can’t get your Sneak Attack some other way, such as attacking together with a melee ally or the many other situations that grant Advantage. This spell is for those times when you are in a pinch and can’t get your Sneak Attack any other way.

The first feat that you should take for this build is Lucky, unless your DM allows Xanathar’s Guide, then your first pick should be Elven Accuracy (assuming you are an elf or half-elf).

Paraphrasing the The Elven Accuracy Feat from Xanathar’s Guide:

Increase your Dexterity, Intelligence, Wisdom, or Charisma score
by 1, to a maximum of 20

Whenever you have advantage on an attack roll using one of those
ability scores, you can reroll one of the dice once

Be prepared for some DMs to veto Elven Accuracy though, because it essentially turns Advantage on all attack rolls into Super Advantage (best of 3 rolls) which will scare them.

As a DM, I would absolutely allow this feat, I don’t believe it is over powered because it still requires Advantage, and sure, you can get Advantage more often with True Strike, but you also have to sacrifice an Action for that, so I feel like, rather than making it too overpowered, this feat brings True Strike up to the level it should have been on anyway.

If allowed, Elven Accuracy makes True Strike much better by not only increasing your chances to hit (57.81% chance to roll at least a 16) but also increasing your chances to get a critical hit (14.26% with best of 3d20 vs 9.75% with normal Advantage) and getting to double that Sneak Attack damage!

Add the Lucky feat to that and you will potentially get to roll as many as 4d20 on a single roll, granting what I call Ultra Advantage. Anyway, no matter what you call it, with this build, your two rolls over for two normal attacks can turn into 4 rolls for a single Sneak Attack.

With Ultra Advantage from one of your three uses of Lucky, your chances of rolling at least 16 are boosted to 68.36%, and your chances of rolling a 20 are 18.55%.

Again, I would argue that this is not overpowered because in the end, you can still only do this three times per day (and those uses of Lucky need to compete with things like Saving Throws), and only when you have Advantage, which you may have had to sacrifice an Action to set up for yourself. On top of that you are spending 2 Feats toward this build, so if your DM has an aneurism over it they need to chill out.

time complexity – is it true that if $f(n)in O(g(n))$ then $f(h(n)) in O(g(h(n)))$?

Formally it’s easy to bring counterexample: suppose $f(1)=1$, $g(1)=0$ and then, for other values of argument, $f, g$ are any pair of non-zero functions with property $f(n)in O(g(n))$. Now taking $h(n)=1,forall n in mathbb{N}$ makes impossible $f(h(n)) in O(g(h(n)))$.

On other hand, for example, if $h$ is strictly increasing function, then your claim will be true, because we obtain property for subsequence from sequence.

http request – How do you provide the true last modified date header?

We recently discovered that our internal search engine (using elasticsearch) was picking up a last modified date from the header that did not match the actual date the node was last updated. It was way off. We use Cloudflare, and I speculate that is is putting out the last cache date instead.

How do we provide a true last modified date header?

Our current work around is to use a preprocess function to provide a meta tag that our internal crawler will read. We check the current node for the changed field and set a changed date value from that. If it is not a node, it uses the current date. This work around is fine enough for our internal crawler because we can control what it’s looking for. However, that won’t help external search engines that are crawling our sites. So, I’m hoping someone might have an idea for a better Drupal way of handling this issue.