I have Java ArrayList&lt;Map&lt;String, Object&gt;&gt;. Is it okay to remove elements from that list as follows:      for (Map&lt;String, Object&gt; anObject : manyObjects) {         if (anObject.get("x").equals("y")) {             manyObjects.remove(anObject);         }     }   Is there anything fundamentally wrong with this approach?
We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection&lt;Integer&gt; l = new ArrayList&lt;&gt;();      for (int i = 0; i &lt; 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.
How do I install a .tar.gz (or .tar.bz2) file? I have downloaded tar.gz files. But I don't know how to install it. How do I install this kind of file? Showcase of beautiful typography done in TeX & friends If you were asked to show examples of beautifully typeset documents in TeX &amp; friends, what would you suggest? Preferably documents available online (I'm aware I could go to a bookstore and find many such documents called 'books'). Extra bonus for documents whose LaTeX source is available.  This is not an idle question. Seeing great examples of any craft is both educational and inspiring, let alone explaining why we prefer TeX to Word or other text editors.  For instance, I like how Philipp Lehman's  looks. I don't know enough LaTeX to realize how much customization was done, but the ToC looks polished.  Your nominations, please ... What is the explicit meaning of “corresponding author”? Problem  This question was triggered by the comments on , but comments and answers on   confirm the existence of conflicting ideas.  There seem to be two prevalent interpretations of the word corresponding author:   The corresponding author is the one who corresponds the (unpublished) paper to the journal, i.e., who performs the technical process of submitting the paper, is available for requests on the review and publishing processes, and so on. The corresponding author is the one who corresponds on the (published) paper with anybody who likes to do so, e.g., because they found an error or like some clarification.   What I found out so far  Until today, I was only aware of the first interpretation, which was confirmed by my experience: For all papers I submitted, I automatically became the corresponding author and cannot remember that I could choose one of my co-authors for this role. Some of these journals do not even indicate a corresponding author to the reader. Also, there already is a way to indicate that an author is available for questions on the paper (interpretation 2): stating the e-mail address.  On the other hand, other journals do indicate corresponding authorship, which makes little sense for interpretation 1. Also, the value put into this role by some funding agencies for its  makes more sense for interpretation 2 (not that I completely agree with it).  Looking for some guidelines from publishers covering multiple fields, I found the following  from Elsevier¹, which kind-of covers both interpretations:     Clearly indicate who will handle correspondence at all stages of refereeing and publication, also post-publication.   While there are other questions on this site touching this issue, they focus on consequences of the interpretation, such as , , or .  Actual question  What is the explicit meaning of the word corresponding author? Interpretation 1 or 2 as listed above, both, something else, or is this an extreme example of  and the answer depends on the field or publisher? Please answer only if you have more to offer than personal experience and individual journal guidelines. In particular, please address the possibility of a varying meaning.     ¹ which is separate for each journal, but seems to be identical in content for many journals prove or disprove: For a prime number p, there is a positive integer n such that $p+1 $= $n^2$ if and only if $ p = 3.$ Prove or disprove: For a prime number p, there is a positive integer n such that $p+1 $= $n^2$ if and only if $ p = 3.$  first im trying to proof if p is prime number there is positive integer n such that $p+1=n^2$ implies $p=3$  suppose there is positive n integer such that $p+1=n^2$ and prove that $p=3$. $p=n^2-1=(n+1)(n-1)$ since $p$ is prime $n-1=1$,$ n = 2 $ $p+1=4$ $p=3$ hence it is proved that $p=3$  now if $p=3$ implies there is positive integer n such that $p+1=n^2 $  $p=3$ and p is prime  $p+1=n^2$, $4=n^2$, $n2$ or $n=-2$ hence it is proved that there is positive integer $n$ such that $p+1=n^2 $  is my proof correct? and also for prime number can i write $n+1=1$ instead $n-1=1$? What's the difference between the following sentences?      (a) I wish they wouldn't make so much noise.   (b) I wish they were not making so much noise.    (c) I wish they did not make so much noise.   I'd appreciate your help. Comma as decimal marker with siunitx (Spanish usage) I'm using siunitx to input some big numbers and units in my document.  Is there a way to make the output of \num{3.14} be "3,13" instead of "3.13"? In Spanish, we use the first one. I am very new to R. I am learning machine learning right now. Very sorry, if this question appears to be very basic.  I am trying to find a good feature selection package in R.  I went through Boruta package. It is a good package but I read that it is only useful for classification.  I want to do implement feature selection in R for regression tasks. I went through the caret package documentation but for my level, it is very difficult to understand.  Can any one please point me to a good tutorial or list any good packages or most frequently used packages in R for feature selection.  Any help would be appreciated. Thanks in advance. What special characters must be escaped in regular expressions? I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps? This is what my GRUB 2 menu looks like so far:  I want to do a few things here:  I want to rename &quot;Windows Boot Manager (on /dev/sda1)&quot; to just &quot;Windows 8.1&quot;. I'd like to rename &quot;Ubuntu&quot; to &quot;Lubuntu 14.04.1&quot;. I'd also like to switch the order of the options to this:  Windows 8.1 Lubuntu 14.04.1 Advanced options for Lubuntu    (Windows will be the default OS) If it helps in any way, I'll explain the steps I took prior to this, since I am very new to Linux and don't know what information is required.  I bought a laptop on Amazon (ASUS X551MAV-EB01-B) pre-installed with Windows 8.1 64-bit I downloaded the proper Lubuntu .iso file for my system (Lubuntu 14.04.1 amd64) and put it on my flash drive (via UNetBootin) I went to Disk Management, and shrunk the C:/ drive down 32Gb so that 32Gb will be free for Lubuntu I used my flash drive (32Gb Sandisk Cruzer) as a LiveUSB for Lubuntu 14.04.1 I went through the install process. It didn't recognize Windows 8.1 so I had to do the &quot;Something Else&quot; option. I highlighted the free space, and pressed the + button I created a 10,000mb ext4 partition and mount point is / (is now dev/sda7) I created a 4,000mb swap area partition (is now dev/sda8) I created an ext4 partition using the rest of the free space and the mount point is /home (is now dev/sda9) I selected dev/sda7 to install Lubuntu and selected dev/sda7 for the bootloader installation It installed just fine, booted up just fine, and I'm happy to know the GRUB menu works. I am a history teacher and I like to make my own maps (I can never find exactly what I want).  I am using QGIS 1.8 and .  I want to reproject their cross-blended hypso rasters into projections that are more familiar looking to my students, like Lambert Conic Conformal.  I have tried changing the crs for the whole project, and the warp and assign functions from the raster menu, and changing the crs for the raster layer itself.  None of these seem to work properly - the resulting maps are unrecognizable and extremely large (file size).  I feel like I am making some kind of basic mistake but I don't know where to begin with this.  Any help would be appreciated. Find conditional expectation from a 3-dimensional random vector? Which is higher — "hyper-", "ultra-" or "super-"? Got less output with print0 option on find? I have read the man page and other references, but I am still confused by the behavior of find with -print0 option.  -print0      This primary always evaluates to true.  It prints the pathname of              the current file to standard output, followed by an ASCII NUL              character (character code 0).   First command:  $ find /some/path/ -iname "*intro*jpeg" -o -iname "*intro*jpg" 2&gt; /dev/null /some/path//asdf199Intro-5kqlw.jpeg /some/path/199intro-2jjaj.JPEG /some/path/199intro-3.jpg /some/path/wuer199intro-4.JPG /some/path/xbzf199INTRO-1.jpg   Second command:  $ find /some/path/ -iname "*intro*jpeg" -o -iname "*intro*jpg" 2&gt; /dev/null -print0 /some/path/136intro-3.jpg/some/path/wuer136intro-4.JPG/some/path/xbzf136INTRO-1.jpg   I can see that the the filenames from the second command are null character separated, but why do I get 3 output as opposed to 5 above? Comparison theorem for ODE Here is something I'm trying to prove:     Conjecture: Suppose $f'(x) \leq \phi(f(x), x)$ and $f(a)=\alpha$. Suppose $g'(x)=\phi(g(x),x)$ and $g(a)\geq \alpha$. Then $f(x)\leq  g(x)\,\,\forall x$.   It definitely seems like it should be true, and I don't think we even need continuity of $\phi$.  (Edit: a user has correctly pointed out that we should require $\phi$ be locally Lipshitz in the first variable, uniformly with respect to the second variable. Let's add that assumption.)   I can prove it in the case that the inequality is strict. I'll place my proof below the fold. How can I extend it to weak inequality?  If it's wrong, I'd love to see a counterexample. A reference is fine; I have the book by Teschl, for example.  A similar question with stronger assumptions was asked .     Proposition: Suppose Suppose $f'(x) &lt; \phi(f(x), x)$ and $f(a)=\alpha$. Suppose $g'(x)=\phi(g(x),x)$ and $g(a)\geq \alpha$. Then $f(x)\leq  g(x)\,\,\forall x$.  Proof: Suppose not. Suppose WLOG there is a $b&gt;a$ such that $f(b)&gt;g(b)$. Let $c:=\inf \{x&gt;a:f(x)&gt;g(x)\}$. By definition of the derivative we have $f'(c)\geq g'(c)$, a contradiction, since $f'(c)&lt;\phi(f(c),c)=\phi(g(c),c))=g'(c)$. Defining starred versions of commands (* macro) Why do we say "is it" when asking a question rather than "it is"? How do thrown weapons interact with the Extra Attack feature?  Can you throw more than one weapon per turn?  How about two-weapon fighting?  Do you need the Dual-Wielder feat to throw two weapons every turn? Difference between confidence intervals and prediction intervals For a prediction interval in linear regression you still use $\hat{E}[Y|x] = \hat{\beta_0}+\hat{\beta}_{1}x$ to generate the interval. You also use this to generate a confidence interval of $E[Y|x_0]$. What's the difference between the two? I read with interest about Einstein's Theory of Relativity and his proposition about the speed of light being the universal speed limit.    So, if I were to travel in a spacecraft at (practically) the speed of light, would I freeze and stop moving?  Would the universe around me freeze and stop moving?  Who would the time stop for? How to compare a program's version in a shell script? Suppose I want to compare gcc version to see whether the system has the minimum version installed or not.  To check the gcc version, I executed the following  gcc --version | head -n1 | cut -d" " -f4   The output was  4.8.5   So, I wrote a simple if statement to check this version against some other value  if [ "$(gcc --version | head -n1 | cut -d" " -f4)" -lt 5.0.0 ]; then     echo "Less than 5.0.0" else     echo "Greater than 5.0.0" fi   But it throws an error:  [: integer expression expected: 4.8.5   I understood my mistake that I was using strings to compare and the -lt requires integer. So, is there any other way to compare the versions?