Why Java code doesn't work when moved into a function? I have a dummy Java function here. If p is a valid object, t should point to it.  private void turhake(Piece p, Piece t) {     if (null == t &amp;&amp; null != p) {         t = p;         if (null == t) System.exit(44);     } else System.exit(43); }   In the following code I ensure that the above function is only called if p is non null and t is null.      if (threatener != null) System.exit(42);     if (board[row][col] != null) {         turhake(board[row][col], threatener);         if (threatener == null) System.exit(41);     }   The result should be that both p and t (board[row][col] and threatener) point to the same object. However my program exits with the code 41, indicating that t got nullified after the function call. Piece class has a few enum variables, nothing special. If I replace the function call with the following, all is good.      if (threatener != null) System.exit(42);     if (board[row][col] != null) {         threatener = board[row][col];         if (threatener == null) System.exit(41);     }   What makes t point to null after it has successfully been assigned a non null object?
Is Java "pass-by-reference" or "pass-by-value"? 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?
Internet through wireless hotspot, intranet through wired network - can I use both at the same time? How to set AUTO-SCROLLING of JTextArea in Java GUI? typeof is an operator and a function Can I check if the C# compiler inlined a method call? I'm writing an XNA game where I do per-pixel collision checks. The loop which checks this does so by shifting an int and bitwise ORing and is generally difficult to read and understand.  I would like to add private methods such as private bool IsTransparent(int pixelColorValue) to make the loop more readable, but I don't want the overhead of method calls since this is very performance sensitive code.  Is there a way to force the compiler to inline this call or will I do I just hope that the compiler will do this optimization?   If there isn't a way to force this, is there a way to check if the method was inlined, short of reading the disassembly? Will the method show up in reflection if it was inlined and no other callers exist?  Edit: I can't force it, so can I detect it? How can I figure out the size of a file, in bytes?  #include &lt;stdio.h&gt;  unsigned int fsize(char* file){   //what goes here? } Flag apron shows superfluous closing anchor tag I awoke this morning to a spam flag on a site I moderate, and noticed this when I went to read the post.    Notice answered&lt;/a&gt;, which I imagine isn't meant to have the &lt;/a&gt; there.  I also confirmed that this displays asked&lt;/a&gt; for other types of flags (namely, closed without comment).   I looked around for a duplicate of this but can't seem to find it, so maybe it's a recent change? I'm looking for a good way to perform multi-row inserts into an Oracle 9 database.  The following works in MySQL but doesn't seem to be supported in Oracle.  INSERT INTO TMP_DIM_EXCH_RT  (EXCH_WH_KEY,   EXCH_NAT_KEY,   EXCH_DATE, EXCH_RATE,   FROM_CURCY_CD,   TO_CURCY_CD,   EXCH_EFF_DATE,   EXCH_EFF_END_DATE,   EXCH_LAST_UPDATED_DATE)  VALUES     (1, 1, '28-AUG-2008', 109.49, 'USD', 'JPY', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),     (2, 1, '28-AUG-2008', .54, 'USD', 'GBP', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),     (3, 1, '28-AUG-2008', 1.05, 'USD', 'CAD', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),     (4, 1, '28-AUG-2008', .68, 'USD', 'EUR', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),     (5, 1, '28-AUG-2008', 1.16, 'USD', 'AUD', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'),     (6, 1, '28-AUG-2008', 7.81, 'USD', 'HKD', '28-AUG-2008', '28-AUG-2008', '28-AUG-2008'); Run a GUI program at startup Can a matrix have a null space that is equal to its column space? I had a question in a recent assignment that asked if a $3\times 3$ matrix could have a null space equal to its column space... clearly no, by the rank+nullity theorem... but I have a hard time wrapping my head around the concept of such a matrix, no matter what size, even existing. How could this be possible, and does anybody have an example of such a $m\times n$ matrix? I'm using Microsoft Word 2010 and I worked in a word-2003 compatible document (.doc). After hours of working, I selected a half of text and did Ctrl+X to copy it into another document. Surprising, after closing the current document and opening a new one and pressing Ctrl+V, nothing happened. After closing original document, ms word asked me if I want to save the clipboard buffer and I pressed No, as I didn't knew that MS Word has it's own clipboard.  Is there a way to recover that text that was "cutten" from original document and never "pasted" to the new one? The PC was not rebooted so i guess all my temp files are here. Cannot modify files installed by `snap` I have installed a package using snap and I need to modify one of the files but when I try to change its ownership or permissions, I always get the following message:  sudo chmod +x ./my_file.js chmod: changing permissions of '/snap/my_app/my_file.js': Read-only file system   How can I modify files that are installed via snap? Could there be a body of water the size of a planet? How can I "normalize" the scale of what seems to be either an infinitely large or infinitely small object I'm having issues with an obj file I've imported into Blender. At first I thought the import was broken in some way because the import would go smoothly, but there was no model to be seen. Eventually I figured out that I could snap my view to the object by pressing . on the numpad and it was in fact there, just extremely small or large (I can't tell). I've tried scaling, but the sizes are so extreme that it doesn't seem to be working. Also due to the extreme nature of the object I can only see certain parts of it at a time depending on the angle in which im viewing it at it starts to de-render the parts not directly in front of the camera. Why is it that scanf() needs the l in "%lf" when reading a double, when printf() can use "%f" regardless of whether its argument is a double or a float?  Example code:  double d; scanf("%lf", &amp;d); printf("%f", d); What is recursion and when should I use it? One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or lack thereof) of doing a Computer Science Degree. An argument that seems to come up time and again for the negative party is that they have been coding for some number of years and they have never used recursion.  So the question is:   What is recursion? When would I use recursion? Why don't people use recursion? Is there a difference between "Alpha Helix" and "Alpha subunit"? The sum of powers of two and two's complement – is there a deeper meaning behind this? How do I summon the Golem boss? iPhone Apps in Waiting mode for the last 4 days I tried to download the "Dictionary Free" app from the App Store four days ago, but it's been stuck in "Waiting" ever since. I've tried everything: rebooting the phone, restoring from an iTunes backup, side-loading the app from iTunes, but nothing has worked.  When I turn Airplane Mode on and then off again, I get an alert popup that says "Unable to download application. It will be available for download when you log in to the iTunes Store on your computer".  I've tried what it recommends, but nothing seems to work. Topologist's sine curve is connected I just came across the example of the topologist's sine curve that is connected but not path-connected. The rigorous proof of the non-path-connectedness can be found .   But how can I prove that the curve is connected? To be honest, even intuitively I am not being able to see that the curve is connected. I am thinking if it is proved that the limit point of $\sin(1/x)$ as $x \to 0=0$, then it would be proved. But, why is this true? IMO, this limit doesn't exist. Intuitively also, it seems that the graph would behave crazily and not approach a particular value as a tends to $0.$  EDIT (Brett Frankel): There are a few different working definitions of the topologist's since curve. For the sake of clarity/consistency, I have copied below the definition used in the linked post: $$ y(x) = \begin{cases} \sin\left(\frac{1}{x}\right) &amp; \mbox{if $0\lt x \lt 1$,}\\\ 0 &amp; \mbox{if $x=0$,}\end{cases}$$