I have two list a =[72,82,955,55,.....] and b=[5,7,8...] I want to remove the element from a. list b specifies the indexes from where elements to be removed.
Is it possible to delete multiple elements from a list at the same time? If I want to delete elements at index 0 and 2, and try something like del somelist[0], followed by del somelist[2], the second statement will actually delete somelist[3].  I suppose I could always delete the higher numbered elements first but I'm hoping there is a better way.
Where has the trailing newline char gone from my command substitution? The following code best describes the situation.  Why is the last line not outputting the trailing newline char?  Each line's output is shown in the comment.  I'm using GNU bash, version 4.1.5          echo -n $'a\nb\n'                  | xxd -p  # 610a620a              x=$'a\nb\n'   ; echo -n "$x" | xxd -p  # 610a620a      echo -ne "a\nb\n"                  | xxd -p  # 610a620a x="$(echo -ne "a\nb\n")" ; echo -n "$x" | xxd -p  # 610a62 I just flagged a comment as "obsolete" in . To my surprise, it was deleted immediately, just after pressing "Flag Comment".  Now I see it in my flag summary as helpful:        Does this mean that obsolete flags are somehow handled automatically? I went through  but could not find any description on this. How many rationals of the form $\large \frac{2^n+1}{n^2}$ are integers? Anyone know if R has quote-like operators like Perl's qw() for generating character vectors? I found a better proof for a theorem than a proof from a published paper. Is it possible for me to publish my proof with the same theorem citing that paper? This post has been locked; locked posts can't be voted on Why does the area of a bar in a histogram represent the frequency of that particular class In a bar-graph, the height of the bars represent the frequency of a particular category but it is counter-intuitive that in a histogram, instead of the height of the bar(which represents the frequency density), the area of the bar represents the frequency of the particular class. Why is this so? I need to find my external IP address from a shell script. At the moment I use this function:   myip () {      lwp-request -o text checkip.dyndns.org | awk '{ print $NF }' }   But it depends on perl-libwww, perl-html-format, perl-html-tree installed. What other ways can I get my external IP? Singular verb after two noun phrases joined by "and" that can be thought of as a single thing I am having trouble with the following sentence:      "The complexity and diversity of the new platforms is worrying us."   If "complexity" and "diversity" constitute two subjects, then the verb should presumably be "are"; however, the sentence feels more natural with "is". Is this correct? Is there a linguistic term for this occurrence?    The following questions address the general topic of compound subjects, but not specific cases like this:             And the following question seems to have somewhat inconclusive answers:         So this question is not really a duplicate of these three. I've noticed this on occasion with a variety of applications. I've often thought it was because the output was cancelled early (ctrl+c, for example) or something similar, and zsh is filling in a new line character. But now curiosity has gotten the best of me, since it doesn't seem to do this in bash.   zsh    bash    The Sequence program is something I pulled from a book while reading on Java certifications and just wanted to see if it would compile and run. I did notice that it does not use the println() method from the System.out package/class. Instead it uses plain old print().  Is the lack of a new line character the reason I get this symbol? Base64 Encode String in VBScript I have a web service load driver that's a Windows Script File (WSF), that includes some VBScript and JavaScript files. My web service requires that the incoming message is base64 encoded. I currently have a VBScript function that does this, but it's very inefficient (memory intensive, mostly due to VBScripts awful string concatenation)  [Aside; Yes, I've seen . The concatenation is happening in a loop across messages that are 1,000's to 10,000's bytes in size.]  I've tried using some custom string concatenation routines; one using an array and one using ADODB.Stream. These help, a little, but I think it would help more if I had some other way of encoding the message rather than via my own VBS function.  Is there some other way of encoding my message, preferebly using native Windows methods? Proving that $d(f,g)=\|f-g\| = \sup \limits_{0\leq x \leq 1} |f(x)-g(x)|$ is a metric on $X=C[0,1]$ Let $X=C[0,1]$ be the set of all continuous functions on $[0,1]$. For any two functions $f,g\in X$, set $$d(f,g)=\|f-g\| = \sup \limits_{0\leq x \leq 1} |f(x)-g(x)|.$$  Prove $(X,d)$ is a metric space.    My attempt:  This question comes down to showing that $d$ is a metric, which means that:   $d(f,g)\geq 0$ $d(f,g)=0\iff f=g$ $d(f,g)=d(g,f)$ Triangular sadness.     1) Nonnegativity is guaranteed by taking the supremum of the absolute value of a sum, since the absolute value of a sum is non-negative, the supremum of non-negative numbers is non-negative.  $\square$    2) For the supremum of $|f(x)-g(x)|$ to be equal to $0$, the greatest number for $|f(x)-g(x)|$ from $0\leq x\leq 1$ must be $0$, hence $|f(x)-g(x)|=0$ for all values on this range, and thus $f(x)=g(x)$ is the constant zero map.  $\square$    3) $|f(x)-g(x)|=|g(x)-f(x)|$ implies that $\sup \limits_{0\leq x \leq 1} |f(x)-g(x)|=\sup \limits_{0\leq x \leq 1} |g(x)-f(x)|$ $\square$    4) Triangular sadness:  We need to prove that $d(f,g)\leq d(f,h) + d(g,h)$  I.e.  $\sup \limits_{0\leq x \leq 1} |f(x)-g(x)|\leq \sup \limits_{0\leq x \leq 1} |f(x)-h(x)|+\sup \limits_{0\leq x \leq 1} |g(x)-h(x)|$  Now I am not sure how I can 'behave' with the sup 'function'. Can I do the following?  $$\sup|f(x)-g(x)| = \sup|f(x)-g(x)+h(x)-h(x)|=\sup|f(x)-h(x)+(h(x)-g(x))|$$ Then use normal triangular inequality:  $$\sup|f(x)-h(x)+(h(x)-g(x))|\leq \sup(|f(x)-h(x)|+|h(x)-g(x)|)=\sup(|f(x)-h(x)|+|g(x)-h(x)|)$$   This is obviously less than $\sup \limits_{0\leq x \leq 1} |f(x)-h(x)|+\sup \limits_{0\leq x \leq 1} |g(x)-h(x)|$, but I don't know how to prove it. How do I finish that one off. I'm using GNU Emacs from  After Migration to OSX 10.11 "El Capitan", Auctex can't run the *tex utilities anymore:  Running `LaTeX' on `poisson' with ``pdflatex  -file-line-error   -interaction=nonstopmode "\input" poisson.tex'' /bin/sh: pdflatex: command not found   There is no problem running for example pdflatex on the shell:  #pdflatex This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)  restricted \write18 enabled.   but it seems that auctex calls /bin/sh pdflatex instead, and that does not work anymore:  /bin/sh pdflatex /Library/TeX/texbin/pdflatex: /Library/TeX/texbin/pdflatex: cannot execute binary file   maybe due to El Capitan's changes to Gatekeeper sandboxing.  How can I configure auctex to run pdflatex again? I have a datetime column in MySQL.   How can I convert it to the display as mm/dd/yy H:M (AM/PM) using PHP? What does "restricted \write18 enabled" mean and why does TexLive keep reporting it? Please rate and comment. I want to improve; constructive criticism is highly appreciated. Please take style into account as well.  The following proof is solely based on vector space related axioms. Axiom names are italicised. They are defined in Wikipedia (see vector space article).  Vector spaces - Multiplying by zero scalar yields zero vector  \begin{array}{lrll} \text{Let} &amp; \dots &amp; \text{be} &amp; \dots \\ \hline &amp; F &amp;&amp; \text{a field.} \\ &amp; V &amp;&amp; \text{a vector space over $F$.} \\ &amp; 0 &amp;&amp; \text{an identity element of addition of $F$.} \\ &amp; \mathbf{0} &amp;&amp; \text{an identity element of addition of $V$.} \\ &amp; \mathbf{v} &amp;&amp; \text{an arbitrary vector in $V$.} \\ \end{array}  $$\text{Then, }0\mathbf{v} = \mathbf{0}.$$  Proof. We will denote by $1$ an identity element of scalar multiplication; we will denote by $(-\mathbf{v})$ an additive inverse of $\mathbf{v}$. \begin{align*} 0\mathbf{v} &amp;= 0\mathbf{v} + \mathbf{0}                     &amp;&amp; \text{by }\textit{Identity element of vector addition} \\ &amp;= 0\mathbf{v} + (\mathbf{v} + (-\mathbf{v}))   &amp;&amp; \text{by }\textit{Inverse elements of vector addition} \\ &amp;= (0\mathbf{v} + \mathbf{v}) + (-\mathbf{v})   &amp;&amp; \text{by }\textit{Associativity of vector addition} \\ &amp;= (0\mathbf{v} + 1\mathbf{v}) + (-\mathbf{v})  &amp;&amp; \text{by }\textit{Identity element of scalar multiplication} \\ &amp;= ((0 + 1)\mathbf{v}) + (-\mathbf{v})          &amp;&amp; \text{by }\textit{Distributivity of scalar multiplication (field addition)} \\ &amp;= ((1 + 0)\mathbf{v}) + (-\mathbf{v})          &amp;&amp; \text{by }\textit{Commutativity of field addition} \\ &amp;= (1\mathbf{v}) + (-\mathbf{v})                &amp;&amp; \text{by }\textit{Identity element of field addition} \\ &amp;= \mathbf{v} + (-\mathbf{v})                   &amp;&amp; \text{by }\textit{Identity element of scalar multiplication} \\ &amp;= \mathbf{0}                                   &amp;&amp; \text{by }\textit{Inverse elements of vector addition} \\ \end{align*} QED The app keeps asking for a nickname, and I have entered dozens of names, but it keeps saying that the names aren't available. How can I find an available name? Why does Beamer's table of contents items link to the second slide in a section? When I include a table of contents in a Beamer slide show, each section entry in the TOC ends up linking to the second slide in that section. I would have expected it to link to the first slide. What am I doing wrong?:  \documentclass{beamer}  \begin{document} \begin{frame}{Test TOC}   \tableofcontents \end{frame}  \section{Section 1}  \begin{frame}   \frametitle{Test 1} \end{frame}  \begin{frame}   \frametitle{Test 2} \end{frame}  \end{document}   Just to clarify: when I click Section 1 in the TOC, it takes me to the slide Test 2.  UPDATE: I am actually not sure if it takes me to slide Test 2. When I click the link, the viewer (Evince and Okular) displays most of Test 2, but with a tiny strip of the slide Test 1 visible at the top of the window. I suspect that the viewer may treat the link as pointing to the very bottom of slide Test 1 and then aligns that with the top of the window. Could this be the explanation? Singular or plural "set"? I'm having some issues with a sentence that is part of the purpose in a report that I'm writing. I'm not sure if the word "communicate" (in bold) should be singular or plural.  The applications in the "set" will communicate with each other, not with other "sets".     The purpose of this report is to develop a sample set of applications   that communicates between services on the internet, mobile devices   and a central processing unit in a motor vehicle. Is GNU's Java Compiler (GCJ) dead?