The value of array elements are getting changed while calling a static method with the parameter passing the same array as argument but primitive value does not get changed Is it work differently in the case of while we pass data structure as method argument ? Want to know why array element get changed after the method call with the array .. I was expecting value 0 in the last syso statement instead of 999 public class TestStatic {          public static int square (int x)     {         x = x + 1;         return x * x;            }      public static int[] changeArr(int a[])     {         a[0] = 999;         return a;     }          public static void main(String[] args)     {         int a = 10;          System.out.println((square(a)));         System.out.println(a);          int arr[] = {0,0};         changeArr(arr);         System.out.println(arr[0]);     } }  Actual Output: 121 10 999   I was expecting 121 10 0
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?
Upon system restart, dconf editor doesn't save changes I can use the dconf-editor to change my touchpad settings to natural scrolling, but upon system restart the settings get reverted. (But not on sleep or hibernate.) When I open the editor, the option is still orange indicating it has been changed. when I uncheck and recheck the natural scroll option, it is re-enabled. Is there a fix, or am I changing the wrong option? The path is org > gnome > settings-daemon > peripherals > touchpad > natural-scroll.  Currently running 13.10 Evaluate $ \int_{0}^{\frac{\pi}2}\frac1{(1+x^2)(1+\tan x)}\:\mathrm dx$ If $g$ is the generator of a group $G$, order $n$, when is $g^k$ a generator? Say a cyclic group of order $9$ is denoted by $G = \langle g \rangle$. I have a claim that  $\langle g^k \rangle = G $ whenever $k$ is a unit in $\mathbb{Z}_9$. I'm struggling to understand why this is true. Is this specific to order 9? In general, for a group of order $n$, do we require that $k$'s multiplicative inverse in $\mathbb{Z}_n$ be $n$ itself? Otherwise the generating group will be of order less than $n$, and thus cannot be equal to the group. How can a point-particle have properties? I have trouble imagining how two point-particles can have different properties.  And how can finite mass, and finite information (ie spin, electric charge etc.) be stored in 0 volume?  Not only that, but it can also detect all fields without having any structure. Maybe it can check curvature of spacetime to account for gravity, but how can a point contain the information of what the other fields-vectors are? This seems to mean that also the information/volume in space is infinite.  Mathematically, a point cant have any intrinsic structure, so how does physics which is a mathematical theory explain this? In addition to showing reputation scores, SO should rank users. In the users section, users are ordered by the reputations they have.  Each user should also have a unique rank, since many users can have the same reputation score.  Rank must follow the order laid out by reputation, but for those having similar reputation, an additional formula should be defined which can rank users based on tags, time since registration, frequency of activity and/or helpfulness of their answers.  What are your thoughts on this? Of course most languages have library functions for this, but suppose I want to do it myself.  Suppose that the float is given like in a C or Java program (except for the 'f' or 'd' suffix), for example "4.2e1", ".42e2" or simply "42". In general, we have the "integer part" before the decimal point, the "fractional part" after the decimal point, and the "exponent". All three are integers.  It is easy to find and process the individual digits, but how do you compose them into a value of type float or double without losing precision?  I'm thinking of multiplying the integer part with 10^n, where n is the number of digits in the fractional part, and then adding the fractional part to the integer part and subtracting n from the exponent. This effectively turns 4.2e1 into 42e0, for example. Then I could use the pow function to compute 10^exponent and multiply the result with the new integer part. The question is, does this method guarantee maximum precision throughout?  Any thoughts on this? How to find $\lim\limits_{x\to0}\frac{e^x-1-x}{x^2}$ without using l'Hopital's rule nor any series expansion? What is the EV scale? I have seen an "EV" (exposure value) scale that's sometimes used to express a camera's exposure settings, or scene brightness. How exactly does this scale work? How to install Eclipse? I want to install the latest version of Eclipse but the Ubuntu Software Centre contains an older version.  Is there a PPA or some other way to install latest Eclipse? Please describe the steps for full installation. Object Positions Reset On Blender Load Projection of a point onto a simple convex polytope I have a convex polytope described by the intersection of a hypercube and two parallel lower and upper hyperplanes cutting through the hypercube. I want to find the projection of a point onto the polytope. I read the question  and see that the general problem of finding a projection onto a convex polytope can be solved with quadratic programming. However, taken alone, projection onto a hypercube or a hyperplane is trivial. For the hypercube, each dimension is defined by a lower+upper bounds and we just pull each dimension within those bounds, which take $O(n)$ time in $n$ dimensions. For the hyperplane just find the projection onto it. So I'm wondering whether there is simpler method for finding such a projection, maybe somehow combining the two independent projections. What is used in the 12.10 full disk encryption? What are quarks made of? So atoms are formed from protons and neutrons, which are formed from quarks.  But where do these quarks come from? What makes them? Does a GFCI receptacle provide overcurrent protection? Does a GFCI receptacle provide over-current protection? (note that I'm not referring to GFCI circuit breakers as may be found in a service panel, nor to specialty devices such as an inline plug-in GFCI that may offer over-current protection)  I've checked some GFCI  (note, this link opens a PDF) but haven't found any that mention overcurrent protection, or provide trip curves as would be expected in a circuit breaker datasheet.  So, does a GFCI receptacle provide any inherent over-current protection or must it always be used with a circuit breaker for over-current protection?  This question was prompted by  where the answer suggests using a GFCI outlet as a circuit breaker. This seems like very big misconception of the protection offered by a GFCI, and is potentially dangerous if it leads someone to think that GFCI outlets are the same as circuit breakers. I have created a model which requires some faces to be dual sided.  I intend to import this model into Unity. Reading about this, it seems that the recommendation is to duplicate the polygons and then flip the normals.  What I have done so far is simply to duplicate the all of the relevant faces using Shift+D and then flip the normals. I don't like this method though as it hampers any future alterations to the model itself.  What is the best way of doing this? Creating Layer in GeoServer using REST As part of a possible solution to   I want create a layer in GeoServer via REST that supplies a SQL statement along with a userid. I think i would  and publish it. I need to do this all in REST. Does anyone have any code examples? Is there a way to find out if I need a transit visa for a layover in the UK? Is complex conjugation needed for valid inner product? What are the benefits of using a conjugate linear inner product in a complex vector space vs a simple linear inner product?  That is, why do we demand that $(y,x) = \overline{(x,y)}$ as opposed to $(y,x)=(x,y)$?  Of course, this ensures that $(x,x)$ is real and thus makes an easy definition of norm, but is that necessary? How do I cd into a directory in the home folder? How do I change directories to downloads, from the home folder, in the latest version Ubuntu 12.10? I tried cd /downloads, but it gave an error saying that there is no such directory. Is it possible to activate an iPhone 4 without a SIM? So we bought an iPhone 4 from the Apple store. But we didn't get a micro-SIM as there are no PAYG tariffs on micro-SIM available.  Is there anyway to activate the device without getting hold of a SIM? I don't want to sign up to a contract just to develop with.