I'm trying to create a script which will find files of a certain filename, copy a  file to that file's location, and then delete the found file.   Ignoring the delete part for now, this is what I have so far:  find /path/to/searchdir -name "file.rtf" -exec cp -v "/path/to/filetocopy.rtf" `dirname {}` \;   Unfortunately I can't seem to get it to evaluate the dirname properly, as it returns "." for any instances of the file that it finds.
Suppose I have a directory structure as follows  test test/a test/b   Now I want to execute a command, such that in the . folder I can execute a command on the basename of the files a and b.  So basically, I want something like this, which I naively tried  find test -type f -exec touch `basename {}` \;   Only, this does not result in empty files a and b in the parent directory. Suppose that my touch command can only take a single argument.  This will result in a directory structure like this  a b test test/a test/b   I know how to do this in a bash script, but I am interested in single command solution.
Redefining "cited on" string (and others) in biblatex How do I start applications automatically on login? How can I make an application automatically start when I have logged in? I am trying to use the MailManager class in Drupal 8 to send HTML mail. I got it working, but it isn't parsing the HTML markup. I think something is wrong with the headers of the email.  What I have is a custom module (Custom_forward) that contains a form and that calls Mailmanager::mail() in its submitForm() method, which contains the following code.          // Email body         $header = $sender . ' thought you would like to see this page from the website.';         $personal_message = $form_state-&gt;getValues()['message_body'];         $entity_url_value = '&lt;a href="' . $entity_url-&gt;toString() . '"&gt;Go to article&lt;/a&gt;';         $message = $header . '&lt;br&gt;' . $personal_message . '&lt;br&gt;' . $entity_url_value;          // Email         $langcode = 'en';         $mailManager = \Drupal::service('plugin.manager.mail');         $to = $form_state-&gt;getValues()['recipient'];          $params['title'] = 'Forward';         $params['message'] = $message;         $result = $mailManager-&gt;mail('custom_forward', 'forward', $to, $langcode, $params, NULL, true);          if ($result['result'] !== true) {             drupal_set_message(t('There was a problem sending your message and it was not sent.'), 'error');             \Drupal::logger('mail-log')-&gt;error($message);         }         else {             drupal_set_message(t('Your message has been sent.'));         }   According to Drupal you also need the hook_mail method in mytheme.theme to be able to send message, you can see this method here:  function custom_forward_mail($key, &amp;$message, $params) {   $message['body'] = [];   $message['subject'] = [];   $message['headers'] = array(     'content-type' =&gt; 'text/html',     'charset' =&gt; 'UTF-8',     'format' =&gt; 'flowed',     'delsp' =&gt; 'yes',     'from' =&gt; \Drupal::config('system.site')-&gt;get('mail')   );    switch ($key) {     case 'forward':       $message['subject'] = $params['title'];       $message['body'][] = '&lt;html&gt;&lt;body&gt;' . $params['message'] . '&lt;/body&gt;&lt;/html&gt;';       break;   } }   As you can see, I am setting the content type to text/html and that should tell the mail system to parse the content as an HTML, but this is not working for some reasons.  This is a testing email. All the HTML markup is not shown, but also not working.  Bassem thought you would like to see this page from the website. personal message Go to article [1] [1] http://myhost/node/81 Is it better to difference a series (assuming it needs it) before using an Arima OR better to use the d parameter within Arima?  I was surprised how different the fitted values are depending on which route is taken with the same model and data. Or am I doing something incorrectly?  install.packages("forecast") library(forecast)  wineindT&lt;-window(wineind, start=c(1987,1), end=c(1994,8)) wineindT_diff &lt;-diff(wineindT)  #coefficients and other measures are similar modA&lt;-Arima(wineindT,order=c(1,1,0)) summary(modA) modB&lt;-Arima(wineindT_diff,order=c(1,0,0)) summary(modB)  #fitted values from modA A&lt;-forecast.Arima(modA,1)$fitted  #fitted from modB, setting initial value to the first value in the original series B&lt;-diffinv(forecast.Arima(modB,1)$fitted,xi=wineindT[1])   plot(A, col="red") lines(B, col="blue")   ADD:  Please note I am differencing the series once and fitting arima (1,0,0) then I am fitting arima (1,1,0) to the original series. I am (I think) reversing the differencing on the fitted values for the arima(1,0,0) on the differenced file.   I am comparing the fitted values - not the predictions.  Here is the plot (red is arima(1,1,0) and blue is the arima (1,0,0) on the differenced series after changing back to the original scale)  :    Response to Dr. Hyndman's Answer:  1) Can you illustrate in R code what I would need to do in order to get the two fitted values (and presumably forecasts) to match (allowing for small difference due to your first point in your answer) between Arima (1,1,0) and Arima(1,0,0) on the manually differenced series? I assume this has to do with the mean not being included in modA, but I am not entirely sure how to proceed.  2) Regarding your #3. I know I am missing the obvious, but are not $\hat{X}_t = X_{t-1} + \phi(X_{t-1}-X_{t-2}) $ and $\hat{Y}_t = \phi (X_{t-1}-X_{t-2})$ the same when $\hat{Y}_t$ is defined as $\hat{X}_t - X_{t-1}$? Are you saying I am "undifferencing" incorrectly? How to stop "Monkey Test" and "Time Service" apps When I long-press the "home" button to close all apps, there is an app named "time service" with android symbol and another named "monkey test" that are always open.   How to stop this? Can you set custom ringtones for contact groups? In iPhone, you can easily change the default ringtone (Settings → Sounds → Ringtone) and set a custom ringtone for individual people (Contacts → [some person] → Edit → Ringtone).   But can you set a custom tone for a group of contacts? (E.g. "family" or "workmates".)  I think that would be handy—and quite basic functionality, so to speak—but I couldn't find a way to do this through the iPhone UI. Is it possible at all (without jailbreaking)? Is there a \subsubsubsection command? I could do \subsection{} and \subsubsection{} but not \subsubsubsection{}. This command does not seem to be available in LaTeX. Is there an alternative command? Is a droid a ‘he/she’ or an ‘it’? Inspired by  question.  Are droids in the Star Wars universe referred to with gendered pronouns (i.e. he or she), or are they referred to as objects (i.e. it)? Exercise $1.8$ of chapter one in Hartshorne. In exercise 1.8 of chap I in Hartshorne algebraic geometry,       Let $Y$ be an affine variety of dimension $r$ in $\mathbf A^n$. Let $H$ be a hypersurface in $\mathbf A^n$, and assume that $Y \nsubseteq H$. Then every irreducible component of $Y \cap H$ has dimension $r-1$.     I refered to a . In this solution, why $f$ is not a unit in $B$? Python and regular expression with Unicode I need to delete some Unicode symbols from the string 'بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ'  I know they exist here for sure. I tried:  re.sub('([\u064B-\u0652\u06D4\u0670\u0674\u06D5-\u06ED]+)', '', 'بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ')   but it doesn't work. String stays the same. What am I doing wrong? Clean way of building simple taxonomy browser of arbitrary depth How to divide LaTeX table cells vertically? I want my table to have separated cells. Basically double lines but I can't figure how to have horizontal lines disconnected. I tried \hline and \cline but those connect too.  This is best I can do:    This is how I want my table to look:   \begin{tabular}{|c||c||c||c|}   \hline   \multicolumn{2}{|c||}{First Cell}&amp;   Second Cell&amp;   Third Cell\\   \hline   \hline   \begin{tabular}{@{}l@{}} Data\\ Data\\ Data\\   \end{tabular}&amp;   \begin{tabular}{@{}l@{}}     Data\\     Data\\     Data\\   \end{tabular}&amp;   \begin{tabular}{@{}l@{}}     Data\\     Data\\     Data\\   \end{tabular}&amp;   \begin{tabular}{@{}l@{}}     Data\\     Data\\     Data\\   \end{tabular}\\    \hline  \end{tabular} Make OS X Terminal commands I type BOLD I'd like to make commands I've typed (input) into terminal stand out from all the output.   For example:  imac:~ buster$ chmod -R g-w myfolder  imac:~ buster$ cd myfolder imac:myfolder buster$ ls -l total 0 drwxr-xr-x   9 root  admin   306 Apr 20  2010 bin drwxr-xr-x   7 root  admin   238 Apr 20  2010 include drwxr-xr-x  73 root  admin  2482 May 18 17:16 lib drwxr-xr-x   6 root  admin   204 Apr 20  2010 man imac:myfolder buster$ echo Go Giants! Go Giants!  bold jumps to mind but I'd accept a color or even highlighting the whole line...   I'm sure there's a way to do this but it's not obvious to me...  thanks! Do professors care about their rating on websites such as RateMyProfessor or Koofers? I am wondering if a professor is already an Associate Professor, do they still care about their reputation in the eyes of the department considering tenureship is already granted? Whenever I try to cut out a circular hole in either a cylinder or sphere the polygons around the circular hole always have distorted normals after smoothing. Is there anyway to fix this. I've tried using the remesh modifier but wind up with some pretty ugly results. Finding the convergence interval of $\sum_{n=0}^\infty\frac{n!x^n}{n^n}$. I want to find the convergence interval of the infinite series $\sum\limits_{n=0}^\infty \dfrac{n!x^n}{n^n}$. I will use the ratio test: if I call $u_n = \dfrac{n!x^n}{n^n}$, the ratio test says that, if the following is true for some values of $x$, the series will be convergent for these values of $x$: $$\lim_{n\to+\infty}\left|\frac{u_{n+1}}{u_n}\right|&lt;1$$ So, I will first calculate the value of $\left|\dfrac{u_{n+1}}{u_n}\right|$: $$\left|\dfrac{\dfrac{(n+1)!x^{n+1}}{(n+1)^{n+1}}}{\dfrac{n!x^n}{n^n}}\right|=\dfrac{(n+1)!|x|^{n+1}}{(n+1)^{n+1}}\times\dfrac{n^n}{n!|x|^n}=\frac{(n+1)n^n|x|}{(n+1)^{n+1}}=|x|\left(\frac{n}{n+1}\right)^n$$ So, $\lim\limits_{n\to+\infty}\left|\dfrac{u_{n+1}}{u_n}\right|$ becomes: $$\lim_{n\to+\infty}\left|\frac{u_{n+1}}{u_n}\right|=\lim_{n\to+\infty}|x|\left(\frac{n}{n+1}\right)^n=|x|\lim_{n\to+\infty}\left(\frac{n}{n+1}\right)^n$$ Now I must evaluate the value of $\lim\limits_{n\to+\infty}\left(\dfrac{n}{n+1}\right)^n$. For this, let $y = \left(\dfrac{n}{n+1}\right)^n$; so, instead of calculating $\lim\limits_{n\to+\infty}y$, I will first calculate $\lim\limits_{n\to+\infty}\ln y$: $$\lim_{n\to+\infty}\ln y=\lim_{n\to+\infty}\ln \left(\dfrac{n}{n+1}\right)^n=\lim_{n\to+\infty}n\ln\left(\frac{n}{n+1}\right) =\lim_{n\to+\infty}\frac{\ln\left(\frac{n}{n+1}\right)}{\frac{1}{n}}$$ Applying L'Hôpital's rule: $$\lim_{n\to+\infty}\frac{\ln\left(\frac{n}{n+1}\right)}{\frac{1}{n}} =\lim_{n\to+\infty}\frac{\frac{1}{n(n+1)}}{-\frac{1}{n^2}} =\lim_{n\to+\infty}\left(-\frac{n}{n+1}\right)=-1$$ Now, since we know that $\lim\limits_{n\to+\infty}\ln y = -1$, we have that: $$\lim_{n\to+\infty}y=\lim_{n\to+\infty}e^{\ln y} = e^{-1} = \frac{1}{e}$$. Substituting this back into the expression $\lim\limits_{n\to+\infty}\left|\frac{u_{n+1}}{u_n}\right| = |x|\lim\limits_{n\to+\infty}\left(\frac{n}{n+1}\right)^n$, we have that the limit of $\left|\dfrac{u_{n+1}}{u_n}\right|$ as $n\to+\infty$ is: $$\lim_{n\to+\infty}\left|\frac{u_{n+1}}{u_n}\right|=\frac{|x|}{e}$$ Therefore, the series will certainly be convergent for the values of $x$ for which $\dfrac{|x|}{e}&lt;1$, that is, $|x|&lt;e$. So, I know that the series is convergent for $-e &lt; x &lt; e$, but I have to test whether the series is convergent at $x = e$ or $x = -e$. That is, I have to test whether $\sum\limits_{n=0}^{\infty} \dfrac{n!e^n}{n^n}$ and $\sum\limits_{n=0}^{\infty} \dfrac{(-1)^nn!e^n}{n^n}$ are convergent. Since these limits don't approach zero, I know they are both divergent, but I'm not sure how to find the limits, because of the factorial function. Also, I can't use integral test here, because of the factorial. Probably I should use comparison test, but I haven't found any divergent series to which to compare it. Any hints? Thank you in advance.  Edit: Using the suggestion by Ragib Zaman in the answer below, since the Taylor polynomial $P_n(x)$ of $e^x$ at $a=0$ is $$e^x = 1 + x + \dfrac{x^2}{2!} + \cdots + \dfrac{x^n}{n!}+\cdots,$$ if we substitute $n$ for $x$ we see that $e^n&gt;\dfrac{n^n}{n!}$; therefore, $\dfrac{n!e^n}{n^n} &gt; 1$, and, thus, we show that $\sum\limits_{n=0}^{\infty} \dfrac{n!e^n}{n^n}$ is divergent, because its term doesn't approach zero. $\sum\limits_{n=0}^{\infty} \dfrac{(-1)^nn!e^n}{n^n}$ is also divergent, because, although the absolute value of the ratio between two successive terms, $|e|\left(\frac{n}{n+1}\right)^n$, approaches 1 as $n\to\infty$, it approaches 1 from values bigger than 1; therefore, the absolute value of a term is always greater than the absolute value of the previous term. DIY.Blogoverflow.com is redirecting to stackexchange.com/blogs I seem to be the unlucky recipient of a 302 redirect from the blogoverflow site, and was asked by Grace Note to upload the issue here. While trying to access the DIY blog site, I'm getting bounced over to the generic SE blog page. I've tried resolving this by changing DNS servers, clearing my browser cache, and trying a different browser. Others going to the same site aren't experiencing the issue, but I'm at a loss for what's different on my system that would cause this. Here's the wget output of the redirect:  --2014-02-18 14:59:28--  http://diy.blogoverflow.com/ Resolving diy.blogoverflow.com (diy.blogoverflow.com)... 67.228.172.87 Connecting to diy.blogoverflow.com (diy.blogoverflow.com)|67.228.172.87|:80... c onnected. HTTP request sent, awaiting response...    HTTP/1.1 302 Found   Date: Tue, 18 Feb 2014 19:59:28 GMT   Server: Apache   X-Powered-By: PHP/5.4.22   Location: http://stackexchange.com/blogs   Content-Length: 1001   Connection: close   Content-Type: text/html; charset=UTF-8 Location: http://stackexchange.com/blogs [following] --2014-02-18 14:59:28--  http://stackexchange.com/blogs Resolving stackexchange.com (stackexchange.com)... 198.252.206.140 Connecting to stackexchange.com (stackexchange.com)|198.252.206.140|:80... conne cted. HTTP request sent, awaiting response...    HTTP/1.1 200 OK   Cache-Control: private   Content-Type: text/html; charset=utf-8   X-Frame-Options: SAMEORIGIN   Date: Tue, 18 Feb 2014 19:59:28 GMT   Content-Length: 16775 Length: 16775 (16K) [text/html] Saving to: ‘index.html.1’       0K .......... ......                                     100% 1.04M=0.02s I have looked up various sites online. They only explain it in a very basic arithmetic way. Would someone explain to me why is $\displaystyle\frac{x}{\frac{1}{2}}$ is $\displaystyle\frac{2x}{1}$? Tag scores update is supposed to happen at 03:00 UTC every day. Tag scores are updated by a scheduled job that is time consuming and often times out  (see for example the answers for  and ).  In the past month or two, the issue with not updating the scores has gotten much worse. Tag scores are now regularly not updated for 2-3 days in a row. The job fails more often than it runs which obviously lowers usability and appeal of tag badges (which are not awarded when the script fails) and scores to some extent.  I can also guess that if a job fails on consecutive days, it only makes it harder to make it work as it has more and more tags and answers to recount.  This issue happened in the past but not to the extent it's happening now.  Please do not close it as duplicate. I'm creating a separate post as I've been asked to do it by Adam Lear in a comment for the answer for the first of the linked questions. Other posts reporting this issue have accepted answers which makes them difficult to track for the SE team.  UPDATE  I've been writing down whether the scores were updated or not every day in April.  The results are:  Day      1   2   3   4   5   6   7   8   9   10  11  12  13  14  15   Updated  -   -   -   ✓   -   ✓  -   -   -   -   -   ✓   -   -   -   Day      16  17  18  19  20  21  22  23  24  25  26  27  28  29  30 Updated  ✓   -   ✓   -   ✓   -   -   ✓  ✓   -   ✓  -   ✓   -   -   The update succeeded on 10 days, failed on 20. The situation got somewhat better in the second half of the month. Has something been done about it? How can I replace a string in a file(s)? Replacing strings in files based on certain search criteria is a very common task. How can I    replace string foo with bar in all files in the current directory? do the same recursively for sub directories? replace only if the file name matches another string? replace only if the string is found in a certain context? replace if the string is on a certain line number? replace multiple strings with the same replacement replace multiple strings with different replacements