tolower() segfault's when trying to assign the returned value a char pointer
Why do I get a segmentation fault when writing to a "char *s" initialized with a string literal, but not "char s[]"?
Need a way to do a "loop cut" on a triangle fan Need a way to do a loopcut- ish thingy on the blue line Pure significance of line integrals of vector fields I can understand how the line integral of a scalar function has pure-mathematical significance, representing an area beneath a curve. But is there a pure significance to the line integral of a vector field? The only understanding I have of this is the physical example of work done on a moving particle. Thanks for any insight. What is the difference between dpkg and aptitude/apt-get? When installing a software via dpkg -i packageA.deb, will the dependencies required by packageA be downloaded and installed automatically? How is this different from using apt-get or aptitude? What level should I be to kill Alduin I am level 31 and I have the Elder Scroll. I am not sure if my level is high enough to go to Whiterun and trap one of Alduin's minions. What level should I be before I attempt it? Finding the number of non-negative integral solutions of $x + y + z = 10$ How does the integral $\int_{D_C} e^{ia z}P(z)/Q(z)\,\mathrm{d}z$ blow up. In my book I have a theorem that goes something like the following     Let $P(x)$ be $Q(x)$ polynomials such that $\deg(Q) \geq \deg(P) + 2$.   Then \begin{align*}  \int_{-\infty}^{\infty} \frac{P(x)}{Q(x)}  e^{iax} \,\mathrm{d}x  = 2 \pi i \frac{a}{|a|} \sum_{k=1}^{m} \mathrm{Res}\left[  \frac{P(x)}{Q(x)} , z_k \right] \end{align*} where $a$ is a real   constant and $z_1,\,\ldots\,,z_m$ are the singularities to $P(x)/Q(x)$ in   the upper halfplane if $a&gt;0$ and the lower halfplane if $a&lt;0$.   I am having a bit of problems understanding this. I know the reason why we have to switch contour is that $e^{iz}$ blows up. But I really can not see why or how it blows up.   Take the canonical example for why this theorem is useful  $$   J = \int_{-\infty}^\infty \frac{e^{iz}}{z^2+1} $$    Now the clue here is to show that the integral along the curve tends to zero, and then use the residue theorem. To show that the integral tends to zero I did this \begin{align*}  \left| \int_{C_1} \frac{e^{iz}}{1+z^2} \,\mathrm{d}z\right|  \leq \int_{C_1} \left| \frac{e^{iz}}{1+z^2} \right| \,\mathrm{d}z   \leq \sup_{z = R e^{i \theta}} \left( \frac{1}{\left|1+z^2\right|} \right)       \int_{C_1} |e^{iz}| \,\mathrm{d}z \end{align*} where the $ML$-inequality was used in the last inequality  On the circle with radius $R$ we have $|e^{iz}|=R$, and we can use the inequality $|a+b|\leq|a|-|b|$ to simplify further \begin{align*}  \left|\int_{D_R} \frac{e^{iz}}{1+z^2}\,\mathrm{d}z \right|  \leq \sup_{z = R e^{i \theta}} \left( \frac{1}{|z|^2-1}\right)  \int_{D_R} R \,\mathrm{d}z  \leq \pi \frac{R}{R^2-1} \end{align*} which tends to zero as $R \to \infty$ as wanted. but if one instead had $e^{-iz}$ then the theorem states that one has to use the lower half plane. But I do not see where my calculations err if one persists in using the contour in the upper half plane? What goes wrong, and why does it go wrong? $|e^{-iz}|$ should still be $R$ on the semi-circle.   How can one formally show that the integral diverges when picking the contour as a semi circle in the lower half plane? Collapsing a stream of multiple lines into one line I have a file containing a a large number of lines, each of which contains a bunch of numbers which are separated by spaces. I process this data in a pipe in some way, and then I want to collapse the multiple lines into a single line of all the numbers separated by spaces.  Is there a standard command-line utility I can use to do this? It seems like most line-by-line utilities won't mess with the newlines... Convergence in Distribution in Order Statistics Let $X_1, X_2, \ldots$ be iid from Exp$(\theta)$ with density function $f(x) = \frac{1}{\theta}e^{-\frac{x}{\theta}}$. (a) Find the limiting distribution of $M_n = Y_1 - \theta\ln(n)$ and $T_n = nY_n$, where $Y_1$ and $Y_n$ represent the first and last order statistics (among $n$ observations) respectively. Answer: I have obtained the CDF of X to be: $$F_x(x) = 1 - e^{-\frac{x}{\theta}}$$ the CDF of $Y_1$ to be: $$F_{Y_1} = 1 = e^{-\frac{xn}{\theta}}$$ the CDF of $M_n$ to be: $$F_{M_n}(x) = \left[1 - \frac{1}{n}e^{-\frac{x}{\theta}}\right]^n$$ with limiting distribution $$e^{-e^{-\frac{x}{\theta}}}$$ the CDF of $T_n$ to be: $$F_{T_n}(x) = 1 - e^{-\frac{x}{\theta}}$$ which is also the limiting distribution. (b) Show that $M_n$ and $T_n$ are asymptotically independent. Answer: I've tried finding the joint PDF for ordered statistics by using the equation $$g_{ij}(y_i, y_j) = \frac{n!}{(i - 1)!(j - i - 1)!(n - j)!}[F(y_i)]^{i - 1}[F(y_j) - F(y_i)]^{j - i - 1}[1 - F(y_j)]^{n - j}f(y_i)f(y_j)$$ however, it is a mess based on my CDFs. Any suggestions on a different approach? What is the easiest way to make a backup of an entire hard disk I got myself a dell laptop from the local computer store. Its a used machine with Windows Vista Home Basic on it. I want to load Ubuntu Desktop 10.10 though so I can do perl development. BUT I want to keep a copy of the entire harddrive with the dell utility partition and Windows Vista in case I want to go back. I was thinking I could image the drive but I not sure what to use, I don't have Ghost or anything, Someone had told me about Clonezilla. Would that work for me? Is it hard to use? Also I want to burn the data to a DVD or something more storable than a harddisk. I am looking to set up Ubuntu Server as a headless NAS for my home. I would like to have file storage there, as well as a central hub for my MP3s and pictures.  What are the best packages out there to handle this? Can someone post a link to a good tutorial or post some tips?  One constraint I have is that it has to be Windows 7 friendly. By that I mean the shares and streaming should work for a Windows machine. Automatically rename files when they are placed in a specific directory Is it possible to automatically rename a file when it's placed in a specific directory?  For example I have a directory named "dir0".I move or copy a file named "file1" to "dir0".then "file1" should rename to "file1_{current timestamp}" How to prove $( A \times B ) \cap ( C \times D ) = ( A \cap C ) \times ( B \cap D )$ ? The wavefunction $\Psi(x,t)$ for a free particle is given by  $$\Psi(x,t) = A e^{i(kx-\frac{\hbar k}{2m}t)}$$  This wavefunction is non-normalisable. Does this mean that free particles do not exist in nature?  Why then do we use free particles $\psi(\vec{x}) = e^{ikz}$, for example, in scattering theory? As mentioned in many of my previous questions, I'm working through K&amp;R, and am currently into the preprocessor. One of the more interesting things &mdash; something I never knew before from any of my prior attempts to learn C &mdash; is the ## preprocessor operator. According to K&amp;R:     The preprocessor operator ##   provides a way to concatenate actual   arguments during macro expansion. If a   parameter in the replacement text is   adjacent to a ##, the parameter is   replaced by the actual argument, the   ## and surrounding white space are   removed, and the result is re-scanned.   For example, the macro paste   concatenates its two arguments:      #define  paste(front, back)  front ## back      so paste(name, 1) creates the token   name1.   How and why would someone use this in the real world? What are practical examples of its use, and are there gotchas to consider? Find probability using distribution function method Let $X_1$ and $X_2$ be two independent random variables with distribution $U(0,1)$. Let $Y=|X_1-X_2|$. Find the distribution function and density of $Y$.   Solution:  f(x1)=1 whenever x1 between 0 and 1          =0 Else where f(x2)=1 whenever x2 between 0 and 1          =0 Else where f(x1,x2)=1 whenever x1,x2 between 0 and 1           =0 Else where G(y)= P[-y &lt;= x1-x2 &lt;= y]       =\int_{-y}^y \int_{x1_y}^{y+x1} 1 dx2 dx1       =\int_{-y}^y -2y dx1       =4y^2 when y between 0 and 1       =0 when y less than 0       =1 when y greater than 1 Thus, g(y)= \diff G(y) =8y  Is it correct? Elsevier has started circulating  as a consequence of the  to the editors of their journals:     Subject: US editors and reviewers can no longer handle submissions by   authors employed by the Government of Iran            Dear Dr Bruno Granier,      The Office of Foreign Assets Control (OFAC) of the US Department of   the Treasury administers and enforces economic and trade sanctions. As   a result of OFAC sanctions we have been made aware that US editors, US   Elsevier staff and US reviewers are now unable to handle scientific   manuscripts where any of the authors are employed by the Government of   Iran. This includes the research departments of the various oil and   gas companies which are deemed to be entities of the Government of   Iran. We realize that this OFAC regulation will cause some   inconvenience in your role as an editor but Elsevier is legally   obliged to ensure that all reasonable efforts are made to avoid   submissions from Iranian government agencies and companies being   handled by US editors, US Elsevier staff and US reviewers. Please be   aware that editors, Elsevier staff and reviewers from outside the US   may still handle these manuscripts and that this OFAC regulation does   not pertain to manuscripts where the authors are based at Iranian   academic and research institutes. Manuscripts originating from a   clinical setting that are not government run, for example, a hospital   or clinical practice are also exempt from this regulation.      To view the official OFAC regulation, please click here. In practice   the result of these sanctions will mean that:      • Submissions where any author is based in Iran, and is not at an   academic and research institution, cannot be handled by US-based   editors, US Elsevier staff, US reviewers, or any US citizens based   outside of the US.      • If an Iranian author has dual affiliations (eg. university and   government), their submission cannot be handled by US-based editors,   US Elsevier staff, US reviewers, or any US citizens based outside of   the US.      • Affiliations of Iranian authors should therefore be checked, and any   manuscripts which fall under this OFAC regulation delegated to a   non-US editor, before handling.      • When assigning reviewers, affiliations of Iranian authors should   also be checked, and any papers which fall under this OFAC regulation   should only be sent to non-US reviewers. (As an editor you should do   what is reasonable to determine the nationality of a reviewer e.g.   check their email address. This check does not extend to emailing   reviewers directly to confirm their nationality or location). Unless   there is specific knowledge that a non-US-based reviewer is a US   citizen, editors can send such submissions to reviewers based outside   the US.      • If your journal workflow involves all submissions being handled by   US-based Elsevier staff, they will reject these manuscripts outright   before they reach you.      • Should there be no suitably qualified editor or reviewer, please   reject the manuscript outright.      When rejecting manuscripts which fall under this OFAC regulation   please use the new EES Decision Term "Reject - OFAC Sanctions" and the   following text:      "As a result of OFAC sanctions all editorial staff who are US-based/US   nationals are unable to handle scientific manuscripts which are   authored by Iranian scientists, employed by the Government of Iran.   Based on this OFAC regulation we are unfortunately unable to handle   your manuscript. We wish you success with your submission to another   Journal."       We apologize for the inconvenience this may cause. If you do have any   questions please contact your Publisher.       Sent on behalf of Dan Lovegrove      Cretaceous Research   Has there been any public response, by US editors or reviewers, stating whether they will obey (or not) the instruction? Also, does this letter conflict with the  of the  (all Elsevier journals are members of COPE as of January 2008)? Deploy a project using Git push HTTP and HTTPS impacts on SEO I have a website http://www.domain_1.com/ hosted in a shared webserver.  I have used SSL for another website https://www.domain_2.com/ on the same server.  Due to some technical limitations (single IP), if you try https://www.domain_1.com, browser will show the same domain_2 website. But this is not a concern for me.  Question: will this scnario impact SEO of domain_1 (non-HTTPS) site? I often see questions on Stack Exchange sites which I presume are written by non-native English speakers who use the word "doubt" in place of the word "question". Is this a case of misunderstanding the correct meaning or are people being taught that this is correct usage? Compile error with \href ToC and \apacite I would like to edit my document but I have a compile error somewhere between the \href and the apacite but can't locate it. I've tried blocking out code and taking out references, with varying results.  \documentclass[a4paper,12pt]{article} \usepackage[english]{babel} \usepackage[utf8]{inputenc}  % TOC, Citations, Refereneces, and Appendicies \usepackage{apacite} % \cite{ref1,ref2} %Warning - unsupported tocstyle code \usepackage[tocindentauto]{tocstyle}     \renewcommand{\thesection}{\Roman{section}}      \renewcommand{\thesubsection}{\arabic{subsection}.}     \renewcommand{\thesubsubsection}{\roman{subsubsection}.} %\usepackage{hyperref} %\urlstyle{same} %\hypersetup{ %   colorlinks=true, %   urlcolor=cyan, %   linkcolor=blue, %   citecolor=green, %   filecolor=magenta, %   pdftitle={Sharelatex Example}, %   pdfpagemode=FullScreen, %} \usepackage[toc,page]{appendix}  \begin{document}    ...to be installed \cite{church13,hershkowits97}. \bibliographystyle{apacite} \bibliography{bibliography} \end{document}   Here are the bibliography.bib entries then  @ARTICLE{church13,    author       = {K.H. Church and H. Tsang and R. Rodrigiguez and P. Defembaugh and R. Rumpf},    year         = 2013,    title        = {Printed circuit structures, the evolution of printed circuit boards},    journal      = {Circuit Insight},    volume       = {},    number       = {},    pages        = {},    howpublished = {},     url          = {http://www.808multimedia.com/winnt/kernel.htm}, }  @ARTICLE{hershkowits97,    author       = {N. Hershkowits and R.A. Breun},    year         = {1997},    title        = {Diagnostics for plasma processing (etch plasmas) (invited)},    journal      = {Review of Scientific Instrumentation},    volume       = {68},    number       = {1},    pages        = {880--885},    howpublished = {}, }