I'm trying to fix a bug that occurs seldomly (a concurrentModificationException) while looping through a Set of generics Set (on the clean() method).  for (final K key : this.bean.keySet()) {     getProxy(key).clean(); }   All the answers I found suggest to use an iterator and then calling the method remove() on it but here I am not looping through a list where I need to remove an item.  There is maybe also the possibility to convert my Set to an array and lock it (using java.util.concurrent.Locks) / make it synchronous.  I am confused about the best approach to fix my problem, the solutions above don't really satisfy me as they make me lose all benefits of multithreading.
I am using a Collection (a HashMap used indirectly by the JPA, it so happens), but apparently randomly the code throws a ConcurrentModificationException. What is causing it and how do I fix this problem? By using some synchronization, perhaps?  Here is the full stack-trace:  Exception in thread "pool-1-thread-1" java.util.ConcurrentModificationException         at java.util.HashMap$HashIterator.nextEntry(Unknown Source)         at java.util.HashMap$ValueIterator.next(Unknown Source)         at org.hibernate.collection.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:555)         at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)         at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)         at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)         at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)         at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
"A friend of my father" vs. "a friend of my father's" — which one is right? Why? I have seen them both in my reference book, which is written by a native speaker. I wonder why there are two different phrases to describe the same meaning and am looking forward to some reasonable details to explain why this is so. ConcurrentModificationException Woes Where can I find a standalone installer for Windows 7 Service Pack 1? I downloaded the Upwork desktop App on ubuntu 18.04. When I open it with Gdebi package installer I saw this error:    I tried to install gksu manually via sudo apt install gksu but I got this error  Building dependency tree        Reading state information... Done Package gksu is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'gksu' has no installation candidate   How can I install this software on ubuntu 18.04 (I download it yesturday so it is the most recent version on upwork website) ? The  is essentially that the nucleus is a ball and the electrons are balls orbiting the nucleus in a rigid orbit.    This  chemists to find a model of chemical bonding where the electrons in the outer orbits could be exchanged. And it works pretty well as seen in the Lewis structures:    However,  were found to be less rigid and instead be fuzzy fields which, instead of being discrete/rigid orbits, look more like:     However, in chemistry education like organic chemistry you still learn about chemical reactions using essentially diagrams that are modified lewis structures that take into account information about electron orbitals:    What I'm wondering is, if the Bohr model is used essentially throughout college education in the form of these diagrams, it seems like it must be a pretty accurate model, even though it turns out atoms are more fuzzy structures than discrete billiard balls. So I'm wondering what the inaccuracies are, and if there is a better way to understand them than the Bohr model. If you build a computer simulation of atoms with the Bohr model, I'm wondering if it would be "accurate" in the sense of modeling atomic phenomena, or is it not a good model to perform simulations on. If not, I'm wondering what an alternative model is that is better for simulation. Essentially, how good the Bohr model is as a diagram, as a tool for learning, and as a tool for simulation. What do we know about the Ainur who stayed in the Timeless Halls? To prove in a Group Left identity and left inverse implies right identity and right inverse Let $G$ be a nonempty set closed under an associative product, which in addition satisfies :      A. There exists an $e$ in $G$ such that $a \cdot e=a$ for all $a \in G$.      B. Given $a \in G$, there exists an element $y(a) \in G$ such that $a \cdot y(a) =e$.      Prove that $G$ must be a group under this product.   Attempt -Since Associativity is given and Closure also, also the right identity and right inverse is given .So i just have to prove left identity and left inverse.  Now as $ae=a$ post multiplying by a, $aea=aa$. Now pre multiply by a^{-1} I get hence $ea=a$. And doing same process for inverse Is this Right? How to pipe output from one process to another but only execute if the first has output? How can I rewrite this command to only email if there is output from the mailq | grep?  mailq | egrep 'rejected|refused' -A 5 -B 5 | mail -s 'dd' email@email   Is this even possible on one line?  See  for a more general case than sending email. The prime example is C# and .Net. 95% of C# questions are also tagged .Net. The reverse isn't the case so it's not a synonym. Basically, C# is a child of .Net.  Would it be possible to create some sort of one-way linkage like this? Becoming Thieves Guild Guildmaster, am I bugged? I've completed the Thieves Guild main questline () and chosen my special power (Shadowcloak of Nocturnal). It says completed in my quest log.  I also completed the  in each city you can give Thieves guild influence to (Markarth, Whiterun, Windhelm, and Solitude) and done their special jobs from Delvin. They show completed in my quest log. I've even done at least one of each kind of job from Vex and Delvin (but not in each city).  I got  in the Ragged Flagon and have done the quest for Tonilia (delivering the Moon Sugar to a caravan) and Vekel (getting the 4 books). I've also upgrade one of my pieces of Thief Armor.  I talk to  to become guild master and I get no dialogue options but he just says he's busy and we'll talk another time. There is a guild chest in front of his desk but it's locked and I don't have the key.  What am I missing? Is there some bug I've encountered? Execute function when post is published I try to use this function i have created when a post is published for the first time.  function a_new_post($post){   $post_id = $post-&gt;ID;    if ( !get_post_meta( $post_id, 'firstpublish', $single = true ) ) {       // ...run code once       update_post_meta( $post_id, 'firstpublish', true );   } } add_action( 'draft_to_published', 'a_new_post' );   I can't see anything wrong with it, but when i try to create some sample posts i check the database and the field "firstpublished" has not been created.  Does anyone see anything wrong? It's not difficult to show that  $$(1-z^2)^{-1/2}=\sum_{n=0}^\infty \binom{2n}{n}2^{-2n}z^{2n}$$  On the other hand, we have $(1-z^2)^{-1}=\sum z^{2n}$.  Squaring the first power series and comparing terms gives us  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}2^{-2n}=1$$  that is,  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}=2^{2n}$$  My question: is there a more direct, combinatorial proof of this identity?  I've been racking my brains trying to come up with one but I'm not having much success. Badge icons missing in Achievements of mobile view The badge icon followed by the site icon in the Achievements dialog is missing in the mobile view. But the same is available in the full site view.  Screenshots for reference:  Achievements - Full site view:        Achievements - Mobile view: Bug? LaTeX misparses nested optional arguments LaTeX seems to be having problems handling nested optional arguments. I've included a minimal code example that generates the error:  \documentclass[12pt,oneside]{book} \begin{document}  \newcommand{\termbad}[2][]{#2#1} \newcommand{\termgood}[2][]{#2#1}  \newcommand{\up}[1]{#1} \newcommand{\dd}[1][]{#1}  \termgood{\up{Tart}}{Pop} \termbad[\up{Tart}]{Pop}      \termgood{\dd[Tart]}{Pop} \termbad[{\dd[Tart]}]{Pop} %\termbad[\dd[Tart]]{Pop}   \end{document}   If you run this code, it works. If you remove the % in the second to last line, it fails with:  Runaway argument?  Tart{Pop} \par \par \end {document}  !File ended while scanning use of \dd.   After further tinkering, I have discovered the problem: LaTeX is reading the ] for the inner optional argument as the end of the outer optional argument and then passing a malformed argument in. So it is passing in \dd[Tart as the optional argument to \termbad instead of \dd[Tart].  This still feels like a bug to me. Nesting braces in arguments works, brackets should as well. The following are workarounds:   Enclose the inner optional argument in braces (as in the line before %). Redefine your inner function to require its argument instead of using optional arguments. Redefine your outer function to require its argument instead of using optional arguments.   Any one of the three works around the issue.  (Reposted here; question was originally posted to stackexchange and then closed instead of being migrated.) What is this colored fiber in my chicken? I smoked a whole chicken. When I cut into the breast I found this:    What is it and is my chicken ruined? Console flashes on launching, then closes (ms-windows) I installed blender on a windows 7 64 bit system.  I opened it one time then went to the tutorials.  in the meantime I had a power failure and when I tried to start blender again I get a dos window that closes itself then nothing.  I reinstalled Blender and get the same thing.  I am going to try to uninstall then reinstall but in the mean time, any other suggestions are welcome. $X$ and $Y$ i.i.d., $X+Y$ and $X-Y$ independent, $\mathbb{E}(X)=0 $ and $\mathbb{E}(X^2)=1$. Show $X \sim N(0,1)$ $X$ and $Y$ are independent and identically distribued (i.i.d.), $X+Y$ and $X-Y$ are independent, $\mathbb{E}(X)=0$ and $\mathbb{E}(X^2)=1$. Show that $X\sim N(0,1)$.  We should use characteristic functions to prove this. Any ideas? Who owns R2-D2 & C-3PO in the Prequel trilogy? Is there any concrete evidence that Anakin officially owned R2-D2 or C-3PO?  I found this episode of Star Wars: Clone Wars that shows it, but it's fairly vague... Why use a prime number in hashCode? Intuitive explanation of the tower property of conditional expectation I understand how to define conditional expectation and how to prove that it exists.  Further, I think I understand what conditional expectation means intuitively. I can also prove the tower property, that is if $X$ and $Y$ are random variables (or $Y$ a $\sigma$-field) then we have that  $$\mathbb E[X] = \mathbb{E}[\mathbb E [X | Y]].$$  My question is: What is the intuitive meaning of this? It seems quite puzzling to me.  (I could find similar questions but not this one.)