I understand if I buy a stock one day before the ex-dividend date and it settles after the ex-dividend date I don't get the dividend.  If I sell a stock the day before the ex-dividend date and it doesn't settle until after the ex-dividend date Who gets the dividend?
For example, if the ex-dividend date is next Monday, and I buy the stock on next Monday, would I get the dividend? Or would the person who sold the stock to me get the dividend?
Moving Grub to a new drive to get rid of Windows Change rep required to downvote on MSE To make your opinion known on MSE you need both up and downvotes. Given at the moment you need 125 rep to downvote on this site, the voting patterns will be skewed positive because not everyone is active on the site.   This is to be expected for regular Stack Exchange sites as you are expected to be involved in the community before you are deemed knowledgeable enough to be part of the community voice. However, MSE is different because you are voting for the entirety of the Stack Exchange network and you shouldn't need to be active on MSE itself to have a voice on changes to the entire network.  This is especially important for questions like  because it will effect every network to do with coding at all. This was brought up in .  I would suggest reducing the rep required to downvote on MSE down to 100 (or 101) rep. This is the amount you get for the site association bonus. This is given once you achieve 200 rep on any network site and shows that you are active in at least one community. I think this would be the perfect use of the association bonus in showing that you are a member of the Stack Exchange community. I need two bib-like sections: a "References" giving works explicitly cited in my text, and a "Bibliography" (or "Further reading" if you prefer) giving everything from my bibfile that didn't already appear in "References". The first is of course completely standard, but the second... I'm stumped.  Further loose constraints: I'm somewhat committed to biblatex and the biblatex-apa style. But I'll happily accept an answer not related to them if there's any chance I can adapt it. Is GNU's Java Compiler (GCJ) dead? What is the meaning of "stop to do"? My teacher said that "stop to do" had two meanings: quit doing present work to do next work (which is following after the word "do") and pause for a while then continue. I have searched a lot about its meanings but what i got just about the first meaning. Is the second one true?  For examples:   I stop to play games.   First meaning: i stop doing something in order to play games.  Second meaning: i pause playing games for a while then i continue. remove locked by android device manager message I have played with Android device manager and I have blocked my phone. I have deblocked but everytime my phone enters into standyby it apears me the message "locked by android device manager" and I have to enter the password again.  Do you know how to remove this message? Creating your own Tinyurl style uid I'm writing a small article on humanly readable alternatives to Guids/UIDs, for example those used on TinyURL for the url hashes (which are often printed in magazines, so need to be short).  The simple uid I'm generating is - 6 characters: either a lowercase letter (a-z) or 0-9.   "According to my calculations captain", that's 6 mutually exclusive events, although calculating the probability of a clash gets a little harder than P(A or B) = P(A) + P(B), as obviously it includes numbers and from the code below, you can see it works out whether to use a number or letter using 50/50.  I'm interested in the clash rate and if the code below is a realistic simulation of anticipated clash rate you'd get from generating a hash. On average I get 40-50 clashes per million, however bare in mind the uid wouldn't be generated a million times at once, but probably only around 10-1000 times a minute.  What is the probability of a clash each time, and can anyone suggest a better way of doing it?  static Random _random = new Random();  public static void main() {     // Size of the key, 6     HashSet&lt;string&gt; set = new HashSet&lt;string&gt;();     int clashes = 0;     for (int n=0;n &lt; 1000000;n++)     {         StringBuilder builder = new StringBuilder();          for (int i =0;i &lt; 7;i++)         {             if (_random.NextDouble() &gt; 0.5)             {                 builder.Append((char)_random.Next(97,123));             }             else             {                 builder.Append(_random.Next(0,9).ToString());             }         }          if (set.Contains(builder.ToString()))         {             clashes++;             Console.WriteLine("clash: (" +n+ ")" +builder.ToString());         }          set.Add(builder.ToString());         _random.Next();         //Console.Write(builder.ToString());     }      Console.WriteLine("Clashes: " +clashes);     Console.ReadLine(); }   UPDATE:   from this question  I really asked two questions here so I was cheating. The answer I was after was rcar's, however Sklivvz's is also the answer to the 2nd part (an alternative). Is it possible to make a custom unique id generator in a database, or would it be client side (which would be 2 possible reads first)?  The general idea I was after was using Ids in databases or other stores that can be used by phone or printed material, not a giant 16 byte guid.  UPDATE 2: I put the formula for two mutually exclusive events above instead of 2 independent ones (as getting an 'a' the first time doesn't mean you can't get an 'a' the second time). Should've been P(A and B) = P(A) x P(B) Mechanics of Horizontal Stretching and Shrinking I know $y=2f(x)$ doubles the $y$ value in vertical shifting, and I know that $y=(1/2)f(x)$ halves the $y$ value. But, why does $y=f(2x)$ halve the $x$ value, and why does $y=f((1/2)x)$ double the $x$ value in horizontal shifting? I looked at the graphs, and I see the difference, but I want to know the math behind why it halves instead of doubling the $x$ value for $y=f(2x)$. Maybe this is a stupid question, but could someone help me out?  Thank you. Problem about angle in isosceles triangle $ABC$ is an isosceles triangle, $AB=AC$, and $\measuredangle A=20^{\circ}$. For point $M$ on $AB$ and $N$ on $AC$, we have $AM=NC=BC$. Compute the  $\measuredangle BMN$.  In a similar problem (with only one point on one side) the key step was to construct an equilateral triangle on the other side. I tried using that in this problem too, but I didn't manage to solve it. Earlier this year, I read a huge (1000+ pg) novel about a cloistered group of monks that sort of worshiped math. The story involved alternate dimensions or time travel or something. A big thing in the book was coordinates, containing data like for speed or something as an alternate axis. There were several rings of the monastery.   At some point the main character was called out of his monastery to never return. I'm hoping to figure out the name so I can discuss it with my book club. redirecting openshift rhcloud domain to custom domain for SEO purposes Openshift application url: example.rhcloud.com  Custom domain: example.com  I came across this  and added the redirection rule. However, I can not access example.rhcloud.com now. My custom domain is www.example.com.  To avoid duplicate content problems, I tried this redirection.   Here is my .htaccess file:  RewriteEngine on   # Uncomment the following lines to force HTTPS #RewriteCond %{HTTP:X-Forwarded-Proto} !https  #RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]   # WordPress Defaults RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]  # Redirect Https traffic to Http RewriteEngine on  RewriteCond %{SERVER_PORT} ^443$ [OR] RewriteCond %{HTTPS} on RewriteRule  ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]   # Redirect non-www to www RewriteEngine on  RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]    # Redirect openshift rhcloud domain to custom domain RewriteEngine on  RewriteCond %{HTTP_HOST} ^example.rhcloud.com$ RewriteRule (.*)$ http://www.example.com/$1 [R=301,L]   Why is example.com not redirecting to ww.example.com? How do I fix this?  Also, I see that since I have https to http redirection and non www to www redirection, my blog has been loading slow. How can I reduce it to lesser number of rules?  Edit:  In chrome:   In Firefox:     The page isn't redirecting properly, Firefox has detected that the server is redirecting the request for this address in a way that will never complete.     This problem can sometimes be caused by disabling or refusing to accept cookies. Are there either examples, or a mention of this having happened, of students permanently transferring from one magical school to another in Potterverse?  Canon only please (books/JKR/Pottermore).  Please note that I am only asking about transfers, e.g. you must already be studying in one school. Therefore an example of Malfoys considering sending Draco to Durmstrang is not in scope, since that happened before he attended Hogwarts. Also, guest-studying during Tri-Wizard doesn't count as it wasn't permanent.  Also, if the answer is a "no", please provide evidence (other than "well I read the books before and I don't remember a single case like that", unless you have eidetic memory) from entire canon. LIGO has announced the detection of gravitational waves on 11 Feb, 2016. I was wondering why the detection of gravitational waves was so significant?   I know it is another confirmation of general relativity (GR), but I thought we had already confirmed GR beyond much doubt. What extra stuff would finding gravitational waves teach us? Is the detection of gravitational waves significant in and of itself, or is there data which can be extracted from the waves which will be more useful? Prove that $6$ divides $n(n + 1)(n + 2)$ I am stuck on this problem, and was wondering if anyone could help me out with this. The question is as follows:  Let $n$ be an integer such that $n ≥ 1$. Prove that $6$ divides $n(n + 1)(n + 2)$. Note: An integer $a$ divides an integer $b$, written $a|b$, if there exists $q ∈ Z$ such that $b = qa$. Alternatively, $a|b$ if dividing $b$ by $a$, $b ÷ a$, results in an integer.  Should I do a proof by induction? All help/input is appreciated! How do I alter a language item link? I cannot find enable-interactive-search in    gsettings set org.gnome.nautilus.preferences enable-interactive-search true.     I searched using    gsettings list-recursively | grep search     and    gsettings list-recursively | grep interactive     but no such option.  Can you help me disable this in Ubuntu 17.10 and later? Develop rich API exposing Stack Overflow functionality I would love to see an actual native iPhone app for Stack Overflow, Server Fault, Super User, etc.  I've actually developed a number of iPhone apps myself, and would certainly be interested and willing in doing the bulk of the legwork, but it would be necessary for the SO team to expose a real API, instead of simply RSS feeds.  Maybe if there's enough demand behind this, we can convince the SO team to build a rich API, which could be useful for many other applications, not just an iPhone app. Send email using the GMail SMTP server from a PHP page I saw the sentence like     Donald Trump to run for president next month.   in the newspaper on the internet.  But I don't know why we have to use to instead of will.  Is there any rule I don't know?  Can anyone tell me the reason why we should use to in the news? Ephemeral error message: "cryptsetup: unknown fstype, bad password or options?"