After I compile my code, I see this as the output:  [I@7852e922  I'm assuming I need to use Array.toString after some searching but when I  I seem to have other errors so I'm assuming I'm not putting it in the right place.  Here is my code:  public class TwoSum      {         static int[] arraynums = new int[]{2, 7, 11, 15};         static int target = 9;          public static void main(String args[])         {             //TwoSum name = new TwoSum();             //name.twoSums(arraynums, target);             System.out.println(twoSums(arraynums, target));         }             public static int[] twoSums(int[] nums, int target)              {                 int sum = 0;                  for (int i = 0; i &lt; nums.length; i++)                 {                     for (int j = 0; j &lt; nums.length; j++)                     {                            sum = nums[i] + nums[j];                         if (sum == target)                         {                             //System.out.println(i + " " + j);                             return new int[] {i,j};                         }                      }                 }                 return new int[] {};             }     }
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 $2$x$2$ matrix $A=$ \begin{pmatrix} a &amp; b \\ c &amp; d \end{pmatrix}  And an initial vector $x_n$ = \begin{pmatrix} x_0 \\ y_0\end{pmatrix}.  Under repeated iteration $x_{n+1} = Ax_n$, we find that $x_{n+1}$ converges to a line in the direction of the $eigenvector$  of $A$ of the form $X$= $[u,mu]$ where $m$ is the slope of the line.  I know that this process somehow also involves the largest $eigenvalue, \lambda,$ of $A$, though I am unsure how it connects.  My question is: How does the largest eigenvalue connect to this repeated iteration, how do I find the slope of the line of convergence $m$, and what is meant by the "direction of the eigenvector"? Who decides which half of the universe should be destroyed? How can latex and pdflatex be both symbolic links to same executable (pdftex) and not behave the same? When I run  $ latex my_doc.tex   and   $ pdflatex my_doc.tex   it works, and when I run  $ pdftex my_doc.tex   it doesn't work.  The thing is I noticed that both LaTeX and pdflatex commands are symbolic links to the same pdftex executable. That is,  $ which latex pdflatex pdftex   yields  /usr/bin/latex /usr/bin/pdflatex /usr/bin/pdftex   and   $ ls -l /usr/bin/latex /usr/bin/pdflatex /usr/bin/pdftex   yields  /usr/bin/latex -&gt; pdftex /usr/bin/pdflatex -&gt; pdftex /usr/bin/pdftex   So how is it possible that commands being symbolic links to a same executable do not behave in the same way ?  Thanks.  I have Ubuntu 12.10 with TeXLive-full 2012.20120611-4 installed. Can bug reports and feature requests requiring SE Dev attention be reported on per-site metas, or do they need to all go here? iptables drop all incoming ICMP requests except from one IP Currently, I have something like:  iptables -A INPUT -p ICMP --icmp-type 8 -j DROP iptables -A INPUT -s x.x.x.x -p ICMP --icmp-type 8 -j ACCEPT   However, when I run the second command, it looks as if iptables just stops.  I have to break out of it to get back to terminal.  Perhaps I am doing it all wrong, but some insight would be helpful. How many injective functions $f:[1,...,m]\to{[1,...,n]}$ has no fixed point? $(m\le n)$ USB-C Dongles killing Wifi on 2016/2017 MacBooks – Who’s to blame? I recently switched from my beloved MacBook Pro Retina (Late 2013) i5 2.6/16/512 to MacBook Pro (2017) Non-TB i5 2.3/16/512.  I purchased what from the build-quality looked like a good USB-C-to-DisplayPort cable with 4k/60Hz support, just to run into the very problem the Logicboard repair guru Louis Rossmann had described in : As soon as you plug in the USB-C dongle, the (2.4 GHz) Wifi stops working despite full antenna signal. Unplug the USB-C connector and you are immediately back in the game.  The big question I'm asking myself now: Who is to blame? Is this a design flaw in the current generation MacBooks with improper shielding or is it a design flaw in the various dongles?  I mean the fact that even Apple’s very own USB-C Digital AV Multiport Adapter is causing these WiFi issues (as you can learn from the many horrific ; but AFAIK have been fixed through a ), show that there’s something going horribly wrong. I would like to clarify something that I don't think is clear in   The first automatic delete rule kicks in at 9 days for closed questions:     If the question was closed more than 9 days ago, and ...         was not closed as a duplicate   has a score of 0 or less   has no answers with a score > 0   some other criteria that don't matter right now...      Then, at 30 days, there's:     If the question is more than 30 days old, and ...         has −1 or lower score   has no answers   is not locked      This rule applies to both open and closed questions, but it doesn't mention the same exemption for duplicates.  I'm pretty sure that I've seen old, downvoted duplicates disappear on ServerFault (and that fits what the rule says), but I'm also sure I've seen lots of comments along the lines of  "duplicates aren't deleted."  So what I'm after is a clear statement from a power-that-be or a clear reference that says "duplicate questions fall under the same 30-day automatic deletion rule as any other question."  (or that they don't)  (Note: I realize this doesn't apply the stub left behind when a question is merged into another.  Those "stubs" are locked and are never deleted.) What is the lifespan of an SSD drive? Are SSDs comparable to HDDs for reliability and is there published research on this?  Also are all SSD manufacturers at a similar 'reliability level'? ISP blocking port 25 My ISP has started blocking port 25 so I can not send email through my dedicated server any more.   I have several options:   Send email through the SMTP server provided by my ISP. Any problems with this? Setup mu server so that it receives email on another port instead of port 25     No one else sends email through my server so it should be OK. How do I do this on a Linux server? Buy a static client IP - these are not being blocked so far.   Which one is preferable? I  want to download free app in my iPod touch device and i have the following doubts.  Kindly resolve me doubts.   when i try to download it asks my credit card security number. since i am trying to download free app , why do i need to provide my credit card security code? Will i be debited for downloading the free app from app store?   I cant able to find any information regarding this on apple.  Please provide me some references about this from apple and please resolve my doubts.  Thanks a lot. How do I create a completely unattended install of Ubuntu? I need a CD or USB stick, that will install Ubuntu on a completely headless machine. Stick CD in and restart, no keyboard or screen should be involved.  There are a few obstacles:   The language selection menu when you first boot the CD. The fact that the CD menu waits. The installer's asking questions during installation. $ apt-get install -f -o 'Dpkg::Options::=--force-confmiss --force-all --force-confnew --overwrite-conffiles' --reinstall at-spi2-core Reading package lists... Done Building dependency tree        Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies:  kde-workspace-bin : Depends: qdbus but it is not going to be installed  libqt4-dbus : Depends: qdbus (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).   I don't quite understand "but it is not going to be installed". Why doesn't it install it then?  apt-get -f install does not help, it does nothing:  $ apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. I am unable to cover the following class get set method. Need help in creating test class  public class Aresult{      public class Parent {         public String type {get; set;}         public String id {get; set;}         public String sequence_id {get; set;}         public String etag {get; set;}         public String name {get; set;}     } }   Please suggest  @isTest  public class CirriusGetItemsResultTest {     public static void myUnitTest(){         Aresult.parent a = new Aresult.parent();         a.type='hello';         a.id='hello';         a.sequence_id ='hello';         a.etag ='hello';         a.name ='hello';     } } A groupoid is defined to be a category where every morphism is an isomorphism. So sometimes a group is said to just be a groupoid with one object.   When I try to make sense of this, I denote the single object as $G$. I view the morphisms as the analogue of "elements." The identity $1_G$ is the analogue of the usual identity $e$, we can compose any two morphisms since they are all arrows on $G$, and for any arrow $f$, we have some $f^{-1}$ such that $f\circ f^{-1}=f^{-1}\circ f=1_G$, so the idea of inverses is still there.  So I informally associate the elements of the group in the usual definition to be the arrows in the groupoid. But what does the sole object $G$ in the groupoid "correspond to" if I were to try to informally make sense of a group in the usual sense? Does it even correspond to anything? Best way to find a point on a circle closest to a given point Given a point (pX, pY) and a circle with a known center (cX,cY) and radius (r), what is the shortest amount of code you can come up with to find the point on the circle closest to (pX, pY) ?  I've got some code kind of working but it involves converting the circle to an equation of the form (x - cX)^2 + (y - cY)^2 = r^2 (where r is radius) and using the equation of the line from point (pX, pY) to (cX, cY) to create a quadratic equation to be solved.  Once I iron out the bugs it'll do, but it seems such an inelegant solution. Prove by induction: $$\frac1{n+1} + \frac1{n+2} + \cdots +\frac1{3n+1} &gt; 1$$  adding $1/(3m+4)$ as the next $m+1$ value proves pretty fruitless. Can I make some simplifications in the inequality that because the $m$ step is true by the inductive hypothesis, the 1 is already less than all those values? What is the name of the package for R? I tried aptitude search r, but (unsurprisingly), there are waaaay too many results to sift through. A matrix inside a table Possible Duplicate:          I am trying to insert a matrix inside a table, and I am looking for a good way to do this. Usually when I write matrices in equations, I use array environment, so I naively defined an array inside tabular, and it sort of works. The only problem is that the matrix itself seems to take up a huge amount of space inside the cell. An example is   \begin{tabular}{|c|c|} \hline \textbf{EKF} &amp; \textbf{UKF}\\ \hline $Q = \left[ \begin{array}{cc} 0.1 &amp; 0 \\ 0 &amp; 0.1 \end{array}\right]$ &amp; $Q = left[ \begin{array}{cc} 0.01 &amp; 0 \\ 0 &amp; 0.01  \end{array}\right]$\\ \hline $R = 5 \times 10^{-3}$ &amp; $R = 5 \times 10^{-5}$ \\ \hline \end{tabular}   Is there any way to increase the spacing in the cell containing the matrix without that matrix taking up all the space? Is it possible to get the data off of the hard drive of a PlayStation 3 that has crashed? I have already voided the warranty so I am not worried about that and I have access to quite a few tools.   I have a new PlayStation and a few saves that were not backed up. I am not worried about them but if it is possible I would love to get it moved over.   The old PlayStation will not turn on at all and I think I am going to have to pull the drive. My main concern is if I am able to transfer the files without running into any issues. I have heard that some of the stuff is specific to each PlayStation, is that true?