I need to express the following improper integral as a double integral of $x$ and $y$ and then, using polar coordinates, evaluate it.  $$I=\int_{-\infty}^{\infty}e^{-x^2}dx$$  Plotting it, we find a Gaussian centered at $x=0$ which tends to infinity to both sides. We can easily express it as a double integral :  $$I=\int_{0}^{1}\int_{-\infty}^{\infty}e^{-x^2}dxdy$$  Evaluating both using Wolfram Alpha gives $\sqrt{\pi}$, so it converges.  I know that $x=rcos(\theta)$ and that $dxdy=rdrd\theta$, but substituing this in the above integral and evaluating $\theta$ from $0$ to $2\pi$ and $r$ from $0$ to $\infty$ doesn't yield the correct answer. What's wrong here?  Thanks a lot !
How to prove  $$\int_{0}^{\infty} \mathrm{e}^{-x^2}\, dx = \frac{\sqrt \pi}{2}$$
Generate random numbers uniformly over an entire range I've been using SSH Tunnel manager to easily set up and stop port tunneling over SSH to various servers at my company. That saved me the pain of opening up a new terminal window which will hang out there just for the sake of having a tunnel open.  This worked great (well , sort of) but SSH Tunnel Manager is a PowerPC application. With Lion, it is not supported any more.  What is a good replacement? I want to prove the definition of limit of a function from definition (1) to definition (2).  (1) A function $f(x)$ is said to have $f^*$ as the limit as $x$ tends $x^*$ iff for every sequence $\{x_n\}$ with limit $x^*$, the limit $\lim_{n-&gt;\infty}f(x_n)$ exists and is equal to $f^*$. (2) A function is said to have $f^*$ as the limit as $x$ tends $x^*$ iff for each $\epsilon &gt;0$, there exists a $\delta_\epsilon &gt;0$ such that $|f(x)-f^*| &lt;\epsilon \forall |x^*-x|&lt;\delta_\epsilon$  I am confused about the steps. Suppose I am given an $\epsilon &gt; 0$ and $x^*$. I have to show the existence of a $\delta_\epsilon &gt;0$ such that for all $x$ satisfying  $|x^*-x|&lt;\delta_\epsilon$ I can construct a sequence $x_n$ which converges to $x^*$ and $x_n=x$ for some $n \geq N$. Then I can say that $f(x_n)-f^*=f(x)-f^* &lt; \epsilon$. I think I may have made some mistake about the steps.  My main confusion is the following : Suppose I choose $\delta_\epsilon=\epsilon$. Then if a sequence $\{x_n\}$ converges to $x^*$ then $x_n=x$ (where $x$ satisfies $|x-x^*|&lt;\epsilon$) for some $n\geq N$. Now, $\lim_{n-&gt;\infty}f(x_n)$ exists implies there exists an $M$ such that $\forall n\geq M$, $f(x_n)-f^* &lt;\epsilon$. Now, I need to show that for some $n \geq M$ indeed $x_n=x$. How do I show that ? This $M$ and $N$ are different. I have a C++ library that provides various classes for managing data.  I have the source code for the library.  I want to extend the C++ API to support C function calls so that the library can be used with C code and C++ code at the same time.  I'm using GNU tool chain (gcc, glibc, etc), so language and architecture support are not an issue.  Are there any reasons why this is technically not possible?  Are there any gotcha's that I need to watch out for?  Are there resources, example code and/or documentation available regarding this?    Some other things that I have found out:   Use the following to wrap your C++ headers that need to be used by C code.     #ifdef __cplusplus extern "C" {   #endif   //   // Code goes here ...   //   #ifdef __cplusplus   } // extern "C"   #endif    Keep "real" C++ interfaces in separate header files that are not included by C.  Think  here.  Using #ifndef __cplusplus #error stuff helps here to detect any craziness. Careful of C++ identifiers as names in C code Enums varying in size between C and C++ compilers.  Probably not an issue if you're using GNU tool chain, but still, be careful. For structs follow the following form so that C does not get confused.  typedef struct X { ... } X  Then use pointers for passing around C++ objects, they just have to be declared in C as struct X where X is the C++ object.   All of this is courtesy of a friend who's a wizard at C++. How should I rewire a miswired 3-way switch? I have a 3 way switch that was wired incorrectly when the switches were replaced with a different color switch.  Is there a methodical way for me to identify which wires represent which piece of the system so I can correct the bad wiring?  Currently if switch 1 is on, switch 2 can turn light on or off.  If switch 1 is off, then switch 2 does nothing. Simple question.   SO had turned me into a better developer by far, I like to browse questions that strike my interest and curiosity and just read through the answers. I never fail to learn something new everyday, whether it's something trivial or something much more complex.  When I receive reputation it means a lot to me, almost a self achievement of sorts. Something I can show to someone to prove my "worth". I think it works for me as a great confidence booster, also its something I can show my friends who don't understand what I do.   It almost feels like I can finally have something to back me up if need to be.  So the question is what does YOUR reputation mean to YOU? Is it simply a number, is it a score as if you're playing a game, or does it help you mentally achieve your goals and improve yourself like it does for me. Custom ordering of duplicate targets is not necessarily honored on mobile apps Let $(X,d)$ be a metric space, and say $(x_n)$ is a Cauchy sequence such that it has a convergent subsequence $(x_{n_k})$ that converges to $x$. We show $x_n \to x$. Let $\epsilon &gt; 0$. Take $N &gt;0$ such that for all $n,m &gt; N$, we have   $$d(x_n,x_m) &lt; \frac{\epsilon}{2}.$$  By hypothesis, we can take also $K &gt;0$ such that for all $n_k &gt; K$, we have  $$ d(x_{n_k},x) &lt; \frac{\epsilon}{2}.$$  Put $M = \max \{N,K\}$. Therefore, for all $n,m,n_k &gt; M$, we have  $$ d(x_n,x) \leq d(x_n, x_{n_k}) + d( x_{n_k},x) &lt; \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon.$$  Hence, $x_n \to x$ as desired.  Is this a correct approach? Thank you very much in advance. What are exchanges like "How are you," "I'm fine," and "See you later" called? Combining style numeric with style authoryear in BibLaTeX I haven't had a lot of experience with biblatex so far and I decided to use the numeric style for citations in the text. However, the authoryear style for the bibliography is much nicer. I know, I can't actually combine numeric citestyle with authoryear bibstyle.  That brings me to my question: How can I achieve using the numeric citestyle and the formatting of authoryear in the bibliography? I have a document divided into \part \chapter \section and \subsection. I have 3 parts and in each part I reset all the counters.  I want that, when I do a crossref to something that is in the 1st part, chapter 3 and section 5, that LaTeX prints something like I-3.5, but  I don't want that in the tableofcontents part that LaTeX prints the part number. For example, what I want is:     Part I      chapter 1 section 1.1 section 1.2      chapter 2   AND NOT     chapter I-1 section I-1.1 section I-1.2      chapter I-2   The command that I've tried   \renewcommand{\thechapter}{\thepart-\arabic{chapter}} \renewcommand{\thesection}{\thechapter.\arabic{section}}   does exactly what I've said  Can anyone help me? C, C++ and Java IDE for Ubuntu Is there an IDE which can run on Ubuntu that supports C, C++ and Java? I installed , but it only supported Java. I installed the C/C++ package manually, but that package gives an error if I include iostream.   Is there any other IDE which can satisfy my needs? Or can I get NetBeans with all packages pre-installed in it? Ubuntu 12.04 gnome issue, no clock is shown, strange starter icon cannot be removed i am finding nowhere a solution I am running UBUNTU 12.04 and using GNOME desktop, which I installed additionally. Logging into classic GNOME I see the following:     WHAT is this "earth globe" icon coming from?Seems to be named "starter". It is configured to open a website, from my bookmarks. WHY is it not showing the TIME?   Using dconf-editor I had no luck in answering the above questions.  Any idea? My Bash Prompt is currently setting the xterm titlebar using the following sequence:  PS1='\033]0;\u@\h&gt;\w\007'   Is there an easy way to display the current command in the titlebar. For example, if I am tailing a file using tail -f foo.log, I want my titlebar to say tail -f foo.log. I have been trying for a long time to change Blender's icon, but no matter what I do, I am not allowed to edit anything in /snap/blender-tpaw/3/.  Here's what I tried:   Editing the files from nautilus without sudo. Editing the files from nautilus with sudo (sudo nautilus in terminal ). Using terminal commands such as cp or rm without sudo. Using terminal commands with sudo (such as sudo cp &lt;source&gt; /snap/blender-tpaw/3/ or sudo rm /snap/blender-tpaw/3/&lt;filename.ext&gt;) Doing everything above in a root terminal (using sudo -i)   In every case I get the following error:  cannot remove/copy '/snap/blender-tpaw/3/filename.ext': Read-only file system   where filename is the file and .ext is its extension.  This also applies to other snaps' files, not only Blender.  Am I doing something wrong here? Or is it just impossible to change those files? Although I don't think it is impossible because everything here from Ubuntu to Blender is open-source, so they have no reason to block us from modifying those files.  EDIT:  I used Main Menu (alacarte) to change the icon, but I still want to know why I cannot modify any snap file. In Chipaca's answer to  there's a screenshot with certain highlights. The highlights are the following:   A row of a GUI list is highlighted by the other parts of the screenshot being darker. A check mark is highlighted by being circled by what looks like a (orange) crayon.   How do I create both of these highlights on a screenshot? Is there an automated process?  The screenshot I'm referring to looks like this: How to reduce the fan noise and how to increase battery life? I have a brand new Sony Vaio S series laptop.() It came factory installed with Windows 7 professional Edition 64bit. Runs Intel core i5, 500 GB HDD , 4GB Ram. First I installed ubuntu 11.10 64 bit along side Windows to dual boot. Later,since the problem did not solve, I installed ubuntu 12.04 64bit along side Windows to dual boot. However the problem keeps annoying me.  Problem: When running ubuntu 11.10/12.04, the battery lasts only about 1.5 hours. The Fan runs loud and continuously. And there is a lot of heat generated. System monitor shows less than 5% CPU used. My laptop enjoys hybrid graphic and I tried turning off ADM graphic card and keep Intel graphic card on. However I can not get the Fan noise or heat to go away and consequently the battery drain continues. BTW, in windows, the laptop gives 4-5 hours of battery power, Fan is silent and there is no heat problem. Any ideas on how to reduce the fan noise and how to increase battery life in ubuntu 11.10/12.04? Parse and Extract Attributes from JSON Possible to get type of an aliased type in c#? Type.GetType("System.String")   Is there a lookup for the aliases available somewhere?  Type.GetType("string")   returns null. Let $G$ a group with normal subgroups $M,N$ such that $M\cap N=\{e\}$. Show that if $G$ is generated by $M\cup N$ then $G\cong M \times N$.