I have 2 EditText. The user will enter the minimum number in the first EditText and the maximum in the second EditText.  There is one TextView to show  the generated number and a Button to click after entering the minimum and maximum numbers   How to generate a number between 2 numbers the user entered and show it in TextView ?
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.
Why wasn't Poe told about Holdo's plan? Assign points within 150 meter buffer of each other the same unique identifier? I have a bunch of points on a QGIS map. Each point is a unique sampling event. However, some of these points have been sampled multiple times but there is no common identifier in the attribute data to determine this. The only way we can see this is by looking at the map and seeing points very close to each other.   I am wondering if anyone has a method to assign points within a 150 meters of each other a common identifier? What does a tilde in angle brackets mean when creating a Java generic class? Edit:  I foolishly changed my example right before posting this. The following is what I meant to ask.  On the wikipedia page below, it says "a non-zero non-unit element in an integral domain is said to be irreducible if it is not a product of two non-units."   Then, on the wikipedia page below, it says "an irreducible polynomial is, roughly speaking, a non-constant polynomial that cannot be factored into the product of two non-constant polynomials."   The page then gives an example of a polynomial that is irreducible "over the rationals" (I assume it is implied that "the integers" is referring to the ring of polynomials over the field of rationals, right?)  $p(x) = x^2 + 2 = (x+\sqrt{2})(x-\sqrt{2})$  On the Wofram page below, it says "the irreducible polynomials are examples of irreducible elements."   If irreducible polynomials are a subset of irreducible elements, how is $x+\sqrt{2}$ a unit?  What can it be multiplied by to equal the multiplicative identity?  I think I have it right this time (sorry. long day)  ====================================================================  The following is the original post (for those who already responded and those looking at the corresponding responses)  On the wikipedia page below, it says "a non-zero non-unit element in an integral domain is said to be irreducible if it is not a product of two non-units."   Then, on the wikipedia page below, it says "an irreducible polynomial is, roughly speaking, a non-constant polynomial that cannot be factored into the product of two non-constant polynomials."   The page then gives an example of a polynomial that is reducible "over the integers" (I assume it is implied that "the integers" is referring to some sort of ring, right? due to the claim below)  $p(x) = x^2 + 4x + 4 = (x+2)(x+2)$  On the Wofram page below, it says "the irreducible polynomials are examples of irreducible elements."   If irreducible polynomials are a subset of irreducible elements, how is $x+2$ a unit?  What can it be multiplied by to equal the multiplicative identity? The USB has various purposes for data transfer, movement of input and output signals for hardware like connecting an Android device to another Display screen (USB on the go), charging the device etc.(during a device charge the voltage drawn from the USB is same irrespective of the device or OEM then Why are two USB Cables different ?  A USB of one manufacturer may not be supporting another manufacturer. We get problems if we do connect them like      or How to make Unicode charset in cmd.exe by default? How can I check the integrity of a downloaded Ubuntu CD? I've just downloaded a CD image of Ubuntu. I know the installer has a check CD option, but how can I check that the image is good before burning it to CD? I want to install the latest Python tarball on Ubuntu, downloaded from .  Is this is a correct way to install?  ./configure make make install   If not, how do I do that? How can I recover photo files from a memory card with a corrupt filesystem? I know this is not specifically a photography issue but since many of us with prosumer/professional-level DLSRs use Compact Flash cards, it is bound to happen to others as well.  I have a Sandisk 16GB Ultra card that occasionally had the camera reporting inability to access the card. I had to reinsert the card to continue using it. I was able to read the card and transfer the photo files to my computer drive. Today, the same thing happened again, just that nearing the capacity of the card, it failed one last time and the camera was subsequently unable to read it anymore. Despite reinsertion.  My other CF cards never once exhibited this problem, so it's pretty much isolated to this card.  The card is similarly unrecognisable on my computer CF card reader. I think the filesystem is toast, but I suspect the photo files are still intact. I would like to find ways where I can inspect the raw binary data in the card and hopefully recover the photos? Why isn't the gamma function defined so that $\Gamma(n) = n! $? As a physics student, I have occasionally run across the gamma function  $$\Gamma(n) \equiv \int_0^{\infty}t^{n-1}e^{-t} \textrm{d}t = (n-1)!$$  when we want to generalize the concept of a factorial.  Why not define the gamma function so that   $$\Gamma(n) = n!$$  instead?  I realize either definition is equally good, but if someone were going to ask me to choose one, I would choose the second option.  Are there some areas of mathematics where the accepted definition looks more natural?  Are there some formulas that work out more cleanly with the accepted definition? Why does PGFplots not recognize my expression? What are the differences between Holmes, Moldvay, and Mentzer D&D? Is Ubuntu an open source software? Is Ubuntu an open source software (OSS)? How do I enumerate the properties of a JavaScript object?  I actually want to list all the defined variables and their values, but I've learned that defining a variable actually creates a property of the window object. How can I check which songs or videos that I purchased from the iTunes Store have DRM restrictions?  All of the mobile OSes are very impressive to me at the moment, and I'm thinking about trying a non-iOS device again. I want to know now the impact it has on my Apple-sourced music collection though.  Is there a date cut-off for purchases when items went DRM free? I want to write a query like this:  SELECT o.OrderId, MAX(o.NegotiatedPrice, o.SuggestedPrice) FROM Order o   But this isn't how the MAX function works, right?  It is an aggregate function so it expects a single parameter and then returns the MAX of all rows.     Does anyone know how to do it my way? How do I get Gmail to ask me to be a mailto handler again? Prove without using graphing calculators that $f: \mathbb R\to \mathbb R,\,f(x)=x+\sin x$ is both one-to-one, onto (bijective) function. Prove that the function $f:\mathbb R\to \mathbb R$ defined by $f(x)=x+\sin x$ for $x\in \mathbb R$ is a bijective function.    The codomain of the $f(x)=x+\sin x$ is $\mathbb R$ and the range is also $\mathbb R$. So this function is an onto function. But I am confused in proving this function is one-to-one. I know about its graph and I know that if a function passes the  horizontal line test (i.e horizontal lines should not cut the function at more than one point), then it is a one-to-one function. The graph of this function looks like the graph of $y=x$ with sinusoids going along the $y=x$ line. If I use  a graphing calculator at hand, then I can tell that it is a one-to-one function and $f(x)=\frac{x}{2}+\sin x$ or $\frac{x}{3}+\sin x$ functions are not, but in the examination I need to prove this function is one-to-one theoritically, without graphing calculators. I tried the method which we generally use to prove a function is one-to-one but no success. Let $f(x_1)=f(x_2)$ and we have to prove that $x_1=x_2$ in order fot the function  to be one-to-one. Let $x_1+\sin x_1=x_2+\sin x_2$ But I am stuck here and could not proceed further. Google calendar sharing I am a Google Apps administrator in the process of transferring a multitude of secondary calendars from a previous Google account. So following advice from  I did the following:  Old Account   Download calendar and save as ICS   New Administor Account   Create new calendar Select "Share Calendar With Others", "Share calendar with everyone in the organization - see all event details"    However nobody in the organization can see the new calendar under "Other Calendars" nor do they get any form of notification.   It seems everyone in the organization has to now somehow add this calendar(s) via "Add a colleague's calendar" OR I have to add each user's new Google account. This is turning into an administrative nightmare.  The behavior I want is:   Maintain a list of calendars that everyone in the organization has access to By default all users in organization have "See All Event Details" access. Certain organization users have "Make Changes To Events" and Apps Administrators have "Make Changes AND Sharing" As users are added/removed to the Google Apps domain the access to these calendars are automatically granted/revoked ie. Organization users should not have to do anything to get access to the list of calendars.   I am sure there is a simple solution to this that I am missing, so if someone can point me in the right direction I would appreciate it. Trying to locate a file, how can I search the entire hard drive for a file?