Highlight matches in string by color
Highlighting pattern strings in a large text
File Upload using Selenium WebDriver and Java Robot Class static variables in an inlined function I have a function that is declared and defined in a header file. This is a problem all by itself. When that function is not inlined, every translation unit that uses that header gets a copy of the function, and when they are linked together there are duplicated. I "fixed" that by making the function inline, but I'm afraid that this is a fragile solution because as far as I know, the compiler doesn't guarantee inlining, even when you specify the "inline" keyword. If this is not true, please correct me.  Anyways, the real question is, what happens to static variables inside this function? How many copies do I end up with? I'm  having some trouble editing the content of a Managed Email Template, I can quite easily modify the content of the Email Template, but when I wish to refer to an unmanaged component, like this:  &lt;messaging:attachment renderAs="PDF" filename="invoice.pdf"&gt;     &lt;c:MyComponent/&gt; &lt;/messaging:attachment&gt;   I get the error message:     Error: Unknown component c:mycomponent   Does anyone know if its possible to embed an unmanaged component in a managed Email Template? How do I get and modify the source code of packages installed through apt-get? "Give him a box that everyone knows what it contains." Why is $\mathbb{E}[X] = 1 + \sum^\infty_{k=1}\mathbb{P}(X > k)$ true? I'm working through a problem regarding expected values in Markov chains, and at some point it says:     Recall from probability that if $X$ is a positive integer valued random variable, then $\mathbb{E}[X] = 1 + \sum^\infty_{k=1}\mathbb{P}(X &gt; k)$.   I know that by definition $\mathbb{E}[X] = \sum_a a\mathbb{P}(X = a)$, but I can't see how the above equality follows from this, nor am I sure if this is how to approach the problem. E: Malformed entry 54 in list file /etc/apt/sources.list (Component) Just switched from 10.04 to 11.10. I'm wondering about the limited options in the GUI for managing users and groups. Where is the old GUI to change groups, id's, etc. I know that I can do this from cli, that's no problem. But I want this comfortable GUI back. How to reorder /etc/resolv.conf at load time I have a CentOS system that retrieves its upstream DNS servers via DHCP.  I want to run DNSMasq on this box and use it as a server to resolve some hostnames for development.  The problem is when my system starts, the upstream DNS servers are loaded into /etc/resolv.conf and THEN the DNS1 entry from my ifcfg-enp0s3 setup gets loaded.   That's a problem because when I query for the internal dev names, it tries to go out to the upstream DNS server instead of checking DNSMasq first.  I need the DNSMasq server to be at the TOP of the /etc/resolv.conf and the dhcp loaded ones at the bottom of the resolv.conf so that DNSMasq will work properly.  Any simple way to do that? How to call C++ function from C? FileSystemWatcher Changed event is raised twice I'm inserting an image with a simple:  \includegraphics[height=5cm]{filename.png}   This results in an image that maintains the aspect ratio, and so gives me something like 6cm width. I only really want the left side of the image though, and would like to crop it to 50% width. Is it possible to do this?  If possible, I'd like to do this in a portable way (i.e. something that other authors of this document won't have to install packages for, and something that works with a reasonably old version of pdflatex - our computers at work are in sore need of an upgrade). Calculate: $$\int_{0}^{2\pi}e^{R{ {\cos t}}}\cos(R\sin t+3t)\mathrm{d}t$$ My try: $\displaystyle\int_{0}^{2\pi}e^{R{ {\cos t}}}\cos(R\sin t+3t)dt\\ \displaystyle \int_{|z|=R}e^{\mathfrak{R\textrm{z}}}\cos(\mathfrak{I\textrm{z}}+3(-i\log z)dz\\ \displaystyle \int_{|z|=R}e^{\mathfrak{R\textrm{z}}}\mathfrak{R\textrm{e}}^{(\mathfrak{I\textrm{z}}+3(-i\log z))i}dz\\ \displaystyle \int_{|z|=R}e^{\mathfrak{R\textrm{z}}}\mathfrak{R\textrm{e}^{\mathfrak{I\textrm{z}}}}z^{3}dz\\ \displaystyle \int_{|z|=R}e^{\mathfrak{R\textrm{z}}}\mathfrak{R\textrm{e}^{\mathfrak{I\textrm{z}}}R}z^{3}dz$ and there is nothing here that is not holomorphic, therefore according to Cauchy theorem it must be exactly $0$. calculating resistance for LED strips to use as parking lamps and turn signals I'm installing LED strips in my car's tail lamps to convert it from conventional bulbs to LEDs. I have a understanding of what I'm doing but not the complete knowledge to make the circuit work correctly without doing some guessing so I figured I would ask here.   I'm planning on working with and I need a length of 16", 15" and 14" to make then look correct in my housings. When I did the math the 19.7" strips have about 1.5 LEDs per inch and need to be segmented into 3 LED groups so I may have to get creative with the placement.   Ffom what I understand I need 2 diodes and a resistor. One diode on the parking lamp power, and one on the turn signal/brake power and then a resistor on the parking lamp  wire to step down the voltage enough to make them dim enough to use as a parking lamp and distinguish it from the brighter turn/brake lamps.  Does anyone know what size resistor and what size diode to use in this project? The voltage, with the car running, is around 13.8V to the rear lamps. I figure it should be running around 7V to the LEDs to light them as parking lamps.  Also will leaving out a cluster of 3 LEDs change the strips intensity to where I'll need different resistors for each strip? If $a_n$ is a strictly increasing unbounded sequence, does $\sum_n \frac{a_{n+1} - a_n}{a_n}$ diverge? So I've been thinking through some test cases. If $a_n = n$ then $\sum_n \frac{a_{n+1} - a_n}{a_n}$ is the harmonic series which diverges. And if $a_n = \sum_{k=1}^n 1/k$ then $\sum_n \frac{a_{n+1} - a_n}{a_n}$ diverges like $\sum_n 1/(n \log n)$. So that got me thinking, if $a_n$ is a strictly increasing unbounded sequence, does $\sum_n \frac{a_{n+1} - a_n}{a_n}$ necessarily diverge? Overfull hbox using biblatex Correct XML serialization and deserialization of "mixed" types in .NET At one point, I decided to make friends with the low-lying spectrum of QCD. By this I do not mean the symmetry numbers (the "quark content"), but the actual dynamics, some insight.  The pions are the sloshing of the up-down condensate, and the other pseudoscalars by extending to strangeness. Their couplings are by soft-particle theorems. The eta-prime is their frustrated friend, weighed down by the instanton fluid. The rho and omega are the gauge fields for flavor SU(2), and A1(1260) gauges the axial SU(2), and they have KaluzaKlein-like echoes at higher energies, these can decay into the appropriate "charged" hadrons with couplings that depend on the flavor symmetry multiplet. The proton and the neutron are the topological defects. That accounts for everything up to 1300 but a few scalars and the b1.  There are scalars starting at around 1300 MeV which are probably some combination of glue-condensate sloshing around and quark-condensate sloshing around, some kind of sound in the vacuum glue. Their mass is large, their lifetime is not that big, they have sharp decay properties.  On the other hand, there is nothing in AdS/QCD which should correspond to the sigma/f0(600), or (what seems to be) its strange counterpart f0(980). While looking around, I found this discussion: . The literature that it pointed to suggests that the sigma is a very unstable bound state of pions (or, if you like, tetraquarks).   gives strong evidence for an actual pole;  gives a more cursory review. The location of the pole is far away from the real axis, the width is larger than the mass by 20% or so, and the mass is about 400MeV. The authors though are confident that it is real because they tell me that the interpolation the interactions of pions is safe in this region because their goldstone properties dominate the interactions. I want to believe it, but how can you be sure?  I know this particle was controversial. I want to understand what kind of picture this is giving. The dispersion subtraction process is hard for me to visualize in terms of effective fields, and the result is saying that there is an unstable bound state.  Is there a physical picture of the sigma which is more field theoretical, perhaps even just an effective potential for pions? Did anyone who convinced himself of the reality of the sigma have a way of understanding the bound state properties? Is there an analog unstable bound state for other goldstone bosons? Any insight would be welcome. Dual Canadian and British citizen - healthcare coverage in the UK? Combinatorial argument for $\sum\limits_{k=i}^{n}\binom{n}{k}\binom{k}{i} = \binom{n}{i}2^{n-i}$