Want to print {act , dgo , act , dgo  ,act} but it printing address, please provide reason.  import java.util.Arrays;  public class PrintingAnagram {      /**      * @param args      */     public static void main(String[] args) {          String str[] = {"cat", "dog", "tac", "god","act" };          int index[]={0,1,2,3,4};          String words[]=str.clone();          SortByWords(words);          for(String s:words)             System.out.println(s);      }      public static void SortByWords(String a[])     {          for(int i=0;i&lt;a.length;i++)         {         char arr[]=a[i].toCharArray();         Arrays.sort(arr);         a[i]=arr.toString();         }     }  },
In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]
Suppose I am given a morphism of schemes $f: X \longrightarrow Y$ and suppose that for any point $y \in Y$, $\kappa(y)$ denotes the residue field. I would like to show that the fibered product $$X \times_{Y} \text{Spec}(\kappa(y))$$ is homeomorphic to the preimage $f^{-1}(y)$ in the induced topology.  The following is my attempt so far:  The question is obviously affine on the target, so without loss of generality we reduce to the case of a morphism $f: X \longrightarrow \text{Spec }A$. Then we have  $$ f^{-1}(\text{Spec }A) = \bigcup_{i \in I} \text{Spec }B_{i} $$ via morphisms $$ \phi_{i}: A \longrightarrow B_{i}. $$ We can then write, \begin{align*} f^{-1}(\text{Spec } A) \times_{\text{Spec } A}\text{Spec } \kappa(y) &amp;= \bigcup_{i \in I} \left( \text{Spec } B_{i} \times_{\text{Spec }A} \text{Spec }\kappa(y) \right) \\  &amp;= \bigcup_{i \in I} \text{Spec }  \left( B_{i} \otimes_{A} \kappa(y)  \right). \end{align*} Now let $\mathfrak{p}$ be the prime ideal of $A$ corresponding to the point $y \in \text{Spec } A$. Then $\kappa(y) = (A/ \mathfrak{p})_{\mathfrak{p}}$. Then for any of the $B$ (dropping the index for brevity), we have \begin{align*} B\otimes_{A} (A/ \mathfrak{p})_{\mathfrak{p}} &amp;\simeq B \otimes_{A} A / \mathfrak{p} \otimes_{A} A_{\mathfrak{p}} \\ &amp;\simeq B_{\mathfrak{p}} \otimes_{A} A / \mathfrak{p} \\ &amp; \simeq B_{\mathfrak{p}} / \mathfrak{p}B_{\mathfrak{p}} \end{align*}  Now the prime ideals in $B_{\mathfrak{p}} / \mathfrak{p}B_{\mathfrak{p}}$ correspond precisely to the prime ideals of $B_{\mathfrak{p}}$ containing $\mathfrak{p}B_{\mathfrak{p}}$. Further, the prime ideals of $B_{\mathfrak{p}}$ correspond precisely to the prime ideals of $B$ contained in $\phi(\mathfrak{p})B$. That is, we have \begin{align} \text{Spec }B_{\mathfrak{p}} &amp;= \{  \mathfrak{q} \subseteq B :  \phi^{-1}(\mathfrak{q})  \subseteq \mathfrak{p}  \} \\ &amp;=  \{ \mathfrak{q} \subseteq B : f(\mathfrak{\mathfrak{q}}) \subseteq \mathfrak{p}      \}. \end{align} Note that in the very last line we have abused notation slightly: There is not really any notion of being "inside" $\mathfrak{p}$ when it is being treated as a point in the scheme. So really we mean that $f(\mathfrak{q})$ is a point in the scheme whose corresponding prime ideal is a subset of $\mathfrak{p}$. Now as we said above, the prime ideals of $B_{\mathfrak{p}}/\mathfrak{p}B_{\mathfrak{p}}$ are the following $$ \text{Spec }(B_{\mathfrak{p}}/\mathfrak{p}B_{\mathfrak{p}}) = \{ \mathfrak{q} \subseteq B : f(\mathfrak{\mathfrak{q}}) \subseteq \mathfrak{p}      \text{ and } ???  \} $$ This is the point at which I get stuck. Ideally I would like to make some argument from the statement "Now the prime ideals in $B_{\mathfrak{p}}/\mathfrak{p}B_{\mathfrak{p}}$ correspond precisely to the prime ideals of $B_{\mathfrak{p}}$ containing $\mathfrak{p}B_{\mathfrak{p}}$" to conclude that the question marks are the condition $\mathfrak{p} \subseteq f(\mathfrak{q})$. Could someone point me in the right direction as to how to get this condition?   Is the proof up until this point correct? Different sources online seem to do this many different ways, so it's difficult for me to check. Slipstream Windows 7 + Service Pack 1 Why is TV remote's infrared wave shown by a camera as purple light, why not red or something else? How can I split a beamer bibliography across two slides? Why can't you use the keyword 'this' in a static method in .Net? I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}? How can I convert a vector to a cell array? I have an idea or subject that should have a Q&amp;A, and want to propose a new site. How can I do this?  Related: $ \frac{1}{a^{2} + b^{2} + 1} + \frac{1}{b^{2}+c^{2}+1} + \frac{1}{c^{2} + a^{2} + 1} \ge 1 $, prove $ab + bc + ca \le 3$ If $a,b,c$ real numbers such that $$ \frac{1}{a^{2} + b^{2} + 1} + \frac{1}{b^{2}+c^{2}+1} + \frac{1}{c^{2} + a^{2} + 1} \ge 1 $$,  prove that $ab + bc + ca \le 3$.     Attempt:  Assume that $a,b,c &gt; 0$.   $$ \frac{1}{a^{2} + b^{2} + 1} + \frac{1}{b^{2}+c^{2}+1} + \frac{1}{c^{2} + a^{2} + 1} \ge 1  $$ $$ \implies  (a^{2} + b^{2} + 1)(b^{2}+c^{2}+1) + (a^{2} + b^{2} + 1)(a^{2}+c^{2}+1) +  (a^{2} + c^{2} + 1)(b^{2}+c^{2}+1) \ge (a^{2} + b^{2} + 1)(b^{2}+c^{2}+1)(c^{2} + a^{2} + 1)$$  $$ \implies  ((ab)^{2} + (ac)^{2} + (bc)^{2} + a^{2} + 2 b^{2} + c^{2} + b^{4} + 1) + ((ab)^{2} + (ac)^{2} + (bc)^{2} + b^{2} + 2 a^{2} + c^{2} + a^{4} + 1) + ((ab)^{2} + (ac)^{2} + (bc)^{2} + a^{2} + 2 c^{2} + b^{2} + c^{4} + 1) \ge (a^{2} + b^{2} + 1)(b^{2}+c^{2}+1)(c^{2} + a^{2} + 1)$$  $$ \implies  3((ab)^{2} + (ac)^{2} + (bc)^{2}) + 4(a^{2} + b^{2} + c^{2}) + (a^{4}+b^{4}+c^{4}) + 3  \ge (a^{2} + b^{2} + 1)(b^{2}+c^{2}+1)(c^{2} + a^{2} + 1)$$  Next, notice  $$(a^{2} + b^{2} + 1)(b^{2}+c^{2}+1)(c^{2} + a^{2} + 1) = ((ab)^{2} + (ac)^{2} + (bc)^{2} + a^{2} + 2 b^{2} + c^{2} + b^{4} + 1)(c^{2} + a^{2} + 1) $$ $$ = (abc)^{2} + a^{2}c^{4} + b^{2}c^{4} + (ac)^{2} + 2(bc)^{2} + c^{4} + b^{4}c^{2} + c^{2} + a^{4} b^{2} + a^{4}c^{2} + (abc)^{2} + a^{4}  + 2(ab)^{2} + (ac)^{2} + b^{4}a^{2} + a^{2} +  (ab)^{2} + (ac)^{2} + (bc)^{2} + a^{2} + 2 b^{2} + c^{2} + b^{4} + 1 $$ $$ = 2(abc)^{2} + 3(ac)^{2} + 3(bc)^{2} + 3(ab)^{2} + c^{4}a^{2} + c^{4} b^{2} + b^{4}a^{2} + b^{4} c^{2} + a^{4}b^{2} + a^{4} c^{2} + a^{4} + b^{4} + c^{4} + 2(a^{2} + b^{2} + c^{2}) + 1  $$  So we have  $$ \frac{1}{a^{2} + b^{2} + 1} + \frac{1}{b^{2}+c^{2}+1} + \frac{1}{c^{2} + a^{2} + 1} \ge 1 $$ $$ \implies  2(a^{2} + b^{2} + c^{2}) +  3  \ge 2(abc)^{2}  + c^{4}a^{2} + c^{4} b^{2} + b^{4}a^{2} + b^{4} c^{2} + a^{4}b^{2} + a^{4} c^{2} + 1 $$ Variance of Normal Order Statistics Suppose we have $X_1, \cdots, X_n \overset{\textrm{i.i.d.}}{\sim} \mathcal{N}(0, 1)$ with $n &gt; 50$, and let $X_{(1)}, \cdots, X_{(n)}$ be the associated order statistics. Are there any references pointing to formulas that specify (or estimate) the variance of the $k^{\textrm{th}}$ order statistic, i.e. $\textrm{Var}(X_{(k)})$, for $1 \leq k \leq n$? I am looking for formulas can be explicitly evaluated without resorting back to numerical integration.  I have seen this question: , which attracted a number of answers on approximate formula for the mean of the $k^{\textrm{th}}$ order statistic, e.g. Blom (1958) (and modifications based on work by Harter (1961) and Elfving (1947)). Searching on Google also yields a number of work on the variance / standard deviation for the $k^\textrm{th}$ order statistics for small $n$, all of them opting for a computation/tabulation route. They are: Godwin(1949), Teichroew (1956), and Parrish (1992). I have also attempted to derive something myself following the method sketched by @probabilityislogic in , along the lines of: $$\textrm{Var}(X_{(k)}) = \int_{-\infty}^{\infty} \left(x-\mathbb{E}(X)\right)^2 \frac{n!}{(k-1)!(n-k)!} f_X(x)[1-F_X(x)]^{n-k}[F_X(x)]^{k-1}\;\textrm{d}x,$$ with lower case $f$ denoting the PDF of a r.v. $X$, and upper case $F$ denoting the CDF. Noting $x = F^{-1}(F_X(x))$ and using the substitution $u = F_X(x)$ (with corresponding r.v. in upper case $U$), we have: $$\textrm{Var}(X_{(k)}) = \int_{0}^{1} \left(F_X^{-1}(u) - \mathbb{E}\left(F_X^{-1}(U)\right)\right)^2\,\mathcal{B}(u | k, n-k+1) \; \textrm{d}u,$$ where $\mathcal{B}$ denotes the PDF of a beta distribution (not the beta function). This can be rewritten as the variance based on the beta distribution: $$\textrm{Var}(X_{(k)}) = \textrm{Var}_{\mathcal{B}(u | k, n-k+1)}\left(F_X^{-1}(u)\right).$$ Approximating the RHS using (the variance bit of the) delta method, we get: $$\textrm{Var}_{\mathcal{B}(u | k, n-k+1)}\left(F_X^{-1}(u)\right) \approx \textrm{Var}_{\mathcal{B}(u | k, n-k+1)}(U) \cdot \left[(F_X^{-1})'\left(\mathbb{E}_{\mathcal{B}(u | k, n-k+1)}(U)\right)\right]^2,$$ where the prime denotes the derivative. The first term of the product is standard result. For the second part, given $(F^{-1})'(\cdot)=\frac{1}{f(F^{-1})(\cdot)}$ (see e.g. ), we then have: $$\textrm{Var}_{\mathcal{B}(u | k, n-k+1)}\left(F_X^{-1}(u)\right) \approx \frac{k(n-k+1)}{(n+1)^2(n+2)} \frac{1}{\left(f\left(F^{-1}\left(\frac{k}{n+1}\right)\right)\right)^2}.$$ Substituting in the standard normal distribution ($\phi$ for PDF, $\Phi$ for CDF) and scaling it to the desired variance $\sigma^2$ we arrive at: $$\textrm{Var}(X_{(k)}) \approx \frac{k(n-k+1)}{(n+1)^2(n+2)} \frac{1}{\left(\phi\left(\Phi^{-1}\left(\frac{k}{n+1}\right)\right)\right)^2},$$ which we can throw in a $\sigma^2$ term in front if it is not a standard normal. But surely someone must have derived that somewhere (again I am looking for some references), and there is a high chance that I have gone off track somewhere above. Understand PAM and NSS In the last days I have set up some Linux system with LDAP authentication and everything works fine, but there's still something I can't really understand regarding NSS and PAM, also after a lot of research. Citing:  NSS allows administrators to specify a list of sources where authentication files, host names and other information will be stored and searched for  and  PAM is a set of libraries that provide a configurable authentication platform for applications and the underlying operating system  What I don't understand is how PAM and NSS work and interact together. In  the architecture is explained pretty well: I configure PAM to use pam_ldap for LDAP accounts and pam_unix for local accounts, then I configure nsswitch.conf to fetch information from local files and LDAP. If I have understood correctly LDAP is used twice: first by pam_ldap and then by NSS which is itself called from pam_unix. Is that right? Is LDAP really used twice? But why do I need to configure both NSS and PAM? My explanation is that PAM performs different tasks than NSS and it is used by other programs. But, then, it should be possible to use only NSS or only PAM, as I have read in . So I experimented a bit and I have first tried to delete LDAP from the nsswitch.conf (and the authentication stopped to work as if only pam_ldap is not enough to do the job). Then I re-enabled LDAP in NSS and I deleted it from the PAM configuration (this time everything worked fine, as if pam_ldap is useless and NSS is enough to authenticate a user). Is there anyone who can help me to clarify this? Many thanks in advance. UPDATE I've just tried something now. I removed again all the pam_ldap entries in all pam configuration fields and I have also removed shadow: ldap from nsswitch.conf. As now in all the system there are only the lines: passwd: ldap files and group: ldap files in nsswitch.conf. Well... the login with LDAP users works perfectly, those two lines (plus /etc/ldap.conf) are enough to configure LDAP auth. From my knowledge PAM in independent from NSS, but my tests showed it's not. So I ask myself is it possible to completely disable NSS and use only PAM? Suppose we have $x^2+4x+3=0$  We differentiate both sides to get $2x+4=0$.  So $x=-2$  But $(-2)^2+4(-2)+3=0$   $4-8+3=-1$ is not equal to $0$.  Which tells that we cannot differentiate equalities. But in many proofs, like in integral calculus, differentiating both sides occurs. So, where is the fallacy? How can I take a photo with everything in focus with my DSLR? If $f$ is a periodic function with $T = \pi$, does that mean that $F$ (a primitive of $f$) has the same period ? What about the inverse implication (periodic primitive implies periodic function) ? Change keyboard layout (English UK) on command line to English US How to get product recommendations Possible Duplicate:          I have a question of the form "what companies provide service X?"  I checked meta, and apparently such questions are highly discouraged on all Stack Exchange sites. Which is fine, but it obviously raises the meta-question: Where can I ask my question?  (In particular, I know that there are people hanging out on Stack Overflow who have probably needed the same service, so if an answer exists, they possess it...)  Edit: I should perhaps point out that the service I'm looking for is rather specific and slightly obscure. Otherwise, yeah, this would be a 10-second exercise with Google. Why doesn't my screen lock in XFCE? I saw this keyword for the first time and I was wondering if someone could explain to me what it does.   What is the continue keyword? How does it work? When is it used? Singular or plural following a list Can anyone tell me if I should use inspire or inspires in this phrase?     An extraordinary leader whose vision, values, integrity and boundless curiosity inspires all who follow in his footsteps. Can graduated Stack Exchange sites get closed too?