Remove unwanted characters, country code from phone numbers fetched from contacts iOS
Remove all but numbers from NSString
dpkg: error processing package mysql-server (--configure) Confused about complex numbers I am confused about something: \begin{eqnarray}     (e^{2 i \pi})^{0.5} = (e^{2 i \pi \cdot 0.5})= e^{i \pi}=-1 \end{eqnarray} but \begin{eqnarray}      e^{2 i \pi}=1~ and~ 1^{0.5}=1  \end{eqnarray} where is my mistake??  thanks Spoilers for A Storm of Swords / Season 4 episode 2 "The Lion and the Rose".  At the Purple Wedding,      Littlefinger and Lady Olenna Tyrell   perform their plan of      poisoning King Joffrey.   A short summary of their plan:  Littlefinger orders Ser Dontos Hollard to give Sansa Stark a beautiful silver hairnet adorned with amethysts. At least some of the amethysts are actually strangler crystals in disguise. Ser Dontos also, still under orders of Littlefinger, urges Sansa to wear the hairnet at the wedding, which she then does. At the wedding, when Lady Olenna greets Sansa, she fusses her hairnet a bit, while secretly taking one of the strangler crystals. Later, during the wedding, Lady Olenna puts the crystal in Joffrey's royal cup, poisoning him.  But why was their plan so complicated? Why couldn't Lady Olenna just bring a strangler crystal with her to the wedding (as suggested in )?  Then they wouldn't depend on Ser Dontos and Sansa who could unknowingly have done something to prevent the success of the plan.  The only reason that I could think of, is Littlefinger and Lady Olenna plan for Sansa (and Tyrion as her husband with her) to take the blame for Joffrey's death.  They put the crystals on her person, so that upon examination it would clearly show that Sansa had the murder weapon on her. But Littlefinger had a plan he did not tell Lady Olenna, namely rescuing Sansa during the chaos ensuing the murder (and thereby leaving Tyrion behind as the only accused).  Is there anything confirming or debunking this theory? If my theory doesn't hold up, is there another explanation for why the plan was so needlessly complicated? I frequently find myself writing code like this:  List&lt;int&gt; list = new List&lt;int&gt; { 1, 3, 5 }; foreach (int i in list) {     Console.Write("{0}\t", i.ToString()); } Console.WriteLine();   Better would be something like this:  List&lt;int&gt; list = new List&lt;int&gt; { 1, 3, 5 }; Console.WriteLine("{0}\t", list);   I suspect there's some clever way of doing this, but I don't see it. Does anybody have a better solution than the first block? ANOVA analysis with only mean and standard deviation Processor: PIC18F66K22 Compiler:  C18 (XC8 is fine also)   I've just made (and succesfully tested) code to measure the voltage on AN4 analog pin.  Now I want to try something else, not quite sure if it's theoretically possible.  My test-board has a PIC processor, with VDD,AVVD connected to a supply (ranging from 0(if the battery is empty/disconnected) to 4,2(full battery).  Can I use ADC to measure the VDD(-in) of my board?  Why not?:   It's not an ANx pin, not sure how to make the ADC measure it? (Channel?) If the voltage on VDD(-in) drops, will my ADC reference voltage also drop? (So when my PIC only gets 3,3V the ADC will still say it's 100% (as the max Voltage on the chip, also the reference is 3,3V).   Why/what do you ask?:   Can I just measure Channel 30 (VDDCORE)? Could I set my Vref to Vdd and measure a precision voltage reference with the A/D converter. (Not sure how) Or I could add a wire from VDD-in to an ANx pin? Will Internal VREF+ (4.096V) stay 4+V when the VDD-in is around 3,4V? Is there some kind of transformator that makes it so? Internal VREF+ (4.096V) is a bit lower than the max of the battery (4,2V), does this mean I can damage the ADC? Or just that the result will be max when the battery is full. (4,2V out of 4,096V)     Please mind that my knowledge of Electronics is "low". I've learnt way more about the software part in my education, but I'd like to know more about (Embedded) Electronics as it's a crucial part in Embedded Engineering. (It's sad how my school doesn't see this.) What happens to matter in a standard model with zero Higgs VEV? Tentative definitions in C and linking How do I create a partially transparent flag? Is it costly to do array.length or list.count in a loop I know that in JavaScript, creating a for loop like this: for(int i = 0; i &lt; arr.length; i++) is costly as it computes the array length each time. Is this behavior costly in c# for lists and arrays as well. Or at compile-time is it optimized?  Also what about other languages such as Java, how is this handled? How can install Desktop Toggl on Ubuntu 13.04? I try type:  sudo add-apt-repository ppa:official-toggl/ppa sudo apt-get update sudo apt-get install desktop-Toggl    But getting information desktop-Toggl not found. How can I obtain the command line arguments of another process?   Using static functions of the System.Diagnostics.Process class I can obtain a list of running processes, e.g. by name:  Process[] processList = Process.GetProcessesByName(processName);   However, there is no way to access the command line used to start this process. How would one do that? Show Previous/Next Posts navigation only inside the same category Is it possible to force previous/next navigation to browse through the posts (back and forth) that are only inside the same category (and to exclude other categories)? Show that a holomorphic function satisfying $|f(z)|\leq c|z|^n$ must be $f(z)=a\cdot z^n$ for some a. Let $f:\mathbb{C}\to\mathbb{C}$ be a holomorphic function such there exists a $c\in\mathbb C$ with $|f(z)|\leq c\cdot |z|^n$ for all $z\in\mathbb C$. Show that there exists an $a\in\mathbb C$ with $f(z)=a\cdot z^n$.   Proof.  My general idea is to show that the taylor series only has one non-zero coefficient:  $\displaystyle |a_k|\leq\frac{k!}{2\pi}\oint_{|w|=r}\frac{|f(w)|}{|w|^{k+1}}dw\leq \frac{k!}{2\pi}\oint_{|w|=r}\frac{c\cdot|w|^n}{|w|^{k+1}}dw\leq \\\displaystyle\leq \frac{c\cdot k!}{2\pi}\oint_{|w|=r}|w|^{n-k-1}dw$  Now using the standard estimate since $\oint=2\pi r$:  $\displaystyle \leq c\cdot k!\cdot r^{n-k}\longrightarrow\begin{cases}0,\ k&gt;n\\c\cdot n!,\ k=n\\ \infty,\ k&lt;n\end{cases}$ as $r\to\infty$  In conlusion the taylor series for now looks like $f(z)=\sum_{k=0}^{n-1}a_k z^k+ a_n z^n$ with $|a_n|\leq n!\cdot c$. What do I do with the remaining summands?  Edit: I would say that for $k&lt;n$ we have $|z|^k&gt;|z|^n$ for $z\in D_1(0)$. So since the estimate has to hold for all $z\in \mathbb C$ we can't have that either. Here's an example question from the :     On the last day of a one-week sale, customers numbered 149 through 201 were waited on. How many customers were waited on that day?   Possible answers: 51, 52, 53, 152, 153.   The correct answer here is 53, which is the result of (201-149) + 1 = 53.  What's the reasoning in adding the +1? Is there a quick way to set an HTML text input (&lt;input type=text /&gt;) to only allow numeric keystrokes (plus '.')? I am from Nigeria and I'm doing a one year Internship program with The Marriott hotel in Wisconsin, I applied for the UK visitor visa two weeks ago to visit my fiance who lives and work in the UK, but I was refused the visa because the letter of my workplace that I provided was back dated of 2014 which they say they are not satisfy it accurately reflects my current employment circumstance. I also provided my pay slips, but they said they were not satisfied with it demonstrating the terms and conditions of my employment, and they also said I did not present any evidence to satisfy me having sufficiently strong ties and commitments in my country of habitual residence or elsewhere to motivate my timely departure from the UK. They said the documents my fiance presented were OK.  How soon can I re-apply for a UK visa after getting a refusal? Use #ifdefs and #define to optionally turn a function call into a comment Is it possible to do something like this  #ifdef SOMETHING #define foo // #else #define foo MyFunction #endif   The idea is that if SOMETHING is defined, then calls to foo(...) become comments (or something that doesn't get evaluated or compiled), otherwise it becomes a call to MyFunction.  I've seen __noop used, but I don't believe I can use that.  EDIT(s):  I don't think I can really use a macro here, because MyFunction takes a variable number of arguments.  Also, I'd like to make it so the arguments are NOT evaluated!  (So doing something like commenting out the body of MyFunction doesn't really give me what I need, as the arguments will still be evaluated) Differentiability implies continuity - A question about the proof I have a question, to aid my understanding, about the proof that differentiability implies continutity.$\mathstrut$    Differentiability Definition  When we say a function is differentiable at $x_0$, we mean that the limit:  $$‎f^{\prime} ‎(x) = \lim_{x\to x_0} \frac{f(x) - f(x_0)}{x-x_0}$$ exists.  Continuity Definition  When we say a function is continuous at $x_0$, we mean that: $$\lim_{x\to x_0} f(x) - f(x_0) = 0$$  Theorem: Differentiability implies Continuity: If $f$ is a differentiable function at $x_0$, then it is continuous at $x_0$.  Proof:  Let us suppose that $f$ is differentiable at $x_0$. Then $$ \lim_{x\to x_0} \frac{f(x) - f(x_0)}{x-x_0} =  ‎f^{\prime} ‎(x) $$  and hence  $$ \lim_{x\to x_0} f(x) - f(x_0) = \lim_{x\to x_0} \left[ \frac{f(x) - f(x_0)}{x-x_0} \right] \cdot \lim_{x\to x_0} (x-x_0) = 0$$  We have therefore shown that, using the definition of continuous, if the function is differentiable at $x_0$, it must also be continuous.  My Question  The proof seems to execute the following steps:   Assume the function is continuous at $x_0$ Show that, with little algebra, we can change this into an equivalent question about differentiability at $x_0$. With this little bit of algebra, we can show that if a function is differentiable at $x_0$ it is also continuous.   What I am slightly unsure about is the apparent circularity. In my mind it seems to say, if a function is continuous, we can show that if it is also differentiable, then it is continuous. Rather than what I was expecting, namely, if a function is differentiable, we can show it must be continuous.  Hopefully my confusion is clear. Any help will be greatly appreciated. When I open the terminal on my Mac, this is what it shows:  australia:~ rod$   I don't live in Australia, don't have anything to do with Australia, nor have ever setup terminal as Australia.   Where does that name come from, why is it there, what does it mean and how do I change it (or should I even change it at all)?