I have a following XML structure:  &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Class&gt;   &lt;subjects&gt;   &lt;/subjects&gt;   &lt;students&gt;     &lt;Name&gt;klashf&lt;/Name&gt;     &lt;Name&gt;lkashf&lt;/Name&gt;   &lt;/students&gt;   &lt;marks&gt;     &lt;english&gt;yes&lt;/english&gt;     &lt;math&gt;yes&lt;/math&gt;   &lt;/marks&gt; &lt;/Class&gt;   Now for e.g. I want to delete English element &lt;english&gt;yes&lt;/english&gt; from it. How can I do that? I tried many things like following but I am unable to find a way to get to that node. I tried to construct a XPath to that node but unable to get there. Can nayone tell me what should be the xPath to there?      public bool RemoveTag(string userName, string tagName)     {         XmlDocument newDoc = new XmlDocument();         newDoc.Load(path);          XPathNavigator navigator = newDoc.CreateNavigator();         XPathExpression query = navigator.Compile("//marks");          query = navigator.Compile("//marks/" + tagName);          XmlNodeList marksNodes = newDoc.GetElementsByTagName("marks");         XmlNode nodeToDelete=marksNodes[0].SelectSingleNode(userName+"/marks/"+tagName);         for (int i = 0; i &lt; marksNodes.Count; i++)         {             marksNodes[i].RemoveChild(nodeToDelete);         }         return status;     }
The following code should find the appropriate project tag and remove it from the XmlDocument, however when I test it, it says:  The node to be removed is not a child of this node.  Does anyone know the proper way to do this?  public void DeleteProject (string projectName) {     string ccConfigPath = ConfigurationManager.AppSettings["ConfigPath"];      XmlDocument configDoc = new XmlDocument();      configDoc.Load(ccConfigPath);      XmlNodeList projectNodes = configDoc.GetElementsByTagName("project");      for (int i = 0; i &lt; projectNodes.Count; i++)     {         if (projectNodes[i].Attributes["name"] != null)         {             if (projectName == projectNodes[i].Attributes["name"].InnerText)             {                                                                 configDoc.RemoveChild(projectNodes[i]);                 configDoc.Save(ccConfigPath);             }         }     } }   UPDATE  Fixed. I did two things:  XmlNode project = configDoc.SelectSingleNode("//project[@name='" + projectName + "']");   Replaced the For loop with an XPath query, which wasn't for fixing it, just because it was a better approach.  The actual fix was:  project.ParentNode.RemoveChild(project);   Thanks Pat and Chuck for this suggestion.
I recently updated my version of Lyx from 1.6.7 to 2.0.6. I would like to transfer my old keyboard shortcuts to this new version, but I am having difficulty because I was inconsistent with the way that I set them up:   Some were defined in the specified .bind file,  but others were modified in the lyx preferences menu.   I found that when importing my old .bind file into this updated version of lyx, it imported the keyboard shortcuts that were in the .bind file, but not those that I had added in the preferences menu.  Does anyone know if these keyboard shortcuts that were added via the preferences menu are stored in another .bind file somewhere in the lyx directory? Has anyone else successfully transferred keyboard shortcuts that had been implimented in the preferences menu? Change owner of internal hard drive partition from root to user I have a number of drives internal and external. Some are partitioned. Most mount automatically at boot (all did at one point).    One partition is owned by root and therefore does not mount automatically. I know how to mount it as root.   I do not know how to take ownership of that partition as user X. I have tried changing permissions using the gui in Nautilus as root. They are not accepted and immediately revert.  The partition is NTFS. The other parition on that drive is owned by me as user and mounts automatically How to prove this question? If a graph with $n$ vertices and $n$ edges it must contain a cycle? There is a  being thrown out of a flask, literally hovering out of the container  My question is how detailed a physical explanation of this phenomenon we have?  Question: More precisely, if we used the best available mechanical physics simulator software, and we tried to simulate this behavior, would the software be able to reproduce the effect or not? My guess is not but I would like to know why not.  Or do we have to content ourselves only with handwaved explanations? I am from the school of thought that you don't understand physics until you have a reasonable certainty that you can reproduce the physics in a computer. How do I change the extension of multiple files? I would like to change a file extension from *.txt to *.text. I tried using the basename command, but I'm having trouble on changing more than one file.  Here's my code:  files=`ls -1 *.txt`  for x in $files do     mv $x "`basename $files .txt`.text" done   I'm getting this error:  basename: too many arguments Try basename --help' for more information What is a good criterion or rule-of-thumb for determining when a control should be greyed-out and when should it be completely invisible? Can you make an opportunity attack against a moving object? How to request a random row in SQL? How can I request a random row (or as close to truly random as is possible) in pure SQL? Proving that 1- and 2-d simple symmetric random walks return to the origin with probability 1 How does one prove that a simple (steps of length $1$ in directions parallel to the axes) symmetric (each possible direction is equally likely) random walk in $1$ or $2$ dimensions returns to the origin with probability $1$?  Edit: note that while returning to the origin is guaranteed $(p = 1)$ in $1$ and $2$ dimensions, it is not guaranteed in higher dimensions; this means that something in a correct justification for the $1$- or $2$-d case must fail to extend to $3$-d (or fail when the probability for each direction drops from $\frac14$ to $\frac16$). Mouse cursor flickering and disappearing I installed Ubuntu today and since the first start up I have a problem with the mouse cursor.  It starts randomly disappearing and flickering a lot.  I have searched for a solution on Google and here but didn't find anything. Does $f(x)$ is continuous and $f = 0$ a.e. imply $f=0$ everywhere? I wanna prove that   "if $f: \mathbb{R}^n \to \mathbb{R}$ is continuous and satisfies $f=0$ almost everywhere (in the sense of Lebesgue measure), then, $f=0$ everywhere."  I am confident that the statement is true, but stuck with the proof. Also, is the statement true if the domain $\mathbb{R}^n$ is restricted to $\Omega \subseteq \mathbb{R}^n$ that contains a neighborhood of the origin "$0$"? Today 4/30/20 my seemingly worthless USO call option increased in value.   Specifically: USO1 $2.5 Call 5/8  On 4/29 it was valued at $.04 and stayed there.   4/30 I checked after hours and now it’s up to $.08? Which was wasn’t even the highest it went to today.  So who is buying this contract?  Who is allowed to buy this contract? Bc I’m only able to sell and from what I understood, nobody is able to buy it.   I have screenshots and will post if requested. Thank you Check if this proof about real numbers with an irrational product is correct. Can anyone confirm if my proof is correct, please?  Claim:- “If $x$ and $y$ are real numbers and their product is irrational, then either $x$ or $y$ must be irrational.”  Proof:-   Assume that both $x$ and $y$ are rational. Now, let $x = \dfrac pq$ and $y = \dfrac mn$ since both of them are rational. $xy =\dfrac pq * \dfrac mn = \dfrac{pm}{qn}$ Thus, if the product $xy$ can be written as a fraction, it's not a irrational number. Therefore if one of $x$ and $y$ is not irrational, then the product is not irrational.  By the principle of proof by contraposition, If $x$ and $y$ are real numbers and their product is irrational, then either $x$ or $y$ must be irrational. Is it mandatory to have published papers while applying for PhD? I've heard from people saying that while applying for PhD, you need to have past experience in researching something and should have international publications. I was like more concentrated towards practical experience and have't had any publications. If I am aspiring to do PhD and want to apply, it would be impossible if such a criteria exists! What does "causally connected" or "causes" really mean? In a different thread, a user stated the following about events preceding or following other events:     However, if the two events are causally connected ("event A causes event B"), the causal order is preserved (i.e. "event A precedes event B") in all frames of reference.   My question is what does "causally connected" really mean? What does "causes" mean? Further, given that we know that we can have instantaneous effects in typical quantum processes (e.g. flip the polarizer, effect on another a reading light years away, even though we cannot transmit useful information with this), does that not constitute "causing" for the purpose of this statement? Find all entire functions $f(z)$ such that $|f(z)|=1$ for $|z|=1$ Ubuntu 14.04, problem when install gstreamer1.0-libav, unmet dependencies Getting nauseated from air travel, but it's not motion sickness... what to do? How to create a Facebook page without a personal account In the past, Facebook used to let business create pages or apps without a personal account. This account created in the page/app creation process had limited capacities and could be switch to a full personal account after—if needed (irreversible).  But today, if I want to create a page for a new brand, without having a Facebook account, it seems I can’t anymore. And I can’t find any communication from Facebook regarding this change.   Anybody has any info? Is it still possible (in a new way maybe)? Preprocess categorical variables with many values