Random generating I'm trying to make a randomly generated, say, square equations with integer coeffs. Like this 3x^2 - 6x + 8 = 0 But i want them to have integer roots too, so it would be way smarter to generate roots instead, and then produce coeffs. I came up with this  \pgfmathsetmacro{\x}{random(1,9)*((random(0,1)==0)?-1:1)} \pgfmathsetmacro{\y}{random(1,8)*((random(0,1)==0)?-1:1)} \pgfmathsetmacro{\a}{random(1,9)*((random(0,1)==0)?-1:1)} \pgfmathsetmacro{\b}{-\a*(\x+\y)} \pgfmathsetmacro{\c}{\a*\x*\y}  $$\a x^2 + \b x + \c = 0$$   Couple of problems here:   It looks like 8.0 instead of 8. When it makes negative numbers, i get smth like + -9.0x instead of -9x. Can i generate random signs too? I tried it, but with no success. Obviously it would be better to have x instead of 1x. Is there a way to remove 1 if it gives me 1? Well, the major idea was, of course, to generate linear and quadratic equations and inequalities (with parametres, for ex. $4ax^2 -5x + 6a = 0 $. Since i don't quite understand this code  can someone explain it or at least show how to remake it?   The ability to generate coefficients is important, since you can do all the things after that. Make stuff like $3sin(x)^2 - 5sinx + 8 = 0$
Random quadratic equation I would like to produce quadratic equation with integer coefficients.  Here's my code using pgfmath.  \documentclass{article} \usepackage{tikz} \pgfmathsetseed{\pdfuniformdeviate 10000000}  \begin{document} $\pgfmathdeclarerandomlist{signe}{{+}{-}}% \pgfmathrandomitem{\s}{signe}% \pgfmathparse{random(2)}% \pgfmathparse{ifthenelse(\pgfmathresult==1,"-"," ")}\pgfmathresult \pgfmathrandominteger{\a}{1}{6} \pgfmathparse{ifthenelse(\a==1," x^{2} ","\a x^{2}")}\pgfmathresult % coeff a \pgfmathdeclarerandomlist{lincoeff}{{}{2}{3}{4}{5}{6}} \pgfmathrandomitem{\b}{lincoeff}% \pgfmathrandomitem{\s'}{signe}% \pgfmathsetmacro{\e}{random(0,6)} \pgfmathparse{ifthenelse(\e==0," ", " \s' \b x ")}\pgfmathresult % coeff b \pgfmathrandominteger{\c}{0}{6} \pgfmathrandomitem{\s''}{signe}% \pgfmathparse{ifthenelse(\c==0,"","\s'' \c")}\pgfmathresult % coeff c =0$ \end{document}   It works but it seems to be not a good way, I had some pain with the x-coeficient and my solution looks complicated. I tried to use an ifthenelse inside an other ifthenelse but without success. Is there a better way ?
Getting always extra button on display .. 1 button dont have any ID I am having problem while looping.  I am always getting an extra button. Please help.   {this.state.items.map(myitems1 =&gt; {     return (        &lt;div key={myitems1.Id}&gt;            &lt;span&gt;{myitems1.Item_x0020_Name}&lt;/span&gt;            &lt;button onClick={e =&gt; this.dosometing(myitems1.Id)}&gt;Offline&lt;/button&gt;        &lt;/div&gt;     ); })}   I can see the collection has only three (3) values, But I am getting 4 buttons on screen.   Getting always extra What happens to the energy when waves perfectly cancel each other? if the curvature is constant and positive, then it is on the circunference I'm trying to prove that if $\alpha(t)=(x(t),y(t))$ is a $C^2$ regular curve $(\alpha'\neq0)$ with constant and positive curvature, then $\alpha$ is on the circunference and if $\alpha$ is the circunference, then its curvature is constant.  I solved the second part since $\alpha$ is the circunference, then $\alpha(t)=(r\cos\theta,r\sin\theta)$, so $|\alpha'(t)|=r$, I need help in the first part.  Thanks a lot. "Specially" vs "especially" When should I use specially and when especially? Classification of groups of order 12 I have a lot of difficulty understanding this proof we went over in class about classification of groups of order 12.  Let $G$ be a finite group of order $n=p^rm$ where $m \nshortmid p$.  Denote $Syl_p(G)$ as the set of all sylow p-subgroups, and $n_p(G)$ as the cardinality of $Syl_p(G)$.  (1) G has subgroups of order $p^r$. (How do we know this??)  (2) We know all sylow p-groups are conjugate and their number $n_p(G) | m$, by the 2nd and 3rd Sylow Theorems.  (3) We have that $n_p(G) \equiv 1(p). $  Then $n=12=2^2*3^1$ so $n_2(G)|3$ gives $n_2(G) \in \{1,3\}$ and $n_3(G)|4$ so $n_3(G) \in \{1,4\}$ since $2 \not\equiv 1(3)$.  Case 1: $n_3(G) = 4.$ Then the action of G by conjugation on $Syl_3(G)$ gives a homomorphism $f: G \rightarrow S_{Syl_3(G)} \simeq S_4$. $Ker(f)$ consists of $g \in G$ that normalizes all 3-Sylow subgroups. (Why?). Let $P_3$ be a 3-Sylow subgroup. Then the order of $P_3$ is 3. (I don't get that either), and $[G:N_G(P_3)] = 4.$ Thus $P_3 \subset N_G(P_3)$ gives $P_3 = N_G(P_3)$. (I'm lost here...) So $Ker(f) = \cap Syl_3(G) = \{e\}$ (the intersection of the sylow 3-subgroups is trivial. (How did we arrive here...) Thus we conclude that $G$ is isomorphic to a subgroup of $S_4$ of order 12.  To show $G$ is isomorphic to $A_4$, we have that $G$ has 8 elements of order 3: 4 3-sylow subgroups each has 3-1=2 elements of order 3. And $S_4$ has 8 3-cycles meaning f(G) contains all 3-cycles and hence the group they generate, which is $A_4$, so $A_4 \subset f(G)$. But since $|A_4| = 12 = |f(G)$ then $f(G) = A_4$ and $G \simeq A_4$. (Not understanding the first half of the proof, I do not get this part either).  Case 2: $n_3(G) = 1.$ The scope of the question is too large, I will need to post separately to understand the second half, unless the organizational rules of math.stackexchange would require that I post here. In that case, I'll edit the question.  I basically cannot follow the proof because it seems to skip too many steps; it would be helpful if anyone could elaborate case 1 with more reasoning so that I can follow it. Any help would be appreciated; I've spent hours trying to look up and decipher the proof but without any success. How do I get a Cron like scheduler in Python? Why copy constructor not invoked here How do the Goodman-Kruskal gamma and the Kendall tau or Spearman rho correlations compare? In my work, we are comparing predicted rankings versus true rankings for some sets of data. Up until recently, we've been using Kendall-Tau alone. A group working on a similar project suggested we try to use the  instead, and that they preferred it. I was wondering what the differences between the different rank correlation algorithms were.  The best I've found was , which claims Spearman is used in place of usual linear correlations, and that Kendall-Tau is less direct and more closely resembles Goodman-Kruskal Gamma. The data I'm working with doesn't seem to have any obvious linear correlations, and the data is heavily skewed and non-normal.  Also, Spearman generally reports higher correlation than Kendall-Tau for our data, and I was wondering what that says about the data specifically. I'm not a statistician, so some of the papers I'm reading on these things just seem like jargon to me, sorry. I am trying to prove the following statement.     If a field $K$ is not algebraically closed, then any $K$-variety $V\subset\mathbb{A}^n$ can be written as the zero set of a single polynomial in $K[X_1,X_2,...,X_n].$     Suppose $V=V(f_1,f_2,...,f_n)$, and I would want to find a polynomial $g\in K[X_1,X_2,...,X_n]$ such that $V=V(g)$.  I know that if I can find a polynomial $\phi\in K[X_1,X_2,...,X_n]$ whose only zero is $(0,0,...,0)$, then it is done, since we could take $g=\phi(f_1,f_2,...,f_n)$.  For $n=1$, then I would just choose $\phi=X$, but I do not even know how to proceed to the case $n=2$. Maybe we could choose an irreducible polynomial of degree $&gt;1$.  Any help will be appreciated. I have a question about MediaWiki formatting. Since this is similar to LaTeX questions, I figured it would have a nice, happy home on Stack Overflow. I'm not quite sure if it's programmer related enough though.  What does the community think? Objective-C and Swift URL encoding Unbiased estimator for geometric distribution parameter p How do Prestige Classes that advance spellcasting interact with racial spellcasting ability? Keen eye for detail (or details?) Which one is correct? "To have a keen eye for detail" or "To have a keen eye for details"? Regular expression to match non-ASCII characters? What is the easiest way to match non-ASCII characters in a regex? I would like to match all words individually in an input string, but the language may not be English, so I will need to match things like ü, ö, ß, and ñ. Also, this is in Javascript/jQuery, so any solution will need to apply to that. Does it look good to edit the question you're answering? I have a question about editing practices:  Does it look good to edit a question you have just answered?  For example: say I had just answered a question, then saw that the question had some minor formatting issues. Should I edit it? Does it turn up voters off when they see that I am answering a question I changed, possibly to better suit my answer? While browsing I have received notification on Google "Unusual traffic from your computer network"   We're sorry..."your computer or network may be sending automated queries. To protect our users, we can't process your request right now." See Google Help for more information.  Right now I am using the "Ubuntu 12.04" 32 bit version.  Any suggestion, why this is happens &amp; How it resolve?  Thank you for your worthy suggestion. The "Select your next badge" dialog box is not displaying correctly. It looks like this:    Freehand circles, as requested:    It seems to be an issue with box-sizing, because when it's content-box, it looks fine. I think the width and height rules for .popup-badges .all-badge-progress .badge-progress should be increased a little, for example:  .popup-badges .all-badge-progress .badge-progress {   width: 214px;   height: 96px; }   Tested on the latest Chrome and Firefox on Linux Mint. Is “are” a borrowed word? I read somewhere that English is the only language to have borrowed a form of its to be verb from another language. I want to say, if memory serves, that it was are that was borrowed from an early Scandinavian language. Is that so?  I know Old English had sind for one of their pronouns inflections of be, the same as in German.  But did it switch to are naturally from some other gentler evolution, or was it borrowed? Is it possible to detect 32 bit vs 64 bit in a bash script? I am writing a bash script to deal with some installations in an automated way... I have the possibility of getting one such program in 32 or 64 bit binary... is it possible to detect the machine architecture from bash so I can select the correct binary?  This will be for Ubuntu machines.