I am trying to understand Supplier interface. I understand that it can return an object if we invoke its get() method. However, in the following example:  public class SupplierExample {      public static void main(String[] args) {         Supplier&lt;String&gt; s = new Supplier&lt;String&gt;() {             public String get() {                 return "test";             }         };          System.out.println(s.get());     } }   I am not able to understand how we can instantiate an object (s in above exaple) from an interface. Please advise.
What is the use of anonymous classes in Java? Can we say that usage of anonymous class is one of the advantages of Java?
Why use foreign keys if cascade action is not need? $P$ is a prime ideal of $R$ iff $R/P$ is an integral domain. : $P≠R$ Here is the theorem and proof in my textbook.     Thm.  Let $P$ be an ideal of a commutative ring $R$ with identity $1$.  Then $P$ is a prime ideal of $R$ if and only if $R/P$ is an integral domain.   Proof.   Suppose that $P$ is a prime ideal of a commutative ring $R$ with $1$.  Then $P$≠$R$ implies $1+P≠0+P$. Hence $R/P$ is a commutative ring $R$ with identity.  Assume that $(a+P)(b+P)=0+P$.  Then $ab+P=0+P$ and $ab∈P$.  By the definition of a prime ideal P we get $a∈P$ or $b∈P$.  That is, $a+P=0+P$ or $b+P=0+P$.  Thus $R/P$ is an integral domain.   Conversely, if $R/P$ is an integral domain, then $1+P≠0+P$ and $R/P$ is a commutative ring $R$ which has no zero divisors.  Hence $P≠R$.  Assume $ab∈P$.  Then $ab+P=0+P$ and $(a+P)(b+P)=0+P$.  Since $R/P$ is an integral domain, we get $a+P=0+P$ or $b+P=0+P$.  So $a∈P$ or $b∈P$.  Thus $P$ is a prime ideal.    I am having problems understanding proof with "Conversely, if $R/P$ is an integral domain, then $1+P≠0+P$.".  I know that $R/P$ has an identity. (cause it is ID)  But, why doesn't "$P$" have an identity?  Isn't there a case $P=R$?  Please help me understanding. I think $P≠R$ should be with condition of Thm..  Thank you in advance. MySQL Hashing Function Implementation I know that php has md5(), sha1(), and the hash() functions, but I want to create a hash using the MySQL PASSWORD() function.  So far, the only way I can think of is to just query the server, but I want a function (preferably in php or Perl) that will do the same thing without querying MySQL at all.  For example:  MySQL hash -> 464bb2cb3cf18b66  MySQL5 hash -> *01D01F5CA7CA8BA771E03F4AC55EC73C11EFA229  Thanks! Solve differential equation:  $x'=x^2- \frac{2}{t^2}$  Maybe is it sth connected with homogeneous equation? I have no idea how to solve it. What is batch size in neural network? I'm using Python Keras package for neural network. This is the . Is batch_size equals to number of test samples? From Wikipedia we have  information:     However, in other cases, evaluating the sum-gradient may require   expensive evaluations of the gradients from all summand functions.   When the training set is enormous and no simple formulas exist,   evaluating the sums of gradients becomes very expensive, because   evaluating the gradient requires evaluating all the summand functions'   gradients. To economize on the computational cost at every iteration,   stochastic gradient descent samples a subset of summand functions at   every step. This is very effective in the case of large-scale machine   learning problems.   Above information is describing test data? Is this same as batch_size in keras (Number of samples per gradient update)? What does 'per unit frequency' refer to? We were discussing Kirchoff's theorem on blackbody radiation in class today and the equation was: $$e_{f}= J(f,T)$$  $e_f$ was defined as power per unit area per unit frequency. What does per unit frequency refer to here? I know what per unit time means but don't understand 'per unit frequency'. Finding the limit of $x_1=0 , x_{n+1}=\frac{1}{1+x_n}$ Inverse of Heine–Cantor theorem Is there a non written rule to which person to use in the PhD thesis, 5 years of using "We" in the papers have brought me to the innate necessity to do it every time I describe something.  Recently, though, one of my lab-mates told me that I should use I, since it is your work, if the thesis were co-written, then it would be a different story.  Is there any standard in your universities, or do you have any preferred practice. Incorrect plot using pgfplots (trigonometric functions like cos, sin and tan) Have we managed to make a perfect vacuum? Have we managed to make a device without any atom inside it on earth? I was reading about vacuum , and I found in the examples part  that even on the best man made vacuum devices, there are still millions of "molecules per $cm^3$". So my other question here is, what are these molecules and what is the mass of them? Finding determinant of matrix without expanding I'd really like your help proving:  $(A\rightarrow B),(A\rightarrow C)\rightarrow B,  \mapsto_{HPC} B $  Where $HPC$ is the Hilbert's system proof which contains the following relevant axioms:   $A\rightarrow(B \rightarrow A)$ $(A\rightarrow(B\rightarrow C)) \to ((A\rightarrow B)\rightarrow(A\rightarrow C))$ $(A\rightarrow B)\rightarrow ((A\rightarrow\bar{B})\rightarrow \bar{A})$ $\bar{\bar{A}} \rightarrow A$   In addition tried to use these following lemmas: $\bar{A} \rightarrow (A \rightarrow C) $ and $(A\rightarrow B)\rightarrow (\bar{B} \rightarrow \bar{A})$.  Any suggestions? I want to run a command line that opens a new chrome window with another profile. I tested the following commands: Preconditions:  I have two profiles: Profile 1 and Profile 2  Chrome is already running with Profile 1   open -a &quot;Google Chrome.app&quot; --args --profile-directory=&quot;Profile 2&quot; The above command does nothing other than bringing focus to the currently running chrome with Profile 1 I also tried: open -a &quot;Google Chrome.app&quot; --args --profile-directory=&quot;Profile 2&quot; --new-window The effect is the same. I want to run a command line that opens a new chrome window with Profile 2 while there is already a Chrome window running with Profile 1 Java is one of my programming languages of choice.  I always run into the problem though of distributing my application to end-users.  Giving a user a JAR is not always as user friendly as I would like and using Java WebStart requires that I maintain a web server.  What's the best way to distribute a Java application?  What if the Java application needs to install artifacts to the user's computer?  Are there any good Java installation/packaging systems out there? Why was Edo Tensei Madara young, when he had died at an old age? From Naruto manga and anime, I know that Uchiha Madara died as an old person after he helped Uchiha Obito.   But it was bit weird for me, when Kabuto summoned Uchiha Madara-sama with Edo Tensei, Madara was a younger person.  Again, when Chiyo was summoned, she was older as when she died.  How can it be possible? Existence of minimal prime ideal contained in given prime ideal and containing a given subset Let $R$ be a unital commutative ring, $P$ $\subseteq$ $R$ a prime ideal, $X\subseteq P$ a subset. Show there exists a minimal (inclusion minimal) prime ideal contained in $P$ which contains $X$.   My approach: Let $\langle X\rangle$ be the ideal generated by $X$. $P^c$ is a multiplicative set, as $P$ is prime. $\langle X\rangle\subseteq P\subseteq R$ and $P^c\cap\langle X\rangle=\emptyset $ so by Zorn's lemma there exist prime ideal $I_1$ satisfying $\langle X\rangle\subseteq I_1\subseteq P$. As $I_1$ is prime, it's complement is a multiplicative subset which does not intersect $\langle X\rangle$, hence I can find prime ideal $I_2$ satisfying $\langle X\rangle\subseteq I_2 \subseteq I_1$ and so on... I've got an infinite descending chain of prime ideals and I can't be sure that the process will stop.  Hints will be appreciated, thank you.   Edit: Can I conclude that every prime ideal contains a minimal prime ideal? Is there a utility to replace one block type with another within a region? I'd like to be able to select a region (either with a graphical utility or command line) and be able to switch one block type with another, e.g. change all cobblestone in the region to stone. Does a program/mod exist that can do this? My textbook explains the proof, which I don't understand:  "Consider two bases $v_1...v_p$ and $w_1...w_q$ of V. Since the vectors $v$ are linearly independent and the vectors $w$ span V..."  How exactly does $w$ span V?   The book then says the same for vectors $v$, that $v$ spans V and hence $p=q$, but I don't really understand how you can assume that given two sets of vectors that are basis, one set must span V. What is the "rootless" feature in El Capitan, really? I have just learned about the "Rootless" feature in El Capitan, and I am hearing things like "There is no root user", "Nothing can modify /System" and "The world will end because we can't get root".  What is the "Rootless" feature of El Capitan at a technical level? What does it actually mean for the user experience and the developer experience? Will sudo -s still work, and, if so, how will the experience of using a shell as root change?