Hello fellow Stackoverflowers,  How do I print out the numbersArray so that I can see the numbers?  When I sysout the numbersArray, it shows me:  [I@677327b6  [I@677327b6  Thank you for your time and help!  package AlgoExercises;  public class InsertionSort {    static int[] numbersArray = { 5, 2, 4, 6, 1, 3 };    static void swap(int a, int b) {     int temp = a;     a = b;     b = temp;     // a and b are copies of the original values.     // The changes we made here won't be visible to the caller.   }    static void insertionSort(int[] numbersArray) {     for (int i = 1; i &lt; numbersArray.length; i++) {       int j = i;       while ((j &gt; 0) &amp;&amp; (numbersArray[j] &lt; numbersArray[j - 1])) {         swap(numbersArray[j], numbersArray[j - 1]);         j = j - 1;         System.out.println(numbersArray);       }     }   }    public static void main(String args[]) {     insertionSort(numbersArray);   } }
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]
How to get the last argument to a /bin/sh function What's a better way to implement print_last_arg?  #!/bin/sh  print_last_arg () {     eval "echo \${$#}"  # this hurts }  print_last_arg foo bar baz # baz   (If this were, say, #!/usr/bin/zsh instead of #!/bin/sh I'd know what to do.  My problem is finding a reasonable way to implement this for #!/bin/sh.)  EDIT: The above is only a silly example.  My goal is not to print the last argument, but rather to have a way to refer to the last argument within a shell function.    EDIT2: I apologize for such an unclearly worded question.  I hope to get it right this time.  If this were /bin/zsh instead of /bin/sh, I could write something like this  #!/bin/zsh  print_last_arg () {     local last_arg=$argv[$#]     echo $last_arg }   The expression $argv[$#] is an example of what I described in my first EDIT as a way to refer to the last argument within a shell function.  Therefore, I really should have written my original example like this:  print_last_arg () {     local last_arg=$(eval "echo \${$#}")   # but this hurts even more     echo $last_arg }   ...to make it clear that what I'm after is a less awful thing to put to the right of the assignment.  Note, however, that in all the examples, the last argument is accessed non-destructively.  IOW, the accessing of the last argument leaves the positional arguments as a whole unaffected. What are the biggest pros and cons of  vs ? Prove $\sum\limits^m_{k=0} \frac{2n-k\choose k}{2n-k\choose n}\frac{2n-4k+1}{2n-2k+1}2^{n-2k}=\frac{n\choose m}{2n-2m\choose n-m}2^{n-2m}$ for- What is the exact use of the symbols $\partial$, $\delta$ and $\mathrm{d}$ in derivatives in physics? How are they different and when are they used? It would be nice to get that settled once and for all.  $$\frac{\partial y}{\partial x}, \frac{\delta y}{\delta x}, \frac{\mathrm{d} y}{\mathrm{d} x}$$   For what I know, $\mathrm{d}$ is used as a small infinitisemal change (and I guess the straight-up letter $\mathrm{d}$ is usual notation instead of italic $d$, simply to tell the difference from a variable). Of course we also have the big delta $\Delta$ to describe a finite (non-negligible) difference. And I have some vague idea that $\partial$ is used for partial derivatives in case of e.g. three-dimensional variables. Same goes for $\delta$, which I would have sworn was the same as $\partial$ until reading this answer on Math.SE:    Then to make the confusion total I noticed an equation like $\delta Q=\mathrm{d}U+\delta W$ and read in a physics text book that:     The fact that the amount of heat [added between two states] is dependent on the path is indicated by the symbol $\delta$...   So it seems $\delta$ means something more? The text book continues and says that:     a function [like the change in internal energy] is called a state function and its change is indicated by the symbol $\mathrm{d}$...   Here I am unsure of exactly why a $\mathrm d$ refers to a state function.   So to sum it up: down to the bone of it, what is $\delta$, $\partial$ and $\mathrm{d}$ exactly, when we are talking derivatives in physics.  Addition  Especially when reading a mathematical process on a physical equation like this procedure:  $$\delta Q=\mathrm{d}U+p\mathrm{d}V \Rightarrow\\ Q=\Delta U+\int_1^2 p \mathrm{d}V$$  It appears that $\delta$ and $\mathrm{d}$ are the same thing. An integral operation handles it the same way apparently? Sine $\theta$ = opposite/hypotenuse   Cosine $\theta$  = adjacent/hypotenuse   Tangent $\theta$  = opposite/adjacent      In order to calculate the sine or the cosine or the tangent I need to know $3$ sides of a right triangle. $2$ for each corresponding trigonometric function. How does a calculator calculate the sine, cosine, tangent of a number (that is actually an angle ?) without knowing any sides? Calculate battery life I have a webpage that implements a set of tabs each showing different content. The tab clicks do not refresh the page but hide/unhide contents at the client side.  Now there is a requirement to change the page title according to the tab selected on the page ( for SEO reasons ). Is this possible? Can someone suggest a solution to dynamically alter the page title via javascript without reloading the page? Why I have this error when I try to install this old blog on my local webserver? I am pretty new to WP (I came from Joomla) and I am finding some difficulties trying to put on my local web server an old backup of a website (made using WP 3.5)  I have performed the following operation:  1) I have put the website backup into a directory named blog into my Apache www directory on my Ubuntu local system.  2) Then I have put the database backup on my MySql local server  3) Finally I have change the values in the wp-config.php file to use my local DB  The problem is that when I try to open the URL to see the website I see noting (a white screen)  Into the Apache log file (/var/log/apache2/error.log) I found the following errors messages:  [Fri Jan 10 22:04:50 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.9 with Suhosin-Patch configured -- resuming normal operations [Fri Jan 10 22:05:08 2014] [error] [client 127.0.0.1] PHP Warning:  require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12 [Fri Jan 10 22:05:08 2014] [error] [client 127.0.0.1] PHP Fatal error:  require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12 [Fri Jan 10 22:38:37 2014] [error] [client 127.0.0.1] PHP Warning:  require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12 [Fri Jan 10 22:38:37 2014] [error] [client 127.0.0.1] PHP Fatal error:  require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12 [Fri Jan 10 22:38:38 2014] [error] [client 127.0.0.1] PHP Warning:  require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12 [Fri Jan 10 22:38:38 2014] [error] [client 127.0.0.1] PHP Fatal error:  require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12 [Fri Jan 10 22:38:39 2014] [error] [client 127.0.0.1] PHP Warning:  require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12 [Fri Jan 10 22:38:39 2014] [error] [client 127.0.0.1] PHP Fatal error:  require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12 [Fri Jan 10 22:38:40 2014] [error] [client 127.0.0.1] PHP Warning:  require_once(/var/www/blog/wp-load.php): failed to open stream: No such file or directory in /var/www/blog/wp-blog-header.php on line 12 [Fri Jan 10 22:38:40 2014] [error] [client 127.0.0.1] PHP Fatal error:  require_once(): Failed opening required '/var/www/blog/wp-load.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/blog/wp-blog-header.php on line 12   Why? what could be the problem? How can I try to solve it?  Tnx  Andrea Can I check iPhone, iPad, Watch battery on Mac? My goal is to have battery status of other Apple device on my Mac (preferably on menubar). I'd like to have a glimpse of the battery status of my iPhone, iPad, Watch, and Airpods.  I'm a user of Bitbar and iStat menu, but I haven't found any widgets can wirelessly check other Apple device's battery status.  What I know is that I can click the Wi-Fi icon on menu bar and it will show my iPhone battery status. To show the percentage, I have to option + click the Wi-Fi icon and hover over my mouse on the iPhone hot spot section. It's pretty clunky, but I guess at least the API is there.  I am also open to third party apps which can let me see battery status across devices. Can I buy PSN games and DLC without giving Sony my credit card info? Can i use the /testfor command to check for certain words in chat? Newton's third law of motion states that every action has an equal and opposite reaction. That is the reason we do not sink into the earth, because when our weight exerts a force on the earth it also exerts an equal and opposite force on us.  But when we stand on quicksand or on fluids we can sink in. How is this possible? Does it not exert an equal and opposite force on us? Or are Newton's laws different in the case of fluids and substances of low densities? Include the option to flag posts as spam in the Low Quality queue I guess this is an additional to previous requests like  and .  But I just came across  review item, and was unable to flag it as spam.  edit: Since I posted this, the item has been removed (deleted) here is a screenshot: What does “pull sb. out of the hat” mean? How do I align an image to centre? How do I align an image to centre?  In a beamer presentation I have a 2-3 items on a slide followed by an image. The image is not wide enough to cover whole slide, so it leaves around 30% space from right. How do I adjust it to leave enough space on both sides?  \begin{frame} \frametitle{Outlook} \begin{itemize} \item apps \item apps \item apps \includegraphics[scale=0.3]{P2P}     \end{itemize} \end{frame} Searching for a string on multiple zip files Mean Value Theorem: $\frac{2}{\pi}<\frac{\sin x}{x}<1$ I need to show that $\dfrac{2}{\pi}&lt;\dfrac{\sin(x)}{x}&lt;1$ for $0&lt;x&lt;\dfrac{\pi}{2}$.  I know I need to use the mean value theorem, would I just say that since $f$ is continuous in the interval (call it I).  We know $\exists c\in I$ such that $f'(c) = \dfrac{f\left(\dfrac{\pi}{2}\right)-f(0)}{\dfrac{\pi}{2}}$. I don't know where this is going though.  Also, would I need to show $\lim_{x \to 0}\dfrac{\sin(x)}{x} = 1$? Is there a way to do this without L'H Rule? Showing that the class of all sets of a particular cardinality is not a set. How to show that the class of all sets of a particular cardinality ,say $h$ is not a set.   My argument:  I assume that I've shown the following lemma.  Lemma: If $X$ is an infinite set of cardinality $h$ , $a\ne x$ for every $x\in X$ then $\{a\}\cup X$ is of cardinality $h$ too i.e. adding new element to an infinite set doesn't change cardinality.  Let $h$ be an infinite cardinal number. Let $T_h=\{x:\text{x is a set of cardinality h}\}$. Suppose $T_h$ is a set.   Let $a$ be any set and consider any $t\in T_h$. Let $R=t\cup \{a\}$. Using the above lemma, $R\in T_h$.   So, $a\in R\subset \bigcup T_h$. As $T_h$ is a set then $\bigcup T_h$ is also a set.  As $a$ was arbitrary set then we have, $a\in\bigcup T_h$ for every set $a$. Hence, the set $\bigcup T_h$ contains all sets which meas that the collection of all sets is a set, contradiction.    If $h$ is non-zero finite cardinal number. Define $T_h$ the same way as above. Let $a$ be any set, Let $A_1=a, A_{n+1}=A_n\times a$. Consider $A=\{A_1,A_2,...,A_h\}$. So, $A\in T_k$. Hence, $a=A_1\in \bigcup T_h=K$. So K is a set containing all sets $a$ since $a$ was arbitary,contradiction.  My main question is, Is there any flaws in my argument? If yes, point it out please.   If the argument is valid, Is there any standard proof to show the same fact? Which video editor can I use to make clips to upload? I am looking for an easy video editor for Ubuntu 12.04. My needs are simple: make clips and upload them on sites (cut segments from a video file with frame to frame precision, convert into common formats, resize the file).  Can anyone suggest one? An ideal whose radical is maximal is primary I've got to prove that an ideal $Q$ whose radical is a maximal ideal is a primary ideal. That is, I want to prove that if $xy\in Q$, then $x\in Q$ or $y^n\in Q$ for some $n&gt;0$.    I've been trying for a while and I'm not sure where to begin. All I've got is that if $\text{Rad}(Q)$ is maximal and by definition it's the intersection of all prime ideals $P_i$ containing $Q$, then it must be equal to each of these $P_i$. So there is only 1 prime ideal containing $Q$, namely $\text{Rad}(Q)$.  Could anyone point me in the right direction? Thanks for any replies.