Regex with META characters PHP I have a string: http:\/\/example\.com  I try to regex this to be: http://example.com  I've used preg_replace('/\(\)/', '', $string) but it is not working.  Could you help me, please?
What special characters must be escaped in regular expressions? I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?
How are Stormtroopers uniquely identified in the field? Multiple times in Star Wars: The Force Awakens, people refer to trooper FN-2187 by that specific correct name, while he is in armor.  But the armor is largely identical (some have little accessories like shoulder pads, or different weapon loadouts, but FN-2187 lacks these), which makes me wonder how do First Order (or even the old Imperials) identify who they're talking to?  How are Stormtroopers correctly identified while they're in armor? Determining bounds for the sum $\sum\limits_{n=1}^\infty \frac{1}{2^n - 3^n }$ Value of having done applied math research when applying to PhD programs in pure math I will be a second year math under-grad in September, and currently doing an internship at applied math research institute. Most probably, I will come up with a research paper at the end of the internship.  However, my interest after my bachelors is to do PhD in pure math from a top math school.My question is this:     Would the admission committee consider my current research since it is in applied math?    In addition, if anyone can suggest me some ideas on how can I bridge the gap between my paper in applied math and my interest in analysis, I would be extremely grateful.  P.S.:  is a related but different question also of mine. What is the best way to parse html in C#? I'm looking for a library/method to parse an html file with more html specific features than generic xml parsing libraries. "None" as plural indefinite pronoun In my grammar book (English Grammar, HarperCollins Publishers), I read that none is occasionally treated as plural, but it is usually regarded as singular. Can you give me an example of sentence where none is used as plural pronoun? Calling Overridden Constructor and Base Constructor in C# I have two classes, Foo and Bar, that have constructors like this:  class Foo {     Foo()     {       // do some stuff     }      Foo(int arg)     {       // do some other stuff     } }  class Bar : Foo {     Bar() : base()     {       // some third thing     } }   Now I want to introduce a constructor for Bar that takes an int, but I want the stuff that happens in Bar() to run as well as the stuff from Foo(int).  Something like this:  Bar(int arg) : Bar(), base(arg) {   // some fourth thing }   Is there any way to do this in C#?  The best I have so far is putting the work done by Bar() into a function, that also gets called by Bar(int), but this is pretty inelegant. Inequality : $\sum_{k=1}^n x_k\cdot \sum_{k=1}^n \frac{1}{x_k} \geq n^2$ I have to show the inequality of $$\left(\sum_{i=1}^n x_i\right)*\left(\sum_{i=1}^n \frac{1}{x_i}\right) \geq n^2.$$For $x_1, ... x_n \in \mathbb{R_{&gt;0}}$ and $ n \geq 1$. I wanted to show this inequality by induction. The basis is clear, but I am not sure how to do the inductive step. Can someone help me with that? How to create a new object instance from a Type One may not always know the Type of an object at compile-time, but may need to create an instance of the Type.    How do you get a new object instance from a Type? Can we build capacitors on a PCB board? For the magnitude of nF or µF capacitors, I hope I can build them on a PCB board. The capacitor is like a two metal layer and something between them.   Is this possible?   Not buying the capacitor, just design the capacitor on the PCB board. Double metal layers on the PCB board. What's recommended for the number of users to use in qualitative and quantitative testing? Greiner in his book "Field Quantization" page 173, eq.(7.11) did this calculation:     ${\mathcal L}^\prime=-\frac{1}{2}\partial_\mu A_\nu\partial^\mu A^\nu+\frac{1}{2}\partial_\mu A_\nu\partial^\nu A^\mu-\frac{1}{2}\partial_\mu A^\mu\partial_\nu A^\nu $   $\space\space\space\space=-\frac{1}{2}\partial_\mu A_\nu\partial^\mu A^\nu+\frac{1}{2}\partial_\mu[A_\nu(\partial^\nu A^\mu)-(\partial_\nu A^\nu) A^\mu]$        The last term is a four-divergence which has no influence on the field equations. Thus the dynamics of the electromagnetic field (in the Lorentz gauge) can be described by the simple Lagrangian        ${\mathcal L}^{\prime\prime}=-\frac{1}{2}\partial_\mu A_\nu\partial^\mu A^\nu$     Yes, if it is a four-divergence of a vector whose 0-component doesn't contain time derivatives of the field, indeed according to the variational principle this four-divergence will not influence the field equation.  And actually I calculated the time-derivative dependence of 0-component of $[A_\nu(\partial^\nu A^\mu)-(\partial_\nu A^\nu) A^\mu]$, in which only $[A_0(\partial^0 A^0)-(\partial_0 A^0) A^0]$ could possibly contain time-derivative, which vanishes fortunately, so whatever the general case it doesn't matter in this present case.  But how can he seem to claim that it holds for a general four-divergence term,The last term is a four-divergence which has no influence on the field equations?  EDIT: I only assumed the boundary condition to be $A^\mu=0$ at spatial infinity, not at time infinity. And the variation of the action $S = \int_{t_1}^{t_2}L \, dt$ is due to the variation of fields which vanish at time, $\delta A^\mu(\mathbf x,t_1)=\delta A^\mu(\mathbf x,t_2)=0$, not having the knowledge of $\delta \dot A^\mu(\mathbf x,t_1)$ and $\delta \dot A^\mu(\mathbf x,t_2)$, which don't vanish generally, so the four-divergence term will in general contribute to the action, $$\delta S_j=\delta \int_{t_1}^{t_2}dt\int d^3\mathbf x \partial_\mu j(A(x),\nabla A(x),\dot A(x))^\mu =\delta \int_{t_1}^{t_2}dt\int d^3\mathbf x \dot j^0 =\int d^3\mathbf x [\delta j(\mathbf x, t_2)^0-\delta j(\mathbf x, t_1)^0]$$ which does not vanish in general! How does a one-sided glass work? How does a  work? If seen from the outer side, we can see through thinking it is transparent, while if seen from the inside, the glass acts as a mirror. How? Why is "Nature" usually spelt with an initial capital letter in scientific journals? I am mainly referring to life science here, in case this matters.  I am not talking about the obvious cases, like capitalisation in titles, at the beginning of a sentence, etc., but when it appears mid-sentence, where one would normally expect it to be lowercase.  I've heard some explanation that it gives the impression of Nature as a goddess (see comments on this post ) - but this is probably the last thing I would have expected in a scientific article... Options for object creation are greyed out I am trying to model a tree. I turned on the Add a sapling add-on in user preferences, however once I want to begin editing the settings, they come up but is grey and doesn't let me click on it.    I have also attached my blend file here: I don't know how to prove this example. Let $y(t):\mathbb{R}^+\to \mathbb{R}$ be a nonincreasing function. Assume that there is a constant $A&gt;0$ such that \begin{equation} \int_{s}^{+\infty}y(t)dt \leq Ay(s), \quad 0\leq s&lt;+\infty \end{equation} Then $y(t)\leq y(0)e^{1-\frac{t}{A}}$, for all $t&gt;0$. Both apt-get update and upgrade hang:  sudo apt-get update [sudo] password for xxx:  0% [Connecting to archive.ubuntu.com (2001:67c:1360:8001::17)]   I'm able to ping archive.ubuntu.com:  ping archive.ubuntu.com PING archive.ubuntu.com (91.189.88.162) 56(84) bytes of data. 64 bytes from yukinko.canonical.com (91.189.88.162): icmp_seq=1 ttl=50 time=42.2 ms 64 bytes from yukinko.canonical.com (91.189.88.162): icmp_seq=2 ttl=50 time=42.1 ms 64 bytes from yukinko.canonical.com (91.189.88.162): icmp_seq=3 ttl=50 time=42.1 ms ^C --- archive.ubuntu.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 42.169/42.206/42.265/0.240 ms   I checked , and I don't think its the same issue.  Any tips for investigating this further? Is it possible to legally visit uninhabited islands in the Pacific for a couple of days/weeks like Robinson Crusoe Do you know any way how can I visit uninhabited islands in the Pacific (French Polynesia, Micronesia etc.) and stay there for a couple of days or weeks?  The only condition, these island (or islands) should have drinking water.  Could it be done legally or only illegally?  Does any company do such crazy things via plane or boat?  Any information is appreciated.  I am mostly interested in French Polynesia.  Boat or plane... that's not very important. Functions satisfying $f:\mathbb{N}\rightarrow\ \mathbb{N}$ and $f(f(n))+f(n+1)=n+2$ Find all functions $f$ such that $f:\mathbb{N}\rightarrow\  \mathbb{N}$ and $f(f(n))+f(n+1)=n+2$   Let us plug in $n=1$  $f(f(1))+f(2)=3$  Since the function is from $\mathbb{N}$ to $\mathbb{N}$, $f(2)$ can only take the values $1,2$. Now we divide the problem into cases.  Case-1: $f(f(1))=2,f(2)=1$  We can assume that $f(1)=c$ for the time being. Then plugging in $n=3$ and using $f(2)=1$ gives $$f(3)=4-c$$ and again since the range of the function is positive integers,then $4-c$ has to be positive and hence $c$ belongs to  {$1,2,3$}. Now, $$f(1)=c$$$$\implies f(f(1))=f(c)$$$$\implies 2=f(c)$$ by the assumption that $f(f(1))=2$ . Now,since $c$ can only take the values $1,2,3$,we start treating cases. If $c=1$,$$f(c)=2$$$$\implies f(1)=2$$ but we know from the deinition of $c$ that $f(1)=c=1$,a contradiction.If $c=2$,then $2=f(c)=f(2)$ but $f(2)=1$ by assumption. Finally,if $c=3$ $$2=f(c)=f(3)$$ but $$f(3)=4-c=4-3=1$$ which is once again a contradiction. Therefore there are no such functions in this case.  Case-2: $f(f(1))=1,f(2)=2$  Again assuming $f(1)=c$ and using $f(n)\le n$ along with plugging $n=c-1$ will give us that $f(1)=1$ and then it is easy to prove that such a function exists by recursion. I can only give a "sort of recursive" way to define the function. Here it goes $$f:\mathbb{N}\rightarrow \mathbb{N}$$$$f(1)=1$$$$f(n)=n+1-f(f(n-1))$$  But this case is harder to deal with.Some help will be appreciated. Consider I have N dynamic points on my Scene, I would like to "frame" all them, with my Camera.    How can i calculate (at runtime) Vector3 Position to correctly frame all my scene ?   This is my idea:    Calculate Avarage for all my points  Move my Camera "up" to correctly "frame" all my points  (i don't know how) Use Unity LookAt(myAvaragePoint)   Thanks This is a phrase I've heard many people use, and it sounds wrong to me; e.g.:     The thing about that is, is that she might take it the wrong way.   It seems to treat "The thing [...] is"—the entire phrase—as the subject of the sentence. Of course, even if that were allowed, the comma placement would still be questionable.  I'm curious to know:   Is there a name for this wording? Is it specific to a certain dialect? Is its etymology known?