LateX equation issue - use of brackets? - formatting

I am struggling with this equation:
\begin{equation}\label{planewave}
\begin{aligned}
\textbf{E} \quad & = \quad \textbf{u}_{1} E_{0} e^{i(wt-\textbf{k\cdot r})} \\[5pt]
\end{aligned}
\end{equation}
Somehow it's not compiling even though I don't se any obvious error in the bracketing!
Thanks for the help!

Fixed! Posting here in case it can be useful to anyone in the future! :)
\begin{equation}\label{planewave}
\begin{aligned}
\textbf{E} \quad & = \quad \textbf{u}_{1} E_{0} e^{i(\omega t-\textbf{k} \cdot \textbf{r})} \\[5pt]
\end{aligned}
\end{equation}

Related

How to ignore nodes with It values when comparing two xmls with XMLUnit2

Comparing two xml files in soapui using groovy with XMLUnit2, Have some weird cases which are different in both files, but are acceptable. So have to ignore/skip those.
ResXML1:
<alpha:Errors>
<alpha:Error ShortText="SHiff" Type="11">Generic error occured.</alpha:Error>
<alpha:Error ShortText="SHiff" Type="12">Generic error occured.</alpha:Error>
</alpha:Errors>
<ShiftAttributes>
<ShiftAttribute ShiftAttributeCode="41"/>
<ShiftAttribute ShiftAttributeCode="17"/>
</ShiftAttributes>
<alpha:PriceInfo AgeQualifyingCode="10" Amount="19999.00" DiscountTypes="3" AMZAmount="225.00" NetAmount="19999.00" MCH="1" ValueAddAmount="150.00"/>
ResXML2:
<alpha:Warnings>
<alpha:Warning ShortText="SHiff" Type="11">Generic error occurred.</alpha:Warning>
</alpha:Warnings>
<ShiftAttributes>
<ShiftAttribute ShiftAttributeCode="17"/>
<ShiftAttribute ShiftAttributeCode="41"/>
</ShiftAttributes>
<alpha:PriceInfo AgeQualifyingCode="10" Amount="19999.0" DiscountTypes="3" AMZAmount="225.0" NetAmount="19999.0" MCH="1" ValueAddAmount="150.0"/>
If anyone have any idea, please help me in below conditions.
1) How to ignore child attribute order? tried different nodematchers(byXpath, byNameandText etc..), but no luck.
<ShiftAttribute ShiftAttributeCode="41"/>
<ShiftAttribute ShiftAttributeCode="17"/>
2) How to ignore decimal value, 100.0 & 100.00. Tried to use BigDecimalElementDifferenceEvaluator, but cannot able to complete in soapui. If we have any easy method please help me?
Found solution for first part of the above question
diff = DiffBuilder.compare(ResXML1).withTest(ResXML2)
.withNodeMatcher(
new DefaultNodeMatcher(
ElementSelectors.conditionalBuilder()
.whenElementIsNamed("ShiftAttribute")
.thenUse( ElementSelectors.byNameAndAttributes("ShiftAttributeCode"))
.elseUse(ElementSelectors.byName)
.build()
)
).build();

Matplotlib - Draw H and V line by specifying X or Y value on a plot

I was wondering today about how finding a specific value on a plot and drawing the right line that goes with. I used to do that on an old chart library, and I was wondering that perhaps this functionnality exist but I don't know how to find it.
The result should look like this: https://miro.medium.com/max/1070/1*Ckhi9soE9Lx2lIf9tPVLMQ.png
To provide some context, I'm doing a PCA over my data, and I would like to point out some thresholds at 97.5, 99 and 99.5% of explained cumuled variance.
Have a great day!
EDIT:
See Answer
As solved by ImportanceOfBeingErnest, here is the code:
whole_pca = PCA().fit(np.array(inputs['Scale'].tolist()))
cumul = np.cumsum(np.round(whole_pca.explained_variance_ratio_, decimals=3)*100)
over_95 = np.argmax(cumul>95)
over_99 = np.argmax(cumul>99)
over_995 = np.argmax(cumul>99.5)
plt.plot(cumul)
plt.plot([0,over_95,over_95], [95,95,0])
plt.plot([0,over_99,over_99], [99,99,0])
plt.plot([0,over_995,over_995], [99.5,99.5,0])
plt.xlim(left=0)
plt.ylim(bottom=80)
plt.ylabel('% Variance Explained')
plt.xlabel('# of Features')
plt.title('PCA Analysis')
Result in:
Thank you!

Rally API Fetch All Features under specific Epic

Hi I cannot find this anywhere and it seems so easy.
I am trying to get All the Features under specific Epic with Alteryx.
I am using this to get them all, but I want to make more precise.
https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/feature?pagesize=2000
https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/....
Can anyone help please?
Got another solution but it is still not perfect:
First I am getting SubEpics
https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/subepic?pagesize=2000&&start=1&query=(Parent.FormattedID = E101)
And then Features:
https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/feature?pagesize=2000&query=(((Parent.FormattedID = SE104) OR (Parent.FormattedID = SE101)) OR ((Parent.FormattedID = 102) OR (Parent.FormattedID = 103)))
OK! Correct answer for Feature is :) Got it with help from SAGI GABAY from CA:
https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/feature?pagesize=2000&&start=1&query=(Parent.Parent.FormattedID
= E101)
I have also asked about the User Stories level and going this way (Parent.Parent.Parent.FormattedID) doesn't work anymore but you can do this:
https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?pagesize=2000&&start=1&query=(Feature.Parent.FormattedID = SE101)

Rally Excel Plugin Queries

I am working with the Rally/Excel plug-in and setting up queries/filters for our various delivery teams. One of the teams is named "Agency / L&C". The & is causing me all sorts of problems that I cannot seem to get past. The current filter is:
((Release.Name = "2013 November") AND (Project.Name = "Agency / L&C"))
When I execute the query I get this error:
Query failed due to errors:
Could not parse: Cannot parse expression "((Release.Name = "2013 November") AND (Project.Name = "Agency / L" as a query
I have tried several things, ' before and after, '' before and after, %, " and \ and nothing seems to be making it register the & as text.
Thanks for the help
This is an educated guess but I would think the problem arises from the ampersand not being escaped before the request is made to the to the API. You might try changing it to "%26" (the HTML code for "&") and see what you get.

Sanitize help on Raw sql

I have some complex queries in my plugin which require me to use the ->query() and not the ->find() methods.
I couldn't understand how to sanitize the raw sql so I guessed someone here can guide me.
So the first step is to include the App:import("sanitize"); before the declaration of the class.
Now let's say I have this :
$query = $this->Mytable->query("SELECT * FROM mytable WHERE " . $WHERECLAUSE . ";");
Can some one help me out in sanitizing my query as i got completely lost in the cookbook.
Thanks for your help, it is very much appreciated.
Use this: Sanitize::clean($query, $options)
Sanitize::clean is used for values / whole arrays such as $this->data.
$WHERECLAUSE = Sanitize::clean($whereclause, array('escape'));
$query = $this->Mytable->query("SELECT * FROM mytable WHERE " . $WHERECLAUSE . ";");
That'll do the trick. array('escape') is used for SQL statements.