I have a XML file(MyXML.xml) like this :  &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;     &lt;S:Body&gt;         &lt;ns3:GetAllInfoFromRest xmlns:ns2="http://com.lanuk.cfe/b2_7/service/objects" xmlns:ns3="http://com.lanuk.cfe/b2_7/service/operations"&gt;             1111,GH43567,Hamburger,GET,278598655,\n000001,                    ,Kunal,Bhyuo,Ramond,856 K. 98 Rd,                                        ,                                        ,Tripura,AGT,INDIA,856987,                    ,S,S,S,8956,\666666         &lt;/ns3:GetAllInfoFromRest&gt;     &lt;/S:Body&gt; &lt;/S:Envelope&gt;   Now i need to strip out the SOAP content and all the tag attributes from this xml and get only the string response 1111,GH43567,Hamburger,GET,278598655,\n000001,                    ,Kunal,Bhyuo,Ramond,856 K. 98 Rd,                                        ,                                        ,Tripura,AGT,INDIA,856987,                    ,S,S,S,8956,\666666.  How can i do it with awk or  sed ?  I tried it in this  way :  $ xgawk -lxml 'XMLATTR["xmlns:ns3"]=="http://com.lanuk.cfe/b2_7/service/operations"{print $2}' MyXML.xml   But obviously I am making some mistake  due to which it is not working.  Can some one suggest any other way around this ?
The Unix environment has some excellent tools for parsing text in various forms. However, of late, the data is not in the traditional (historical) formats (CSV, TSV, record-based or some other delimiter-based) it used to be before. Data these days is exchanged in structured formats like XML/JSON.  I know there are some good tools like sed, awk and Perl which can chew down nearly any form of data out there. However, to work with this sort of structured data, often one has to write a complete program, and, given the little time available to extract information, one has to sit down and figure out the whole logic of what one wants to query and put it down programmatically. Sometimes this is not OK – basically because the information extracted from those files acts as inputs for further work; also because of the time it takes to search for the appropriate solution and code it up. A command line tool is needed with sufficient switches to find, query and dump data.  I'm looking for tools that take a XML/JSON or other forms of structured data and dump it into other formats like csv, etc., so that from there one could use other commands to get any information out of it.  Are there any command line utilities you know of which do this kind of a job? Are there already awk/Perl scripts available to this?
I have two dates of the form:  Start Date: 2007-03-24  End Date: 2009-06-26   Now I need to find the difference between these two in the following form:  2 years, 3 months and 2 days   How can I do this in PHP? I think this was more of a fantasy series, though it was more subtle than The Lord of the Rings IIRC. Set in modern times - though there was some alternate realm thing that was less modern I think.   I read it about ten years ago, I think, and there were a number of books at that time. My brother and I stopped reading it shortly after the main character summoned a small demon somehow who was a bad influence... I think.  It involved a boy who somehow was at some kind of training school/academy. Unsure where it was located, but it needed a classic portal to get to it I think. I clearly remember some scene involving a car driving at specific speeds to get past some barriers. There may have been something about how the school was (slowly) moving or the wards were shrinking... unsure. I don't think it was only magic based, but that was some element of it. The boy had some kind of strange power that made him an incredible fighter, but he wasn't sure how (at least from what I remember). The recordings of him training just showed a white flash I think. I remember some scene in an elevator going down to the training floor where he went to a level below some adult with him.  There was something else about him joining a group that had twelve members, one for each month, whose powers grew and lessened based on how close the date was to "their" month.  Oh, and there was something about him looking for his mother I think? Perhaps in another "realm"?   Any help is appreciated! What are the dev-loop services that started on boot? After booting I ran systemd-analyze blame and here are the results:       21.596s systemd-journal-flush.service      18.658s dev-sda8.device      15.099s dev-loop33.device      15.034s dev-loop19.device      15.012s dev-loop34.device      14.989s dev-loop21.device      14.877s dev-loop15.device      14.866s dev-loop26.device      14.773s dev-loop27.device      14.684s dev-loop30.device      14.677s dev-loop32.device      14.649s dev-loop35.device      14.590s dev-loop25.device      14.267s dev-loop23.device      14.192s dev-loop24.device      14.156s dev-loop29.device      14.133s dev-loop16.device      14.065s dev-loop31.device      14.059s dev-loop28.device      13.821s dev-loop20.device      13.531s dev-loop22.device      13.495s dev-loop14.device      13.364s dev-loop18.device   What are these dev-loopxx.device (xx denotes numbers) services and why are they taking so much time? Are they related to the mounting of snaps? Can I reduce the boot time by disabling them? I'm running Ubuntu 18.04 alongside Windows 10. I have a website running in English and Japanese and the default language is Japanese.  What are the advantages of one over the other solution:   Solution 1. When accessing example.com, you will see only Japanese. When accessing example.com/en, you will see only English. Solution 2. When you access example.com, it will redirect you to example.com/ja, where you will see only Japanese. English site is still example.com/en. Is the coefficient of friction always less than unity? What are the cases in which coefficient of friction is greater than unity? How to disable grub menu at boot time in Ubuntu 20.04? Are there any rules related to the creation of a ?   I am aware of the creation method for the amulet. But I'm asking about creating the actual construct. If cooking meat kills bacteria, and bacteria are responsible for problems with eating meat which has been left out, then why is it dangerous to eat meat which has been left out at room temperature and then thoroughly cooked?   mentions that "Even if the bacteria is dead, toxins can remain if the food was out too long, causing problems".  However, there's no further detail given.  Are these toxins as dangerous as the bacteria themselves?  How long does meat have to be left out to accumulate a dangerous level of toxins and thus be dangerous even if thoroughly cooked?  Are these toxins the reason for the usual guideline of keeping meat unrefrigerated for a maximum of 2 hours?  update  The revelation, courtesy of Aaronut, that e. coli is actually dangerous because of its toxins — which cannot be denatured at temperatures which will leave meat in an edible state — has pretty much answered this question.  And also given me further incentive to stop eating meat altogether :)  Our discussion (see the comments on hobodave's answer) has progressed into the realm of microbiology.  Some highlights from my ongoing research:  .  These seem to be the reason for the importance of keeping meat at a high temperature for a period of time.  .  This also provides fascinating insight into how bacteria evolved immunity to antibiotics.  Fungi. What is the method to make files in a USB Flash Drive undeletable? Does these method work with USB 3.0 interface?  (I have surveyed some Flash Drive manufacturers, and I only see undeletable files for USB 2.0 drives, and not 3.0 drives. One manufacturer claimed that USB 3.0 cannot do undeletable file, so I am curious whether the claim is correct...) vertically align top line of item contents with item number \begin{enumerate}     \item This looks good.     \item       $\begin{aligned}         \mathrm{This} &amp;= \mathrm{is} \\                       &amp;= \mathrm{not\ nicely\ aligned}       \end{aligned}$     \item \begin{tabular}{ccc}             &amp; Neither &amp; is \\        this &amp; table.  &amp;    \\     \end{tabular} \end{enumerate}   It currently looks like this:    But I want it to look like this:    Vertically-aligned so that the top line of the ... item contents, lines up with the item number. How to fix Eclipse with OpenJDK 9 Will Find my iPhone Lost Mode be useful if stolen phone as shows Offline? My phone was stolen last night. I made sure it was in Lost Mode in iCloud and it was immediately in Offline status when I open iCloud. I am positive the thief switched it off. Now I am 100% certain the Find my iPhone option was turned on on my iPhone, but will the "Lost Mode" be of any help if it was not turned on on the iPhone? Would it be showing "Offline" if I did not turn on the option? `tail -f` until text is seen I've got a CI server with a command-line interface that allows me to remotely kick-off a job (jenkins CI server and the jenkins-cli.jar tool).  After I kick the job off I tail -f the log (sorry for the messy command):  ssh -t my-jenkins-host.com "tail -f \"/var/lib/jenkins/jobs/$job_name/builds/\`ls -ltr /var/lib/jenkins/jobs/$job_name/builds/ | grep '^l' | tail -n 1|awk '{print \$9}'\`/log\""   After the job successfully completes, usually after at least 5 minutes, I get the following line on the output:  Finished: SUCCESS   Is there a good way to stop tailing the log at this point? i.e. is there like a tail_until 'some line' my-file.log command?  BONUS: extra credit if you can supply an answer that returns 0 when SUCCESS is matched, 1 when FAILURE is matched, and your solution works on mac! (which i believe is bsd based) How to find $\partial\chi^2/\partial a$ where $\chi^2=\sum_{i=1}^N\dfrac{D(x_i)-a-b(x_i)^2}{\sigma_i^2}$?  My attempt: \begin{align} \dfrac{\partial}{\partial a}\sum_{i=1}^N\dfrac{D(x_i)-a-b(x_i)^2}{\sigma_i^2} &amp;= \dfrac{\partial}{\partial a}\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\sum_{i=1}^N\dfrac{-a}{\sigma_i^2}\\ &amp;=\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\dfrac{\partial}{\partial a}\sum_{i=1}^N\dfrac{-a}{\sigma_i^2}\\ &amp;=\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\dfrac{1}{\sigma_i^2}\cdot\dfrac{\partial}{\partial a}\sum_{i=1}^N-a\\ &amp;=\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\dfrac{1}{\sigma_i^2}\cdot\dfrac{\partial}{\partial a}a^N\\ &amp;=\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\dfrac{1}{\sigma_i^2}\cdot N\cdot a^{N-1}\\ \end{align}  Is this correct?  EDIT: As per the accepted answer, this is how I got my final partial derivative. \begin{align}             \dfrac{\partial}{\partial a}\sum_{i=1}^N\dfrac{D(x_i)-a-b(x_i)^2}{\sigma_i^2} &amp;= \dfrac{\partial}{\partial a}\Bigg[\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}-\sum_{i=1}^N\dfrac{-a}{\sigma_i^2}\Bigg]\\             &amp;=\dfrac{\partial}{\partial a}\Bigg[\sum_{i=1}^N\dfrac{D(x_i)-b(x_i)^2}{\sigma_i^2}\Bigg]-\dfrac{\partial}{\partial a}\Bigg[\sum_{i=1}^N\dfrac{-a}{\sigma_i^2}\Bigg]\\             &amp;= 0-\dfrac{\partial}{\partial a}\Bigg[\dfrac{-a}{\sigma_1^2}+\dfrac{-a}{\sigma_2^2}+\cdots+\dfrac{-a}{\sigma_N^2}\Bigg]\\             &amp;= -\Bigg[\dfrac{\partial}{\partial a}\Bigg[\dfrac{-a}{\sigma_1^2}\Bigg]+\dfrac{\partial}{\partial a}\Bigg[\dfrac{-a}{\sigma_2^2}\Bigg]+\cdots+\dfrac{\partial}{\partial a}\Bigg[\dfrac{-a}{\sigma_N^2}\Bigg]\Bigg]\\             &amp;= -\Bigg[\dfrac{-1}{\sigma_1^2}\cdot\dfrac{\partial}{\partial a}[a]+\dfrac{-1}{\sigma_1^2}\cdot\dfrac{\partial}{\partial a}[a]+\cdots+\dfrac{-1}{\sigma_N^2}\cdot\dfrac{\partial}{\partial a}[a]\Bigg]\\             &amp;= -\Bigg[\dfrac{-1}{\sigma_1^2}+\dfrac{-1}{\sigma_2^2}+\cdots+\dfrac{-1}{\sigma_N^2}\Bigg]\\             &amp;= \sum_{i=1}^{N}\dfrac{1}{\sigma_i^2}\\         \end{align} What is a good data plan for Internet surfing in northern Italy? I've checked the webpages of some their providers, but franly, just like in the case of those in my own language, I literally cannot find my way around them. So if you wouldn't mind sharing a word of two or advice.  I'm looking for a good solution for mobile internet surfing in northern Italy, that can be connected to a laptop (you know, that usb stick with a SIM card inside kind of thing). 15 Gb or so at some decent speed. Can you perhaps give a recommendation or two of what to get?    Edit: Just to define what I'm looking for exactly. A data plan of 15 Gb with an internet key (usb stick into which a SMS card goes) that you plug into a laptop. Preferably non-contractual, so I can cancel when I leave. I am not interested in surfing on my mobile phone since due to size I still prefer the smaller Nokia-like models for calls (smaller to carry) - no internet on them. Electric circuits in TeX, LaTeX, and Friends What are some ways to draw electric circuits in TeX systems?  I'm making this community wiki since I haven't found a question related to this.  I was thinking along the lines of . What do you think of that? Other examples are more than welcome, of course. Convergence of $A_nT$ to $AT$ in operator norm for compact $T$ $A_n:Y\rightarrow Z$ are operators that strongly converge to $A$. Also, $\|A_n\|_\text {op}\le c$ for $c&gt;0$. Given a compact operator $T:X\rightarrow Y$, I need to show that $A_nT$ converges to $AT$ in operator norm (all spaces in this question are Banach spaces).     I was unable to prove this and I also do not understand why we need to assume that $T$ is compact. Any ideas? When clicking &quot;edit&quot; I see:  Your edit will be placed in a queue until it is peer reviewed. We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.  Like:     Likewise, when I am not logged in, clicking &quot;improve this question&quot; or &quot;improve this answer&quot; shows:  You are not . Your edit will be placed in a queue until it is .  And when I click 'Save', I get:  Thanks for submitting an edit. It is only visible to you until it's been approved by trusted community members  Like:     Who can suggest an edit? Where do suggested edits go? Who can vote on a suggested edit? How do suggested edits get reviewed? Can I earn reputation? What about abuse or bad edits? Sometimes the Community user approves or rejects my edit. Why is that? When can I not suggest an edit? Is there a minimum change requirement for a suggested edit? How do I check my suggested edit history? I disagree with the reasons why my suggested edit was rejected. What can I do? How do I know whether there are edits waiting for review? Someone suggested an edit to my own post, and the reviewers took the wrong action. What can I do? Are tag wikis included in this scheme? What do the &quot;Improve Edit&quot; and &quot;Reject and Edit&quot; buttons do? Why are apparently valid links to rejected edits resulting in 404 errors?   For more information about editing, see &quot;&quot; in the . Given a method signature:  public bool AreTheSame&lt;T&gt;(Expression&lt;Func&lt;T, object&gt;&gt; exp1, Expression&lt;Func&lt;T, object&gt;&gt; exp2)   What would be the most efficient way to say if the two expressions are the same? This only needs to work for simple expressions, by this I mean all that would be "supported" would be simple MemberExpressions, eg c => c.ID.  An example call might be:  AreTheSame&lt;User&gt;(u1 =&gt; u1.ID, u2 =&gt; u2.ID); --&gt; would return true Changing parameter values according to other parameter choice in Processing script using QGIS 3? I couldn't find anything about this problem.  Suppose to have the first parameters in a Processing script defined as an Enum:     self.addParameter(         QgsProcessingParameterEnum(             self.CHOICE,             self.tr('Choose the parameter'),             ['param1', 'param2']         ) )   While the second one as a number:  self.addParameter(     QgsProcessingParameterNumber(         name=self.VALUE,         description=self.tr('My value'),         type=QgsProcessingParameterNumber.Double,         defaultValue=40,         optional=False,         minValue=0,         maxValue=100     ) )   Is it possible to change the minValue, maxValue, description, ecc.. of the second parameter depending on the first or second choice of the first parameter already in the GUI?  e.g. if the user choose param1 then the second parameter should become:  self.addParameter(     QgsProcessingParameterNumber(         name=self.VALUE,         description=self.tr('My value'),         type=QgsProcessingParameterNumber.Double,         defaultValue=40,         optional=False,         minValue=0,         maxValue=100     ) )   while if he choose param2 it should became:  self.addParameter(     QgsProcessingParameterNumber(         name=self.VALUE,         description=self.tr('My AWESOME value'),         type=QgsProcessingParameterNumber.Double,         defaultValue=0,         optional=False,         minValue=50,         maxValue=500     ) )