When I use a css class within a div tag it seems to ignore what is inside the css.    .centered {   background-color: red;   padding: 5px 20px 5px 20px; }     &lt;div style="text-align:center" class="centered"&gt;     I am centered with bg around me &lt;/div&gt;   When is use the same class with a span tag nested within the div element it does what I want.  &lt;div style="text-align:center"&gt;     &lt;span class="centered"&gt;I am centered with bg around me&lt;/span&gt; &lt;/div&gt;   Why is this? What makes the difference?
I would like to ask for some simple examples showing the uses of &lt;div&gt; and &lt;span&gt;.   I've seen them both used to mark a section of a page with an id or class, but I'm interested in knowing if there are times when one is preferred over the other.
Implementing the decorator pattern in Python How does ServerName and ServerAlias work? It's the following part of a virtual host config that I need further clarification on:  &lt;VirtualHost *:80&gt;   # Admin email, Server Name (domain name), and any aliases   ServerAdmin example@example.com   ServerName  141.29.495.999   ServerAlias example.com ...   This is and example config, similar to what I currently have (I don't have a domain name at the moment).  &lt;VirtualHost *:80&gt; - Allow the following settings for all HTTP requests made on port 80 to IPs that this server can be contacted on. For instance, if the server could be accessed on more than one IP, you could restrict this directive to just one instead of both.  ServerName - If the host part of the HTTP request matches this name, then allow the request. Normally this would be a domain name that maps to an IP, but in this case the HTTP request host must match this IP.  ServerAlias - Alternate names accepted by the server.  The confusing part for me is, in the above scenario, if I set ServerAlias mytestname.com and then made an HTTP request to mytestname.com, there would have to be a DNS record pointing to the server's IP for this to work? In which case, is ServerAlias just basically EXTRA ServerName entries?  Say I had a DNS entry such that foobar.com = 141.29.495.999 but then I had ServerName = 141.29.495.999 and ServerAlias was empty, would that mean that although foobar.com gets resolved to the right IP, because there is no reference to accept foobar.com in ServerName or ServerAlias?  Or something. Man I'm confused. Transit Visa in Hong Kong for 15 hour layover between India and USA? We are (2) Indian nation and travelling from India to USA via Hong Kong airport and about 15 hours layover in Hong Kong airport. Do we need a transit visa even if only changing planes? And can we apply in Hong Kong Airport? Reading the extension of files in a directory with Java? Can a unit test project load the target application's app.config file? I am unit testing a .NET application (.exe) that uses an app.config file to load configuration properties.  The unit test application itself does not have an app.config file.    When I try to unit test a method that utilizes any of the configuration properties, they return null.  I'm assuming this is because the unit test application is not going to load in the target application's app.config.  Is there a way to override this or do I have to write a script to copy the contents of the target app.config to a local app.config?     post kind-of asks this question but the author is really looking at it from a different angle than I am.  EDIT: I should mention that I'm using VS08 Team System for my unit tests. Prove normal matrix is 4th power of some self-adjoint matrix Let $A\in\mathbb{M}_n(\mathbb{C})$ be a matrix of order $n\geq 2$. Let $p_A(x) = (x-\lambda_1)\cdots (x-\lambda_n)$ be the characteristic polynomial of $A$ such that all $\lambda_i$ are positive real numbers.  Suppose that $A$ is a normal matrix. Prove that one can write $A=G^4$ for some self-adjoint matrix $G$.  My thinking is that since $A$ is normal, by Principal Axis Theorem, we have $A=UDU^\ast$, where $U$ is a unitary matrix and $D$ a diagonal matrix. However, I fail to see how to proceed. Could anyone help me out? Please tell me is there any fundamental difference between the two sentences:   Even today, people continue to use cheques.  Even today, people are continuing to use cheques.    I mean is there a difference as in time period (i.e when the action starts and when it ends). Or are the two sentence just the same and interchangeable? GeoReference tiff image into the Google map? I want to Geo-reference a tiff image contain a Map for a specific region, I need to add this region(image) and Geo-reference it on the Google map, SO I can see on the map for the region I select the image which I have inserted.  the image also need information such as the Latitude and Longitude of corners and size, and the pixel per meter measurement.  How to do the correct Geo-reference for that ? What is the chance that at least two people were born on the same day   of the week if there are 3 people in the room?   I'm wondering if my solution is accurate, as my answer was different than the solution I found:  Probability that there are at least 2 people in the room born on the same day = 1 - (No one was born on the same day) - (Exactly one person was born on the same day)  There are (3 choose 2) different pairs of couples. Each couple has the same birthday as another couple with the chances of 1/7 and different with chances 6/7. Thus:  $$1 – (6/7)^3 – 3(1/7)(6/7)^2 = 0.0553$$  Thanks for any help! Confusion between Voltage gain & Voltage gain in decibels (dB) The definition of voltage gain is \$V_{\text{out}}/V_{\text{in}}\$.  However, I read some articles about the gain in decibels, and I have a confusion now.  Here is an article about it:   Here, I understand the definition of Power gain in decibels, which is $$ \text{Gain} = 10 \log \left( {P_{\text{out}} \over P_{\text{in}}} \right)\text{ dB} $$  However, I can't understand why Voltage gain in decibels is $$ 20 \log \left( {V_{\text{out}} \over V_{\text{in}}} \right)\text{ dB} $$  If \$ 20 \log \left( {V_{\text{out}} \over V_{\text{in}}} \right)\text{ dB} \$ is derived from $$ 10 \log {\left( {V_{\text{out}}^2 \over R_{\text{out}}}\right) \over \left({V_{\text{in}}^2 \over R_{\text{in}}}\right) }\text{ dB} $$ then this is the power gain, not the voltage gain, isn't it? However, the Wikipedia says it is a formula for the Voltage gain in decibels. I thought the voltage gain in decibels would be \$ 10 \log \left( {V_{\text{out}} \over V_{\text{in}}} \right)\text{ dB} \$. Actually, the example section in that linked page uses voltage gain \$ V_{\text{out}} \over V_{\text{in}} \$.  Why did \$V^2/R\$ suddenly come out from the voltage gain in decibels? How long can I wait before choosing to counter a spell? Is the motivation behind the introduction of measure theory the Lebesgue integral? In order to evaluate such an integral we need the length of each of the horizontal strip of width $h$. I have a question here. Why do we need such a general concept of measure? Length is a kind of measure, but why did Lebesgue think of so general a concept of "measure" when he just needed the length to evaluate his integrals? Is there any other motivation behind this ? How to enable fast user switching when Login Options are disabled? I want to derive a closed formula for the integral $$I_n= \int \frac {dx}{\prod_{r=0}^n (x+r)}$$  On writing out first few terms we get   For $n=0$, $$I_0=\ln \vert x\vert+C$$ For $n=1$, $$I_1=\ln \vert x\vert-\ln \vert x+1\vert+C$$ For $n=2$ $$I_2=\frac {1}{2!}\left(\sum_{r=0}^2 (-1)^r\binom {2}{r} \ln \vert x+r\vert\right)+C$$ For $n=3$ $$I_3=\frac {1}{3!}\left(\sum_{r=0}^3 (-1)^r\binom {3}{r} \ln \vert x+r\vert\right)+C$$  Hence for generalized $n$ we have $$I_n=\frac {1}{n!}\left(\sum_{r=0}^n (-1)^r\binom {n}{r} (\ln \vert x+r\vert)\right)+C$$  Now this is just an observation but I want to prove that it is correct. I have tried lot of methods but not useful. Partial fractions would have been most useful but would go out on tedious task which is nearly impossible.  Also integration by parts won't help nor any trig substitution. So any ideas are welcome.  And ya,  this is not a homework question,  it's a question which I just saw in a integral challenge paper. What is a serialVersionUID and why should I use it? Eclipse issues warnings when a serialVersionUID is missing.       The serializable class Foo does not declare a static final   serialVersionUID field of type long   What is serialVersionUID and why is it important?  Please show an example where missing serialVersionUID will cause a problem. Variable is already defined in method lambda In a problem, we have to differentiate : $$ y = \arcsin (2 x \sqrt{1 - x^2}),$$ given: $$-{1/(\sqrt2)} &lt; x &lt;{1/(\sqrt2)}$$.   My approach :  Put $x = \cos (p)$, so y reduces to:- $y = 2p = 2 \arccos (x)  \implies$ ${dy}/{dx}$ $ = -{2}/{\sqrt{1-x^2}}$   But the solution given is without the minus sign, so I am doing something wrong here but don't know what.  So please tell me what I am doing wrong and how to correct it. Add 1Password extensions support to the SE iOS app Please implement the URL scheme to call 1Password for password lookups on the iOS app.   a URL scheme for switching to 1Password to search item titles for a custom term, usually a service name like “twitter” or “evernote”. This speeds up the process for the user so they can copy something like their password and get back to your app  That will ease sign up speed using long, complicated or unmemorable passwords for many users of both apps. In the two years since the above blog was published there are now updated instructions for implementation and code on github: Probability Problem with $n$ keys A woman has $n$ keys, one of which will open a door. a)If she tries the keys at random, discarding those that do not work, what is the probability that she will open the door on her $k^{\mathrm{th}}$ try?  Attempt: On her first try, she will have the correct key with probability $\frac1n$. If this does not work, she will throw it away and on her second attempt, she will have the correct key with probability $\frac1{(n-1)}$. So on her $k^{\mathrm{th}}$ try, the probability is $\frac1{(n-(k-1))}$ This does not agree with my solutions.   b)The same as above but this time she does not discard the keys if they do not work.  Attempt: We want the probability on her $k^{\mathrm{th}}$ try. So we want to consider the probability that she must fail on her $k-1$ attempts. Since she keeps all her keys, the correct one is chosen with probability $\frac1n$ for each trial. So the desired probability is $(1-\frac{1}{n})^{k-1} (\frac1n)^k$. Again, does not agree with solutions.  I can't really see any mistake in my logic. Can anyone offer any advice? Many thanks How do I disable "Workspace dock" (a bottom panel with the list of open windows and a workspace indicator-cum-switcher), the one that is over "Plank" in the screenshot below?    I'm using Ubuntu 17.10.