Dot Product doesn’t behave like normal function

I am trying to slightly modify the Dot function by treating it like a usual function, but soon I notice something weird about it.

Suppose there is a set set = {λ}, and I want to force Dot[a, λ] (having two arguments) to just print out {a, λ}.

set = {λ};  Unprotect[Dot]; Clear[Dot] Dot[x_, λ_] := Module[{}, Print[{x, λ}]] /; MemberQ[set, λ] Unprotect[Dot];  (* test *) Dot[a, λ] Dot[a, b, λ]  

The two tests print out

{a,λ} 

and

{b, λ} {a.b, λ} 

respectively.

However, the same code for a different function Dott behave completly differently,

set = {λ}; Dott[x_, λ_] :=   Module[{}, Print[{x, λ}]] /; MemberQ[set, λ]  (* tests *) Dott[a, λ] Dott[a, a, λ] 

where the two tests print out {a,λ} and an unevaluated expression Dott[a, a, λ] respectively, and as expected.

I wonder what is going on under the hood (it appears that Dot is trying to exhaust all possible "two-factor product" given any number of dotted factors), and how to properly temper with the Dot product? (my ultimate goal is to adapt it for some non-commutative algebra).

How does Hunger of Hadar behave in confined space?

Hunger of Hadar has a curious wording:

A 20-foot-radius sphere of blackness and bitter cold appears, centered on a point with range and lasting for the duration.

Compare this to Fireball:

A bright streak flashes from your pointing finger to a point you choose within range then blossoms with a low roar into an explosion of flame. […] The fire spreads around corners.

And Darkness:

Magical darkness spreads from a point you choose within range to fill a 15-foot radius sphere for the duration. The darkness spreads around corners.

Total cover rule here states:

A target with total cover can’t be targeted directly by an attack or a spell, although some spells can reach such a target by including it in an area of effect.


What would allow or require Hunger of Hadar to appear in a different shape or size?

Most simply this would be mundane walls, though I guess manufacturing a glass container of desired shape wouldn’t be hard, and then there’re spells like Force Cage and Leomund’s Tiny Hut. These would block most spells, but the HoH spell description is very explicit… a 20-foot radius sphere appears, no buts, no ifs. Is there a rule which would override the HoH description?

How does the Broom of Flying behave?

Similar to this, but for 5th ed.

The Broom of Flying is activated by a Command Word, has 50ft flying speed, and the hover property. It can also be remotely controlled if it is not being ridden.

When being ridden, does it count as a Mount? A Vehicle? Does its rider simply gain 50ft flying speed? If it is considered a mount, should I enforce mounted combat rules? In the case of the broom, it would be unable to move independently.

How does Phantom Steed behave in combat?

The description of the 3th level Wizard ritual spell Phantom Steed reads:

The creature uses the statistics for a riding horse, except it has a speed of 100 feet and can travel 10 miles in an hour, or 13 miles at a fast pace. When the spell ends, the steed gradually fades, giving the rider 1 minute to dismount. The spell ends if you use an action to dismiss it or if the steed takes any damage.

I’m unclear on how Phantom Steed behaves, especially in combat:

  1. If the steed takes enough damage to be killed, does it die immediately or does it continue existing for 1 minute?
  2. Can the steed perform the dodge, disengage, or dash actions as a regular mount can?
  3. Can the steed pull a wagon or other vehicles?
  4. If not ridden, does the steed block the space it is on? If not, is the space it occupies considered difficult terrain?

Non-Mathematical Algorithms that behave like Taylor Series

Are there tasks or problems for which no algorithm can give a complete or precise answer but there do exist algorithms that can give increasingly “better” answers if permitted to execute for longer and longer?

For example, computing the value of $ e$ by means of a Taylor Series yields an increasingly accurate answer, but at no finite point in time will the exact value of $ e$ be computed.

In particular, I’m wondering if there are problems or tasks like this one that are not mathematical in nature. Or is my understanding flawed and indeed all algorithms are in some sense mathematical in nature?

Thanks for reviewing my question.

Magento 1.9.3 CE, Staging & Live Sites behave differently

Lately, we found our Staging Site and Live Site behave differently in 2 situations: 1). we found Live Site to have 500 error timeout while Staging Site is normal; 2). we found update on CSS file in staging site reflected in frontend, while Live Site do not reflect the changes.

how to check the code difference, and how to sync the Staging site code to Live site?

PowerShell – Return doesn’t behave as expected

I’m using PowerShell v5.1. I have a question about “Return”. Shouldn’t “Return” stop script execution?

Get-CimInstance Win32_OperatingSystem | ForEach-Object {     "Exiting"     Return } "It doesn't"  ForEach ($  number in 1..2){     "Exiting"     Return } "It doesn't" 

Result is: Exiting => It doesn’t => Exiting

As you can see “Return” behaves differently inside “ForEach-Object” loop then inside “ForEach” loop. What am I missing? Thank you 🙂

How can I force android phone behave like a tablet, so that apps behave as if they are running on tablet?

I have three devices, two android phones and an android tablet. Below is there screen details:

  1. Phone 1: 5.96 inches, 1440 x 2560 pixels, 16:9 ratio (broader)
  2. Phone 2: 6.18 inches, 1080 x 2246 pixels, 18.7:9 ratio (taller)
  3. Tablet: 8.0 inches, 1200 x 1920 pixels, 16:10 ratio (broader)

On tablet, Microsoft OneNote is rendered like this:

enter image description here

But on Phone 2, it is rendered like this:

enter image description here

Surprisingly on phone 1 also it is rendered like a tablet, may because of broad aspect ratio and I feel this rendering is far more better for productivity and is more intuitive. How can I have phone 2 render like phone 1 / tablet?

How to make Mojave keyboard shortcuts behave like Windows/Linux

I’m not interested in mapping the windows keyboard keys to mac shortcuts, that doesn’t help, I just started in a new position and unfortunately I have to use a Mac, I don’t have the mental capacity to work with 3 different OSs ,I work with Windows & Linux at home, but MacOS has a completely different keyboard layout and shortcuts.

I’ve heard all about how it’s easier to get things done with macOS compared to windows/linux, but if I have to try multiple combinations to achieve something simple (like copy+paste, alt+tab, home/end) every time I switch to a different OS I don’t see that as productive as just takes twice as long to get things done.

So my questions is simple; is it possible to make macOS work with a windows keyboard and have all the same windows shortcuts work?