## Create a block in transactional emails to solve the {{if}} problem

I'm new to Magento. The problem I have is that I want to change the template of a transactional email.

It is basically a return, where the customer should receive another email if the return is "rejected" or "approved".

I tried to change the code with an if, but found that I can not compare strings with it. It only indicates if the variable is TRUE or FALSE

`{{if order.delivery_time == "10"}}` Can not.

I can not touch the code because it contains a comment stating that the file will be completely overwritten when the Magento version is updated.

So I thought about making a block for which I do not have a clear understanding of how to do that.

I think it's something …

`{{block type = "cms / block" block_id = "this_block" template = "cms / content.phtml"}}`

But my question is … What should I write in the template area? and what about the block ID section?

I'm sorry, but I'm a beginner.
If you give me a hint, I'm very grateful.

Many Thanks.

## Tensors – How to solve a linear transformation with a specific part of the input and output vectors?

We say $$v, w in mathbb {R} ^ n$$ and $$v = A w$$, from where $$A in M_ {n times n}$$, We receive all entries from $$A$$,

Well, if all the components are given to me $$w$$ It is very easy to find $$v$$and if I am given $$v$$ I can find $$w$$ by reversing $$A$$,

The question is, if I am given $$m$$ Components of $$v$$ and $$l$$ Components of $$w$$How can I find $$v, w$$ ?

I know that this is not possible for all sorts of inputs, but I want an algorithmic solution method that resembles finding the inverse of a matrix.

Previously, I solved problems like these by transforming them into systems of equations and then solving them on a case-by-case basis.

I want to do this with linear algebra or tensors.

* When I say components, I'm referring to the default base coordinates.

## How can you solve 5 equations that only consist of 3 undermined variables?

Suppose that there is a system of five trigonometric equations, among which are three indefinite parameters (eg, x, y, z). In principle, only the solutions of the three parameters that satisfy all five equations are permissible. I have tried to solve only three equations with "NSolve" and also with "FindRoot", of course the later command gives approximate solutions, NSolve took about 18 hours (the equations are too complicated in the expression) to solve the equation system, but the solutions do not satisfy the two remaining equations, indicating inconsistency. Can you please show me a way to solve the three equations, on the condition that the remaining two are fulfilled at the same time? That is, the code generates only the solutions that take all five equations into account. Any help in this regard will be of great help.

Thank you in advance.

## How do you find out which libraries you can use to solve a problem?

I've read that experienced software developers are more likely to use libraries than less experienced developers. But how do you learn about these libraries?

How do you even realize that they have a problem that could be solved by a library?

After learning the syntax of a language, do developers spend their time learning the most popular libraries for their specific language in Github? Add to her mental toolbox?

Or do you just have Google "X-Solve Library" while working on a project?

## Differential Equations – Solve a nonlinear eigenvalue problem

I tried to solve a nonlinear eigenvalue problem (in the form of an integro differential equation for $$u (x)$$in MMA,

$$uu ^ prime + u ^ { prime prime} + u ^ { prime prime prime} + frac {a} {2 pi} PV int _ {- pi} ^ pi u ^ { prime prime prime} (x_p) cot left ( frac {x-x_p} {2} right) mathrm {d} x_p-b (uu ^ prime) ^ prime + du ^ { prime prime prime} = cu ^ prime,$$

where derivatives in terms of $$x$$ are called prime numbers, PV is the principal value of the integral, since there is a singularity $$x = x_p$$. $$a$$. $$b$$, and $$d$$ are parameters and $$c$$ is the eigenvalue. For example, this problem should be solved with periodic constraints on a domain $$x in[-20,20]$$, I also realized that such problems could be solved with Newton iterations.

I have found here a similar problem, namely a linear PDE, which can be solved by performing a Fourier transform in $$x$$, But here the problem is nonlinear.

My questions are:

(1) I am not sure if I can draw certain phase levels, trajectories or pelvic charts of attractions. But at least we can draw a curve from $$c$$ in terms of the parameter $$a$$For example, by setting $$b = 1$$ and $$d = 0.5$$,

(2) Is it possible to determine the stability of the solution by observing the eigenvalues? $$c$$;

Here I try to implement with this code:

``````L = 20; b = 1; d = 1/2;
sys = {u[x]* D[u[u[u[u[x], x]+ D[u[u[u[u[x], {x, 2}]+ D[u[u[u[u[x], {x, 4}]+
a / (2 * L) * NIntegrate[
D[u[xp], {xp, 3}]* Cot[[Pi]* (x - xp) / (2 * L)], {xp, -L, x, L},
Method -> {"PrincipalValue"}]- b * D[u[u[u[u[x]* D[u[u[u[u[x], x], x]+
d * D[u[u[u[u[x], {x, 3}]== c * D[u[u[u[u[x], x]u[-L] == u[L]};

ParametricNDSolve[sys, u, {x, -L, L}, {a, c}]
``````

in which I use `Principal value` as the `NIntegrieren` dominate since the singularity $$x = x_p$$,

Any help is greatly appreciated. Thank you very much.

## magento2 – how did you solve this error during the installation of magento 2?

[ERROR] Magento Framework Setup Exception: The status for the same indexer already exists. in C: xampp htdocs magento vendor magento framework Setup Patch PatchApplier.php: 167 Stack trace: # 0 C: xampp htdocs magento setup src Magento Setup Model Installer. php (1002): Magento Framework Setup Patch PatchApplier-> applyDataPatch (& # 39; Magento_Indexer & # 39;) # 1 C: xampp htdocs magento setup src Magento Setup Model Installer. php (874): Magento Setup Model Installer-> handleDBSchemaData (Object (Magento Setup Modules DataSetup), & # 39; data & # 39 ;, Array) # 2 [internal function]: Magento Setup Model Installer-> installDataFixtures (Array) # 3 C: xampp htdocs magento setup src Magento Setup Model Installer.php (367): call_user_func_array (Array, Array) # 4 C: xampp htdocs magento setup src magento setup controller install.php (109): Magento setup model installer-> install (array) # 5 C: xampp htdocs magento Manufacturer zendframework zend-mvc src Controller AbstractActionController.php (84): Magento Setup Controller Install-> startAction () # 6 [internal function]: Zend Mvc Controller AbstractActionController-> onDispatch (Object (Zend Mvc MvcEvent)) # 7 C: xampp htdocs magento vendor zendframework zend-eventmanager src EventManager.php (490): call_user_func (Array, Object (Zend Mvc MvcEvent)) # 8 C: xampp htdocs magento vendor zendframework zend-eventmanager src EventManager.php (260): Zend EventManager EventManager-> triggerListeners (&) # 39; Object # (Zend Mvc MvcEvent), Object (Closure) # 9 C: xampp htdocs magento vendor zendframework zend-mvc src Controller AbstractController.php (118 ): Zend EventManager EventManager-> triggerEventUntil (Object (Closure), Object (Zend Mvc MvcEvent)) # 10 C: xampp htdocs magento vendor zendframework zend-mvc src DispatchListener.php ( 118): Zend Mvc Controller AbstractController-> dispatch (object (Zend Http PhpEnvironment Request), object (Zend Http PhpEnvironment Response)) # 11 [internal function]: Zend Mvc DispatchListener-> onDispatch (Object (Zend Mvc MvcEvent)) # 12 C: xampp htdocs magento vendor zendframework zend-eventmanager src EventManager.php (490): call_user_func (Array , Object (Zend Mvc MvcEvent) # 13 C: xampp htdocs magento vendor zendframework zend-eventmanager src EventManager.php (260): Zend EventManager EventManager-> triggerListeners (& # 39; dispatch & # 39 ;, Object (Zend Mvc MvcEvent), Object (Closure) # 14 C: xampp htdocs magento vendor zendframework zend-mvc src Application.php (340): Zend EventManager EventManager-> triggerEventUntil (Object (Closure), Object (Zend Mvc MvcEvent)) # 15 C: xampp htdocs magento setup index.php (39): Zend Mvc Application-> run () # 16 {main}

## Euclidean geometry – Look for a clever geometric approach to solve a surface problem.

In the acute $$Triangle ABC$$is the position of each point as shown $$F$$ is the center of $$BD$$. $$G$$ is the center of $$CE$$. $$F$$ is not on $$CE$$, and $$G$$ is not on $$BD$$, It is known that $$S _ { triangle AFG} = 1$$and the area of ​​the quadrangle $$BCDE$$ is received?

An inaccurate answer: Consider $$D$$. $$E$$ and $$A$$ It is easy to know that the area of ​​the quadrangle $$BCDE$$ is $$4$$,

Or: leave $$overrightarrow {AB} = vec {a}, overrightarrow {AC} = vec {b}, overrightarrow {AE} = lambda_1 vec {a}, overrightarrow {AD} = lambda_2 vec { b}, (0 < lambda_1, lambda_2 <1)$$, then
begin {align} S _ { triangle ABC} & = frac12 | vec {a} times vec {b} | \ S _ { triangle AED} & = frac12 lambda_1 lambda_2 | vec {a} times vec {b} | \ S_ {BCDE} & = S_ { Delta ABC} -S _ { Delta AED} \ & = frac {1} {2} left (1- lambda_ {1} lambda_ {2} right ) | vec {a} times vec {b} | end
$$because$$ $$overrightarrow {AF} = frac { vec {a} + lambda vec {b}} {2} quad overrightarrow {AG} = frac { lambda_ {1} vec {a} + vec {b}} {2}$$

$$so$$

begin {align} S _ { Delta A F G} & = frac {1} {2} left | overrightarrow {A F} times overrightarrow {A G} right | \ & = frac {1} {2} left | left ( vec {a} + lambda_ {2} vec {b} right) times left ( vec {a} _ {1} vec {a} + vec {b} right) right | \ & = frac {1} {8} left (1- lambda_ {1} lambda_ {2} right) | vec {a} times vec {b} | end

$$so$$ $$frac {S_ { triangle AFG}} {S_ {BCDE}} = frac {1} {4} Longrightarrow S_ {BCDE} = 4$$

Now I need a purely geometric approach to solve this problem, but I have no idea. Could someone help me? Many thanks.

## How do I solve a bullet-net collision?

I'm doing a rolling ball game and it seems my ballast collision code is not working properly.

Currently I have the following for the main loop (in terms of collision):

``````Calculate the player acceleration based on the input
Clamping speed to avoid clipping
Add speed to the position
Speed ​​up the speed
For every fixed object:
Check for and fix a collision for this object (as I do, see below)

If there were collisions:
Normalize Accumulated Normal Vector (see below)
Slow the ball to take the friction into account
``````

I've tried two main methods of resolving collisions, each with its own problems.

The first method:

``````For each triangle:
If there is a collision:
Correct the player's speed along the normal based on the distance
Normal accumulate for later friction calculations
If the speed is perpendicular to the surface above the threshold:
Rebound from the surface with damping factor
Otherwise, if you move to the surface instead of moving away:
Clear vertical speed
``````

The problem with this method is that the player rebounds irregularly when hitting a wall. The collision with which I test this looks like this (Player to Scale):

The second method is similar to the first one:

``````Set the collision distance memory to an arbitrarily high value
Set triangle index to -1 (to indicate that there are no collisions)

For each triangle:
If there is a collision:
Calculate the collision distance
If this distance is smaller than the accumulator value:
Set triangle index to current triangle
Set the collision distance memory to the current distance value

If the index is not -1 (there was a collision):
Correct the player's speed along the normal based on distance in the accumulator
Normal accumulate for later friction calculations
If the speed is perpendicular to the surface above the threshold:
Rebound from the surface with damping factor
Otherwise, if you move to the surface instead of moving away:
Clear vertical speed
``````

This fixes the bounce problem, but now I can go through surfaces that are supposed to be solid.

I have no idea where to go at this time. Hopefully someone can give an insight on what's going on.

[EDIT] I can add a video if that would help someone.

[EDIT 2] Here's a link to a video with the first method:

## Solve with the main clause: T (n) = T (n / 2) + n⋅log n and T (n) = T (n / 8) + 2.n

Could someone help me with these 2 questions?

I do not understand the case 3

First
T (n) = T (n / 2) + n log n

Second
T (n) = T (n / 8) + 2n

## Explain the failure of the solution method to solve the economic equation

Below is an economic equation consisting of Y, Ki, Alpha, G, Ki, K,
and two parameters Epsilon and Eta. The solution method of Mathematica
G calculates with respect to the other one
Variables, but can not be resolved to Ki (see below).
I've inserted a "Adopted Block" to help
Push a solution for Ki, but this addition does not
guide the solution.

What makes it difficult to solve Ki in this case?

A Solve method call for G works with a warning:

``````To solve[Y == [Alpha] Ki ((G (Ki / K) ^ (1 - [Epsilon])) / Ki) ^ [Eta], G]
``````

Solve :: ifun: Inverse functions are used by Solve, so some solutions may not be found. Use Reduce for complete solution information.

Here is an acceptable solution for G:

``````{{G-> K (Ki / K) ^ [Epsilon] (Y / ([Alpha] Ki)) ^ (1 / [Eta])}}
``````

A similar call to Ki fails.
What makes Ki uniquely difficult in this case?

``````Provided[{{YKiGK[{{YKiGK[{{YKiGK[{{YKiGK[Alpha] , [Epsilon], [Eta]}[Element]
Reals, 1> = [Eta] > = 0, 1> = [Epsilon] > = 0, K> 0, Y> 0,
Ki> 0, G> 0, [Alpha] > 0},
Simplify[
To solve[Y=[Y=[Y=[Y=[Alpha] Ki ((G (Ki / K) ^ (1 - [Epsilon])) / Ki) ^ [Eta], Ki]]]
``````

Solve :: nsmet: This system can not be solved with the methods available for Solve.