I'm learning the Java language and am trying to do this:  public class IntegerPlusOne {     public static int addOne(int n) {         n = n + 1;         return n;     }     public static void main(String[] args) {         int n = 0;         addOne(n);         System.out.println(n);     } }   It should be printing "1", but instead it print zero. No matter what I set n equal to, the addOne function never changes it and I think the function is broke, but if I test it on its own it returns one more than whatever int I send to it which really confuses me.
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?
Irrationality of $\sum_{p\in\mathbb{P}} \frac{1}{2^{p}}$ Let $\mathbb{P}$ be the set of prime numbers, and consider $m=\displaystyle\sum_{p\in\mathbb{P}} \frac{1}{2^{p}}$. Is $m$ irrational?  In the following  , the author recalls several sufficient criteria for irrationality. When applying some of this criteria to $m$ I arrive that the condition of some of the criteria are not satisfied by means of Bertrand´s Postulate.  I found a similar result by Sándor:  Let $\lbrace a_m\rbrace$, $m\geq 1$ be a sequence of positive integers such that $$\text{lim sup}\frac{a_{m+1}}{a_1a_2\cdots a_m}=\infty \;\;\;\;\text{and}\;\;\;\;\;\;\text{lim inf}\frac{a_{m+1}}{a_m}&gt;1$$ Then the series $\displaystyle\sum_{m} \frac{1}{a_m}$ is an irrational number.  I have yet to prove that if $f$ is a continuous function then $\text{lim sup} \;f(a_m)=f(\text{lim sup}\, a_m)$. Assuming this;  $$\text{lim inf}\; P_{m+1}-P_{m}&gt;1$$ where $P_m$ is the $m$-th prime.  But I have trouble with $$\text{lim sup}\; P_{m+1}-\sum_{j=1}^{m}P_{j}$$ my guess is that $$\text{lim sup}\; P_{m+1}-\sum_{j=1}^{m}P_{j}\neq\infty$$ so $$\text{lim sup}\frac{2^{P_{m+1}}}{2^{P_1}\cdots 2^{P_m}}\neq\infty$$   and this theorem will result useless to tell if $m$ is irrational.   How can I prove (or disprove) that $m$ is irrational (are there any other simpler criteria)? How can I use Dirichlet criterion  or Hurwitz criterion? What is its ?    Any help is highly appreciated.      Edit: That $m$ is irrational is clear by the criteria provided in the comments, namely that if $x$ is rational then the binary representation of $x$ is periodic. The number $m$ in binary expansion has $1$ in the $P$-th position and zero elsewhere. As there are arbitrarily large gaps between primes; then the binary representation fails to be periodic.  So the question that remains unsolved is:   What is its irrationality measure? How to execute hostapd command in cli? I always got error. When i execute hostapd command. I was changed everything in my hostapd.conf file but i got error.  hostapd_cli wps_pbc Failed to connect to hostapd - wpa_ctrl_open: No such file or directory  Can anyone help to me.? Lookup list dependant on the contents of another cell hope someone can help to crack this one?  I've got a table on my data entry tab (sheet 1) where each row includes two data validation drop down lists (source is on sheet2). I want the options in the second drop down list (k13) to be dependant on what is selected in the first drop down list (g13)...  ie. if you select 'Diary' in the first drop down box then the second drop down only has 'Cheese', 'Milk' and 'Yogurt' - likewise, if you select 'Fruit' in the first box - I want the only options to be available specific to that categories column in the lookup table on sheet 2 (which are 'apple', 'pear' and 'banana' in this case)?  Please help - i think this is a vlookup indirect formula?? Disabling OBSOLETE error in C# Gnome-shell seems to like to leave one monitor as "fixed" when you switch workspaces.  Additionally, there is no preview in the Activities view of my secondary monitor.  Also, on the second monitor, where there should be either empty desktop space, or a copy of the panel, I just have a white bar.  How can I get gnome-shell to treat my secondary monitor like the primary one? What split-screen options are available in Battlefront? How many players can play split-screen, and what game modes are (or aren't) available?   How many players can play local co-op? How many players can play local multiplayer? How many players can play online multiplayer from a single console? I'd like to create a Yahoo! account. The signup page won't let me proceed without entering a cell phone number, and it won't recognize my Google Voice number as a valid cell phone number. Is there a workaround to be able to create a Yahoo! account without having a cell phone that can receive SMS messages? What terminal command or program can list an SSD's Power On Hours? I'm looking to script using the unix shell the retrieval of SSD (and HDD) data that disk utility shows in the information window.    I'm immediately interested in the Power On Hours and Power Cycle, but if all the data comes from one data structure or tool, so much the better. The usual tools diskutil info disk0 and ioreg -l are not producing the "of interest" values listed in the screen shot above.  Is this information available from any of the built in OS X terminal tools or do I need to locate an open-source package that makes the same API calls to get this level of detail about a Mac drive? What is a good word to describe someone who is empathetic, quick, and witty in conversation Possible Beamer bug: Frame number has different color than date in infolines footer How to render world position pass A world position pass is a pass used for composting other elements into the scene after the initial render. In a world position pass the R, G, B values correspond to the X, Y, Z axis (or X, Z, Y). A world position pass could look something like this. (Image form another 3d app)    Is there a way to render out corresponding world space coordinates of each pixel? Can there be an option to allocate rep from any site account for offering a bounty? I think it would be useful if we had an option when deciding to open a bounty on a question that we could choose to allocate rep from one site even though the bounty is being offered on another site.  For instance I would like to use my rep from SO for putting a bounty on a question that resides on SF. I don't have enough rep on SF to make it enticing. So when you click on "start a bounty" you get sliders for each site that you can pull your rep from, maybe make it where you need to burn up all your rep for the site that your asking the question on and then allocate more rep from other ones, if you have it.  thanks devinb for clearing up my question with your comments! " transfer rep INTO a bounty. But you can't transfer rep across accounts. So, the rep you'd 'lose' from SO would never actually go into your SF account, it would go straight onto a bounty on whatever question." – devinb Show community wikis differently in the Android app How to sort an array of integers correctly $\forall$ At the beginning or at the end? I have a set of real numbers $x_1, x_2, \ldots, x_n$ and two functions $f:\mathbb{R} \rightarrow \mathbb{R}$ and $g:\mathbb{R} \rightarrow \mathbb{R}$.  What are the differences between the following statements?   $\forall v \in \{1, \ldots, n\} ~f(x_v) = 0 \vee g(x_v) = 0$ $f(x_v) = 0 \vee g(x_v) = 0 ~\forall v \in \{1, \ldots, n\} ~$ Data   I want operator users on this machine to mount their own cifs shares The sudoers file already contains the /bin/mount -t cifs //*/* /media/* -o username=* command for all operators I want the users to mount a cifs share through a script typing the password only once, not twice. The sudo password and the cifs password are identical.   What I already have  This script works:  #!/bin/bash sudo 'mount -t cifs //192.168.1.1/home /media/$USER/home -o username=$USER'   ...but it requires the users to type the same password twice!     Once for sudo Once for the mount itself   This would also work:  #!/bin/bash echo -n Password:  read -s szPassword echo $szPassword | sudo -S sh -c 'echo $szPassword | mount -t cifs //192.168.1.1/home /media/$USER/home -o username=$USER'   ...but this would require me to allow all operator users to be able to sudo sh (major security problem)  Question  How to mount a cifs share in bash¹ without putting sh in the sudoers file nor creating a permanent/temporary file???  Note 1: no python, perl, C, Go, ... please? Note 2: I know I can just remove the password through the sudoers file, but I'm trying to tighten security, not loosen it, without giving up convenience... Can you switch to the other Unarmored Defense by multiclassing? PHB p164 states:      If you already have the Unarmored Defense feature, you can't gain it again from another class.   So if I start as a Monk and gain the UD(Wis) feature, and then at next level up, take a level in Barbarian, can I switch to the alternate UD(Con)? Or am I stuck with UD(Wis), even if I take 19 levels in Barbarian?  I'm unclear if the rule is stating this or stating that you can't use both at the same time, which I know. What is the difference between: Rooting, Jailbreak, ROM, Mod, etc.? What is the difference between:   Unlocking the bootloader (prerequisite for doing many, though not all, other things below) Rooting Jailbreaking ROM NAND and Nandroid Operating System Mod (e.g. CyanogenMod) Recovery (ClockworkMod, Amon Ra) Custom Kernel (e.g. LeshaK's kernel) Firmware Driver Over The Air (OTA) update Fastboot SIM unlocking Flashing SPL (Second Program Loader)   (any other often-confused terms that I've missed?) Background: I am currently employed by a start-up that, so far, is doing really well. As part of my contract, I have stock options that will come available on a typical vesting schedule. A quarter of my options are set to vest later this year. Also, the company is not public yet, and it may be several years before it is public / I could sell my shares of the company.  My question is, is there any reason I should exercise them as soon as they vest? As far as I know they don't expire as long as I work at my company (if I leave for any reason, then I only have 3 months to exercise).  I don't foresee leaving any-time soon, and if I did, I would have 3 months to make a final decision.  Is there any disadvantage to just letting the option stay an option for a while? Prove $\chi(G)\chi(\bar{G}) \geq n$ for chromatic number of graph and its complement