I'm making a simple gradebook that's supposed to generate random numbers for each assignment for each student. It generates random numbers, but the numbers are the same each loop. Here's the code I have so far:  import java.util.Random; import java.util.Scanner;  public class Testing { public static void main(String args[]) {     Scanner sc = new Scanner(System.in);     String choice = "y";     while (choice == "y")   {           System.out.println("Please enter a number for the random number generator seed:");         //User input for seed         int seed = sc.nextInt();          //Initializing Seed         Random randomSeed = new Random(seed);          //Prompting for number of students         System.out.println("Please enter the no of students for whom you have grade information: ");          //User input for number of students         int numberOfStudents = sc.nextInt();          String homework = "HW";          System.out.printf("%16s", homework);         System.out.println("\n");          //Finding random value for Homework.         int randomHomework = randomSeed.nextInt(((600-300) + 1) + 300);           //Creates an array that has 7 rows for points         //Will eventually add more values into array         int points [][] = new int[6][3];           //for loop that starts at 1 and prints number of students user entered         for (int i = 0; i &lt; numberOfStudents; i++) {             System.out.print("Student #" + (i + 1) + "    ");              points[0][2] += randomHomework;             System.out.print(randomHomework + "    ");              System.out.println("\n");             }//End of for loop          choice = sc.nextLine().toUpperCase();         }//End of while loop     } }   I get 540 points for each student, but I should be getting a random value between 300 and 600 for each student each time it loops.   Thanks for anything!
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
I am trying to achieve something like this:     This image is linked from .  also provides a solution and seems simpler. Both answers deal with the algorithmicx package however. I am interested in the solution for the algorithm2e package.   I read the documentation of the algorithm2e package but didn't find an answer.   How can I achieve the colored effect?  EDIT:  Here is sample code to create a minimum working example.  \documentclass{article}  \usepackage[ruled]{algorithm2e} % http://www.ctan.org/pkg/algorithm2e  \begin{document}  \begin{algorithm}[h]  \caption{Evolutionary algorithm}   initialize population \;  \For( \emph{Evolutionary loop}){$g := 1$ to $G_{max}$}  {     do things \;     evolve population \;  }  celebrate \; \end{algorithm}  \end{document} Possible to click on an object in the viewport and the object list hierarchy automatically goes to that object also? Finding a clear difference between truth and fact I have been starting back in school after a long hiatus.  In one of my classes, a discussion of Truth began.  The problem I have had is that no one seems to have a solid definition between the two.   My earlier training and schooling left me with this definition, and I would like some feedback.  Fact - A point of data that can be directly qualified/quantified through confirmed, standardized measurement.  Truth - A point of data not directly qualified/quantified through confirmed, standardized measurement.  So fact would be that ice cream is cold, as we can place a measurement of the temperature.  Ice cream being tasty would be truth, as it is impossible to accurately measure "tasty".  Please let me know your thoughts. Will free-fall object into black hole exceed speed of light $c$ before hitting black hole surface? In Newtonian mechanics, if we throw an object in against direction of gravity with speed $v$ and it achieve max height of $h$. Now if we allow object to fall from that height $h$, it will eventually attain speed $v$ when it reach position where we launch it.   Now applying same idea to a black hole in general relativity. Speed require to escape black hole gravity is greater than $c$, so if we throw something into black hole with almost the speed of light, the object speed will exceed speed of light $c$ before hitting black hole surface! How relativity explain this? Can space-time curvature reduce speed of this freely falling object from attaining speed of light? Change color of links created with \in, \at, etc "Shall" versus "will" for the first person When I studied English, I was taught that shall is used to express the future tense for the first person (singular, or plural), and will is used for the same purpose in the other cases.  When I look for shall on the NOAD, I read the following sentence, in a note about the usage of shall:     In practice, however, shall and will are today used more or less interchangeably in statements (although not in questions).   Does that mean shall and will are used with almost the same meaning?  Does I shall return have the same meaning of I will return? What are the downsides of removing ubuntu-desktop metapackage? I once advised someone to remove a package that depends on ubuntu-desktop meta-package, if she didn't need it (EG: if one uses a different editor than gedit). Someone else said that doing so (removing gedit which will in turn remove ubuntu-desktop) could break things. Is this true? Are there any other potential problems? SEO scope for multiple domains hosting on the same IP address I am curious how people picture geometrically how the covariant derivative acts with regards to vector fields. I understand that it is merely an object which has been defined for some use and obeys certain conditions but how would you picture such a thing geometrically? In other words, when someone asks you what the covariant derivative is, how do you explain it in absence of a formal definition? I am using 64bit 2.10.1-Pisa on Windows 10.  When I set up my composer to print, everything looks fine until I try to print or export. The composer goes completely blank and outputs a corrupted PDF using the Export to PDF function. The PDF file won't even open.  I had the same result exporting to PNG.  When I try to use the PDF document printer instead of exporting, QGIS stops responding indefinitely. For QA workstations preparation (Windows-based PCs) our IT department uses typical batch deployment tools. I'm not at all interested in the details of such process, but IT guys ask me:  What typical set of software you need for everyday manual testing tasks? We could include these in our deployment so that you guys could save more time for testing, not for environment prep &amp; tuning.  Sure thing we do test various range of projects, from web applications to standalone solutions, and each application requires its own set of tools for manual testing, e.g.:  Browsers Virtualization utilities DB clients Screens capturing tools FTP clients XML editors etc.  However, and that's for sure - there's a list of tools every QA MUST have installed on its PC, regardless of project types under testing. My area of experience is mostly standalone / complex web apps, that's why my vision on the task is a bit subjective. So, your suggestions of what are tools / software an average QA specialist can't live without will be highly appreciated. 2 assumptions:  Manual testing is a point of interest. Let's limit the list to not more than 15 (better 10) items.  Thanks in advance! Contribute to bounty? I understand that the expressions on both sides of an equal sign are the same entity, and I know that when you modify one side, the other must be changed because it is referring to the same thing. What I do not understand is why making a new equation (adding or taking away from an expression) allows one to know what an unknown represents. What about equations lets us do this? Dynamic single-line printing in Python (time?) The new search function allows quoted queries that include punctuation, and this is fantastic, most of the time. However, the search considers the punctuation as part of the word itself, so searches for "a test" will not show results containing a test,, a test., or a test?. The reverse is also true.  Is this the intended behavior ? &lt;--(space added so that behavior will show in results.)  It seems that the logical way to do fix this (while maintaining character search) is for queries with punctuation to match results with punctuation, while queries without punctuation to match either with and without.    Example:  vs     A more practical example is described in Arjan's answer below. Why use apparently meaningless do-while and if-else statements in macros? The text of the  spell reads:      A flickering flame appears in your hand. The flame remains there for the duration and harms neither you nor your equipment. The flame sheds bright light in a 10-foot radius and dim light for an additional 10 feet. The spell ends if you dismiss it as an action or if you cast it again.   Emphasis mine. The druid in our party asked our DM if he is able to cast produce flame in a dark cave, then opt not to attack with it, and wield a shield and sword. The goal is to continue emitting light, since he doesn't have the light spell. He claims that since the flame does not harm his equipment, he is able to hold a shield or sword with the fiery hand with no problem.  Is this okay to do RAW, or are we missing something?  This is specifically not asking about casting spells with a sword in hand. He wants to draw his weapon after casting and holding the flames.  Related, but not the same question: , , . Text in an equation This is best explained by example. Suppose I have the following:  \[     \begin{align*}     C_3 \rightarrow 6 automorphisms\\     C_4 \rightarrow 8 automorphisms\\     C_5 \rightarrow 10 automorphisms     \end{align*} \]   How can I get the word "automorphisms" to display as if it were not enclosed by the brackets? Determinant of a block lower triangular matrix What does a de Broglie wave look like? What does a  wave look like? Are de Broglie waves transverse or longitudinal?   Can they be polarized?    What about the de Broglie wave of a ground state neutral spin-zero Helium 4 atom?   What experimental evidence do we have that supports the detailed nature of a de Broglie wave?     I have always assumed that de Broglie waves were mathematically  identical to electromagnetic waves, but I just realized there is no basis for this assumption, and in fact it must be false, unless there is an analogue to both the magnetic and the electric components of the electromagnetic wave.  So what does a de Broglie wave "look like"?