Can't get java to recognize when input is 'quit' which is supposed to end the loop/program
How do I compare strings in Java?
Cannot install Oracle JDK via apt in Ubuntu 16.04 I created a new Ubuntu 16.04.3 VM and am attempting to install JDK 9. Unfortunately, the latest version of the JDK apt installer, 9.0.1-1~webupd8~0, is failing to download the binaries and I suspect that the reason is because   I carried out the typical steps for installation:    add-apt-repository ppa:webupd8team/java apt-get update &amp;&amp; apt-get install oracle-java9-installer   I am then prompted with the following error message:  Downloading Oracle Java 9... --2018-01-16 15:15:07--  http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz Resolving download.oracle.com (download.oracle.com)... 23.200.70.136 Connecting to download.oracle.com (download.oracle.com)|23.200.70.136|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://edelivery.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz [following] --2018-01-16 15:15:11--  https://edelivery.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.35.226.115, 2600:1404:21:49d::2d3e, 2600:1404:21:493::2d3e Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.35.226.115|:443... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz?AuthParam=1516137431_0e89d10b30203a572ea858768475ef74 [following] --2018-01-16 15:15:11--  http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz?AuthParam=1516137431_0e89d10b30203a572ea858768475ef74 Connecting to download.oracle.com (download.oracle.com)|23.200.70.136|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2018-01-16 15:15:11 ERROR 404: Not Found.  download failed Oracle JDK 9 is NOT installed. dpkg: error processing package oracle-java9-installer (--configure):  subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing:  oracle-java9-installer E: Sub-process /usr/bin/dpkg returned an error code (1)   I found , but it does not appear that the  works for JDK 9.0.4+11. I've updated the SHA checksums (), set the major version to 9.0.4, and set the minor version to 11, but I'm still not having success.  What steps need to be carried out to get the JDK apt installer to work until the WebUpd8 team is able to update the PPA? Prove that $371\cdots 1$ is not prime Prove that $371\cdots 1$ is not prime.   I tried mathematical induction in order to prove this, but I am stuck.  My partial answer:  To be proved is that $37\underbrace{111\cdots 1}_{n\text{ ones}}$ is never prime for $n\geq 1$. Let $P(n)$ be the statement that $37\underbrace{111\cdots 1}_{n\text{ enen}}$ is not prime.  For $n=1$, we can write $371=7\cdot 53$, and therefore $P(1)$ is true. Let $P(k)$ be true for $k&gt;1$. Then we now have to prove that $P(k+1)$ is true.  I found that $37\underbrace{111\cdots 1}_{k\text{ ones}}$ can be written as $37\cdot 10^k+10^{k-1}+10^{k-2}+\cdots +10^0$ and that $37\underbrace{1111\cdots 1}_{k+1\text{ ones}}$ can be written as $37\cdot 10^{k+1}+10^{k}+10^{k-1}+\cdots+10^0$.  I think I'm pretty close to the answer know, but I don't know how to proceed. \pagestyle{empty} doesn't seem to work for page with \maketitle Redshifting of Light and the expansion of the universe What exactly is an environment variable? I know that VARIABLE=value creates an environment variable, and export VARIABLE=value makes it available to processes created by the current shell. env shows the current environment variables, but where do they live? What comprises an environment variable (or an environment, for that matter)? Is there a way to draw a Voronoi diagram with pgfplots? I want to draw a voronoi diagram with pgfplots, but sadly I cannot get it the way it should look like. I used the Matlab command to get the x and y coordinates and saved them as a dat-file. In that file I stored the x coordinates in the first column and the y coordinates in the second column.      Does anyone have an idea, how it could work?  Minimal Example of the Code:  \documentclass{standalone}  \usepackage{amsmath,amsfonts,amssymb}  \usepackage{mathtools}  \usepackage[ngerman]{babel}  \usepackage[utf8]{inputenc}  \usepackage{graphicx}  \usepackage[svgnames]{xcolor}  \usepackage{pgfplots} \pgfplotsset{compat=newest}  \usepackage{tikz}  \usetikzlibrary{positioning,fit,calc,shapes,arrows,external,3d,patterns,spy}  \usepackage{filecontents}  \begin{document}  \begin{filecontents*}{data.dat}   -7.9265104e+00   3.6503989e-01    4.3133971e-01   9.4062409e-01   -7.9265104e+00   3.6503989e-01    6.3976919e-02   5.4947497e-01    6.3976919e-02   5.4947497e-01    3.0293735e-01   6.5037024e-01    3.6748619e-01   9.5786833e-02    6.3976919e-02   5.4947497e-01    3.0293735e-01   6.5037024e-01    4.0645496e-01   8.2958752e-01    4.9066479e-01   4.4410036e-01    3.0293735e-01   6.5037024e-01    3.6748619e-01   9.5786833e-02    4.9244296e-01   2.3488102e-01    4.9244296e-01   2.3488102e-01    4.9066479e-01   4.4410036e-01    4.9066479e-01   4.4410036e-01    7.3082954e-01   5.1825327e-01    1.8829507e+00   1.7053562e-01    4.9244296e-01   2.3488102e-01    4.3133971e-01   9.4062409e-01    8.7230061e-01   2.0371867e+00    4.0645496e-01   8.2958752e-01    4.3133971e-01   9.4062409e-01    6.6251849e-01   6.4842135e-01    4.0645496e-01   8.2958752e-01    6.9696115e-01   6.8938388e-01    8.7230061e-01   2.0371867e+00    7.3082954e-01   5.1825327e-01    6.6251849e-01   6.4842135e-01    1.8829507e+00   1.7053562e-01    7.3082954e-01   5.1825327e-01    6.6251849e-01   6.4842135e-01    6.9696115e-01   6.8938388e-01   -7.9265104e+00   3.6503989e-01   -1.7371176e+01   8.6111447e-02    3.6748619e-01   9.5786833e-02   -6.0998602e-02  -1.3709259e+00    1.8829507e+00   1.7053562e-01    4.4291165e+00  -2.9045575e-01    8.7230061e-01   2.0371867e+00    1.8287612e+00   4.5227847e+00    6.9696115e-01   6.8938388e-01    1.9370861e+00   1.3452721e+00 \end{filecontents*}  \begin{tikzpicture} \begin{axis}[x=3cm, y=3cm, z=0cm, view={0}{90}] \addplot3 [color=blue, samples y=0] file {voronoi.dat};  \end{axis} \end{tikzpicture}  \end{document}   Thanks for your help!! Some websites have code to "break out" of IFRAME enclosures, meaning that if a page A is loaded as an IFRAME inside an parent page P some Javascript in A redirects the outer window to A.  Typically this Javascript looks something like this:  &lt;script type="text/javascript"&gt;   if (top.location.href != self.location.href)      top.location.href = self.location.href; &lt;/script&gt;   My question is: As the author of the parent page P and not being the author of the inner page A, how can I prevent A from doing this break-out?  P.S. It seems to me like it ought to be a cross-site security violation, but it isn't. Why doesn't connecting a positive terminal of a battery to ground cause current? My wife has a Nikon D3100 that I've been using to film, but the battery typically won't last through long shoots.  I've gathered from searching around that I can't charge the camera with USB, but I wondered if there's ANY way to do that. It seems at least possible that an adapter could exist that would fill in for the battery and plug into the wall, but I haven't been able to find such a thing.  Is there such a product or technique? It would be nice to not buy a second battery, I'm really hoping for a "set it and forget it" solution. How to get file creation & modification date/times in Python? I have a script that needs to do some stuff based on file creation &amp; modification dates but has to run on Linux &amp; Windows.  What's the best cross-platform way to get file creation &amp; modification date/times in Python? I have customer data from 2 brands. The data structure are the same, but I expected the customer behaviour to be different in different brand.  So I could train 2 models, 1 for each brand, or I could train one model on both brands, but flag which brand the customers belongs to within the data.  So my question is, would training on both brands with flags be too much more work for the Machine Learning (I'm using neural network), and therefore be harder to achieve good accuracy than to have dedicated models for each brand? Percentage of overlapping regions of two normal distributions I was wondering, given two normal distributions with $\sigma_1,\ \mu_1$ and $\sigma_2, \ \mu_2$   how can I calculate the percentage of overlapping regions of two distributions? I suppose this problem has a specific name, are you aware of any particular name describing this problem?  Are you aware of any implementation of this (e.g., Java code)? Why there's a finite $\Gamma '$ such that $\Gamma ' \vDash \varphi$? Suppose $\Gamma$ is an infinite set of formulas in FOL. It is given that for a structure, $M$: If $\Gamma$ is satisfiable in $M$ then $\varphi$ is valid in $M$.  Why is it true that there's some finite $\Gamma ' \subset \Gamma$, such that $\Gamma ' \vDash \varphi$?   It reminds the compactness theorem in a way, but it's not quite the same. Putting char into a java string for each N characters I have a java string, which has a variable length.   I need to put the piece "&lt;br&gt;" into the string, say each 10 characters.   For example this is my string:  `this is my string which I need to modify...I love stackoverlow:)`   How can I obtain this string?:  `this is my&lt;br&gt; string wh&lt;br&gt;ich I nee&lt;br&gt;d to modif&lt;br&gt;y...I love&lt;br&gt; stackover&lt;br&gt;flow:)`   Thanks The advantages and disadvantages of using Kaiser Rule to select the number of principal components Coming from Eclipse and having been used to duplicate lines all the time, it's pretty strange finding out that Xcode has no such function. Or does it?  I know it's possible to change the system wide keybindings but that's not what I'm after. Is there a (basic) way to understand why a limit cannot be brought inside of a sum, in certain situations? I have seen that the method of "dominated convergence" implies that sometimes a limit cannot be brought inside of a sum, but is there a more basic way to understand this, preferably without using integrals?   A conceptual or simple answer would be helpful. Thank you! How to get current CPU and RAM usage in Python? What's your preferred way of getting current system status (current CPU, RAM, free disk space, etc.) in Python? Bonus points for *nix and Windows platforms.  There seems to be a few possible ways of extracting that from my search:   Using a library such as  (that currently seems not actively developed and not supported on multiple platform) or something like  (again no activity since 2007 it seems and no support for Windows). Using platform specific code such as using a os.popen("ps") or similar for the *nix systems and MEMORYSTATUS in ctypes.windll.kernel32 (see ) for the Windows platform. One could put a Python class together with all those code snippets.   It's not that those methods are bad but is there already a well-supported, multi-platform way of doing the same thing? Importance of PTR records on nameserver IP's? I have not yet experienced any DNS failures due to a missing PTR record, but am wondering:   Is there any added value in having a valid PTR record on a nameserver IP-address? Noetherian property for exact sequence Let $0 \to M' \xrightarrow{\alpha} M \xrightarrow{\beta} M'' \to 0$ be an exact sequence of $A$-modules. Then $M$ is Noetherian is equivalent to $M'$ and $M''$ are Noetherian.  For the ''$\Leftarrow$'' case:  I guess if we let $(L_n)_{n\geq 1}$ be an ascending chain of submodules of $M$, then $(\alpha ^{-1}(L_n))_{n\geq 1}$ is a chain in $M'$, and $(\beta(L_n))_{n\geq 1}$ is a chain in  $M''$. For large $n$ both these chains are stationary. Then why we know the chain $(L_n)$ is stationary?   Thanks!