$$(a+1)(a+2b)≤\frac{-1}{2}$$ I was solving a problem about quadratic equations and I needed to find the value of $a$ and $b$.  I used the discriminant to get an inequality and I simplified it to get the above inequality.  How to solve this?
$$ x^2+2(1+a)x+(3a^2+4ab+4b^2+2)=0$$  I tried to make an inequality using the discriminant and I simplified it to get $$a^2+2ab+b^2+\frac{1}{2}≤0$$  But I don't know how to solve this.
I have 10 years of daily returns data for 28 different currencies. I wish to extract the first principal component, but rather than operate PCA on the whole 10 years, I want to rollapply a 2 year window, because the currencies' behaviours evolve and so I wish to reflect this. However I have a major problem, that is that both the princomp() and prcomp() functions will often jump from positive to negative loadings in adjacent PCA analyses (ie 1 day apart). Have a look at the loading chart for the EUR currency:    Clearly I can't use this because adjacent loadings will jump from positive to negative, so my series which uses them will be erroneous. Now take a look at the absolute value of the EUR currency loading:    The problem is of course that I still cannot use this because you can see from the top chart that the loading does go from negative to positive and back at times, a characteristic which I need to preserve.   Is there any way I can get around this problem? Can I force the eigenvector orientation to always be the same in adjacent PCAs?   By the way this problem also occurs with the FactoMineR PCA() function. The code for the rollapply is here:  rollapply(retmat, windowl, function(x) summary(princomp(x))$loadings[, 1], by.column = FALSE, align = "right") -&gt; princomproll I wonder about the Adjustments to Cost Basis after a wash sale occur. Considering this  ( from marketwatch.com) where someone: On 1 Dec, 2018 used an amount of money in his account to buy 100 shares of XYZ Co., for $2000 (to make it simple , let's say 1 Feb, 2019 to turn all the transactions into the same year) On 1 Apr, 2019 he sells the shares for $1200, and incurred a loss of 800$. On 10 Apr, 2019 he bought back 100 shares for $1300, and had a wash sale. The 800$ loss gets added to the cost basis of this transaction( and the basis becomes $2100) Now, If on 13 Apr 2019, he sold 100 shares for $1400; I'm pretty sure that the realized Gain/Loss record of this transaction would show something like this: &quot; XYZ Co. shares  100 , Proceeds $1400 , Cost basis  $2100(adjusted), Short-term Gain/Loss  -$700 &quot;. So, even though the Gain/Loss shows a negative number, he still got an actual profit of $100 from this sale, right? PHP: How do I loop through every XML file in a directory? What is the ultimate postal code and zip regex? I'm looking for the ultimate postal code and zip code regex. I'm looking for something that will cover most (hopefully all) of the world. Alternative to Adobe Illustrator Can you recommend a good alternative to Adobe Illustrator?   I am learning vector based graphic design, but I am not ready to make such a large investment as to purchase a copy of Adobe Illustrator. Also, Illustrator might be a little more power than I need at the moment. I am using a Macintosh. prove $\sum_{i=1}^{n}(x_i-\bar{x})^2\lt\sum_{i=1}^{n}(x_i-a)^2$ How do we prove that $$ \sum_{i=1}^{n}(x_i-\bar{x})^2\lt\sum_{i=1}^{n}(x_i-a)^2 $$  where $a$ is any value other than $\bar{x}$, the arithmetic mean.  My Attempt: $$ \sum_{i=1}^{n}(x_i^2-2x_i\bar{x}+\bar{x}^2)\lt\sum_{i=1}^{n}(x_i^2-2x_ia+a^2)\\\sum_{i=1}^{n}x_i^2-2\bar{x}\sum_{i=1}^{n}x_i+\sum_{i=1}^{n}\bar{x}^2\lt\sum_{i=1}^{n}x_i^2-2a\sum_{i=1}^{n}x_i+\sum_{i=1}^{n}a^2\\-2\bar{x}.n\bar{x}+n.\bar{x}^2\lt-2a.n\bar{x}+n.a^2\\-2\bar{x}^2+\bar{x}^2\lt-2a\bar{x}+a^2\\-\bar{x}^2\lt-2a\bar{x}+a^2 $$ But how do I proceed further or is there any better way ? Say, for example, you and a group of people were all sailing out in the ocean and something happens...then you say,  "I guess we are all in the same boat"  You are literally in the same boat with everyone else, and your current situation is the same as everyone else.  Now such a phrase can be applied literally and figuratively. I was wondering if there was a word that would mean both literally and figuratively. I know this is a tad bit of an oxymoron, but I was curious to see if there was such an "all encompassing" word for this. Escape string for use in Javascript regex Example: I type man ls, than I want to get man only.   By using !! I can get man ls but how do I get man? QtCreator and Command Line Arguments Martingale that is not a Markov process Why is "If ψ ∈ Γ then the sequent (Γ ⊢ ψ) is correct" true? In Chiswell and Hodges Mathematical Logic the authors define a sequent as such      "A sequent is an expression   (Γ ⊢ ψ) (or Γ ⊢ ψ when there is no ambiguity)   where ψ is a statement (the conclusion of the sequent) and Γ is a set of statements (the assumptions of the sequent) ...There is a proof whose conclusion is ψ and whose undischarged assumptions are all in the set Γ.".   They then go on to provide the axiom as follows:     Sequent Rule (Axiom Rule) If ψ ∈ Γ then the sequent (Γ ⊢ ψ) is correct.   Upon further reading about what exactly it means to be a sequent  I understand that for $\psi$ to be satisfied or "correct", every element of   $\Gamma$ must be true as their all linked by AND conjunctions.    What confuses me is that suppose that there is an element in $\Gamma$ which is false then the whole antecedent is false according to the wikipedia definition by conjunction and then even though $\psi$ exists and is true in $\Gamma$ ultimately $\psi$ would be false. Could someone please explain to me and help clarify how the axiom and the definition can both be true. Thank you for all of your help. How can I check the actual size used in an NTFS directory with many hardlinks? On a Win7 NTFS volume, I'm using cwrsync which supports --link-dest correctly to create "snapshot" type backups. So I have:  z:\backups\2010-11-28\cygdrive\c\Users\... z:\backups\2010-12-02\cygdrive\c\Users\...   The content of 2010-12-02 is mostly hardlinks back to files in the 2010-11-28 directory, but there are a few new or changed files only in 2010-12-02. On linux, the 'du' utility will tell me the actual size taken by each incremental snapshot. On Windows, explorer and du under cygwin are both fooled by hardlinks and shows 2010-12-02 taking up a little more space than 2010-11-28.   Is there a Windows utility that will show the correct space acutally used? How to disable USB storage device support I want to disable a particular USB storage device (a sandisk flash drive). I read somewhere that you can use the .config file. How do i use it to disable that? How do I check if a file exists in Java? How to Remove URLs from Google Search Engine Post Feedback link is broken I first noticed this a while back. But it has yet to resolve itself.  When I click on the  in the 10k tools, it hangs for a while.Then it gives me an error message: Taxonomy count per Post type Below is the code i use to output the post tag (taxonomy) count/number. I want to be able to split the count based on post type that the taxonomy features in (rather than the total number).   So i have the default "post" Post type, aswell as "blogs", &amp; "pics". I want the taxonomy count to display something like: x posts | x blogs | x Pics              &lt;?php             $tags = get_tags( array('name__like' =&gt; "a", 'order' =&gt; 'ASC') );             foreach ( (array) $tags as $tag ) { ?&gt;                 &lt;li&gt;                                                 &lt;a href="&lt;?php echo get_tag_link( $tag-&gt;term_id ) ?&gt;"&gt;                                   &lt;span class="name"&gt;&lt;?php echo $tag-&gt;name ?&gt;&lt;/span&gt;                         &lt;span class="number"&gt;&lt;?php echo $tag-&gt;count ?&gt;&lt;/span&gt;                     &lt;/a&gt;                 &lt;/li&gt;             &lt;?php } ?&gt; The following question is on my homework assignment that I cannot figure out:     Let U and V be independent random variables, each having a normal distribution with mean zero and variance one. Find the moment generating function of the random variable W = UV .   I have looked around online, and cannot find an answer to this question. In fact, the only answers I can find that even relate to the product of standard normal random variables are using techniques that we never covered in my class. We covered in class how to find the MGF for linear combinations of random variables, by W isn't linear, its a product of two normals. So that technique won't work.   What am I supposed to do? I am completely at a loss. I have tried multiplying the MGFs of U and V together, but that leaves me with something ugly that I can't reduce. Past participle after noun: "proposed cost" vs. "cost proposed" I have the following two examples:        Our proposed cost is expensive.   Our cost proposed is expensive.      Is there any difference between them? Or is the second sentence wrong?