Returning a calculation correct to 2 decimal places
How to round a number to n decimal places in Java
How do I set up a global locale for the computer?  I have recently installed Kubuntu 14.04LTS in english but since I am in Spain, I chose Spain as a country and then changed locale options so that I get all country specific configuration such as digit grouping, decimal separator, date format, etc. I also added the spanish language.  Now all applications complain that locale is wrong. check-language-support tells me I'm using en_ES.UTF-8 as system's locale, and that locale is indeed wrong, there is no locale for english language in Spain.  I tried using Kubuntu's country/region &amp; language settings but it doesn't fix it. I tried using export LANG=en_GB.UTF-8 and export LC_ALL=en_GB.UTF-8 and then sudo dpkg-reconfigure locales and that caused check-language-support to say that I now have a correct configuration but if it is, it's only in that konsole session. This problem also prevents konsole from showing unicode characters and I cannot use dead keys or enter any 'international character' such as ñ or ç (those work on other applications such as Firefox, that I'm using to post this question).  So the question is: How do I set up a global locale for the computer?  This is not a bug report, I will probably reinstall my computer eventually if I can't fix it. But I really want to know how I can perform this REALLY basic task.  Thank you.  $ check-language-support perl: warning: Setting locale failed. perl: warning: Please check that your locale settings:         LANGUAGE = "en:es:en",         LC_ALL = (unset),         LC_PAPER = "en_ES.UTF-8",         LC_ADDRESS = "en_ES.UTF-8",         LC_MONETARY = "en_ES.UTF-8",         LC_NUMERIC = "en_ES.UTF-8",         LC_TELEPHONE = "en_ES.UTF-8",         LC_IDENTIFICATION = "en_ES.UTF-8",         LC_MEASUREMENT = "en_ES.UTF-8",         LC_TIME = "en_ES.UTF-8",         LC_NAME = "en_ES.UTF-8",         LANG = "en_ES.UTF-8"     are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_COLLATE to default locale: No such file or directory hunspell-en-ca libreoffice-help-en-gb libreoffice-l10n-en-gb libreoffice-l10n-en-za mythes-en-au wspanish  $ cat /etc/default/locale LANG="en_US.UTF-8" LC_NUMERIC="es_ES.UTF-8" LC_TIME="es_ES.UTF-8" LC_MONETARY="es_ES.UTF-8" LC_PAPER="es_ES.UTF-8" LC_NAME="es_ES.UTF-8" LC_ADDRESS="es_ES.UTF-8" LC_TELEPHONE="es_ES.UTF-8" LC_MEASUREMENT="es_ES.UTF-8" LC_IDENTIFICATION="es_ES.UTF-8"   $ locale locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory LANG=en_ES.UTF-8 LANGUAGE=en:es:en LC_CTYPE="en_ES.UTF-8" LC_NUMERIC=en_ES.UTF-8 LC_TIME=en_ES.UTF-8 LC_COLLATE="en_ES.UTF-8" LC_MONETARY=en_ES.UTF-8 LC_MESSAGES="en_ES.UTF-8" LC_PAPER=en_ES.UTF-8 LC_NAME=en_ES.UTF-8 LC_ADDRESS=en_ES.UTF-8 LC_TELEPHONE=en_ES.UTF-8 LC_MEASUREMENT=en_ES.UTF-8 LC_IDENTIFICATION=en_ES.UTF-8 LC_ALL= $ update-locale perl: warning: Setting locale failed. perl: warning: Please check that your locale settings:         LANGUAGE = "en:es:en",         LC_ALL = (unset),         LC_PAPER = "en_ES.UTF-8",         LC_ADDRESS = "en_ES.UTF-8",         LC_MONETARY = "en_ES.UTF-8",         LC_NUMERIC = "en_ES.UTF-8",         LC_TELEPHONE = "en_ES.UTF-8",         LC_IDENTIFICATION = "en_ES.UTF-8",         LC_MEASUREMENT = "en_ES.UTF-8",         LC_TIME = "en_ES.UTF-8",         LC_NAME = "en_ES.UTF-8",         LANG = "en_ES.UTF-8"     are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). A possible incorrect application of Law of Large numbers The first time I learnt LaTeX, I thought \newcommand properly fits for inline mode and \newenvironment for displayed mode.  Later I noticed it is not correct. So the question is   What is the rule of thumb when deciding whether we should use one over the other one? I am trying to create a vase that looks similar to this:    If there is another post out there I will happily remove this one or redirect it there.  Specifically, I am trying to create the creased effect in the geometry that looks like it is twisting around the vase.  I have tried using Checker Deselect and extrude->scaling the verts but that really screws up my mesh.  Link to my model if it helps: Using Residue Theorem find $\displaystyle \int_0^{2\pi} \frac{1}{a^2\cos^2 t+b^2 \sin^2 t} dt \;; a,b&gt;0$.   My Try:  So, I am going to use the ellipse $\Gamma = \{a\cos t+i b \sin t: 0\leq t\leq 2\pi\}$.   On $\Gamma$, $z=a\cos t+i b \sin t$, so $|z|^2=z\bar{z}=a^2\cos^2 t+b^2 \sin^2 t$.   Now, $dz=-a\sin t+i b \cos t dt$.   Hence, the integral becomes $\displaystyle \int_\Gamma \frac{dz}{z(iab+(\sin t \cos t)(b^2-a^2))}$. I know that $\displaystyle \int_\Gamma \frac{dz}{z}=2\pi i$. Now, how do I get rid of $\sin t \cos t$ part? I am stuck here. Can somebody please explain how? Holomorphic function $f:B(0,1) \to B(1,4)$ with $f(0)=3$ and $f(\frac{1}{2})=1$ Problem  Find all holomorphic functions $f:B(0,1) \to B(1,4)$ that verify $f(0)=3$ and $f(\frac{1}{2})=1$.  I have no idea how to attack this problem,since it comes after an exercise related to Schwarz lemma, I thought that maybe the idea is to somehow apply the lemma in this problem as well, but if that is the case, I don't know how could I use it. I would appreciate suggestions. PDOException when creating the table: Base table or view not found I have Drupal running on MariaDB 5.5.33. When I run update.php (after upgrade to Drupal 7.28 from Drupal 6) I get an error:     Failed: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'webdb.location_country' doesn't exist: CREATE TABLE {location_country} ( code CHAR(2) NOT NULL COMMENT 'Primary Key: Two letter ISO Country Code', name VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Full Country Name ', PRIMARY KEY (code) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Country data managed by location.module.'; Array ( ) indb_create_table() (line 2720 of /home/web/public_html/includes/database/database.inc).   When I try to run command     CREATE TABLE {location_country} ( code CHAR(2) NOT NULL COMMENT 'Primary Key: Two letter ISO Country Code', name VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Full Country Name ', PRIMARY KEY (code) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Country data managed by location.module.';   in phpMyAdmin I get an error     #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '{location_country} ( code CHAR(2) NOT NULL COMMENT 'Primary Key: Two letter IS' at line 1   But I wasn't able to find out where is the problem. I am including pages using Ajax but I also need to include their respective javascript files, which requires removing the previous javascript files from memory at the same time.  How can I unload the currently-loaded javascript files (as well as their code in memory) so that I can load the new page's files? They will more than likely conflict, so having multiple independent files' javascript files loaded. I have only seen infinite vector spaces and the one finite vector space i.e the trivial vector space $\{0\}$. Is there any other finite vector space? Seeking open source solution to access rasters in File Geodatabase? I'm looking for a way to access raster layers in an Esri File-GeoDatabase without using ArcObjects or ArcPy, specifically I would like to access the raster layers with GDAL. I understand that the GDAL FileGDB and OpenFileGDB give access to vector datasets within File-GeoDatabases, and that ESRI's own FileGDB C++ API does not support raster access.   Is anyone out there aware of any open source solutions? What is the maximum number of people that will join a settlement? I've got two settlements on the go that I'm paying attention to - Sanctuary and the Starlight Drive In. Both of these settlements have radio towers and beds and all resources in the green however they appear to have stopped growing at 10 people in each settlement even though happiness is above 80 and I've got 15+ beds at each location.  What is the maximum number of people that will join a settlement? Prevent users from submitting a form by hitting Enter Why have  on every line In the definition of a field one of the required properties is that  every element other than zero has a multiplicative inverse.  It's vague whether the zero is forced not to have an inverse or not, as in is the property  every element other than zero has a multiplicative inverse and zero does not  or  every element other than zero has a multiplicative inverse and zero may or may not?  Regardless, what differences would occur if we adopted one definition as opposed to the other? I know that I can make certain blocks only placeable on a specified block, but what is the command to give an item that can only BREAK certain blocks? If $X_n \stackrel{d}{\to} X$ and $c_n \to c$, then $c_n \cdot X_n \stackrel{d}{\to} c \cdot X$ Let $X_n$, $X$ random variables on a probability space $(\Omega,\mathcal{A},\mathbb{P})$ and $(c_n)_n \subseteq \mathbb{R}$, $c \in \mathbb{R}$ such that $c_n \to c$ and $X_n \stackrel{d}{\to} X$. Then $c_n \cdot X_n \stackrel{d}{\to} c \cdot X$.   Here is my proof: By Lévy's continuity theorem it suffices to show that $$\forall \xi: \quad \hat{\mu}_n(c_n \cdot \xi) \to \hat{\mu}(c \cdot \xi) \qquad (n \to \infty)$$  where $\hat{\mu}_n$ (resp. $\hat{\mu}$) denotes the characteristic function of $X_n$ (resp. $X$). Using the tightness of the distributions one can show that $\{\hat{\mu}_n; n \in \mathbb{N}\}$ is uniformly equicontinuous. We have $$|\hat{\mu}_n(c_n \cdot \xi) - \hat{\mu}(c \cdot \xi)| \leq |\hat{\mu}_n(c_n \cdot \xi)- \hat{\mu}_n(c \cdot \xi)| + |\hat{\mu}_n(c \cdot \xi)- \hat{\mu}(c \cdot \xi)|$$ The first addend converges to zero as $n \to \infty$ by the uniform equicontinuity and the second one converges to zero since $X_n \stackrel{d}{\to} X$.  I was wondering whether there is an easier proof - my own proof seems rather like overkill to me. Thanks! Why is the cone measurable? Problem Denote by $\lambda_n$ the Lebesgue measure on $\mathbb {R}^n$. Let $h \in \mathbb {R}_{&gt;0}$. Let $A \subset \mathbb {R}^{n-1}$ be Lebesgue-measurable with finite measure. Define the cone $C(A,h)$ as the union of all straight lines connecting a point in $A \times\{0\}$ with the point $(0, h) \in \mathbb {R}^{n-1} \times \mathbb{R}$. Prove that $\lambda_n (C(A,h))=\frac{h}{n}\cdot \lambda_{n-1}(A)$. Where I struggle  Assuming that $C(A,h)$ is (Lebesgue-)measurable, this is a simple application of Fubini. How Fubini is used is all clear to me.  However, why is $C(A,h)$ measurable? It seems one could roughly argue as follows: As $A$ and $[0,h]$  are measurable so is $A \times [0,h]$. As $A \times [0,h]$ is measurable it is the union of a null set and a Borel set. $C(A,h)$ is the image of $A \times [0,h]$ under a certain diffeomorphism (c.f. ). Diffeomorphisms map null sets to null sets, and Borel sets to Borel sets. Hence, $C(A,h)$ is (as a finite union of measurable sets) measurable.  Unfortunately, I am not allowed to use the above properties of diffeomorphisms. What are other ways to prove the claim? Please only give a hint to set me thinking. RF Energy Harvesting Why can energy invested in RF radiation not be harvested fully? What are the main factors that affect this? Is there any significant research nowadays that fully describes this process? I stand on the conclusion: "Energy moves from one form to another.", but in this case why can it not be harvested in that quantity to use it for powering low-power devices or store it in significant quantities in some batteries for later use? Why is it not profitable nowadays and why is it not used today like energy from water, wind and other energy sources? Execute task if tasker profile has been active for some time How can I execute a tasker task only after a certain condition has been true for a certain time?  Normally a profile executes its task as soon as all conditions are met. I want to delay this activation, until the conditions have stayed true for some time.  E.g.    do something after the screen has been continuously off or on for 10 minutes do something after wifi xy has not been near for 10 minutes do something after cell towers x,y,z have not been near for 10 minutes. In Windows there’re perhaps only a couple of important folders (by important I mean important in my logical picture of the Windows file system) in the installation drive (in my case C:\). Namely Program Files and Windows. I simply stay away from Windows folder and the “add remove program files” is good enough to handle the program files folder of Windows. Of course there’s a folder named Users where the users (who are not admins) can access only their folders.  Thus there’s a clear picture at some level in my mind of the Windows file system. In Ubuntu, when I reach the location /, there’s a huge list of folders, most of which I have no clue as to what they contain. The /bin folder seems to be the equivalent of the Windows folder in windows. The /usr folder seems like it’s the equivalent of the Users folder in Windows. But even the /home folder looks like it can fit the bill.  Please understand that I do understand, that Ubuntu (Linux) has a different character than that of Windows, i.e., there need not be exact equivalent of Windows functions, in Ubuntu. All I am looking for is a bit more clearer picture of the Ubuntu file system.   This question is a part of a bigger question which I am splitting up to make it more answerable. The original question can be found here: