I want to get the value of the following nodes:  ResponseMessage, Response Result and VelocitiHotLeadID  from this SOAP XML response:  &lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Body&gt; &lt;SubmitHotLeadDetailsResponse xmlns="http://tempuri.org/"&gt; &lt;SubmitHotLeadDetailsResult xmlns:a="http://schemas.datacontract.org/2004/07/Velociti.Webservice.VelocitiHotLead" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;     &lt;a:ResponseMessage&gt;1:VendorID Does Not Exist 2:IDNumber is invalid.&lt;/a:ResponseMessage&gt;     &lt;a:ResponseResult&gt;false&lt;/a:ResponseResult&gt;     &lt;a:VelocitiHotLeadID&gt;0&lt;/a:VelocitiHotLeadID&gt; &lt;/SubmitHotLeadDetailsResult&gt; &lt;/SubmitHotLeadDetailsResponse&gt; &lt;/s:Body&gt; &lt;/s:Envelope&gt;   I've tried to use this code but it did not work:  $xml = simplexml_load_string($result, NULL, NULL, "http://schemas.xmlsoap.org/soap/envelope/"); $xml-&gt;registerXPathNamespace('s', 'http://schemas.xmlsoap.org/soap/envelope/'); $xml-&gt;registerXPathNamespace('a', 'http://schemas.datacontract.org/2004/07/Velociti.Webservice.VelocitiHotLead'); $xml-&gt;registerXPathNamespace('i', 'http://www.w3.org/2001/XMLSchema-instance'); foreach($xml-&gt;xpath('//a:ResponseMessage') as $response) {    echo $response; }
Let's say I have some XML like this  &lt;channel&gt;   &lt;item&gt;     &lt;title&gt;This is title 1&lt;/title&gt;   &lt;/item&gt; &lt;/channel&gt;   The code below does what I want in that it outputs the title as a string  $xml = simplexml_load_string($xmlstring); echo $xml-&gt;channel-&gt;item-&gt;title;   Here's my problem.  The code below doesn't treat the title as a string in that context so I end up with a SimpleXML object in the array instead of a string.  $foo = array( $xml-&gt;channel-&gt;item-&gt;title );   I've been working around it like this  $foo = array( sprintf("%s",$xml-&gt;channel-&gt;item-&gt;title) );   but that seems ugly.  What's the best way to force a SimpleXML object to a string, regardless of context?
"Unable to locate package sudo" when i try to install sudo on new Debian Determining direction of longest segment of polygon using ArcGIS Desktop? I have a shapefile with 9000 agriculture fields and what I like to do is to determine for each field (=each polygon) the direction of the longest segment.  For instance, the selected polygon in the screenshot has its longest segment from west to east so I would like to mark give the polygon the attribute W (for west) or either E (for east).   Is there any solution to solve my problem in a fast but generalized way?   I do not need very detailed results. It's just for the interpretation of a question.   I'm seeking an answer using ArcGIS 10.2 for Desktop.  To be more precise on what I'm looking for I try to explain more practical: I'm doing winderosion analysis for a specific area with 9000 fields. As result I have a potential susceptibility for each field. I like to check, if the fields with high susceptibility are correlated to a certain orientation of the fields, e.g. check if most of the fields with high risk are oriented in the main winddirection or not.   The search for the longest segment is not really important for me. It was just an idea I had to determine the direction. So forget about the longest segment if there is a way to determine the direction with another method ;) Python __str__ and lists Stars and pins are retained when chat messages are moved! If $M^n$ is a compact topological manifold (not necessarily with additional structure), is there an upper bound on the number of charts needed to cover $M$ ? Does this bound depend on the dimension of $M$ ?  Thanks in advance...  Cheers What is tail recursion? Whilst starting to learn lisp, I've come across the term tail-recursive. What does it mean exactly? Consider an isosceles triangle. Let r be the radius of the circumscribed circle and p be the radius of the inscribed circle. Prove that the distance d between the centers of these two circles is $$d = \sqrt{r(2p-r)}$$ Description of varieties in $\mathbb{P}^2\times \mathbb{P}^1$ If $[x:y]$ are coordinates of $\mathbb{P}^1$ and $[X:Y:Z]$ are coordinates of $\mathbb{P}^2$, what do the following varieties look like?   $V(x^2X+y^2Y+xyZ)\subset \mathbb{P}^2\times \mathbb{P}^1$ $V(x^2X^2+y^2Y^2+xyZ^2)\subset \mathbb{P}^2\times \mathbb{P}^1$   As of now, I don't quite know how to visualize these varieties. A detailed geometric picture would be especially welcome. Do spells with a range of "Self" target the caster? New to D&amp;D, and thought about creating a Beast Master. I was wondering if spells with a range of "Self" would count you as the "target" of the spell. There's some debate in my group, as unlike something such as Cure Wounds, which specifies "A creature you touch," there's technically no mention of a target in a Self range spell within the description. A fair amount of people in my playgroup come from a TCG background, where the presence (or lack thereof) of keywords like "target" are essential for determining interaction.  tl;dr Would Paladin Smites or Thunderwave count as "targeting" yourself, and therefore be affected by Beast Master's Share Spell? Say I create an object as follows: let myObject = {   &quot;ircEvent&quot;: &quot;PRIVMSG&quot;,   &quot;method&quot;: &quot;newURI&quot;,   &quot;regex&quot;: &quot;^http://.*&quot; };  How should I remove the property regex to end up with new myObject as follows? let myObject = {   &quot;ircEvent&quot;: &quot;PRIVMSG&quot;,   &quot;method&quot;: &quot;newURI&quot; }; How can I add metadata to NTFS files/folders? I want to tag different file types (i.e. .pdf, .epub, .iso, .bin, folders,..) using the same descriptive fields. For example i would like a metadata field "type" which would be "eBook" on pdf- and epub-files, "CD-Image" on iso- and bin-files.  I read about Alternate Data Streams (ADS) to make this possible. Does anyone know a good program for Windows 7 to tag different files and search for them? It is important for me, that the metadata is NOT stored in a separate database. I move the files a lot and need to stay flexible (ADSs 'stick' to the files).  Any ideas? No, this is not a , nor is it a solicitation on  to backup or  and only a little bit about Where to backup and When to do it.  This is basically a strategy question: what, where and when all together. "How" is not really relevant: there are tons of back-up programs out there and they all do the same basic thing: make copies of data.  But the real question is: are these back-up programs making copies of the data important to you?  How should you install&amp;run Ubuntu while safeguarding your data?  There is no "one size fits all" when it comes to computers, Ubuntu versions or a backup strategy, therefore I've split this up into 5 basic user types with each their own answer:       (or you're running in UEFI mode!)   And as the above does not fit everyone, one for the impatient:   !    So click one of the above links and go to your user type!  P.S. If you're running a server farm and you've read this question so far, I'm sorry: this is about a single PC, not a network, nor a server farm. First post review queue: answers are questions, questions are answers I believe there is a typo in the  review queue. When reviewing a question, the information message asks the user to review the answer. Take a look at the image below.    Similarly, when an answer is posted in the queue, the description box calls it a question instead. Has anyone else noticed this? Disappointed to see that the 18.04 installer no longer offers the option to encrypt the home directory. According to  bug report referenced in the installer, the recommended method for encryption these days is full-disk with LUKS, or fscrypt for directories. Full-disk encryption seems a bit overkill for my needs, and all the bugs and caveats mentioned on the  don't make it a very attractive option. All I really want is to protect my home directory from someone accessing my documents, photos, etc. if my laptop were to get stolen, making fscrypt the option for me.  The  has some examples on how to set it up, but I can't find any documentation aimed at encrypting the home directory on Ubuntu. The old ecryptfs tool is still available, but after setting it up Ubuntu would sometimes freeze at the login screen.  So my question is: How do I setup fscrypt to encrypt my /home directory and decrypt when I log in? I also liked how ecryptfs allowed decrypting the folder manually (eg. from disk images).  (A similar question was posted  and was unfortunately closed for being an "off-topic" bug report. To clarify, this is not a bug report. The fact that the encrypt home directory option was removed from the installer was intentional. All I'm asking here is how to setup fscrypt.) How to boot Ubuntu persistent live USB on Android? I'm discovering the possibilities offered by persistent live USB using Ubuntu 19.10 and I was wondering if it would be possible to boot with Ubuntu on Android (i.e. using your computer capabilities through your smartphone) using those multi-plug USB sticks which have both USB3 and micro-USB2.  In other way: can I get some kind of a boot menu on an Android device in order to boot with a persistent live USB in order to access my Linux computer tools and setup from a wider range of devices? JavaFX accordion with multiple open panes How can I prevent my Wi-Fi connection from glitching? "You should be well-organised" or "You should be well organised"? What is DOCTYPE? Change hanging indent in description list I'm trying to get a description's list hanging indent to lie flush with the first line of text.  I have a description list such as the following:  \begin{description}  \item[Label the first] Lorem ipsum dolor sit amet, consectetur adipisicing                         elit, sed do eiusmod tempor incididunt ut labore et                         dolore magna aliqua.  \item[The longest label] Ut enim ad minim veniam, quis nostrud exercitation                           ullamco laboris nisi ut aliquip ex ea commodo                           consequat.  \item[Shrtlbl] Duis aute irure dolor in reprehenderit in voluptate velit esse                 cillum dolore eu fugiat nulla pariatur. \end{description}   This produces the following output:    I would like to have each paragraph indented so that the following lines are flush with the first letter of the list item's text, the way it's laid out in my TeX.  For instance, the "s" of "sectetur" should be right under the "L" of "Lorem".  I've tried looking through the documentation of , but I can't seem to find a good option.  I tried specifying [leftmargin=3cm, style=sameline], but this results in the following:    This isn't quite right: I'm trying to get each item lined up differently, so that the "L" of "Lorem" is not necessarily flush with the "U" of "Ut" or the "D" of "Duis".  Does anybody know a good way to do this?