Who picks the type of the Basic Attack?

Charm of Misplaced Wrath (Heroes of Fallen Lands, p206)

The target makes a basic attack against a creature of your choice as a free action. The basic attack gains a +2 power bonus to the damage roll.

This is a 1st level Wizard encounter power, if it matters.
Can I make the target do a Ranged Basic Attack (so it provokes attacks of opportunity) or does it get to pick the type of Basic Attack?

DELETE a single row from a table with CASCADE DELETE picks a slow plan… but not always

Schema Summary

A dozen tables related by foreign key to a central table (call it TableA). All tables have a PK that is INT IDENTITY, and Clustered. All the tables’ FKs are indexed.

This looks like a star configuration. TableA has fairly static personal info such as name, & DOB. The surrounding tables each have lists of items about the person in TableA that change or grow over time: for example, a person might have several emails, several addresses, several phone numbers, etc…

In the unusual event that I want to delete from TableA (test data that gets inserted during performance checks, for example), the FKs all have CASCADE DELETE to handle removing all subordinate data lists if they exist in any of the surrounding tables. I have three environments to play with: DEV, QA, and UAT (well, four if you count PROD, but “play” is not something I would want to do to PROD). DEV has about 27 million people in TableA with various counts upward of 30M in the surrounding tables. QA and UAT are only a few hundred thousand rows.

The Problem

The simple “delete from TableA where Id = @Id” takes < 1ms on DEV (the big one) and the execution plan looks fine, lots of tiny thin lines and all index seeks… but here’s the rub: infrequently on DEV, and ALWAYS on QA and UAT, the simple delete takes about 1 second and the plan shows almost all the indexes are being scanned, with big fat lines showing the entire row counts.


The delete statement is issued by Entity Framework Core running inside an API so I have limited capability to mess with it (making it into a stored procedure, index hinting, using a different predicate, and other ideas…)

Despite all three environments being identical (same script created all three environments), nothing I have done so far has improved QA and UAT, but DEV is usually fast.

When DEV becomes slow, it remains slow until “something” happens. I haven’t figured out what the “something” is, but when it occurs, the performance reverts to fast again and remains that way for days.

If I catch DEV at a slow time, and use SSMS to manually run a delete statement, the plan is fast (<1ms); but the deletes coming from the API use a slow plan (1s). Entity Framework is (as best I can tell) using sp_executesql to run a parameterized “delete from tableA where Id = @Id”. The manual query is “DELETE FROM TableA WHERE Id = 123456789”

The row being deleted is always a recently-added row, meaning that the Id is right at the “top” and probably not within the range of the index statistics (although I speak from a position of profound ignorance on that topic and probably have my wires crossed…)

What I have tried so far

Reading up on FK cascade delete issues, it seems all the FKs need to be indexed, so I did that.

Rebuild (not just Reorg) every index.

Selectively delete the bad plans from the plan cache using DBCC FREEPROCCACHE (plan handle)

Running the excellent tools from Brent Ozar got me checking that the FKs were all is_not_trusted = 0

Looked at these (and other) previous StackExchange questions:1, 2, 3, 4

Of those, I suspect that the last one, with a description of how the cardinality estimator gets confused, might be pointing to the source of the problem, but I need help figuring out what to do next…

The plan shot below (from ssms) shows the slow plan: some of the FK indexes are being scanned (but not all) and there is an excessive memory grant. The fast plan would show all index seeks. The whole plan is at ShowMyPlan Link

I hope someone can point out what I have missed, or what I can investigate further.


enter image description here

Bad Plan

What happens when a druid picks up an object which is a polymorphed creature and then tries to merge it into their Wild Shape?

One of the interesting and useful characteristics of a druid’s Wild Shape is that they can merge their equipment into their beast form.

The scenario is this:

A PC from the party is turned into an object using True Polymorph, let’s say a ring or a coin. The druid in the party picks up the object and puts it into a pouch. Then, they use their Wild Shape feature with the option of merging all equipment into themselves.

Does this work – and, if it works, what happens when the duration of the True Polymorph ends after an hour, if the druid is still in beast form?

Thank you for your help with this.

What happens if a race that naturally has claws picks a class that gives them

Okay let’s take cat folk for example they have an alternate racial trait called cats claws which give a 1d4 claw attack. Then take a look at abyssal bloodline bloodrager and I just realized how awkward that is to say. Anyways the bloodrager gives a a claw attack that deals 1d6 for medium creatures from the get go. So that begs the question which source of claws wins? Granted these are just examples that I noticed first there’s probably other ones out there that I’m not aware of.

If an arcane trickster rogue uses his mage hand and makes it invisible, does that mean anything the hand picks up is also invisible?

From PHB (emphasis mine):

Starting at 3rd level, when you cast Mage Hand, you can make the spectral hand invisible, and you can perform the following additional tasks with it:

• You can stow one object the hand is holding in a container worn or carried by another creature.

• You can retrieve an object in a container worn or carried by another creature.

• You can use thieves’ tools to pick locks and disarm traps at range.

You can perform one of these tasks without being noticed by a creature if you succeed on a Dexterity (Sleight of Hand) check contested by the creature’s Wisdom (Perception) check. In addition, you can use the bonus action granted by your Cunning Action to control the hand.

And the invisibility spell (emphasis mine):

A creature you touch becomes invisible until the spell ends. Anything the target is wearing or carrying is invisible as long as it is on the target’s person. The spell ends for a target that attacks or casts a spell.

I know the spell is slightly different but it’s the most comparable thing I could find.

For example:

  • I lift some jail keys off of a guard and then turn the hand invisible.

  • I grab 3 platinum coins off the mayor’s desk when I think no one is watching and close the hand around them so they’re totally inside the fist.

  • I give the hand a lockpick and pick a lock from across a crowded room.

In which of these situations (if any) would the objects be visible?

If a cleric takes the Ritual Caster feat and picks the wizard list, are they able to scribe rituals that are on both classes’ spell lists?

I am playing a cleric. I would like to take the Ritual Caster feat at level 4 to access some wizard spells for utility.

Can my cleric spend the material cost to add rituals shared by both classes (like Detect Magic, Detect Poison, Identify, Gentle Repose, etc.) to the ritual book? Or do I need to find a wizard based written source?

How to get the Environment.CurrentDirectory picks the current deployed directory?

Below syntax deploys the scripts written in the .sql file to the database. Code works fine from the development environment. However when the code is published to .exe version, folder path varies and also .sql file is renamed to .sql.deploy.

Running .exe version in any other computer fails to pick the .sql file and fails to deploy the file to the DB.

How to get the Environment.CurrentDirectory picks the current deployed directory?

 public static void ExecuteDBScript()     {            try         {             string sqlConnectionString = System.Configuration.ConfigurationManager.AppSettings["MyDB"];             string workingDirectory = Environment.CurrentDirectory;             string scriptpath = Directory.GetParent(workingDirectory).Parent.FullName + "\SQLScripts\DeployDBScript.sql";              string script = File.ReadAllText(scriptpath);              SqlConnection conn = new SqlConnection(sqlConnectionString);             Server server = new Server(new ServerConnection(conn));             server.ConnectionContext.ExecuteNonQuery(script);           }         catch (Exception ex)         {             Console.WriteLine(ex.Message);         }              } 

Magento 2 : Order confirmation mail cron language picks up default language

  • I have multi language site.
  • created a cron job to send order confirmation email.
  • I have created an email template for specific language.
  • The problem is, shipping and billing country is displaying in default language instead of order’s store language.

How to fix this issue? I need to display the countries in specific order’s store language.

Can a UWP App access data outside its own app data, publisher data, or what the user picks with the FilePicker?

Can a UWP App access data outside its own app data, publisher data, or what the user picks with the FilePicker?

As far as I can tell, a shared publisher area and a user prompt with the FilePicker are the only ways to access files outside a UWP app’s own personal app data stores. Registry settings are sandbox’d, as are environment variables.

I’d like to pass data from one UWP app to another as plain-text non-executing and read-only if it’s possible, but it doesn’t seem like it is so far from my research. Have I missed anything?