I have a problem where I'm supposed to expand an array, each time creating an array with identical results. Before you tell me to just use ArrayList or something else already in the Java API, I was specifically instructed to use my own code. I tried simply creating an array that is one slot larger than my current array, though that does not seem to work very well. Here is what I have that the current moment:  public static void expand(Object[] objArray) {     Object[] objArray2 = new Object[a.length + 1];     for (int i = 0; i &lt; a.length; i++)         objArray[i] = objArray[i];     objArray = objArray2; }
I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?
Add warning when changing display name Find the last $2$ digits of $$\large7^{7^{7^{10217}}}$$   So far I have: $17\cdot 601=10217$ and $7=7 \pmod{10}$. Any help greatly appreciated. When trying to launch Audacity, I get the following error:  Audacity could not find a place to store temporary files. Please enter an appropriate directory in the preferences dialog.   No files or folder have been moved.   I have purged Audacity, deleted any files, etc manually and re-installed   In terminal:  pst007x@pst007x-Serval-Professional:~$ audacity   (process:16390): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::sm-connect after class was initialised  (process:16390): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::show-crash-dialog after class was initialised  (process:16390): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::display after class was initialised  (process:16390): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::default-icon after class was initialised  ** (Audacity:16390): WARNING **: Owner of /tmp/orbit-pst007x is not the current user  Segmentation fault pst007x@pst007x-Serval-Professional:~$    I have not changed any users or added any additional users. All privaleges, etc are default.   Ubuntu 13.10 64bit (all updates applied)  ADDITIONAL:  I can open as gksu audacity  So it looks like privileges is an issue somewhere. I have checked all privileges and all seems ok, but clearly not....  I tried changing the Directory in Preferences to a directory in my home folder:  /home/pst007x/Music/audacity_temp/  but when starting again (not in root) same error...  Any ideas what files could be lacking privileges?   After changing the Directory, when running I get this:  pst007x@pst007x-Serval-Professional:~$ audacity   (process:28364): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::sm-connect after class was initialised  (process:28364): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::show-crash-dialog after class was initialised  (process:28364): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::display after class was initialised  (process:28364): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::default-icon after class was initialised Segmentation fault pst007x@pst007x-Serval-Professional:~$    I checked installed files using Synaptic Package Manager, then checked permissions:  pst007x@pst007x-Serval-Professional:~$ sudo chmod -R 777 /usr [sudo] password for pst007x:  pst007x@pst007x-Serval-Professional:~$ audacity  (process:31026): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::sm-connect after class was initialised  (process:31026): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::show-crash-dialog after class was initialised  (process:31026): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::display after class was initialised  (process:31026): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::default-icon after class was initialised Segmentation fault pst007x@pst007x-Serval-Professional:~$    EDIT. After the above, I rebooted and was no longer able to login. So I did a fresh install. Not a bad thing since the original install on the this system was 10.10. Working ok after fresh install.  Thank you for taking the time to post answers and suggestions.. Avoid trailing zeroes in printf() I keep stumbling on the format specifiers for the printf() family of functions.  What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point.  If I use:  printf("%1.3f", 359.01335); printf("%1.3f", 359.00999);   I get  359.013 359.010   Instead of the desired  359.013 359.01   Can anybody help me? Add captcha threshold information to privileges page Related:   Related:   The captcha often gets to me when I'm editing a lot of posts in rapid succession. I was wondering if at some point you can get enough reputation to not have it interrupt you as much, so I looked on the SO . However, I didn't see anything there about captcha privileges. Then I dug up the related threads above, which indicate that indeed there are reputation levels at which you can reduce captcha interruption. Why not include this information in the list of benefits on the ? Formula for completing the square? My math teacher said that this was the formula for completing the square.  Original function: $$ax^2 + bx + c$$ Completed square: $$a\left(x + \frac{b}{2a}\right)^2 - \frac{b^2}{4a} + c$$  However, using this formula I'm not getting the same answers that I would get just by determining the stuff myself.  Is this correct? The sup norm on $C[0,1]$ is not equivalent to another one, induced by some inner product Let $\mathrm{C}[0,1]$ be the space of continuous functions $[0,1]\rightarrow \mathbb{R}$ endowed with the norm $||x||_{\infty}=\mathrm{max}_{t\in [0,1]}|x(t)|$. It is easy to verify that this norm is not induced by any inner product (really the parallelogram law fails for $x(t)=t$ and $y(t)=1$). Well, how to understand that this norm is not equivalent to anyone induced by an inner product? So, the norms induced by inner products should have some special properties... How do I get a tourist visa (or a tourist card) for Cuba?  I live in the Netherlands, but I'm not a Dutch citizen, I have an Italian passport. Out of Bag Error makes CV unnecessary in Random Forests? I think it would be very useful.  I have a question that I have an open bounty on. Putting up said bounty brought my reputation below the point where I am allowed to comment on other peoples' posts. It's so frustrating not to be able to comment and give feedback on the answers given!  Especially since it would be helpful, for them, me, and the readers, to know particularly what is good and isn't good about their answer, and therefore give some better guidelines to future answerers on how they can win the bounty. Get real client IP in a Servlet I am trying to make an explosion in Blender.  I am having a problem with the smoke simulation with the Cycles rendering engine. More specifically, I have been able to render smoke, but flames do not show up. In the viewport however, everything looks perfectly fine.  The render looks like this:    But in the viewport, it is clear that there are flames. Does anyone have any idea what is going on?     This is NOT a duplicate of  because I have Flame Rate set to 1.0 How can I deal with "Low on Space" messages on my Android? I keep getting the "Low on Space: Application data space is low. To free up" [the rest is cut off] message.  I've moved every app I can over to the SD card, cleared the cache, compacted my K9 mail cache.  Advanced Task Killer (ouch!) says I have 98M Available Memory  File Manager says I have 223M/748M (29%) free.  That's not so bad -- but I'm stuck in the no-updates scenario. The market downloads won't really start, gmail won't update, etc. I've rebooted several times, and nothing changes. Aaaargh.  What can be done, other than uninstalling everything ? Why is the application of probability in  (QM) fundamentally different from its application in other areas? QM applies probability according to the same  as in other areas of physics, engineering, etc.  Why is there a difference?  Naively one would assume one of these possibilities:   It is not the same probability (theory?) It is a matter of interpretation (of the formalism?) Something else?   Many answers (which I am still studying) focus on the fact that the combined probability of two mutually-exclusive events in QM is not equal to the sum of the probabilities of each event (which holds classically by definition). This fact (appears to) makes the formulation of another probability (a quantum one) a necessity.   Yet this again breaks down to assumed independent, if this is not so, the "classic probability" is applicable (as indeed in other areas). This is one of the main points of the question. Why is this match pattern unreachable when using non-literal patterns? What cause the "from review" links to appear in comments? I sometimes see comments ending in "From Review" (hyperlinked to a review page) on questions and answers, e.g.        I spend a good bit of time in the review queues (on Unix &amp; Linux), but comments I make do not come with these "From Review" links. Note that I only have access to the "First post" and "Late answer" queues.  Do these links only appear for the higher-rep queues? How to edit files in a terminal with nano? I have a Asus ROG G551VW laptop and I'm trying to install Ubuntu 16.04 on my laptop, but when i try to load the installer, my laptop just freezes and its fan starts working for no reason. I have tried to install Ubuntu 14.04 on my laptop and the installation went smoothly. What should I do if I want to install Ubuntu 16.04 on my laptop?  Any help would be greatly appreciated. Which is correct: I'll be moving next month or I'll be shifting next month? For changing one's home from one place to another, I've heard people in western part of the world using the sentence:      I'll be moving next month.   In India, even in the English news channels, I've heard many people using the phrase:     I'll be shifting next month.   Which one is the correct usage? Or are both of them correct and the difference in usage is regional? If every ideal is principal show the same is true for the image of a homomorphism.