I need to compare two files with same tags, but they have some different values and I need to print three lists:  Set&lt;Costo&gt; list1 = read.getCostos("path1");         Set&lt;Costo&gt; list2 = read.getCostos("path2");          Set&lt;Costo&gt; list3 = ListaCostoUtil.listaConjunta(list1, list2);         Set&lt;Costo&gt; plus = ListaCostoUtil.listaComplementoMenos(list3, list2);         Set&lt;Costo&gt; minus = ListaCostoUtil.listaComplementoMas(list3, list2);   where list1 is my first XML file and list2 is the other, I need to print a list3 where is a complete list of all the elements from list1 and list2.  With list plus I just need to compare my list3 with list2 and throw all the elements that are not on list2 with a "+" and it's the same with minus but just adding a "-", how could I start doing it? thanks
I'm trying to write an automated test of an application that basically translates a custom message format into an XML message and sends it out the other end.  I've got a good set of input/output message pairs so all I need to do is send the input messages in and listen for the XML message to come out the other end.  When it comes time to compare the actual output to the expected output I'm running into some problems.  My first thought was just to do string comparisons on the expected and actual messages.  This doens't work very well because the example data we have isn't always formatted consistently and there are often times different aliases used for the XML namespace (and sometimes namespaces aren't used at all.)  I know I can parse both strings and then walk through each element and compare them myself and this wouldn't be too difficult to do, but I get the feeling there's a better way or a library I could leverage.   So, boiled down, the question is:  Given two Java Strings which both contain valid XML how would you go about determining if they are semantically equivalent?  Bonus points if you have a way to determine what the differences are.
Is there a rule to understand how the group "Cha" has to be pronounced?  "Character" sounds with a hard first syllable, while "Charm" sound softer, but I don't find how to tell which sound to use before earing someone saying the word. It could be because of the double consonant "rm" vs "ra"? Or is it just a matter of knowing the rule for every single word?  EDIT: More specifically, let's talk about UK English pronunciation. Why are these estimates to the German tank problem different? Suppose that I observe $k=4$ tanks with serial numbers $2,6,7,14$.   What is the best estimate for the total number of tanks $n$?   I assume the observations are drawn from a discrete uniform distribution with the interval $[1,n]$. I know that for a $[0,1]$ interval the expected maximum draw $m$ for $k$ draws is  $1 - (1/(1+k))$. So I estimate $\frac {k}{k+1}$$(n-1)≈$ $m$, rearranged so $n≈$ $\frac {k+1 }{k}$$m+1$.  But the frequentist estimate from  is defined as:  $n ≈ m-1 + $$\frac {m}{k}$  I suspect there is some flaw in the way I have extrapolated from one interval to another, but I would welcome an explanation of why I have gone wrong! I have an Ubuntu server and I've installed MySQL.  How would I use my two physical static IP addresses in my.cnf bind-address -- can I add two IP addresses? Comma before "and" in compound sentences? Is it advisable to use lead-free PCB and solder paste on a first SMD assembly job? Why is Lamarck's evolutionary theory considered incorrect? Many sources postulate without much argumentation that Lamarck's evolutionary theory is "obviously incorrect". A classic example provided in such sources is the one with giraffes, in which Lamarck argued that the necks of these animals became long as a result of continually stretching to reach high foliage. This mechanism for adaptive change in response to the environment is considered wrong.  Now the counterargument to Lamarck's ideas comprises modern findings in genetics. So it is stated that organisms pass down traits through predetermined genetic information, not based on environmental adaptations during their lifetime. Furthermore, genetic research shows that living organisms cannot alter their genetic material as needed.   Doesn't the latter contradict the evolutionary theory itself, which states that nature (i.e. environment) shapes species through natural selection in the environmental milieu? If it is not the environmental/natural factor that is responsible for genetic evolution, then what is? If genetic material were to be unchangeable, then how would adaptation to the environment and consequent evolutionary change would ever be possible? The genotype (following this logic) would remain the same. And lastly, maybe giraffes do not develop long necks at such a rapid pace (as Lamarck probably thought) by simply stretching their necks in one generation; however, what, if not neck stretching, is responsible for their consistently longer necks throughout thousands or millions of years? Hadn't the environment gradually shaped their genotype? Similarly, if I run more often, maybe my children will not become more fit, but isn't it just a matter of time (thousands of years) that if all of us consistently run a lot, then our offspring will eventually become more fit? Wouldn't our voluntary efforts eventually enhance our genetics? I do not see any problem with Lamarck's logic at all, except probably the time frame. Why is the present perfect used in headlines? In news reports, we often read or hear events introduced with the present perfect, and then the past simple like this:     The film star Jim Cooper has died of cancer. He was 68 and lived in Texas.   What's wrong if we use both first and second sentence in past simple?     The film star Jim Cooper died of cancer. He was 68 and lived in Texas. Is is possible that a software issue could be causing spotty USB-C connections on 2017 MacBook Pro? I have a 2017 MacBook Pro. It has 2 USB-C ports on the left side and I use an Aukey hub to provide more ports (4 USB, 1 HDMI, 1 USB-C) and always to connect two monitors.   I connect one monitor through the hub with the HDMI port and another directly to the MBP with a USB-C adapter. Sometimes when I connect the hub to the Mac and the 2nd monitor to the Mac, it works as it should with no problem...but more than half the time I have to connect, disconnect, jiggle, jangle, switch ports, reconnect HDMI, etc. and hopefully they will both work. OFTEN, I can only get one monitor to fire up.  Is there any kind of software fix or reset that might solve this issue? Any other thoughts welcome. Thanks. How to prove $\cos\left(\pi\over7\right)-\cos\left({2\pi}\over7\right)+\cos\left({3\pi}\over7\right)=\cos\left({\pi}\over3 \right)$ Is there an easy way to prove the identity?     $$\cos \left ( \frac{\pi}{7} \right ) - \cos \left ( \frac{2\pi}{7} \right ) + \cos \left ( \frac{3\pi}{7} \right ) = \cos \left (\frac{\pi}{3} \right )$$   While solving one , I am stuck, which looks obvious but without any feasible way to approach.   Few observations, not sure if it would help $$ \begin{align} \dfrac{\dfrac{\pi}{7}+\dfrac{3\pi}{7}}{2} &amp;= \dfrac{2\pi}{7}\\\\ \dfrac{\pi}{7} + \dfrac{3\pi}{7} + \dfrac{2\pi}{7} &amp;= \pi - \dfrac{\pi}{7} \end{align} $$ If we know the GCD and LCM of two integers, can we determine the possible values of these two integers? I know that $\gcd(a,b) \cdot \operatorname{lcm}(a,b) = ab$, so if we know $\gcd(a,b)$ and $\operatorname{lcm}(a,b)$ and we want to find out $a$ and $b$, besides factoring $ab$ and find possible values, can we find these two integers faster? My professor has stated the following lemma:  Let $U$ and $V$ be two vector spaces and $B$ a basis for $U$. If $f:B\rightarrow V$ is a map, then there exists a unique linear map $A: U \rightarrow V$ such that $A(x)=f(x)\ \forall\ x\in B$  How can I prove this lemma? (This is not a homework problem.) How can I check the integrity of a downloaded Ubuntu CD? I've just downloaded a CD image of Ubuntu. I know the installer has a check CD option, but how can I check that the image is good before burning it to CD? How to remove warnings like `Unknown media type ...` I know that contents of double quotes are expanded, whereas the contents of single quotes are not, such that  echo '$1'   gives  $1   where as   echo "$1"   gives  &lt;the argument - blank in this particular example&gt;   the same as   echo $1   However, the question  led me to wonder why double quotes and not single quotes were used when declaring the alias, thus:  alias cutf="_cutf"   instead of   alias cutf='_cutf'   I would have employed single quotes as in the latter example. Most examples on the web use single too, unless there is some expansion required. However, in this case, no expansion, to my eyes, is apparent. Is it that, in this case, they are interchangeable, or are the double quotes necessary because a function definition is employed? Count occurrences of each element in a List[List[T]] in Scala problems installing mathtools Windows Managers vs Login Managers Vs Display Managers Vs Desktop Environment I posted a  and noticed people weren't distinguishing correctly between many of these things: Windows Managers vs Login Managers Vs Display Managers Vs Desktop Environment.  Can someone please clear this up, i.e. tell us the difference between them and how they are related perhaps?  What category does Xorg fall under?  What about Gdm/Kdm/Xdm?  People also talk about X.  What is X? When I type $\overset{\circ}{Z}^\lambda$ the lambda is placed slightly above and to the right of the circle. Is there a way to make it appear as a superscript on the Z? I tried $\overset{\circ}{Z^\lambda}$, but then the circle is too high and to the right.  As a bizarre aside: a friend uses the exact same code with no problem. However, when I type it into MathOverflow it looks the same as in my compiler (i.e. bad). (1) Does he not know? (2) Doesn't he know?  I don't usually see and hear questions formed in the first style. I was even surprised to know that it is grammatically correct. And actually it is the most &quot;proper&quot; way to form an interrogative sentence.  shows that the first style was much more popular before than now. What are your suggestions on choosing between these styles? And I will probably add the third one.  (3) He does not know?  EDIT: The answers have explained how to form a question, but have not actually provided an account on the usage of the first two forms. Especially I'm interested in the first form: does it sound formal, is it used in speech or only in writing, et cetera. How can I get the Ubuntu shell on Windows 10 to recognize a connected android device? I'm trying to connect adb to my Android device in the Windows 10 Ubuntu shell, but it doesn't seem to be working:    adb does work normally on Windows, so it's not a problem with the phone or the connection.  Do I have to do something like mount the port in the Ubuntu shell?  How?  (The goal is to pass logcat to grep, which would obviously work better in Ubuntu.)