I'm working with two List and trying to use the contains().  I don't break the convention but still am getting false with my class usage for contains.  Items.class   class Items implements Comparable&lt;Items&gt; {      private String name;      private Date date;      private Lib.CLASSENUM type;      public getDate();     public setDate();      ....     public compareTo(Items o) {      ...     }   }   Test.class  List&lt;Items&gt; actualList; List&lt;Items&gt; expectedList;  public setup() {      actualList = new ArrayList&lt;&gt;();      expectedList = new ArrayList&lt;&gt;(); }  class Tests { @Test public void statusCheckValidatingRedLinePromotionItemsTest() {     //this just sets the two ArrayList to clear     clearProductMaps();     Items goodsItem = new Items();      goodsItem.setName("Product_A");     goodsItem.setPrice(4.10);     goodsItem.setStatus(Lib.CLASSENUM.ORIGINAL);     goodsItem.setDate(date);      actualList.add(goodsItem);     goodsItem = new Items();     goodsItem.settName("Product_A");     goodsItem.setPrice(3.70);     goodsItem.setStatus(Lib.CLASSENUM.PROMO);     date = calendar.getTime();     goodsItem.setDate(date);      actualList.add(goodsItem);     goodsItem = new Items();     goodsItem.setName("Product_A");     goodsItem.setPrice(3.70);     goodsItem.setDate(date);     goodsItem.setStatus(Lib.CLASSENUM.PROMO);     expectedList.add(goodsItem);      assertTrue(expectedGoods.get(0).contains(actualList.get(0)); }   The contains should be true, no? (o==null ? e==null : o.equals(e))
I want to be able to have LinkedList.contains() return true for a custom comparator.  Suppose that I have 1 LinkedList and 2 objects  LinkedList&lt;MyObject&gt; myList = new LinkedList&lt;MyObject&gt;();  MyObject a = new MyObject("HELLO"); MyObject b = new MyObject("HELLO");   Technicaly, both objects are identical in terms of comparison (MyObject implements Comparable)   ( a == b ) == true  however, when I do the following, myList does not return true for myList.contains(b)  myList.add(a) myList.contains(b) // == false   I think its because contains will check object reference and see that a and b are 2 distinct objects. Is there any way I can make it so I don't have to extend LinkedList to compare those objects?
Front suspension or full suspension mountain bike I downloaded the July 30th update for Pokemon Go and when I open the app I'm prompted to login, But once I login, it redirects me to this page on Cookies::     If I click "Done" in the top left, it prompts me to login again! I've tried reinstalling the game, restarting my phone, etc. I can't much enable Cookies on the inline Safari browser. It doesn't make sense, and cookies are on in Safari (because I don't use Safari and they're enabled by default).  How can I fix this? How to output a counter with leading zeros? I can output the value of a counter in a LaTeX document via:  \setcounter{mycounter}{1} \arabic{mycounter}   Which inserts a 1. But how do I format the output by, for example, adding a leading zero if mycounter is less than 10 in a way similar to what  lets you do by specifying %02d as your format string? What is the gradient of $f(x, y, z) = \sqrt{x^2+y^2+z^2}$? What is the gradient of $f(x, y, z) = \sqrt{x^2+y^2+z^2}$?  I know that $\nabla f = \left\langle\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z}\right\rangle$ or equivalently $\nabla f = \frac{\partial f}{\partial x}\mathbf{i} + \frac{\partial f}{\partial y}\mathbf{j} + \frac{\partial f}{\partial z}\mathbf{k}$.  Eventually, I am going to evaluate this gradient at a point and then dot it with some given unit vector to find a directional derivative. I think maybe what is troubling me is the radical in $f$. Will I have to use the chain rule in order to find the three partial derivatives?  I tried this:  $$\frac{\partial f}{\partial x} = \frac{1}{2}(x^2 + y^2 + z^2)^{-\frac{1}{2}}2x$$ $$= \frac{x}{\sqrt{x^2 + y^2 + z^2}}$$  That result looks ugly to me. However, if I did that partial derivative correctly, then I think I know what I am doing. How do I check the Database type in a Rails Migration? I pick a random subset $S$ of $\{1,\ldots,N\}$, and you have to guess what it is. After each guess $G$, I tell you the number of elements in $G \cap S$. How many guesses do you need? How to prove that $\lim\limits_{x\to0}\frac{\sin x}x=1$? How can one prove the statement $$\lim_{x\to 0}\frac{\sin x}x=1$$ without using the Taylor series of $\sin$, $\cos$ and $\tan$? Best would be a geometrical solution.  This is homework. In my math class, we are about to prove that $\sin$ is continuous. We found out, that proving the above statement is enough for proving the continuity of $\sin$, but I can't find out how. Any help is appreciated. Meaning of Conditional sentences with 'should' and 'happen to' I'm a bit familarized with conditional sentences. But the following sentences with 'should' and 'happen to' are quite confusing too me. They are:   If it should rain, I will stay at home. 2.If it should happen to rain, I'll stay at home   If it happens to rain, I'll stay at home.    What are the meaings of those sentences ? Do they all mean the same ? Thank you a lot in Advance for your answer. Is there a way to reorganize the fields/attributes in a data extension?  I've added some extra fields that relate to other fields in that extension.   I haven't found a way to regroup those fields. Connectivity, Path Connectivity and Differentiability I have two questions which pertain to differentiability, connectivity and path connectivity. Ocasionally, I will encounter an author who defines connectivity in the following way:   An open subset $U$ of $\mathbb{R}^n$ is said to be connected if and only if given two points $a$ and $b$ of $U$ there exists a differentiable mapping $\phi: \mathbb{R} \rightarrow U$ such that $\phi(0) = a$ and $\phi(1) = b$.   This particular example is from Edward's Advanced Calculus of Several Variables p 84. Now, this is obviously not the standard definition we learn from topology which has nothing to do with differentiability but rather whether there exists two nonempty open subsets that comprise a separation. It also seems to me that what the author is really defining what it means for a space to be "smoothly path connected", which of course implies connectivity and, it seems to me, considerably more.  My first question is: Is "smoothly path connected", as defined above actually equivalent to "connected", in the topological sense, in $\mathbb{R}^n$?  Next, in Vector Calculus by Baxandall and Liebeck on p 150 the authors state the existence of a continuous path $\alpha$ from the closed interval $[0,1]$ to an open subset $D$ of $\mathbb{R}^n$ where $\alpha (0) = a \in D$ and $\alpha(1) = b \in D$ guarantees the existence of a differentiable path with the same properties. This claim is stated without proof.   My second question is: Can someone provide a reference to a proof of the above claim or explain why it is so? Prove that the product of four consecutive positive integers plus one is a perfect square I need to prove the following, but I am not able to do it. This is not homework, nor something related to research, but rather something that came up in preparation for an exam.     If $n = 1 + m$, where $m$ is the product of four consecutive positive   integers, prove that $n$ is a perfect square.   Now since $m = p(p+1)(p+2)(p+3)$;     $p = 0, n = 1$ - Perfect Square      $p = 1, n = 25$ - Perfect Square      $p = 2, n = 121$ - Perfect Square   Is there any way to prove the above without induction? My approach was to expand $m = p(p+1)(p+2)(p+3)$ into a 4th degree equation, and then try proving that $n = m + 1$ is a perfect square, but I wasn't able to do it. Any idea if it is possible? What bends fabric of space-time? I know that mass can bend fabric of space-time, which causes gravity by making an object curve around a planet or star but is there anything else that can bend it?  Other energy sources, forces anything? I'm trying to make a map using the Javascript API.  I want to use my own basemap, but I can't find the most simple code to do this.  I always see something like this:    function init() {     map = new esri.Map("mapDiv", {       basemap: "satellite",       center: [-97.395, 37.537],       zoom: 11     });   But I don't want to use the ArcGIS online basemaps.  What is the code to make a map service I am hosting my basemap? I am looking for idioms or informal/slang/colloquial expression for some people that make you think that they are able of building a skyscraper, constructing a spaceship, playing the piano better than Mozart or something very fancy that requires remarkable skills, but when it comes to practice they prove to be completely inadequate. Why square the difference instead of taking the absolute value in standard deviation? I'm a simple minded Bayesian who feels comfortable in the cosy world of Bayes.   However, due to malevolent forces outside my control, I now have to do introductory graduate courses about the exotic and weird world of frequentist statistics. Some of these concepts seem very weird to me, and my teachers are not versed in Bayes, so I thought I'd get some help on the internet from those who understand both.   How would you explain the different concepts in frequentist statistics to a Bayesian who finds frequentism weird and uncomfortable?   For example, some things I already understand:   The maximum likelihood estimator $\text{argmax}_\theta \;p(D|\theta)$ is equal to the maximum posterior estimator $\text{argmax}_\theta \;p(\theta |D)$, if $p(\theta)$ is flat.  (not entirely sure about this one). If a certain estimator $\hat \theta$ is a sufficient statistic for a parameter $\theta$, and $p(\theta)$ is flat, then $p(\hat \theta|\theta)=c_1\cdot p(D|\theta)=c_1\cdot c_2\cdot p(\theta|D)$, i.e. the sampling distribution is equal to the likelihood function, and therefore equal to the posterior of the parameter given a flat prior.    Those are examples of explaining frequentist concepts to someone who understands Bayesian ones.   How would you similarly explain the other central concepts of frequentist statistics in terms a Bayesian can understand?  Specifically, I'm interested in the following questions:   What is the role of Mean Square Error? How does it relate to Bayesian loss functions? How does the criterion of "unbiasedness" relate to Bayesian criteria? I know that a Bayesian will not demand that its estimators are unbiased, but at the same time, a Bayesian would probably agree that an unbiased frequentist estimator is generally more desirable than a biased frequentist one (even though he would consider both to be inferior to the Bayesian estimator). So how does a Bayesian understand unbiasedness? If we have flat priors, do frequentist confidence intervals somehow coincide with Bayesian ones?  What in the name of Laplace is going on with specification tests like the $F$ test? Is this some degenerate special case of a Bayesian update on the distribution over model space?    More generally:  Is there some resource that explains frequentism to Bayesians?  Most of the books run the other way around: they explain Bayesianism to people who are experienced in frequentist statistics.     ps. I have looked, and while there are a lot of questions already about the difference between Bayesian and Frequentism, none explicitly explain Frequentism from the perspective of a Bayesian.   is related, but is not specifically about explaining Frequentist concepts to a Bayesian (more about justifying frequentist thinking in general).  Also, my point is not to bash frequentism. I really do want to understand it better I just read a book "Linear Algebra and Its Applications 4E" by David C. Lay. The book is (should be) LaTeX typeset. The matrix and equations are so nice, please see the following 3 examples:        It's so beautiful, so I want get the same effect inside my paper. Here is my code:   \usepackage{amsmath} \usepackage{colortbl} \newcommand\y{\cellcolor{clight2}} \definecolor{clight2}{RGB}{212, 237, 244}%  %%% \[A=\left[ \begin{array}{ccccc} \y 0 &amp; -3 &amp; -6 &amp; 4 &amp; 9 \\    -1 &amp; \y -2 &amp; -1 &amp; 3 &amp; 1 \\ -2 &amp; -3 &amp; 0 &amp; \y 3 &amp; -1 \\ 1 &amp; 4 &amp; 5 &amp; -9 &amp; -7      \end{array} \right]\]  \[A=\left[\begin{array}{cccccc} \rowcolor{clight2} 3 &amp; -9 &amp; 12 &amp; -9 &amp; 6 &amp; 15\\ 0 &amp; 2 &amp; -4 &amp; 4 &amp; 2 &amp; -6 \\ 0 &amp; 3 &amp; -6 &amp; 6 &amp; 4 &amp; -5 \end{array} \right]\]   And the result:     But how to add these arrows?? How to show this equality of $\rho(X,Y)$ Let I have $(S,\Sigma,\mu)$ be a probability space, then $X,Y \in \Sigma$. Define $\rho (X,Y)$ by $\rho (X,Y)$ = correlation between random variable $I_X$ and $I_Y$, where $I_X$ and $I_Y$ are the indicator function of $X$ and $Y$. Express $\rho (X,Y)$ in term of $\mu (X)$, $\mu (Y)$, $\mu(XY)$. Conclude that $\rho(X,Y)=0$, if and only if $X$ and $Y$ are independent.      How to show that: $$\rho(X,Y)= \frac{\mu(XY)\,\mu(X^cY^c)-\mu(XY^c)\,\mu(X^cY)}{(\mu(X) \,\mu(X^c)-\mu(Y) \,\mu(Y^c))^{1/2}};0&lt;\mu(X)&lt;1;\,0&lt;\mu(Y)&lt;1$$ How to identify a downvoting stalker Possible Duplicate:          Yeah I got a deranged stalker that keeps downvoting me.  Anyone know how going about identifying such individuals?  (I just got 4 all at the same time just after making a new post).      that was the question I originally asked. Please tell me, what is so wrong with it ? Suppose Alice chooses a random Prime $p$ and a random private Key $a \in \mathbb{Z}^*_p$. By accident, she also chooses a random number $g \in \mathbb{Z}^*_p$, which is not a generator of $\mathbb{Z}^*_p$ and therefore  $$\langle g\rangle \subset \mathbb{Z}^*_p$$  as opposed to $\langle g\rangle = \mathbb{Z}^*_p$, which would yield a valid key. Alice then computes $A \equiv g^a \pmod{p} $ and publishes the Tuple $(p,g,A)$ as her public key.  Bob now encrypts a message $M$ using Alices public key by computing  $$C_1 = g^b \pmod{p}$$ $$C_2 = M \cdot A^b \pmod{p}$$  Is it possible for an attacker (Eve) to distinguish a “real” ciphertext $(C_1,C_2)$ from a random ciphertext $(Z_1,Z_2) \stackrel{$}{\longleftarrow} \mathbb{Z}^*_p$ with significant advantage (say $Adv \geq \frac12$)?    Edit: I guess it should be enough to show, that the ciphertext cannot be random, if  $$\langle g \rangle \neq \langle C_1 \rangle \quad(\text{or $Z_1$, respectively})$$  But how can Eve check for this property efficiently? Can someone point me in the right direction here?    Edit: A real-world situation where this flaw occurred