If $\text E$ is an arbitrary closed set in $\mathbf R^n$, show that there is an $\text f\in \text C^\infty(\mathbf R^n)$ such that $\text f(x)=0~$for every $x \in \text E$ and $\text f(x)&gt;0$ for every other $x\in \mathbf R^n$.  My approach is as follows :  Since $\text E$ is given to be closed hence $\text E^c=\text V$ will be an open set in $\mathbf R^n$ and hence $\text V$ can be written as countable union of open sets $\{\text V_i\}_{i=1}^{\infty}$ and hence one can have a partition of unity $\{\psi_i\}_{i=1}^{\infty}\subset \text C^\infty (\text V)$ such that $\text {supp}(\psi_i)\subset \text V_i$. Then if i take $f=\Sigma_{i=1}^{\infty} \psi_i$ then my this $\text f$ is in $\text C^\infty (\text V)$ and $f(x)&gt;0$ in $\text E^c$ and $f(x)=0$ in $\text E$. Now i am just left with to show that $f\in \text C^\infty (\mathbf R^n)$ or how can i generalize my $f$ to get the desired result.  Any type of help will be appreciated. Thanks in advance.
In Walter Rudin's Principles of mathematical analysis Exercise 5.21, it is proved that for any closed subset $E\subseteq \mathbb{R}$, there exists a smooth function $f$ on $\mathbb{R}$ such that $E=\{x\in \mathbb{R}\mid f(x)=0\}$.   Since $E^c$ is open in $\mathbb{R}$, $E^c$ is a countable disjoint union of open intervals $(a_i,b_i)$. On an interval $(a,b)$, if we let $f(x)=\exp(\frac{1}{(x-a)(x-b)})$, $x\in(a,b)$; $f(x)=0$, $x\notin(a,b)$, ($f(x)=\exp(\frac{1}{(x-a)})$ or $f(x)=\exp(\frac{1}{(x-b)})$ on $(a,\infty)$ and $(-\infty,b)$ resp.), then $f$ is smooth. Hence we can get a smooth function on $\mathbb{R}$ such that $E$ is the zero point sets of $f$.  (1). How about a closed subset $E$ of $\mathbb{R}^n$? is it true that for any closed subset $E\subseteq \mathbb{R}^n$, there exists a smooth function $f$ on $\mathbb{R}^n$ such that $E=\{x\in \mathbb{R}^n\mid f(x)=0\}$?  An open set in $\mathbb{R}^n$ cannot be written as a disjoint union of countable open balls hence the proof above is not valid. The partition of unity only claims that for an  open set $U$, there exists open $V$ in $U$ such that $\bar V\subseteq U$ and a smooth function $f$ on $\mathbb{R}^n$ such that $supp f\subseteq U$, $f|_V=1$.   (2). The taylor series of $f(x)=\exp(\frac{1}{(x-a)(x-b)})$ does not converge around points $a,b$ hence $f$ is not analytic at $a,b$. Is it true that for any closed subset $E\subseteq \mathbb{R}$, there exists an analytic function $f$ on $\mathbb{R}$ such that $E=\{x\in \mathbb{R}\mid f(x)=0\}$?
calculate slope for a road network I am working on a road network for routing operations using postgis and QGIS.    I am new to both of these tools and need to calculate the slope for each edge (by retrieving the Z value for the start and end node for the edge from a raster). Any ideas of the best approach to this?   I know postgis can dump points and get the value from a raster, but can I get the slope attribute to the edge without breaking the network topology (with edges that have corresponding start/end nodes) using this method?   thanks Disk full, du tells different. How to further investigate? I have a SCSI disk in a server (hardware Raid 1), 32G, ext3 filesytem. df tells me that the disk is 100% full. If I delete 1G this is correctly shown.  However, if I run a du -h -x / then du tells me that only 12G are used (I use -x because of some Samba mounts).  So my question is not about subtle differences between the du and df commands but about how I can find out what causes this huge difference?  I rebooted the machine for a fsck that went w/out errors. Should I run badblocks? lsof shows me no open deleted files, lost+found is empty and there is no obvious warn/err/fail statement in the messages file.  Feel free to ask for further details of the setup. Allow only alphanumeric characters for a UITextField Deleting self-answered question gets "Delete this answered question" warning While attempting to delete a question which was answered by myself, and with no other answers, I got the following warning:     Delete this answered question?      We do not recommend deleting questions with answers because doing so   deprives future readers of this knowledge.      Repeated deletion of answered questions can result in your account   being blocked from asking. Are you sure you wish to delete?   I understand that deleting your question when someone else has answered it is effectively nullifying the effort that person put into that answer, which is bad. But is it bad if the only answer that's deleted along with your question is your own? Is "coachee" even a word? If I am Rita's coach, is Rita my *coachee? (yikes) Is that even a word? Would it be correct instead to say she is my ward? What about terms for people at the other end of a mentor, sponsor relationship? I had a bunch of errors in the output of sudo apt-get update:  duplicate entries and 404 not found errors.  Figured those out, I hope: I removed PPAs that didn't have any packages associated with them, then I removed out a duplicate entry in /etc/apt/sources.list.  It seems I have royally buggered it up.  Now most of the lines say Ign when I do sudo apt-get update.  How do I go about straightening out what I have screwed up?  I need to get rid of these Igns that are all over the place.  There are about 50% (eyeball guess) Igns! I am currently wondering about the famous .  Where does it come from mathematically that when you point with your thumb in the direction of the current, your curved fingers will point in the direction of the $B$-field? In other words, which mathematical operation does it come from? Probably it has to do with some vector product or Stokes theorem application, but I am not quite sure about it. Sorry for asking such a basic question - but is there an actual term for the numbers that appear before and after the decimal point?  Example:  25.18  I know the 1 is in the tenths position, the 8 is in the hundredths position. are there singular terms which apply to all of the numbers that appear both before and after the decimal point?  I'm building a billing system, storing dollars and cents as integers (in separate columns), but for other currencies "dollars" and "cents" are not the correct terms = ).  Thanks! I just read on wikipedia that the the complex projective line is homeomorphic to the riemann sphere. How do I prove this? But, before that I have an extremely silly doubt that has been eating me. In the complex projective line, antipodal points are identified, but in the Riemann sphere they are clearly distinct. Then how can the two be homeomorphic.   I found out the following map from the complex projective line to $S^2$. But how do I prove this is a homeomorphism? Finding the inverse of this functions seems complicated, and then how do I prove that the inverse map of a open subset is a open subset, and vice versa?  $f:\mathbb{C}\mathbb{P}^1 \to S^2 = [z:w] \to \frac{(2Re(w\bar{z}), 2Im(w\bar{z}),|w|^2-|z|^2)}{(|w|^2+|z|^2)} $ Intuitive analysis of gradient, divergence, curl Moving tfrom Shimano 9- to Shimano 10- speed I'm thinking of changing the 9-speed Tiagra rear mech on one of my (road) bikes to something, still Shimano, but 10-speed.  The obvious replacements I'll need are cassette, right-shifter and chain. But I reckon because of the narrower chain I'm also looking at a new chainset and rear derailleur. However I think the front derailleur and left-shifter should be safe (still keeping the front mech the same). Ditto the bb, regardless of whether I need a new chainset  Has anyone actually done this conversion and is able to confirm (or put me right)?  Thanks  Update  Decided in the end that going from 9- to 10- was too much to spend all in one go. But I used a service as an excuse to change the cassette (to a 9-speed ultegra) and the chain (dura ace) at quite minimal cost. Can upgrade other parts as and when, although I'm basically looking at Shim's 6500 range here so all quite dated now. $\forall a,b,c \in \mathbb{N}\!:\ a\mid b \Rightarrow ac\mid bc. $ Divisibility Proof Could someone verify this proof?  Given the following definition of divisibility $(\forall{a,b \in \mathbb{N}})[a \mid b \equiv (\exists{c \in \mathbb{N}})(ac=b)]$.  Statement: $(\forall{a,b,c \in \mathbb{N}})[(a\mid b) \rightarrow (ac\mid bc)] $ .  Proof:  Let $a,b \in \mathbb{N}$ be arbitrary.  Assuming that $a\mid b$, we can conclude that $\exists{d \in \mathbb{N}}$ such that $ad = b$.  By Algebra we can deduce the following sequence of statements.  If $(ad)=b$, then $(ad)c=bc$.  Therefore $(ac)d=bc$.  Hence by the definition of divisibility we know that $ac\mid bc$. Why, historically, do we multiply matrices as we do? Multiplication of matrices &mdash; taking the dot product of the $i$th row of the first matrix and the $j$th column of the second to yield the $ij$th entry of the product &mdash; is not a very intuitive operation: if you were to ask someone how to mutliply two matrices, he probably would not think of that method. Of course, it turns out to be very useful: matrix multiplication is precisely the operation that represents composition of transformations. But it's not intuitive. So my question is where it came from. Who thought of multiplying matrices in that way, and why? (Was it perhaps multiplication of a matrix and a vector first? If so, who thought of multiplying them in that way, and why?) My question is intact no matter whether matrix multiplication was done this way only after it was used as representation of composition of transformations, or whether, on the contrary, matrix multiplication came first. (Again, I'm not asking about the utility of multiplying matrices as we do: this is clear to me. I'm asking a question about history.) "Print" and "ui.Label" return different strings in console and in the UI in Google Earth Engine I am working on a variable label in Google Earth Engine and noticed that the label as printed in the console is not the same as the label shown on the map. Why is that? Code below:  var aoi = ee.Geometry.Polygon([[[-106.75701284923326, 42.31332966408458],           [-106.75701284923326, 42.003856624775146],           [-106.31755972423326, 42.06913460511273]]]);  var chirpsSelect = ee.ImageCollection("UCSB-CHG/CHIRPS/DAILY")             .filterDate('1985-01-01','2018-01-01')             .filter(ee.Filter.dayOfYear(3,6))             .filterBounds(aoi)  var chirpsStartImage = ee.String(chirpsSelect.first().get('system:index')) var dateStartString = ((((chirpsStartImage.slice(6,8)).cat('/')).cat(chirpsStartImage.slice(4,6))).cat('/')).cat(chirpsStartImage.slice(2,4))   var sortChirpsSelect = chirpsSelect.sort('system:index',false)  var chirpsEndImage = ee.String(sortChirpsSelect.first().get('system:index')) var dateEndString = ((((chirpsEndImage.slice(6,8)).cat('/')).cat(chirpsEndImage.slice(4,6))).cat('/')).cat(chirpsEndImage.slice(2,4)) var dateTitle = ee.String((dateStartString.cat(' to ')).cat(dateEndString))  print(dateTitle)  var dateLabel = ui.Label({   value: dateTitle })  var panel = ui.Panel() panel.add(dateLabel) Map.add(panel) Under Windows 7, how can I delete a folder whose name ends with "..."? Is there a general method (which can be implemented by hand) to finding the $n$-th roots of $2 \times 2$ matrices? Is there a similar method for a general $m \times m$ matrix? (for $n &gt; 1$ and $n\in\mathbb{Z}$) I am on Ubuntu and I did this command:  $ uname -a Linux slabrams-desktop 2.6.32-29-generic #58-Ubuntu SMP Fri Feb 11 19:00:09 UTC 2011 i686 GNU/Linux   Does it mean I am on 32bit or 64 bit processor?  The reason I am trying to figure this out is that I was getting errors which looked like this:  cannot execute binary file   and from Googling, I thought it was a processor issue.  Any ideas? Why does Stack Overflow allow duplicate display names? What is the reasoning behind the design decision to allow users to create a display name which matches another existing users exactly?    This is opposed to the common practice of enforcing unique user names, and I'd really like to learn something. Coefficients change signs I have a dataset where there is a high degree of multicollinearity, with all variables correlating positively with each other and the dependent variable. However, on some of the models I run I get a couple of significant negative coefficients. Basically there are two coefficients that depending on what variables I include in the model, I can manipulate their signs.  My understanding is that if the variance-covariance matrix only contain positive values, then all coefficients should also be positive. Is this correct? I have just migrated from Windows environment. I have installed Python 3.2 in a separate directory. How can I get the python installation path in Ubuntu shell?  Is there any way I can let the shell know/choose at runtime which python version is to be used for further code execution?  Are there any environment variables and search path kind of things in Ubuntu Linux as well?