&lt;?xml version="1.0"?&gt; &lt;rights&gt;  &lt;visitor&gt;   &lt;user&gt;updateUsers&lt;/user&gt;   &lt;user&gt;deleteUsers&lt;/user&gt;   &lt;user&gt;createUsers&lt;/user&gt;   &lt;user&gt;readUsers&lt;/user&gt;  &lt;/visitor&gt; &lt;/rights&gt;   This is the xml file i am using. I want to delete the nodes depending on their values. Eg if the user want me to remove the entry for updateUsers then i could remove the &lt;user&gt; that has value updateUsers. I want to do it using php. here is my script  $xmlobj=simplexml_load_file($xmlpath);  foreach($xmlobj-&gt;{$owner}[0]-&gt;children() as $mychild) {    $childvalues[]=$mychild;                     }  foreach($childvalues as $values) {   if($userentry==$values)   {     //code to remove that node   } }   I am struck with it. Help will be very much appreciated
I have several identical elements with different attributes that I'm accessing with SimpleXML:  &lt;data&gt;     &lt;seg id="A1"/&gt;     &lt;seg id="A5"/&gt;     &lt;seg id="A12"/&gt;     &lt;seg id="A29"/&gt;     &lt;seg id="A30"/&gt; &lt;/data&gt;   I need to remove a specific seg element, with an id of "A12", how can I do this?  I've tried looping through the seg elements and unsetting the specific one, but this doesn't work, the elements remain.  foreach($doc-&gt;seg as $seg) {     if($seg['id'] == 'A12')     {         unset($seg);     } }
I am new to Force.com and trying to learn some concepts.  Currently I am using Single Email Message to send my emails, but I need to change that to mass email, but I don't quite understand how to do that.   I have also created a Visualforce email template, which I would like to use, but it doesn't seem to work.   It would be great if someone could help me out.  //email_disease_map contains pairs of email address and disease ID for (Id id : email_disease_map.keySet())   {     Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();     String[] defaultAddresses = new String[] {'id@test.com'};      List&lt;String&gt; toAddresses = new List &lt;String&gt; (email_disease_map.get(id));      if (!toAddresses.isEmpty())       {         //set addresses for email to be sent         mail.setToAddresses(defaultAddresses);         mail.setCcAddresses(toAddresses);         mail.setTemplateId(Notification);         //set up remaining email         mail.setReplyTo('test@mail.com');          mail.setSenderDisplayName('Ms Test');          Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });       }  } automatic size adjustment for nested parentheses As I prefer outer parentheses to grow larger in nested expressions, I happen to insert \bigl and \bigr and its larger cousins a lot. I have always wondered whether there is a way to do this automagically.  Inserting \left and \right prophylacticly before all opening and closing parentheses and hoping that it sorts things out doesn't do the trick in all cases as seen below.  The left column is without any size changing commands. The middle column as a \left \right pair at every parentheses/brace/bracket and the rightmost column shows my preferred version.    As seen in the middle column of the second and third line the \left and \right pair sometimes makes the outer parentheses larger, on the cost of an extra horizontal space between \Pr and (. The extra space is fine in case of really big opening parentheses but here I'd prefer the regular spacing.  \documentclass{scrartcl} \usepackage{amsmath} \usepackage{amsfonts} \begin{document} \begin{align*} &amp;1-(1-F(x))^n&amp;&amp;1-\left(1-F(x)\right)^n&amp;&amp;1-\bigl(1-F(x)\bigr)^n\\ &amp;\Pr(X_{(1)}\le x)&amp;&amp;\Pr\left(X_{(1)}\le x\right)&amp;&amp;\Pr\bigl(X_{(1)}\le x\bigr)\\ &amp;\mathbb{E}[\min\{X_1,X_2\}]&amp;&amp;\mathbb{E}\left[\min\left\{X_1,X_2\right\}\right]&amp;&amp;\mathbb{E}\bigl[\min\left\{X_1,X_2\right\}\bigr]\\ &amp;\left(\pi-\arccos(\frac{y}{r})\right)&amp;&amp;(\pi-\arccos\left(\frac{y}{r}\right))&amp;&amp;\left(\pi-\arccos \left(\frac{y}{r}\right)\right) \end{align*} \end{document}   As mathematical expressions can be arbitrarly complex there is probably no general way to do this. But I’m not asking for a solution of the general case. A partial solution that works in the simple cases shown above would be a big help. The simple rule could be, that parentheses never shrink below the size of an inner pair. Of course you can immediately think of extensions like a \mid in a conditional expectation that grows with the size of the expectation’s brackets.  What is your preference regarding the size of nested parentheses? Is there a better way to archieve your preferred style despite inserting \bigl \bigr manually?    EDIT:  A colleague pointed me to section 8.3 of Herbert Voß’  document where size problems with parentheses are solved by playing with two TeX parameters within a group around the expression in question. This led naturally to appendix G of the TeXbook where the mechanics of \delimitershortfall and \delimiterfactor are explained.  \delimitershortfall specifies the maximum space not covered by a delimiter (default 5pt) and \delimiterfactor is the ratio for variable delimiters, times 1000 (default 901).  I used them to implement the never shrink below a subformular size idea from above by setting the shortfall to 0pt and the ratio to 1.0.    While it works nicely in line one and three, in line two and four the parentheses now grow too much, and still there is the extra horizontal space introduced by \left. solving third-order nonlinear ordinary differential equation RegEx: Grabbing values between quotation marks I have a value like this:  "Foo Bar" "Another Value" something else   What regex will return the values enclosed in the quotation marks (e.g. Foo Bar and Another Value)? For a certain Hibernate entity we have a requirement to store its creation time and the last time it was updated.  How would you design this?   What data types would you use in the database (assuming MySQL, possibly in a different timezone that the JVM)?  Will the data types be timezone-aware? What data types would you use in Java (Date, Calendar, long, ...)? Whom would you make responsible for setting the timestamps&mdash;the database, the ORM framework (Hibernate), or the application programmer? What annotations would you use for the mapping (e.g. @Temporal)?   I'm not only looking for a working solution, but for a safe and well-designed solution. What is the English equivalent of gatasan? I'm looking for proof verification/help for the title question. Here is what I have now: Let $f:X \rightarrow Y$ be continuous with $X$ limit point compact. Let $V$ be an infinite subset of $f(X)$. Then we also have that $f^{-1}(V)$ is also an infinite subset of $X$. Since $X$ is limit point compact there is $x \in X$ such that $x$ is a limit point of $f^{-1}(V)$. Then $x \in \overline{f^{-1}(V)}$ by definition of the closure. Hence since $f$ is continuous, $$ f(x) \in f(\overline{f^{-1}(V)}) \subseteq \overline{f(f^{-1}(V))} \subseteq \overline{V} $$ Then since $f(x) \in \overline{V}$, it is either a limit point of $V$ or an element of $V$. However since is infinite, any neighborhood of $f(x)$ will contain infinitely many points of $V$ in either case. Thus $V$ has a limit point and $f(X)$ is limit point compact. In normal line integration, from what I understand, you are measuring the area underneath $f(x,y)$ along a curve in the $x\text{-}y$ plane from point $a$ to point $b$.  But what is being measured with complex line integration, when you go from a point $z_1$ to a point $z_2$ in the complex plane?  With regular line integration I can see $f(x,y)$ maps $(x,y)$ to a point on the $z$ axis directly above above/below $(x,y)$.  But in the complex case, when you map from the domain $Z$ to the image $W$, you are mapping from $\mathbb{R^2}$ to $\mathbb{R^2}$ ...it is not mapping a point to 'directly above/below'...so I don't have any intuition of what is happening with complex line integration. After the DEM creation, I wanted to create slope layer.   However, the result has not satisfied me. I don't think the slope map is correct. Have you ever encountered false calculated terrain map?  This is the DEM:    And this is the slope layer. Site specific magic comment links I would like site specific magic links. Currently you can write [so] in a comment, and it links like this: . I would like to be able to have site specific ones, so for example: English Language &amp; Usage  [dictionary] would go to http://dictionary.com and shows as   Ubuntu  [launchpad] would go to https://launchpad.net/ubuntu and shows as   [launchpad#bugnum] would go to https://bugs.launchpad.net/bugs/bugnum and shows as   [forums] would go to http://ubuntuforums.org/ and sows as   [discourse] would go to http://discourse.ubuntu.com and shows as   [paste] or [pastebinit] would go to http://paste.ubuntu.com and shows as   [install-d] would go to http://ubuntu.com/download/desktop/install-ubuntu-desktop and shows as   [install-s] would go to http://ubuntu.com/download/server/install-ubuntu-server and shows as   ppa:peterlevi/ppa would go to https://launchpad.net/~peterlevi and shows as   There is    Ask Different  [applesup] would go to http://www.apple.com/support and shows as   Christianity  [bible] would go to http://biblegateway.com and shows as   Currently, they are all the same, for all sites. I would like devs (mods maybe) to be able to add them on a per site basis. This is just a selection of examples. People can comment or answer with ones they would like and I'll edit them into this question. I asked this because  on Ask Ubuntu Meta wasn't possible right now - because it wasn't a feature.  [The devs] said right now it isn't possible because magic links are network wide, and they weren't sure it was high enough priority to really get done anytime soon, but if you want you can post a feature-request on Meta Stack Exchange requesting site specific magic links and see if you can garner more support for the feature and maybe get a dev to champion it.  So that's what I've done! The question is from Axler's "Linear Algebra Done Right", which I'm using for self-study.  We are given a linear operator $T$ over a finite dimensional vector space $V$. We have to show that $T$ is a scalar multiple of the identity iff $\forall S \in {\cal L}(V), TS = ST$. Here, ${\cal L}(V)$ denotes the set of all linear operators over $V$.  One direction is easy to prove. If $T$ is a scalar multiple of the identity, then there exists a scalar $a$ such that $Tv = av$, $\forall v \in V$. Hence, given an arbitrary vector $w$, $$TS(w) = T(Sw) = a(Sw) = S(aw) = S(Tw) = ST(w)$$ where the third equality is possible because $S$ is a linear operator. Then, it follows that $TS = ST$, as required.  I am, however, at a loss as to how to tackle the other direction. I thought that a proof by contradiction,  ultimately constructing a linear operator $S$ for which $TS \neq ST$, might be the way to go, but haven't made much progress.   Thanks in advance! How do I disable Aero Shake in Windows 7? I'm always accidentally minimizing most of my windows. This is really annoying. How do I disable Aero Shake? I am debating whether or not to get the Potato Sack (yes, I realize I've been debating for several weeks now) bundle through steam.  I already own: Defense Grid: The Awakening, Super Meat Boy, and Audiosurf, all of which are part of the sack pack. What happens if I buy the Potato Sack?  Do I get 2nd copies of the three above mentioned games to gift elsewhere?  Is the price of the bundle reduced by the games I already have?  Do I get nothing special for already owning those 3 games? 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? Finding a basis for a certain vector space of periodic polynomials SVM for unbalanced data I want to attempt to use Support Vector Machines (SVMs) on my dataset. Before I attempt the problem though, I was warned that SVMs dont perform well on extremely unbalanced data. In my case, I can have as much as 95-98% 0's and 2-5% 1's.   I tried to find resources which talked about using SVMs on sparse/unbalanced data, but all I could find was 'sparseSVMs' (which use a small amount of support vectors).  I was hoping someone could briefly explain:   How well SVM would be expected to do with such a dataset   Which, if any, modifications must be done to the SVM algorithm What resources/papers discuss this ffmpeg working from command line in Terminal but not in an Automator shell script! We can click the website mentioned by the users in their profile page. They can enter anything that  be .   But, in  profile page, the website link is not clickable. Why not? Is it time for Stack Exchange, Inc and the community to legally separate amicably? Are the rationals a closed or open set in $\mathbb{R}$?