I don't have access to a compiler atm, but I was thinking about how I would generate a random float value. To generate a random integer value, I would use:  Random r = new Random(); int x = r.nextInt(8) + 9;   How would I generate a randon number between, lets say, 6.2 and 7.4?
How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum);  Bug: randomNum can be bigger than maximum. Attempt 2: Random rn = new Random(); int n = maximum - minimum + 1; int i = rn.nextInt() % n; randomNum =  minimum + i;  Bug: randomNum can be smaller than minimum.
I have to prove the  by tomorrow and I am really unconfident about what I did:  $$\sum_{n=1}^\infty a_n\text{ converges } \iff \sum_{n=1}^\infty 2^n a_{2^n}\text{ converges}$$  I did the following:  Let $(b_n)$ be a sequence as follow: $b_{2^k+m}:=a_{2^k}$ with $k\in\mathbb N_0$ and $0\leq m&lt;2^k$.  It's $a_{n+1}\leq a_n$ and so $0\leq a_{n+p}\leq a_n$ for all $n,p\in\mathbb N$.  So $\sum\limits_{n=1}^\infty b_n$ converges by the majorizing series $\sum\limits_{n=1}^\infty a_n$. And it's $\sum\limits_{n=0}^\infty b_n=\sum\limits_{n=0}^\infty\sum\limits_{m=0}^{2^n-1}a_{2^{n+1}}=\sum\limits_{n=1}^\infty 2^{n-1}a_{2^n}$ so $\Rightarrow$ is done.  For $\Leftarrow$ consider $c_{2^k+m}:=a_{2^k}$ with $k\in\mathbb N_0$ and $0\leq m&lt;2^k$.  It's $|a_n|\leq c_n$ and $\sum\limits_{n=0}^\infty c_n=\sum\limits_{n=0}^\infty\sum\limits_{m=0}^{2^n-1}a_{2^{n}}=\sum\limits_{n=1}^\infty 2^{n}a_{2^n}$ and so $\sum\limits_{n=1}^\infty a_n$ converges by the majorizing series $\sum\limits_{n=0}^\infty c_n$.  Is this in form and content correct? Normalizing point cloud data How I can get Digital Height Model (only object heights, DSM - DTM = DHM)?  Many applications can do this, but they convert it to GRID or TIN format. I was wondering if it was possible to keep the data as point clouds. Where should I start learning? There are various topics to learn like Objects, Classes, Apex, Visualforce, SOSL, SOQL, Triggers, etc. There are so many options out there to start learning. I couldn't decide what topic to learn first, and then step by step get proficiency in all aspects of Saleforce. runtime error: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver I can't seem to get Python to import a module in a subfolder. I get the error when I try to create an instance of the class from the imported module, but the import itself succeeds. Here is my directory structure:  Server     -server.py     -Models         --user.py   Here's the contents of server.py:  from sys import path from os import getcwd path.append(getcwd() + "\\models") #Yes, i'm on windows print path import user  u=user.User() #error on this line   And user.py:  class User(Entity):     using_options(tablename='users')      username = Field(String(15))     password = Field(String(64))     email    = Field(String(50))     status   = Field(Integer)     created  = Field(DateTime)   The error is: AttributeError: 'module' object has no attribute 'User' Why don't the colonists wear spacesuits in Alien: Covenant? In the beginning of the Alien: Covenant movie, a group of colonists from the main ship make a landing on an unknown planet, which they found out accidentally after ship has been bombarded by an unknown wave from a star collapse and what bothers me, is that they don't wear any spacesuits, any protective gear, any air filter systems, just nothing.  Is that really the way future space expeditions gonna explore new possible planets presumed as possible habitable homes for humanity?  Every 5th grader knows, from the biology school lessons, that water, air, and even earth itself contains and gives life to a thousands of viruses, bacteria, and microorganisms.  You can breathe in bacteria, or virus, and be dead in a seconds.  Do film makers really suppose we will take it as realistic depiction of extraterrestrial expedition?   Reality check just screams out loud.  What do you think can be their motivation for such a decision? Samsung galaxy S4 Blacked out Screen need to retreive files How to float until on left (or right) page? I have two sideways tables that I want on two facing pages so the reader can turn the entire book and read them both in one turn. For the moment I keep moving them around to keep them on facing pages. Is there a way I can make the first one float until it's on a left page and then place the other one right after? Or perhaps some similar way to automatically get them on the same spread? Solving $\sqrt{x+5} = x - 1$ I'm currently learning about radicals and simplifying them, and I came across this problem on the internet and tried to solve it:  $$\sqrt{x+5} = x - 1$$  So I used this logic:  $$ \begin{align} \sqrt{x+5} &amp;= x - 1 \\ x + 5 &amp;= (x-1)^2 \\ x + 5 &amp;= (x-1)(x-1) \\ x + 5 &amp;= x^2 - 2x + 1 \\ 0 &amp;= x^2 - 3x - 4 \\ 0 &amp;= (x-4)(x+1) \\ \end{align} $$  Therefore, $x = -1$ and $x = 4$ satisfy the equation $0 = (x-4)(x+1)$.  But then I tried to plug them in the original problem $\sqrt{x+5}=x-1$:  $$ \begin{align} \sqrt{4 + 5} &amp;= 4 - 1 \\ \sqrt{9} &amp;= 3 \\ 3 &amp;= 3 \end{align} $$  So using 4 works as expected, but when using $-1$:  $$ \begin{align} \sqrt{-1 + 5} &amp;= -1 - 1 \\ \sqrt{4} &amp;= -2 \\ 2 &amp;\ne -2 \end{align} $$  At what stage am I going wrong?  And according the , the solution is $x = 4$. What does it mean when a %CPU exceeds (# of cores) x 100%? Several responses to a question  suggested I try Opera kiosk mode, so I decided to download it and give it a try. Once the download had completed and the disk image was being verified, Safari hung for over a minute and there were periods where Safari used a very high %CPU:    In Mac OS X 10.5, I was accustomed to seeing Safari freeze, but it never used up more than 200% CPU (2 cores x 100%). Is this a bug in Activity Monitor? Or does this mean that %CPU is now more akin to ? Which is correct: "This is her" or "This is she"? Upon answering the telephone, the person calling asks if Joan is available. If Joan is the person who answered the phone, should she say "This is her" or "This is she"? How to find Windows 7 File Transfer History? Is it possible to find out which files are transferred to an external usb flash drive in certain period of time?   To be more clear. If I/someone have a flash drive and take some data from me. How do I know which files are copied? Finding out file copy hostory could be also a work around. Why doesn't mass of bob affect time period? The gravitation formula says $$F = \frac{G m_1 m_2}{r^2} \, ,$$ so if the mass of a bob increases then the torque on it should also increase because the force increased. So, it should go faster and thus the oscillation period should be decrease.  My physics book says that period is only affected by effective length and $g$. Why doesn't mass of bob affect the period? Why is $ the default symbol for a user shell and # the default symbol for a root shell? Operating a standard bash shell on a server, the PS1 prompt defaults to ending in a $ for non-root users, and # for root.  IE:  ubuntu@server:~$ sudo su root@server:/home/ubuntu#   Why is this? Converting a .lasd (Lidar) coordinate system? How can one change a coordinate system for a .lasd (Lidar) dataset?  The file is currently in UTM_Zone_15N and I am trying to convert it to IL_East. Send Gmail calendar invite from alternate email When having a number of files opened in Texmaker, at the top of editor pane, there is a drop down panel with the names of open documents in it. I prefer to have tabs of open documents at the top of editor pane, similar to Texstudio and Winedt. Is there a way that I can change this setting? I've run across (personally or by proxy) a bunch of storage media that exhibited physical problems during their life. Hard disks, solid state drives and other flash storage media all fail after some time. The situation is worse with USB flash drives and flash cards because of the large amount of suppliers with inferior flash cell and flash controller quality.  How can I reliably detect if a storage drive suffers from physical damage?  Note that this question isn't about file system integrity (which can be checked with ). How can we move an object with zero velocity? Consider there is a box of mass $m$ at rest on the floor. Most books give an example that we need to do a work of $mgh$ to lift the box $h$ upward.  If we analyze this work done, the external force acting on the box by us should be equal to the weight of the box. Therefore the net force is zero which in turn there is no acceleration. If there is no acceleration and the initial velocity of the box is also zero, how can the box move upward? What is the standard error of the sample standard deviation? I read from  that the standard error of the sample variance is  $$SE_{s^2} = \sqrt{\frac{2 \sigma^4}{N-1}}$$  What is the standard error of the sample standard deviation?  I'd be tempted to guess and say that $SE_{s} = \sqrt{SE_{s^2}}$ but I am not sure.